finos / perspective

A data visualization and analytics component, especially well-suited for large and/or streaming datasets.
https://perspective.finos.org/
Apache License 2.0
7.72k stars 1.04k forks source link

Feature request : Click + drag to zoom, event/callback to back-end #2631

Open woj-b opened 1 month ago

woj-b commented 1 month ago

Feature Request

Description of Problem:

I'm using the Perspective plugin for Panel (https://panel.holoviz.org/reference/panes/Perspective.html) to build an interactive UI, which renders some timeseries charts based on quite dense data - I've implemented a basic version of this, which downsamples the data and handles click events to zoom in and fetch higher-granularity timeseries.

While this solution alongside some basic additional controls do the job reasonably well, it would be great to be able to click + drag on a section of the chart to zoom in and get a callback on the back-end with the details of the selected range (e.g. start/end date) to determine if I need to load higher resolution data into the chart (e.g. daily data for history >1 month, n-second data for shorter timespans - something similar to: https://canvasjs.com/python-charts/features/chart-zoom-pan/

From an initial look at some of the Python code, this would require changes both in the JavaScript/Python bindings on the Perspective side as well as the Panel Python APIs to handle events other than a click, but a lot of the framework seems to be in place already - is this something on the roadmap?