huww98 / TimeChart

An chart library specialized for large-scale time-series data, built on WebGL.
https://huww98.github.io/TimeChart
MIT License
365 stars 31 forks source link

Allow selectZoom to be adaptive #67

Open janekfleper opened 1 year ago

janekfleper commented 1 year ago

When both axes are enabled for the selectZoom, it's quite inconvenient to zoom along only one axis. Making the zoom adaptive allows only one axis to be zoomed when the selection along the other axis is below a certain threshold. As an example, see the plot "X or Y (adaptive + omni)" here https://leeoniya.github.io/uPlot/demos/zoom-variations.html.

This merge request implements an adaptive select zoom that can be configured with the options thresholdX and thresholdY. By default both thresholds are zero which recovers the regular select zoom. When both thresholds are set to a finite value, the zoom selection will ignore the axis with the smaller selection if it is below its respective threshold.

janekfleper commented 7 months ago

Are you planning to include this feature in an upcoming version?

huww98 commented 7 months ago

Thanks and sorry for the delay. I will try this out this weekend.