visualize-admin / visualization-tool

The tool for visualizing Swiss Open Government Data. Project ownership: Federal Office for the Environment FOEN
https://visualize.admin.ch
BSD 3-Clause "New" or "Revised" License
29 stars 3 forks source link

feat: Only display relevant data points in map legend for non-ordinal scale components #1490

Closed bprusinowski closed 2 months ago

bprusinowski commented 2 months ago

Closes #1476

This PR filters the map legend to only show values that are actually used in a chart, excluding ordinal dimensions and measures.

How to test

PR

Scenario 1

  1. Go to this link.
  2. Switch to map chart.
  3. Open Symbols layer.
  4. Add Observation Location color.
  5. ✅ See that legend contains only one value.

Scenario 2

  1. Go to this link.
  2. ✅ See that all warning levels are displayed in the legend (even though only some appear in the chart).

TEST

Scenario 1

  1. Go to this link.
  2. Switch to map chart.
  3. Open Symbols layer.
  4. Add Observation Location color.
  5. ❌ See that legend contains 189 values.

Scenario 2

  1. Go to this link.
  2. ✅ See that all warning levels are displayed in the legend (even though only some appear in the chart).
vercel[bot] commented 2 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
visualization-tool 🛑 Canceled (Inspect) May 3, 2024 8:37am
KerstinFaye commented 2 months ago

@bprusinowski sorry, was not there last week to take a look. Just tested it. It's a good solution.

bprusinowski commented 2 months ago

Thanks for testing @KerstinFaye 🙇‍♂️