CivicTechTO / tRacket-dashboard

Noise monitoring dashboard built for the tRacket initiative.
https://tracket.info/
MIT License
7 stars 6 forks source link

Line chart zoom sync bug #15

Open danieltsoukup opened 3 months ago

danieltsoukup commented 3 months ago

Describe the bug If one line chart is zoomed in and then the other zoomed out, the second syncing does not happen despite the current callback watching for changes in plot properties.

To Reproduce Start the dashboard.

  1. Zoom in the first chart (the two plots will sync still).
  2. Zoom out on the second chart.
  3. See error: now the two plots are out of sync.
image

Expected behavior The syncing callback should keep the two line chart zoom setting in sync at all times regardless of the order of zooming.

Additional context Look at app_components.py and the update_zoom() callback.

Zen-cronic commented 1 month ago

I was debugging update_zoom and found that:

  1. The reverse case can happen too: zoom out on 2nd (raw) and zoom in on 1st (hourly).
  2. The above happens because update_zoom is not triggered for that particular zoom.
  3. Upstream issue from dash (the same problem as this) hasn't been addressed yet.

A workaround is to click again (zoom in or out on either plot) and both plots should be synced.

danieltsoukup commented 1 month ago

Hey @Zen-cronic thanks for looking into this and linking the dash issue! I feel we can park this task for now given that this is a known problem in dash.

Zen-cronic commented 1 month ago

Agreed. Let's keep an eye on the upstream repo.