Open vivekd95 opened 2 months ago
There is already an event that's used internally to sync the state between the overview and zoomview waveforms. I guess we could make this part of the documented API. It would fire whenever the zoomview start/end time changes, including when scrolling.
I probably wouldn't want to include the previous start/end times, just the new ones, as applications can keep track themselves if they need to.
The API would be something like:
peaks.on('zoomview.update', (event) => {
console.log(event.startTime, event.endTime);
});
I might also consider deprecating the existing zoom.update
event, and have a single event that fires when the view position or zoom level changes:
peaks.on('zoomview.update', (event) => {
console.log(event.startTime, event.endTime, event.scale);
});
Can you release a [3.4.3] to include this change?
Hi @chrisn
As you know, we can get the zoomview's current rendered start and end time stamps via functions
getStartTime()
andgetEndTime()
. We can add an event for zoomview that will be triggered on view change when time crosses the current view's end time stamp. Also, additional details like the time stamps for the previous view's lower and upper bounds, and the time stamps for the new view's lower and upper bounds will be beneficial.What is your opinion?