@checksub_team/peaks_timeline 1.6.6 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/package.json +1 -1
  2. package/peaks.js +6 -0
  3. package/src/main.js +12 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@checksub_team/peaks_timeline",
3
- "version": "1.6.6",
3
+ "version": "1.7.0",
4
4
  "description": "JavaScript UI component for displaying audio waveforms",
5
5
  "main": "./peaks.js",
6
6
  "types": "./peaks.js.d.ts",
package/peaks.js CHANGED
@@ -15631,6 +15631,12 @@ module.exports = function (Colors, EventEmitter, TimelineSegments, TimelineSourc
15631
15631
  this.options.lineHeight = newLineHeight;
15632
15632
  this.emit('options.set.line_height', oldHeight);
15633
15633
  };
15634
+ Peaks.prototype.zoomIn = function () {
15635
+ this.view.setZoom(this.view.getTimeToPixelsScale() + Math.floor(this.view.getTimeToPixelsScale() / 10) + 1);
15636
+ };
15637
+ Peaks.prototype.zoomOut = function () {
15638
+ this.view.setZoom(this.view.getTimeToPixelsScale() - Math.floor(this.view.getTimeToPixelsScale() / 10) + 1);
15639
+ };
15634
15640
  Peaks.prototype.destroy = function () {
15635
15641
  this._removeWindowResizeHandler();
15636
15642
  if (this.keyboardHandler) {
package/src/main.js CHANGED
@@ -745,6 +745,18 @@ define([
745
745
  this.emit('options.set.line_height', oldHeight);
746
746
  };
747
747
 
748
+ Peaks.prototype.zoomIn = function() {
749
+ this.view.setZoom(
750
+ this.view.getTimeToPixelsScale() + Math.floor(this.view.getTimeToPixelsScale() / 10) + 1
751
+ );
752
+ };
753
+
754
+ Peaks.prototype.zoomOut = function() {
755
+ this.view.setZoom(
756
+ this.view.getTimeToPixelsScale() - Math.floor(this.view.getTimeToPixelsScale() / 10) + 1
757
+ );
758
+ };
759
+
748
760
  /**
749
761
  * Cleans up a Peaks instance after use.
750
762
  */