diff --git a/src/util/throttle.js b/src/util/throttle.js index 507ef63e21bca787f0ff9db7fa3736f4d78a8ae2..412777ffd6c9e18bafe17c7ce5607a1634b5fa03 100755 --- a/src/util/throttle.js +++ b/src/util/throttle.js @@ -4,6 +4,7 @@ define(function () { var ORIGIN_METHOD = '\0__throttleOriginMethod'; var RATE = '\0__throttleRate'; + var THROTTLE_TYPE = '\0__throttleType'; /** * @public @@ -104,13 +105,15 @@ define(function () { } var originFn = fn[ORIGIN_METHOD] || fn; + var lastThrottleType = fn[THROTTLE_TYPE]; var lastRate = fn[RATE]; - if (lastRate !== rate) { + if (lastRate !== rate || lastThrottleType !== throttleType) { fn = obj[fnAttr] = lib.throttle( originFn, rate, throttleType === 'debounce' ); fn[ORIGIN_METHOD] = originFn; + fn[THROTTLE_TYPE] = throttleType; fn[RATE] = rate; } diff --git a/test/brush.html b/test/brush.html index 4119c6a7289f98ebb4dab35a0d896b615d18e195..50f62f2d0c8b6750f429cf3eace11c7b7b591d87 100644 --- a/test/brush.html +++ b/test/brush.html @@ -24,7 +24,7 @@ } body .main { height: 550px; - margin-right: 220px; + margin-right: 300px; margin-left: 20px; } .panel { @@ -32,7 +32,7 @@ top: 0; right: 0; bottom: 0; - width: 200px; + width: 280px; background: #555; color: #fff; font-size: 14px; @@ -66,6 +66,14 @@ border-radius: 2px; color: #000; } + + .sm-settings { + border-bottom: 1px solid #777; + padding-bottom: 15px; + } + .sm-settings input { + max-width: 50px; + }
Scatter
@@ -81,6 +89,7 @@ +
Scatter in Map
@@ -88,10 +97,36 @@ +
+
+ DIFF with previous selected: + Y + N +
+
+ animation: + Y + N +
+
+ animationDurationUpdate: + +
+
+ throttleDelay: + +
+
+ throttleType: + debounce + fixRate +
+
+
Stacked Bar (rect-polygon intersect)
@@ -108,6 +143,15 @@ + + + + + + + + +