Update app.py
Browse files
app.py
CHANGED
|
@@ -1,10 +1,9 @@
|
|
| 1 |
from shared import app_dir
|
| 2 |
from utils import create_nav_button
|
| 3 |
-
from shiny import App,
|
| 4 |
import shinyswatch
|
| 5 |
from server import create_server
|
| 6 |
|
| 7 |
-
|
| 8 |
app_ui = ui.page_fluid(
|
| 9 |
ui.tags.style("""
|
| 10 |
.big-table {
|
|
@@ -28,29 +27,31 @@ app_ui = ui.page_fluid(
|
|
| 28 |
.title-logo-container h1 {
|
| 29 |
margin: 0;
|
| 30 |
font-size: 28px; /* Adjust title font size */
|
|
|
|
| 31 |
}
|
| 32 |
"""),
|
| 33 |
-
|
| 34 |
ui.page_fillable(
|
| 35 |
ui.page_sidebar(
|
| 36 |
ui.sidebar(
|
| 37 |
ui.div(
|
| 38 |
-
ui.output_image("
|
| 39 |
-
style="display: inline-block; overflow: hidden; max-height:
|
| 40 |
),
|
| 41 |
-
|
| 42 |
ui.card(
|
| 43 |
create_nav_button(
|
| 44 |
-
button_icon
|
| 45 |
-
button_label_text
|
| 46 |
-
button_link
|
| 47 |
-
button_cls
|
| 48 |
),
|
| 49 |
|
|
|
|
|
|
|
| 50 |
create_nav_button(
|
| 51 |
button_icon = "route",
|
| 52 |
button_label_text = "Origin-Destination",
|
| 53 |
-
button_link = "https://
|
|
|
|
| 54 |
),
|
| 55 |
|
| 56 |
create_nav_button(
|
|
@@ -62,62 +63,72 @@ app_ui = ui.page_fluid(
|
|
| 62 |
create_nav_button(
|
| 63 |
button_icon = "road",
|
| 64 |
button_label_text = "VMT",
|
| 65 |
-
button_link = "https://
|
| 66 |
),
|
| 67 |
|
| 68 |
create_nav_button(
|
| 69 |
button_icon = "truck",
|
| 70 |
button_label_text = "Truck",
|
| 71 |
-
button_link = "https://
|
| 72 |
),
|
| 73 |
|
| 74 |
create_nav_button(
|
| 75 |
button_icon = "plane",
|
| 76 |
button_label_text = "Air Travels",
|
| 77 |
-
button_link = "https://
|
| 78 |
-
),
|
|
|
|
|
|
|
|
|
|
|
|
|
| 79 |
),
|
| 80 |
-
|
| 81 |
open="desktop",
|
| 82 |
),
|
| 83 |
-
|
| 84 |
ui.include_css(app_dir / "styles.css"),
|
| 85 |
-
#title="NAPA Valley Travels",
|
| 86 |
ui.div(
|
| 87 |
ui.tags.div(
|
| 88 |
-
# ui.img(
|
| 89 |
-
# src="images/logo.jpg",
|
| 90 |
-
# style="max-height: 50px; height: auto;"
|
| 91 |
-
# ),
|
| 92 |
ui.h1("NAPA Valley Travels", style="margin: 0; font-size: 28px; font-weight: bold;"),
|
| 93 |
class_="title-logo-container"
|
| 94 |
),
|
| 95 |
style="padding-bottom: 20px;"
|
| 96 |
),
|
| 97 |
-
|
| 98 |
-
ui.
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 106 |
),
|
| 107 |
-
fillable=True,
|
| 108 |
)
|
| 109 |
-
),
|
|
|
|
| 110 |
)
|
| 111 |
|
| 112 |
-
# def server(input, output, session):
|
| 113 |
-
# @render.image
|
| 114 |
-
# def logo():
|
| 115 |
-
# img = {"src": app_dir / "images" / "logo.png", "style": "width: 80%; height: auto; max-height: 150px; margin-bottom: 0px;"}
|
| 116 |
-
# return img
|
| 117 |
|
| 118 |
app = App(app_ui, create_server(app_dir))
|
| 119 |
-
#app = App(app_ui, server)
|
| 120 |
-
#app.run()
|
| 121 |
|
| 122 |
if __name__ == "__main__":
|
| 123 |
import asyncio
|
|
|
|
| 1 |
from shared import app_dir
|
| 2 |
from utils import create_nav_button
|
| 3 |
+
from shiny import App, ui
|
| 4 |
import shinyswatch
|
| 5 |
from server import create_server
|
| 6 |
|
|
|
|
| 7 |
app_ui = ui.page_fluid(
|
| 8 |
ui.tags.style("""
|
| 9 |
.big-table {
|
|
|
|
| 27 |
.title-logo-container h1 {
|
| 28 |
margin: 0;
|
| 29 |
font-size: 28px; /* Adjust title font size */
|
| 30 |
+
font-weight: bold; /* Make it bold */
|
| 31 |
}
|
| 32 |
"""),
|
|
|
|
| 33 |
ui.page_fillable(
|
| 34 |
ui.page_sidebar(
|
| 35 |
ui.sidebar(
|
| 36 |
ui.div(
|
| 37 |
+
ui.output_image("logo2"),
|
| 38 |
+
style="display: inline-block; overflow: hidden; max-height: 75px; width: 90%;"
|
| 39 |
),
|
|
|
|
| 40 |
ui.card(
|
| 41 |
create_nav_button(
|
| 42 |
+
button_icon="house",
|
| 43 |
+
button_label_text="Homepage",
|
| 44 |
+
button_link="https://rsginc-nvtbs.hf.space",
|
| 45 |
+
#button_cls="btn btn-secondary"
|
| 46 |
),
|
| 47 |
|
| 48 |
+
|
| 49 |
+
|
| 50 |
create_nav_button(
|
| 51 |
button_icon = "route",
|
| 52 |
button_label_text = "Origin-Destination",
|
| 53 |
+
button_link = "https://rsginc-nvtbsod.hf.space",
|
| 54 |
+
button_cls="btn btn-secondary"
|
| 55 |
),
|
| 56 |
|
| 57 |
create_nav_button(
|
|
|
|
| 63 |
create_nav_button(
|
| 64 |
button_icon = "road",
|
| 65 |
button_label_text = "VMT",
|
| 66 |
+
button_link = "https://rsginc-nvtbsvmt.hf.space"
|
| 67 |
),
|
| 68 |
|
| 69 |
create_nav_button(
|
| 70 |
button_icon = "truck",
|
| 71 |
button_label_text = "Truck",
|
| 72 |
+
button_link = "https://rsginc-nvtbstruck.hf.space"
|
| 73 |
),
|
| 74 |
|
| 75 |
create_nav_button(
|
| 76 |
button_icon = "plane",
|
| 77 |
button_label_text = "Air Travels",
|
| 78 |
+
button_link = "https://rsginc-nvtbsfly.hf.space"
|
| 79 |
+
),
|
| 80 |
+
),
|
| 81 |
+
ui.div(
|
| 82 |
+
ui.output_image("logo"),
|
| 83 |
+
style="display: inline-block; overflow: hidden; max-height: 40px; width: 50%;"
|
| 84 |
),
|
|
|
|
| 85 |
open="desktop",
|
| 86 |
),
|
|
|
|
| 87 |
ui.include_css(app_dir / "styles.css"),
|
|
|
|
| 88 |
ui.div(
|
| 89 |
ui.tags.div(
|
|
|
|
|
|
|
|
|
|
|
|
|
| 90 |
ui.h1("NAPA Valley Travels", style="margin: 0; font-size: 28px; font-weight: bold;"),
|
| 91 |
class_="title-logo-container"
|
| 92 |
),
|
| 93 |
style="padding-bottom: 20px;"
|
| 94 |
),
|
| 95 |
+
# Tabs inside a card
|
| 96 |
+
ui.card(
|
| 97 |
+
ui.navset_card_underline(
|
| 98 |
+
ui.nav_panel(
|
| 99 |
+
"Bar Chart",
|
| 100 |
+
ui.div(
|
| 101 |
+
ui.h2("Bar Chart", style="text-align: center;"),
|
| 102 |
+
ui.output_plot("bar_chart"), # Output for bar chart
|
| 103 |
+
class_="chart-container",
|
| 104 |
+
),
|
| 105 |
+
),
|
| 106 |
+
ui.nav_panel(
|
| 107 |
+
"Pie Chart",
|
| 108 |
+
ui.div(
|
| 109 |
+
ui.h2("Pie Chart", style="text-align: center;"),
|
| 110 |
+
ui.output_plot("pie_chart"), # Output for pie chart
|
| 111 |
+
class_="chart-container",
|
| 112 |
+
),
|
| 113 |
+
),
|
| 114 |
+
ui.nav_panel(
|
| 115 |
+
"Blank Tab",
|
| 116 |
+
ui.div(
|
| 117 |
+
ui.h2("Coming Soon...", style="text-align: center;"),
|
| 118 |
+
class_="chart-container",
|
| 119 |
+
),
|
| 120 |
+
),
|
| 121 |
+
),
|
| 122 |
+
style="padding: 10px; margin-top: 20px;",
|
| 123 |
+
class_="tabbed-card",
|
| 124 |
),
|
|
|
|
| 125 |
)
|
| 126 |
+
),
|
| 127 |
+
theme=shinyswatch.theme.spacelab,
|
| 128 |
)
|
| 129 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 130 |
|
| 131 |
app = App(app_ui, create_server(app_dir))
|
|
|
|
|
|
|
| 132 |
|
| 133 |
if __name__ == "__main__":
|
| 134 |
import asyncio
|