File size: 1,130 Bytes
89bf277
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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
    )