Viewing a saved revision (read-only)
iF-X26hI5731R-tTDLA4Z
This example demonstrates a minimal Hello World visualization created with D3 v6, displaying the text “Hello VizHub!” centered on the page. It showcases VizHub’s support for loading D3 from UNPKG, importing D3 API functions like `select`, and combining local ES6 modules such as `message.js` alongside HTML and CSS. The rendering approach uses the DOM—D3’s `select` method targets the `#message` div to set its text content, with styling controlled by the linked `styles.css` file. This serves as a template for more complex projects.
TTC Bus Delay Dashboard (2022)
An interactive ECharts dashboard that summarises TTC bus delay reports for the 2022 dataset. Reports are restricted to January–June (2022 H1).
Files
index.html— page structure and script includes.css/styles.css— dashboard styling.js/month-filter.js— restricts the dataset to Jan–Jun.js/format.js— number formatting helpers.js/data.js— loads and normalises the CSV.js/charts.js— builds every ECharts figure, including the incident-category pie chart.js/summary.js— fills in the summary cards.js/filters.js— wires up the filter controls.js/main.js— orchestrates loading, filtering and redraw.ttc-bus-delay-data-2022.csv— the source CSV must be placed next toindex.html. Rename the file or editCSV_FILENAMEinsidejs/data.jsif your CSV has a different name.
Charts
Seven figures are rendered:
- Monthly incident reports (bar, Jan–Jun).
- Reports by incident category — pie chart.
- Reports by hour of day (bar).
- Reports by day of week (bar).
- Delay duration distribution (bar).
- Top routes by report count (horizontal bar).
- Reports by direction (bar).
Every chart responds to the filter bar above them.
Why do I see "Failed to fetch"?
Browsers block fetch() requests for local files when you
double-click index.html (the URL looks like
file:///...). There are two ways to fix it:
Option 1 — use a tiny local web server (recommended)
Run one of the following commands from this folder:
python3 -m http.server 8000npx servephp -S localhost:8000
Then open http://localhost:8000/ in your browser.
Option 2 — use the "Load local CSV" button
The dashboard includes a Load local CSV button above the
charts. Click it and pick ttc-bus-delay-data-2022.csv from
your machine; the page will parse the file locally without
needing a web server.