100pah commented on a change in pull request #11037: new: 10491-support mouse 
wheel in slider data zoom
URL: 
https://github.com/apache/incubator-echarts/pull/11037#discussion_r322620685
 
 

 ##########
 File path: src/component/dataZoom/SliderZoomView.js
 ##########
 @@ -776,6 +779,52 @@ var SliderZoomView = DataZoomView.extend({
         });
     },
 
+    /**
+     * Zoom with the mouse wheel
+     * We simply simulate handle zoom
+     * @private
+     */
+    _mouseWheelZoom: function (e) {
+        const STEP_SIZE = 10;
+
+        // stop wheel navigation so page won't scroll
+        eventTool.stop(e.event);
+
+        // Transform dx, dy to bar coordination.
+        var barTransform = this._displayables.barGroup.getLocalTransform();
+
+        // don't zoom in too much, so sliders won't switch places
+        // and then mouse wheel will invert
+        if (this._range[1] - this._range[0] <= STEP_SIZE) {
+            if (e.wheelDelta > 0) {
+                    return;
 
 Review comment:
   indentation should be 4 spaces.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to