Spaces:
Running
Running
import panel as pn | |
from gui import CannabinoidEstimatorGUI | |
# Initialize Panel extension | |
pn.extension( | |
"tabulator", # For Tabulator tables | |
sizing_mode="stretch_width", # Global sizing mode for components | |
template="fast", # FastListTemplate or similar | |
) | |
pn.state.template.param.update( | |
accent_base_color = "#61B2E4", | |
header_background = "#0B96EB", | |
header_color = "#F2F9FC", | |
favicon = "./static/favicon.ico", | |
title = "CBx Revenue Estimator" | |
) | |
# Create an instance of the application | |
estimator_app = CannabinoidEstimatorGUI() | |
# Get the main layout view from the app instance | |
app_view = estimator_app.view() | |
# Make the app servable (for `panel serve main.py`) | |
app_view.servable(title="CBx Revenue Estimator") | |
# To run directly with `python main.py` (optional, `panel serve` is usually preferred for deployment) | |
if __name__ == "__main__": | |
pn.serve( | |
app_view, | |
title="CBx Revenue Estimator (Panel)", | |
show=True, # Open in browser | |
port=5007, | |
# websockets_origin='*', # If needed for specific deployment scenarios | |
) | |