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: Dashboard time range filter and merging of cubes improvements #1644

Closed bprusinowski closed 2 days ago

bprusinowski commented 6 days ago

Closes #1636

This PR refactors some areas of the application related to merging of cubes, so that we merge cubes in the context of a given chart config, instead of every config at the same time. This eliminates some bugs when dealing with several charts based on different cubes, and adding a new dataset to one of them after already having several charts.

It also simplifies the dashboard time range filter so that there is only one common filter for every temporal X dimension used in the charts. This means that we create a "combined" dimension that uses "lowest" time unit and are able to filter every chart afterwards with only one slider element.

How to test

PR

  1. Go to this link.
  2. Add a new chart (line).
  3. Merge a second dataset to the chart (Gebäudeprogramm - Anzahl unterstützter Gesuche).
  4. Add a new chart based on another cube (Bathing water quality).
  5. Add a new area chart, so that there are four charts in total.
  6. Proceed to layout options.
  7. Switch to dashboard / free canvas layout.
  8. ✅ See that there's one generic shared Date filter available.
  9. Toggle the filter on.
  10. ✅ See that the range encompasses every temporal X dimension (starts at 21.05.2007) and that it has a day resolution (lowest resolution based on year [Photovoltaikanlagen and Gebäudeprogramm datasets] and day [Bathing water quality dataset] temporal dimensions).
  11. See that the time slider appeared on top.
  12. Use the time slider to filter the charts, and see that every one of them reacts to the filtering.
  13. ✅ Reset the time slider to the full extent, and use the left date picker to select a new date, e.g. in June 2017. See that the charts reacted to the new selection.

TEST

  1. Go to this link.
  2. Add a new chart (line).
  3. Merge a second dataset to the chart (Gebäudeprogramm - Anzahl unterstützter Gesuche).
  4. Add a new chart based on another cube (Bathing water quality).
  5. Add a new area chart, so that there are four charts in total.
  6. Proceed to layout options.
  7. Switch to dashboard / free canvas layout.
  8. ❌ See that there are two shared filters available (1. Jahr der Vergütung, Jahr and 2. Date), which are not generic, but connected to 1. first two charts and 2. last two charts.
  9. Toggle the filters on.
  10. ❌ See that the ranges are implicitly based on year and day dimensions from different cubes.
  11. See that the time slider appeared on top.
  12. Use the time slider to filter the charts, and see that every one of them reacts to the filtering.
  13. ❌ Reset the time slider to the full extent, and use the left date picker in the Date field to select a new date, e.g. in June 2017. See that the charts didn't react to the new selection.
vercel[bot] commented 6 days ago

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

Name Status Preview Comments Updated (UTC)
visualization-tool ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 28, 2024 3:49pm