from shared import app_dir from utils import create_nav_button from shiny import App, ui import shinyswatch from server import create_server import numpy as np from shinywidgets import output_widget, render_widget app_ui = ui.page_fluid( ui.tags.style(""" .big-table { font-size: 22px; /* Increase font size */ padding: 25px; /* Add padding for spacing */ width: 100%; /* Make the card take full width */ overflow-x: auto; /* Enable horizontal scrolling if needed */ } .big-table table { width: 100%; /* Make table take full width within card */ } .title-logo-container { display: flex; align-items: center; gap: 15px; /* Add some space between the logo and title */ } .title-logo-container img { max-height: 50px; /* Adjust logo size */ height: auto; } .title-logo-container h1 { margin: 0; font-size: 28px; /* Adjust title font size */ font-weight: bold; /* Make it bold */ } """), ui.page_fillable( ui.page_sidebar( ui.sidebar( ui.div( ui.output_image("clientlogo"), style="display: inline-block; overflow: hidden; max-height: 75px; width: 90%;" ), ui.card( create_nav_button( button_icon="house", button_label_text="Homepage", button_link="https://rsginc-nvtbs.hf.space", #button_cls="btn btn-secondary" ), create_nav_button( button_icon = "route", button_label_text = "Origin-Destination", button_link = "https://rsginc-nvtbsod.hf.space", #button_cls="btn btn-secondary" ), # create_nav_button( # button_icon = "car", # button_label_text = "Auto Travel", # button_link = "https://www.rsginc.com" # ), create_nav_button( button_icon = "house-laptop", button_label_text = "Home-Work Location", button_link = "https://rsginc-nvtbsdwell.hf.space", button_cls="btn btn-secondary" ), create_nav_button( button_icon = "clipboard-question", button_label_text = "Survey", button_link = "https://rsginc-nvtbssurvey.hf.space" ), ), ui.div( ui.output_image("rsglogo"), style="display: inline-block; overflow: hidden; max-height: 40px; width: 50%;" ), open="desktop", ), ui.include_css(app_dir / "styles.css"), ui.div( ui.tags.div( ui.h1("NAPA Valley Travels", style="margin: 0; font-size: 28px; font-weight: bold;"), class_="title-logo-container" ), style="padding-bottom: 20px;" ), # Tabs inside a card ui.card( ui.tags.h5("NAPA Resident and Worker's Home-Work trips", style="text-align: center; font-weight: bold; margin-bottom: 15px;"), # Add card title ui.navset_card_underline( ui.nav_panel( "Home and Work Locations", ui.tags.div( ui.HTML("""
""" ), ), ), ), style="padding: 10px; margin-top: 20px;", class_="tabbed-card", ), ) ), theme=shinyswatch.theme.spacelab, ) app = App(app_ui, create_server(app_dir)) if __name__ == "__main__": import asyncio try: app.run() # Use this for environments without a running event loop except RuntimeError as e: if "asyncio.run()" in str(e): asyncio.run(app.start()) # Fallback for environments with an active event loop