Skip to content

Geographical Map Widget #5

Description

@arsalann

What problem are you trying to solve?

DAC has no choropleth / geographic-map widget, and there's no escape hatch to add one in user code.

  • JSX loader (pkg/dashboard/jsloader.go:654) passes unknown tags through, but BruinWidgetFrame.tsx only renders metric / chart / table / text / divider / image — unknown types render blank.
  • TSX dashboards aren't a normal Vite/React build, so react-leaflet / maplibre-gl / deck.gl can't be imported.
  • <Image> is <img src> only; <Text> strips raw HTML.

Today we either ship non-interactive PNG choropleths via <Image>, build a parallel Streamlit dashboard, or fork DAC.

Proposed solution

First-class <Map> widget:

<Map
  geoUrl="https://gisco-services.ec.europa.eu/.../NUTS_RG_03M_2024_4326_LEVL_3.json"
  regionColumn="nuts_id"
  valueColumn="exceedances"
  colorScale="viridis"
  sql="SELECT nuts_id, exceedances FROM ..."
/>

Hover tooltip, zoom/pan, <Filter> can drive valueColumn.

Alternatives considered

  • 2D chart: heatmap on binned lat/lon — pixel grid, not a map.
  • Pre-rendered PNGs in <Image> — no interactivity.
  • Streamlit alongside DAC — splits the dashboard layer.
  • Fork DAC with a custom MapWidget — works, but per-user install + upstream drift.

Additional context

Geographic views are high-leverage for any regional dataset (EU NUTS, US counties, country comparisons). Current PFAS investigation has 1,165 NUTS3 with metrics where the regional pattern is the story — bar charts hide it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions