@oliasoft-open-source/charts-library 5.6.0 → 5.6.1
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/dist/index.js
CHANGED
|
@@ -19705,25 +19705,29 @@ const getAnnotation = ({ showAnnotations, annotationsData }) => {
|
|
|
19705
19705
|
return showAnnotations && annotationsData && annotationsData?.length ? generateAnnotations(annotationsData) ?? [] : [];
|
|
19706
19706
|
};
|
|
19707
19707
|
const useUpdateAnnotations = (options, dispatch) => {
|
|
19708
|
-
if (!options.annotations?.controlAnnotation) return;
|
|
19709
19708
|
const prevAnnotationsRef = useRef(null);
|
|
19710
19709
|
useEffect(() => {
|
|
19710
|
+
if (!options?.annotations?.controlAnnotation) return;
|
|
19711
19711
|
const { showAnnotations = true, annotationsData = [] } = options?.annotations ?? {};
|
|
19712
19712
|
const prev = prevAnnotationsRef.current;
|
|
19713
|
-
if (!prev || prev.showAnnotations !== showAnnotations || !isEqual(prev.annotationsData, annotationsData))
|
|
19714
|
-
|
|
19715
|
-
|
|
19716
|
-
|
|
19717
|
-
showAnnotations,
|
|
19718
|
-
annotationsData
|
|
19719
|
-
})
|
|
19720
|
-
});
|
|
19721
|
-
prevAnnotationsRef.current = {
|
|
19713
|
+
if (!(!prev || prev.showAnnotations !== showAnnotations || !isEqual(prev.annotationsData, annotationsData))) return;
|
|
19714
|
+
dispatch({
|
|
19715
|
+
type: SET_ANNOTATION,
|
|
19716
|
+
payload: getAnnotation({
|
|
19722
19717
|
showAnnotations,
|
|
19723
19718
|
annotationsData
|
|
19724
|
-
}
|
|
19725
|
-
}
|
|
19726
|
-
|
|
19719
|
+
})
|
|
19720
|
+
});
|
|
19721
|
+
prevAnnotationsRef.current = {
|
|
19722
|
+
showAnnotations,
|
|
19723
|
+
annotationsData
|
|
19724
|
+
};
|
|
19725
|
+
}, [
|
|
19726
|
+
dispatch,
|
|
19727
|
+
options?.annotations?.controlAnnotation,
|
|
19728
|
+
options?.annotations?.showAnnotations,
|
|
19729
|
+
options?.annotations?.annotationsData
|
|
19730
|
+
]);
|
|
19727
19731
|
};
|
|
19728
19732
|
const LegendContext = createContext(void 0);
|
|
19729
19733
|
const LegendProvider = ({ children, options, datasets }) => {
|
package/dist/project.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"generatedAt":
|
|
1
|
+
{"generatedAt":1768567537433,"hasCustomBabel":false,"hasCustomWebpack":false,"hasStaticDirs":false,"hasStorybookEslint":true,"refCount":0,"testPackages":{"@storybook/testing-library":"0.2.2","eslint-plugin-vitest":"0.5.4","eslint-plugin-vitest-globals":"1.5.0","vitest":"4.0.4"},"hasRouterPackage":false,"packageManager":{"type":"yarn","agent":"yarn","nodeLinker":"undefined"},"typescriptOptions":{"reactDocgen":"react-docgen"},"preview":{"usesGlobals":false},"framework":{"name":"@storybook/react-vite","options":{}},"builder":"@storybook/builder-vite","renderer":"@storybook/react","portableStoriesFileCount":0,"applicationFileCount":0,"storybookVersion":"9.1.16","language":"javascript","storybookPackages":{"@storybook/react-vite":{"version":"9.1.16"},"@storybook/testing-library":{"version":"0.2.2"},"eslint-plugin-storybook":{"version":"9.1.16"},"storybook":{"version":"9.1.16"}},"addons":{"@storybook/addon-themes":{"version":"9.1.16"},"@storybook/addon-docs":{"version":"9.1.16"}}}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import { Dispatch } from 'react';
|
|
2
2
|
import { TLegendAction } from '../legend-component/state/legend-state-reducer';
|
|
3
3
|
import { TChartsOption } from '../legend-component/legend-interface';
|
|
4
|
-
/**
|
|
5
|
-
* Syncs annotation when annotationsData or showAnnotations change
|
|
6
|
-
*/
|
|
7
4
|
export declare const useUpdateAnnotations: (options: TChartsOption, dispatch: Dispatch<TLegendAction>) => void;
|
package/package.json
CHANGED