You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This event is emitted when the zoom level in the zoomable waveform view changes.
1706
+
This event is emitted when the time range visible in the zoomable waveform view changes.
1706
1707
1707
1708
The `event` parameter contains:
1708
1709
1709
-
*`currentZoom`: The current zoom level, in samples per pixel
1710
-
*`previousZoom`: The previous zoom level, in samples per pixel
1710
+
*`startTime`: The time at the left edge of the waveform view.
1711
+
*`endTime`: The time at the right edge of the waveform view.
1712
+
1713
+
Note that `startTime` may not be exactly the same value you set when calling [`view.setStartTime()`](#viewsetstarttimetime). This is because the time is rounded to a number of pixels at the view's zoom level.
1711
1714
1712
1715
```js
1713
-
instance.on('zoom.update', function(event) {
1714
-
console.log(`Zoom changed from ${event.previousZoom} to ${event.currentZoom}`);
1716
+
instance.on('zoomview.update', function(event) {
1717
+
console.log(`Start time: ${event.startTime}, end time: ${event.endTime}`);
1715
1718
});
1716
1719
```
1717
1720
1721
+
### `zoom.update`
1722
+
1723
+
This event is emitted when the zoom level in the zoomable waveform view changes.
1724
+
1725
+
The `event` parameter contains:
1726
+
1727
+
*`currentZoom`: The current zoom level, in samples per pixel
1728
+
*`previousZoom`: The previous zoom level, in samples per pixel
0 commit comments