Ovilia commented on code in PR #21339:
URL: https://github.com/apache/echarts/pull/21339#discussion_r2541044746


##########
test/test-optimizations.html:
##########
@@ -0,0 +1,114 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <title>Test Optimizations</title>
+    <script src="../dist/echarts.js"></script>
+</head>
+<body>
+    <div id="chart" style="width: 800px; height: 600px;"></div>
+    <div id="tests">
+        <h3>Test Results:</h3>
+        <div id="test1">Test 1 - Duplicate Refresh Prevention: <span 
id="result1">Running...</span></div>
+        <div id="test2">Test 2 - Adaptive Sleep Threshold: <span 
id="result2">Running...</span></div>
+        <div id="test3">Test 3 - Hover Refresh Prevention: <span 
id="result3">Running...</span></div>
+    </div>
+
+    <script>
+        const chart = echarts.init(document.getElementById('chart'));
+        const zr = chart.getZr();
+        
+        // Simple chart
+        chart.setOption({
+            xAxis: { type: 'category', data: ['A', 'B', 'C'] },
+            yAxis: { type: 'value' },
+            series: [{ type: 'bar', data: [1, 2, 3] }]
+        });
+
+        // TEST 1: Duplicate Refresh Prevention
+        function test1() {
+            let animationStartCount = 0;
+            const originalStart = zr.animation.start;
+            
+            zr.animation.start = function() {
+                animationStartCount++;
+                return originalStart.call(this);
+            };
+            
+            // Reset refresh state first
+            zr._needsRefresh = false;
+            
+            // Call refresh multiple times rapidly
+            zr.refresh();

Review Comment:
   It doesn't seem to make sense calling `zr.refresh();` multiple times. First 
of all, zrender should be a black-box when using ECharts and developers are not 
expected to call this function manually. 



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to