From 2e1f313cc0360bd73b4b3dc341e34b94ddd3ae80 Mon Sep 17 00:00:00 2001 From: pah100 Date: Sat, 18 Jun 2016 19:10:15 +0800 Subject: [PATCH] update example --- src/util/throttle.js | 5 +- test/brush.html | 520 ++++++++++++++++++++++++++----------------- 2 files changed, 318 insertions(+), 207 deletions(-) diff --git a/src/util/throttle.js b/src/util/throttle.js index 507ef63e2..412777ffd 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 4119c6a72..50f62f2d0 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 @@ + + + + + + + + +