Strategic Multimodal Dashboard¶
This module provides an interactive Dash dashboard to explore and analyse the outputs of the Strategic Multimodal Evaluator in MultiModX.
It is designed to support researchers and analysts in visually inspecting strategic scenarios, comparing policy packages, and understanding multimodal passenger flows across air ✈️, rail 🚆, and multimodal 🔁 networks.
Index¶
- What this dashboard does
- Design characteristics
- High-level architecture
- Core components
- Inputs (including configuration (config.py) file)
- How to run
1. What This Dashboard Does¶
The dashboard allows users to:
- Select a case study configuration (CS, Policy Package, Network Definition, Schedule Optimiser)
- Visualise strategic indicators on:
- Interactive maps (NUTS3 level)
- OD matrices
- Inspect passenger itineraries and paths
- Explore mode shares and multimodal routing behaviour
- Drill down into origin–destination flows and selected paths
All visualisations are generated from precomputed CSV outputs of the strategic pipeline — the dashboard itself performs no optimisation and does not execute the models.
The dashboard expects the results to be organised if folders with the name as follows: processed_CSxx.PPyy.NDzz.SOaa.bb,
for example processed_CS10.pp00.nd00.so00.00. Being:
- CS: case study
- PP: Policy package applied
- ND: Network definition (e.g. defining if alliances can be used to generate itineraries)
- SO: Schedule optimiser (i.e., if the Scheduler Optimiser has been executed)
2. Design Characteristics¶
- Read-only by design: no optimisation or modification of data
- Config-driven: behaviour controlled via config.py
- Multimodal-first: air ✈️, rail 🚆, and multimodal 🔁 treated symmetrically
- Traceable: every plot maps directly to pipeline CSV outputs
- Scalable: supports multiple case studies and configurations
3. High-Level Architecture¶
flowchart TD
A[Strategic pipeline outputs<br/>CSV folders] --> B[data_loader.py]
B --> C[Dash callbacks]
C --> D[Maps & matrices]
C --> E[Tables & charts]
subgraph Dash App
F[app.py]
G[layout.py]
C
end
F --> G
G --> C
D --> H[Map visualisations<br/>NUTS3, paths, airports]
E --> I[Bar charts & data tables]
J[config.py] --> B
J[config.py] --> C
4. Core Components¶
Main elements of the dashboard with a short description.
Dashboard components
app.py — Application Entry Point¶
- Creates and configures the Dash application
- Loads the layout
- Registers callbacks
- Starts the server
layout.py — User Interface Definition¶
Defines the static structure of the dashboard:
- Case study selectors (CS / PP / ND / SO)
- Visualisation mode toggle (Map / Matrix)
- Variable selector
- Graph containers
- Data tables
- Session-level stores (
dcc.Store)
No data logic lives here — only UI structure.
callbacks.py — Interactive Logic¶
Handles all dynamic behaviour, including:
- Case study folder resolution
- Variable loading
- Switching between map and matrix views
- Click interactions on maps
- Path selection and highlighting
- Updating tables and charts based on user actions
- Cache management (session-based)
This is where user input becomes visual output.
data_loader.py — Data Access Layer¶
Responsible for loading and preparing input data from disk:
- Detects available case study folders
- Parses folder naming conventions: processed_csX.ppY.ndZ.soW, which correspond to CaseStudy, PolicyPackage, NetworkDefinition and ScheduleOptimiser versions used.
Loads: - Passenger itineraries - Passenger paths - NUTS3 geodata - Rail stops - Airport coordinates
All file access is centralised here to keep callbacks clean.
utils.py — Visualisation & Geospatial Utilities¶
Contains reusable helpers for:
- Reading and reshaping CSV data
- Creating:
- Choropleth maps
- OD matrices
- Bar charts (mode shares)
- Converting GeoDataFrames to GeoJSON
- Drawing:
- Passenger paths
- Airports
- Catchment areas
- Styling and normalising visual elements (line width, colours, legends)
This file encapsulates all plotting logic.
config.py — Configuration & Constants¶
Defines:
- Base data folders
- Map and infrastructure paths
- Available variables and labels
- File naming conventions
This allows the dashboard to be configuration-driven, without hardcoding paths or indicators.
5. Inputs¶
The dashboard expects precomputed strategic outputs in the folder defined by DATA_FOLDER (see config.py).
Each case study must follow the naming pattern:
processed_cs
Typical required CSVs include:
- Passenger itineraries
- Assigned passenger paths
- Clustered itineraries
- Aggregated indicators (e.g. travel time, demand served)
⚠️ The dashboard does not generate these files — they must be produced by the strategic pipeline beforehand.
Configuration file¶
dashboard/config.py contains the configuration of the dashboard (paths to results to load and other information):
Dashboard config.py parameters
import os
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
DATA_FOLDER = os.path.join(BASE_DIR, "../../data/CS10/v=0.16/output/") # Path to experiment output to load in dashboard
# Inside there could be different experiments,
# e.g. processed_cs10.pp00.nd00.so00.00
# The options ofr cs, pp, nd and so are loaded
# automatically based on what's available in
# DATA_FOLDER
MAPS_FOLDER = os.path.join(BASE_DIR, "../../data/EUROSTAT/NUTS_RG_01M_2021_4326.shp/NUTS_RG_01M_2021_4326.shp") # Path
# to folder with shp
# files from EUROSTAT
# to load the NUTS
# profiles in the map
RAIL_FOLDER = os.path.join(BASE_DIR, "../../data/CS10/v=0.16/gtfs_es_UIC_v2.3") # Path to GTFS from rail to be able to
# load rail information
INFRASTRUCTURE_FOLDER = os.path.join(BASE_DIR, "../../data/CS10/v=0.16/infrastructure") # Path to infrastructure file
# to load other infrastructure
# info
# VARIABLES contains the different options/variables that will appear in the options to visualise
# It needs for each variable its type and the name of the file with the results precomputed (these will be inside the
# DATA_FOLDER experiment id.
VARIABLES = {
"Demand original": {"type": "demand_origin", "file": "demand__alldemand_od.csv"},
"Demand served": {"type": "demand_served", "file": "demand_served__by_nuts_n3.csv"},
"Average Total Travel Time": {"type": "travel_time", "file": "strategic_total_journey_time__avg_by_nuts.csv"},
"Origin-Destination demand potential paths": {"type": "od_paths", "files": {"pax_assigned_to_paths": "possible_itineraries_clustered_pareto_w_demand_0.csv",
"possible_it_clustered": 'possible_itineraries_clustered_pareto_filtered_0.csv'}},
"Origin-Destination itineraries": {"type": "od_trips", "files": {"pax_assigned_to_itineraries": "pax_assigned_to_itineraries_options_0.csv"}},
"Catchment areas": {"type": "catchment_areas", "file": "catchment_area__access_egress_rail_stop_access_egress_w_rail.csv"},
}
6. How to Run¶
1. Install dependencies¶
pip install dash geopandas plotly pandas shapely matplotlib
(Exact environment may depend on your system setup.)
2. Configure paths¶
Edit config.py (see Configuration file section) to ensure:
- DATA_FOLDER points to your strategic outputs
- MAPS_FOLDER points to NUTS shapefiles
- Infrastructure paths are valid
3. Run the dashboard¶
Scrip inside dashboard folder:
python strategic_dashboard.py
Then open your browser at:
http://127.0.0.1:8050