Closed chaoran-chen closed 1 week ago
The problem is the following:
We use this function to compute whether to show the proportion number or not: https://github.com/GenSpectrum/dashboard-components/blob/81327971bb353c55bedc016919dc1878d3575844/components/src/preact/mutationsOverTime/mutations-over-time-grid.tsx#L90-L113
When the tab is not visible, then checkWidth
will execute gridRef.current.getBoundingClientRect().width
, which evaluates to 0 (since that grid is currently not visible). Thus, the proportions are not shown.
The component does not receive an update when switching tabs.
In my PR for the wastewater mutations over time plot (#504), I'm reusing the existing mutations over time grid and am observing a bug where the proportion numbers don't display initially when switching the tab but become visible if we change the size of the window:
https://dashboard-components-git-wastewater-mutations-cov-spectrum.vercel.app/?path=/story/visualization-wastewater-mutations-over-time--default
https://github.com/user-attachments/assets/2be8b9d0-6119-4673-b9b4-f27a0d6d7149