Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/samgutentag/bcycle-map/llms.txt

Use this file to discover all available pages before exploring further.

The Explore view is BCycle Map’s analytics dashboard. It answers system-level questions — when is the fleet most active? Which stations see the most traffic? How long does a typical ride between any two stations take? All charts are powered by parquet files in R2 queried directly in the browser via DuckDB-WASM; there is no backend query engine.
DuckDB-WASM runs entirely in the browser inside a Web Worker, reading parquet files over HTTP directly from the public R2 bucket. The first load takes 0.5–1.5 seconds to initialise the WASM binary, but subsequent queries within the same session are fast.

Routes

PathPurpose
/exploreFull analytics dashboard

System Totals

At the top of the page, the SystemTotals component shows system-wide aggregates from the current KVValue snapshot:
  • Total bikes available across all stations
  • Open docks available for returns
  • Active riders — estimated from max_bikes_ever − parked_bikes
  • Fleet size — the max_bikes_ever peak observed by the poller
  • Last changed — when the system-wide parked count last moved

New Stations

The NewStationsSection highlights stations that first appeared in the GBFS feed within the last 14 days (tracked via first_seen_ts). This is useful for spotting dock expansions.

Activity Log

The activity log shows recent departures and arrivals captured by the poller, plus inferred trip pairings scored against the travel-time matrix. How events are generated: The poller diffs per-station num_bikes_available every two minutes and emits:
  • departure — count went down at a station
  • arrival — count went up at a station
How trips are paired: A two-pass algorithm first handles unambiguous 0 → 1 → 0 single-rider transitions (high confidence), then applies a greedy best-fit pass against the travel-time matrix for overlapping multi-rider windows (low confidence). The Explore view shows the 20 most recent events and 20 most recent trips. Click View all → to open the full Activity page at /activity in the app, which shows up to 200 events and 50 trips. Clicking any trip row opens the TripRouteModal — a small map inset replaying that specific trip.
The rolling buffer is capped at 200 events and 50 trips system-wide. A specific station pair will often show zero matched trips unless it’s a high-traffic route.

Active Riders Over Time · 7 Days

This section renders the ActiveRidersOverTime chart: a time-series line of estimated bikes in use, sampled every two minutes over the last 7 days. Formula:
active_riders = max(0, max_bikes_ever − sum(num_bikes_available))
A peak on the chart corresponds to a moment when many bikes were away from docks simultaneously. The chart is independent of the page date-range and is always anchored to the most recent 7 days.
This section requires max_bikes_ever to be populated. The poller needs to observe a quiet early-morning moment (typically around 3 am) when most bikes are docked before an accurate active_riders estimate is possible.

Hour-of-Week Heatmaps

Two HourOfWeekHeatmap components visualise weekly patterns across all historical data. Both display a 7 × 24 grid — rows = days of week (Mon–Sun), columns = hours of day (0–23 in the system timezone). Darker cells = higher values.
Average estimated bikes in use per day-of-week × hour-of-day cell. Identifies when the system is busiest and when bikes are most likely to be available.Uses the useHourOfWeekActiveRiders hook against all parquet history. Requires max_bikes_ever to be set.
Both heatmaps need all 168 day-of-week × hour-of-day cells populated before they are shown. This requires at least 8 days of continuous polling. Until then, a “Coming soon” placeholder shows how many cells have been filled so far.

Travel-Time Matrix

The TravelTimeHeatmap renders an N × N SVG grid where each cell shows the median cycling time between a pair of stations. Cell colour interpolates from light amber (short rides) to dark amber (long rides). The diagonal is neutral (same station → self). Interaction:
  • Use the Origin and Destination StationPicker controls above the grid to highlight a row and column. The intersection cell shows the travel time for that exact pair.
  • Click any non-diagonal cell to open Route Check for that pair (/route/:fromId/:toId).
  • Hover any cell to see the station names, travel time in minutes, and distance in the tooltip at the top of the SVG.
Data source: useTravelMatrix loads travel-times.json from R2 once per session. The matrix stores { minutes, meters } for every (from, to) pair.
The PopularStationsTile will display the top stations by activity from the 30-day rolling leaderboard in R2. It is hidden until at least 30 days of polling data has been collected. Each row will show:
  • Station rank and name (links to Station Details)
  • ↑ Departures (bikes taken)
  • ↓ Arrivals (bikes returned)
  • Total events
The leaderboard requires at least 30 days of accumulated data and is considered stale if the rollup file is older than 48 hours, in which case an empty state is shown. The tile is not rendered until the data threshold is met.

The PopularRoutesTile will list the most-ridden station pairs once sufficient data is available. A segmented control lets you toggle between 30d (last 30 days) and All (entire history). Each row links to Route Check for that pair.

Activity Log Page (/activity)

The /activity route is a separate, focused full-screen view of the activity log rendered by the Activity component — it is not a sub-view of Explore. It is accessible via the View all → link inside the Explore activity log section. It shows:
  • Up to 200 events and 50 trips from the rolling buffer
  • The same inferred trip pairings as Explore
  • A ← Back to Explore link at the top
How the activity log is populated:
Poller diffs every 2 min → departure/arrival events →
  pass 1: clean 0→1→0 transitions (high confidence)
  pass 2: greedy matrix-scored match (low confidence)
→ Stored in KV, capped at 200 events / 50 trips

How to Explore the Data

1

Open Explore

Click Explore in the top nav or navigate to /explore.
2

Check the system totals

Confirm the fleet size and current active-rider estimate at the top of the page.
3

Review the activity log

Scroll to the Activity Log to see the most recent departures, arrivals, and matched trip pairings. Click a trip to replay it on the map.
4

Analyse weekly patterns

Look at the Hour-of-Week heatmaps to identify peak and off-peak windows for your regular commute times.
5

Use the travel-time matrix

Pick an origin and destination in the matrix pickers. The highlighted row, column, and intersection cell give you the median cycling time for that pair. Click the cell to open Route Check.
6

Check popular routes

Switch the Popular Routes tile between 30-day and all-time to understand high-demand corridors across the system.

Data Sources

SectionSource
System totals, new stationsuseLiveSnapshot (KV)
Activity log and tripsuseActivity (KV rolling buffer)
Active riders over timeuseTotalBikesOverTime (parquet via DuckDB-WASM)
Hour-of-week heatmapsuseHourOfWeek, useHourOfWeekActiveRiders (parquet)
Travel-time matrixuseTravelMatrix (R2 JSON)
Popular stations / routesuseLeaderboards (R2 JSON rollup)

Live Map

Real-time station availability across the full system.

Flow Map

Animated trip playback for the past 24 hours.

Route Check

Travel time and availability charts for a specific station pair.

Station Details

Per-station historical charts and nearby station info.

Build docs developers (and LLMs) love