@rfkit/charts 1.1.37 → 1.1.38
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/index.js +16 -5
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -10955,15 +10955,27 @@ const ToolsBar_SeriesDisplayControl_styles_module = SeriesDisplayControl_styles_
|
|
|
10955
10955
|
const SeriesDisplayControl_SeriesDisplayControl = ()=>{
|
|
10956
10956
|
const { state: { globalID, series }, dispatch } = useStore_useStore();
|
|
10957
10957
|
const { data, legendExternal, forceDisplay } = series;
|
|
10958
|
-
const
|
|
10958
|
+
const [updateCounter, setUpdateCounter] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)(0);
|
|
10959
|
+
const dataSnapshot = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>{
|
|
10960
|
+
const snapshot = {};
|
|
10961
|
+
data.forEach((value, key)=>{
|
|
10962
|
+
snapshot[key] = {
|
|
10963
|
+
...value
|
|
10964
|
+
};
|
|
10965
|
+
});
|
|
10966
|
+
return snapshot;
|
|
10967
|
+
}, [
|
|
10959
10968
|
data,
|
|
10969
|
+
updateCounter
|
|
10970
|
+
]);
|
|
10971
|
+
const seriesArray = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>Object.keys(dataSnapshot).filter((name)=>!legendExternal.includes(name)).filter((name)=>name !== constants_SeriesType.TemplateData), [
|
|
10972
|
+
dataSnapshot,
|
|
10960
10973
|
legendExternal
|
|
10961
10974
|
]);
|
|
10962
|
-
const [updateCounter, setUpdateCounter] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)(0);
|
|
10963
10975
|
const seriesDataSnapshot = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>{
|
|
10964
10976
|
const snapshot = {};
|
|
10965
10977
|
seriesArray.forEach((name)=>{
|
|
10966
|
-
const item =
|
|
10978
|
+
const item = dataSnapshot[name];
|
|
10967
10979
|
if (item) snapshot[name] = {
|
|
10968
10980
|
display: item.display,
|
|
10969
10981
|
label: item.label || name,
|
|
@@ -10973,8 +10985,7 @@ const SeriesDisplayControl_SeriesDisplayControl = ()=>{
|
|
|
10973
10985
|
return snapshot;
|
|
10974
10986
|
}, [
|
|
10975
10987
|
seriesArray,
|
|
10976
|
-
|
|
10977
|
-
updateCounter
|
|
10988
|
+
dataSnapshot
|
|
10978
10989
|
]);
|
|
10979
10990
|
const handleDropdownClick = (0, __WEBPACK_EXTERNAL_MODULE_react__.useCallback)(()=>{
|
|
10980
10991
|
setUpdateCounter((prev)=>prev + 1);
|