@pushwoosh/kit-charts 0.4.1 → 0.4.2
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.
- package/core/Chart/Chart.js +5 -3
- package/package.json +1 -1
package/core/Chart/Chart.js
CHANGED
|
@@ -158,11 +158,13 @@ function ChartBody({
|
|
|
158
158
|
const identity = seriesIdentity(options);
|
|
159
159
|
// A different set of series is a different chart: start from its own options
|
|
160
160
|
// again rather than carrying the previous chart's switched-off indices over.
|
|
161
|
-
|
|
161
|
+
const identityDeps = [identity];
|
|
162
|
+
const [prevIdentityDeps, setPrevIdentityDeps] = useState(null);
|
|
163
|
+
if (prevIdentityDeps === null || identityDeps.some((dep, index) => dep !== prevIdentityDeps[index])) {
|
|
164
|
+
setPrevIdentityDeps(identityDeps);
|
|
162
165
|
setHidden(hiddenByOptions(options));
|
|
163
166
|
setZoom(null);
|
|
164
|
-
|
|
165
|
-
}, [identity]);
|
|
167
|
+
}
|
|
166
168
|
const toggle = useCallback(item => {
|
|
167
169
|
// A tooltip captured before the toggle would keep quoting what just went away.
|
|
168
170
|
setHover(null);
|