File size: 8,373 Bytes
6b8ef05
 
260d0ed
6b8ef05
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
260d0ed
6b8ef05
 
 
 
 
 
64dfa95
260d0ed
6b8ef05
 
 
260d0ed
 
 
b5a55c5
6b8ef05
 
 
 
 
260d0ed
b5a55c5
6b8ef05
 
e58c787
 
 
 
 
6b8ef05
 
8b350c4
 
 
6b8ef05
 
 
e7c5b34
d900035
 
260d0ed
 
 
64dfa95
260d0ed
6b8ef05
 
 
 
 
 
 
 
 
 
 
260d0ed
 
b5a55c5
 
 
 
 
 
52b6c63
b5a55c5
 
 
52b6c63
b5a55c5
52b6c63
b5a55c5
260d0ed
b5a55c5
 
 
 
 
 
 
 
 
 
 
 
 
 
260d0ed
b5a55c5
260d0ed
 
6b8ef05
 
260d0ed
 
6b8ef05
 
 
 
0e017e5
 
 
 
 
 
 
 
 
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
from shared import app_dir
from utils import create_nav_button
from shiny import App, ui
import shinyswatch
from server import create_server

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"
                    ),
                    
                    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.h2("Study Scope", style="margin: 0; font-size: 28px; font-weight: bold;"),
                ui.div(
                    ui.markdown(
                        """
                        The Napa Valley Travel Behavior Study (TBS) builds on data received from the 2014 TBS using more cost-effective and advanced data collection tools. The TBS focuses on work, school, and other trips in Napa Valley. The study identifies how many trips per day are associated with visitors, residents and employees, where those trips start and end, and the predominant modes and times of travel. The study takes into account seasonal variations, as well as weekday and weekend travel.
                        
                        Since completing the previous Napa Valley TBS in 2014, the consultant has utilized similar data collection methods but with enhancements and refinements that minimize the shortcomings of the previous approach. Through coordination with data providers, Consultants has a better understanding of available data products, including the advantages and limitations of each data source. The goal of this study is to capitalize on new data sources, be more cost-effective, and obtain a more comprehensive dataset specific to the Napa Valley.
                        
                        This report describes the methodologies used to update and present a summary of the travel patterns and characteristics identified in Napa Valley. The resulting data will provide the basis for multiple planning efforts by the Napa Valley Transportation Authority (NVTA) and jurisdictions within Napa County. Such uses may include but are not limited to the refinement of the Napa Travel Model, the Short Range Transit Plan and the update of the Countywide Transportation Plan. The data is also expected to inform future transit service expansion in Napa County.
                        
                        Travel surveys are the traditional approach for gathering travel behavior data since the information is more robust than a typical traffic count process. These traditional survey methods are costly and usually result in very small sample sizes. They are also prone to human error during the data collection process as well as from the survey responders who may misinterpret the questions. In order to minimize the shortcomings of traditional approaches, Consultants evaluated various innovative data collection techniques as well as enhancements to traditional methods for use in this study.
                        
                        Consultants purchased Cuebiq-based origin-destination mobile device data from StreetLight Data for the TBS update, given their demonstrated experience and success supporting similar travel behavior studies across California, including the previous Napa Valley TBS. StreetLight Data was also selected because of their InSight Portal which offers a quick, convenient, and flexible method for obtaining data, as well as their ability to provide advanced metrics such as trip lengths, trip purposes, and demographic information based on observed home locations. After obtaining this data, it was scaled using newly collected traffic count data and the results were combined to provide a robust, comprehensive dataset, specific to Napa County.
                        """
                    ),
                    style="margin-top: 10px; font-size: 16px; line-height: 1.5;"
                ),
                ui.h2("Visualizer Pages", style="margin: 0; font-size: 28px; font-weight: bold;"),
                ui.div(
                    ui.markdown(
                        """
                        The visualizer prodives the travel behaviour based on big data. The key tabs are as follows:
                        
                        - **Home**: The general description of the project and the visualizer tool
                        - **Origin-Destination tab**: Provides detail visual information on the travel pattern observed through the big-data
                        - **VMT**: Provides the VMT and PMT of the trips asscociated to Napa valley trips
                        - **Truck**: Provides the commercial trip pattern for the Napa Valley
                        - **Airline**: Provides air-travel to and from Napa Valley.
                        """
                    ),
                    style="margin-top: 10px; font-size: 16px; line-height: 1.5;"
                ),
                style="padding: 10px; margin-top: 20px;",
            ),
        )
    ),
    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