leeoniya / uPlot

📈 A small, fast chart for time series, lines, areas, ohlc & bars
MIT License
8.51k stars 371 forks source link

cursor/select/hover-pts should be updated on resize #875

Closed leeoniya closed 5 months ago

leeoniya commented 7 months ago

currently if the cursor is locked or a selection exists they are not updated with chart resize calls. to do this we have to keep a % offsets, widths, and heights rather than just absolute values.

one option is to use % css values. this way we dont have to touch the styles at all during resize, which would be a big win. however, to do this we have to use left and top rather than transform: translate(), which could have worse perf in the more typical non-resize case.

probably makes more sense to manually sync on resize, but needs profiling.