@oliasoft-open-source/charts-library 5.0.0-beta-2 → 5.0.0
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/assets/Color-6VNJS4EI-DLbcRNMp.js +1 -0
- package/dist/assets/DocsRenderer-NNNQARDV-BOzykHvd.js +1 -0
- package/dist/assets/WithTooltip-V3YHNWJZ-BeePhoIB.js +1 -0
- package/dist/assets/_getPrototype-Bgn98YsR.js +3 -0
- package/dist/assets/{bar-chart.stories-D9mtWCnD.js → bar-chart.stories-BEwhK613.js} +35 -35
- package/dist/assets/chunk-HLWAVYOI-BJEcfeBO.js +364 -0
- package/dist/assets/entry-preview-D8lfu5jc.js +1 -0
- package/dist/assets/entry-preview-docs-CRyh30bF.js +54 -0
- package/dist/assets/formatter-SWP5E3XI-Bj1a9__W.js +156 -0
- package/dist/assets/get-draggableData-DhvAHrT5.js +2 -0
- package/dist/assets/iframe-BurE_SJm.js +8 -0
- package/dist/assets/index-B7LTuyD5.js +1 -0
- package/dist/assets/index-BXzfdmYx.js +24 -0
- package/dist/assets/index-CZvFZgOq.js +9 -0
- package/dist/assets/index-D3eZ-H7s.js +1 -0
- package/dist/assets/index-DrFu-skq.js +6 -0
- package/dist/assets/index-uubelm5h.js +9 -0
- package/dist/assets/isPlainObject-DdO3KXLu.js +1 -0
- package/dist/assets/legend-BWpTckOL.js +278 -0
- package/dist/assets/legend-context-BAQplG-D.js +71 -0
- package/dist/assets/line-chart-L0zq38Nj.js +1 -0
- package/dist/assets/line-chart.stories-CurD8upE.js +1130 -0
- package/dist/assets/{line-chart.test-case.stories-DgfMW1VB.js → line-chart.test-case.stories-Cq5J45Io.js} +2 -2
- package/dist/assets/pie-chart.stories-Duex2I6n.js +45 -0
- package/dist/assets/preview-BBDnT5_b.js +30 -0
- package/dist/assets/preview-D4u66u8a.js +2 -0
- package/dist/assets/preview-FHoZfaOb.js +17 -0
- package/dist/assets/react-18-Xi5cNDBV.js +1 -0
- package/dist/assets/scatter-chart.stories-D0618GGr.js +41 -0
- package/dist/assets/syntaxhighlighter-MJWPISIS-Bmhn3z6A.js +1 -0
- package/dist/bar-chart/bar-chart-const.d.ts +2 -0
- package/dist/bar-chart/bar-chart-default-props.d.ts +2 -0
- package/dist/bar-chart/bar-chart.d.ts +3 -0
- package/dist/bar-chart/bar-chart.interface.d.ts +96 -0
- package/dist/bar-chart/bar-chart.stories.d.ts +807 -0
- package/dist/bar-chart/utils/get-bar-chart-data-labels.d.ts +10 -0
- package/dist/bar-chart/utils/get-bar-chart-scales.d.ts +3 -0
- package/dist/bar-chart/utils/get-bar-chart-tooltips.d.ts +6 -0
- package/dist/bar-chart/utils/use-bar-chart-config.d.ts +13 -0
- package/dist/bar-chart/utils/use-bar-chart-options.d.ts +55 -0
- package/dist/common/common.interface.d.ts +206 -0
- package/dist/common/controls-portal.d.ts +7 -0
- package/dist/common/enums.d.ts +10 -0
- package/dist/common/helpers/chart-border-plugin.d.ts +16 -0
- package/dist/common/helpers/chart-consts.d.ts +39 -0
- package/dist/common/helpers/chart-utils.d.ts +84 -0
- package/dist/common/helpers/container.d.ts +18 -0
- package/dist/common/helpers/custom-format-number.d.ts +1 -0
- package/dist/common/helpers/download-pgn.d.ts +4 -0
- package/dist/common/helpers/enums.d.ts +80 -0
- package/dist/common/helpers/get-chart-annotation.d.ts +90 -0
- package/dist/common/helpers/get-custom-legend-plugin-example.d.ts +8 -0
- package/dist/common/helpers/get-draggableData.d.ts +18 -0
- package/dist/common/helpers/range/estimate-close-values.test.d.ts +1 -0
- package/dist/common/helpers/range/estimate-data-series-have-close-values.d.ts +8 -0
- package/dist/common/helpers/range/range.d.ts +33 -0
- package/dist/common/helpers/range/range.test.d.ts +1 -0
- package/dist/common/helpers/text.d.ts +1 -0
- package/dist/common/helpers/to-annotation.d.ts +4 -0
- package/dist/common/hooks/use-generated-labels.d.ts +4 -0
- package/dist/common/hooks/use-legend-state.d.ts +28 -0
- package/dist/common/hooks/use-legend.d.ts +4 -0
- package/dist/common/hooks/use-reset.d.ts +3 -0
- package/dist/common/legend-component/legend-dropzone.d.ts +3 -0
- package/dist/common/legend-component/legend-interface.d.ts +48 -0
- package/dist/common/legend-component/legend-item/LegendItemLine.d.ts +5 -0
- package/dist/common/legend-component/legend-item/legend-item.d.ts +3 -0
- package/dist/common/legend-component/legend-panel.d.ts +3 -0
- package/dist/common/legend-component/legend.d.ts +3 -0
- package/dist/common/legend-component/state/legend-action-types.d.ts +2 -0
- package/dist/common/legend-component/state/legend-context.d.ts +12 -0
- package/dist/common/legend-component/state/legend-state-reducer.d.ts +26 -0
- package/dist/common/legend-component/utils/create-style-object.d.ts +27 -0
- package/dist/common/legend-component/utils/get-generated-labels.d.ts +2 -0
- package/dist/common/plugins/annotation-dragger-plugin/annotation-dragger-plugin.d.ts +15 -0
- package/dist/common/plugins/annotation-dragger-plugin/enums.d.ts +20 -0
- package/dist/common/plugins/annotation-dragger-plugin/event-helpers.d.ts +6 -0
- package/dist/common/plugins/annotation-dragger-plugin/helpers.d.ts +53 -0
- package/dist/common/plugins/annotation-dragger-plugin/helpers.test.d.ts +1 -0
- package/dist/common/plugins/annotation-dragger-plugin/point-annotation-label.d.ts +5 -0
- package/dist/common/plugins/gradient-background-plugin/enums.d.ts +10 -0
- package/dist/common/plugins/gradient-background-plugin/gradient-background-plugin.d.ts +2 -0
- package/dist/favicon.svg +7 -1
- package/dist/iframe.html +51 -259
- package/dist/index.d.ts +1 -8
- package/dist/index.html +30 -80
- package/dist/index.json +1 -1
- package/dist/line-chart/__tests__/test-data/app-test-case-1.json.d.ts +8733 -0
- package/dist/line-chart/__tests__/test-data/app-test-case-2.json.d.ts +11614 -0
- package/dist/line-chart/__tests__/test-data/app-test-case-3.json.d.ts +34 -0
- package/dist/line-chart/__tests__/test-data/app-test-case-4.json.d.ts +411 -0
- package/dist/line-chart/__tests__/test-data/app-test-case-5.json.d.ts +2734 -0
- package/dist/line-chart/__tests__/test-data/app-test-case-6.json.d.ts +2236 -0
- package/dist/line-chart/constants/default-translations.d.ts +25 -0
- package/dist/line-chart/constants/line-chart-consts.d.ts +13 -0
- package/dist/line-chart/controls/axes-options/action-types.d.ts +5 -0
- package/dist/line-chart/controls/axes-options/axes-options-form-state.d.ts +23 -0
- package/dist/line-chart/controls/axes-options/axes-options-form-state.test.d.ts +1 -0
- package/dist/line-chart/controls/axes-options/axes-options-interfaces.d.ts +54 -0
- package/dist/line-chart/controls/axes-options/axes-options.d.ts +6 -0
- package/dist/line-chart/controls/controls-interfaces.d.ts +20 -0
- package/dist/line-chart/controls/controls.d.ts +6 -0
- package/dist/line-chart/controls/drag-options-interfaces.d.ts +14 -0
- package/dist/line-chart/controls/drag-options.d.ts +23 -0
- package/dist/line-chart/controls/line-options.d.ts +19 -0
- package/dist/line-chart/hooks/use-chart-functions.d.ts +32 -0
- package/dist/line-chart/hooks/use-chart-options.d.ts +16 -0
- package/dist/line-chart/hooks/use-chart-plugins.d.ts +7 -0
- package/dist/line-chart/hooks/use-chart-state.d.ts +17 -0
- package/dist/line-chart/hooks/use-toggle-handler.d.ts +12 -0
- package/dist/line-chart/initialize/config.d.ts +12 -0
- package/dist/line-chart/initialize/initialize-line-chart.d.ts +12 -0
- package/dist/line-chart/initialize/initialize-line-chart.test.d.ts +1 -0
- package/dist/line-chart/line-chart-get-default-props.d.ts +2 -0
- package/dist/line-chart/line-chart.d.ts +3 -0
- package/dist/line-chart/line-chart.interface.d.ts +146 -0
- package/dist/line-chart/line-chart.stories.d.ts +1729 -0
- package/dist/line-chart/line-chart.test-case.stories.d.ts +29 -0
- package/dist/line-chart/plugins/chart-area-text-plugin.d.ts +17 -0
- package/dist/line-chart/plugins/line-chart.minor-gridlines-plugin.d.ts +8 -0
- package/dist/line-chart/plugins/line-chart.minor-gridlines-plugin.test.d.ts +1 -0
- package/dist/line-chart/plugins/plugin-constants.d.ts +11 -0
- package/dist/line-chart/plugins/plugins.interface.d.ts +9 -0
- package/dist/line-chart/state/action-types.d.ts +12 -0
- package/dist/line-chart/state/initial-state.d.ts +14 -0
- package/dist/line-chart/state/line-chart-reducer.d.ts +2 -0
- package/dist/line-chart/state/manage-state-in-local-storage.d.ts +15 -0
- package/dist/line-chart/state/state.interfaces.d.ts +34 -0
- package/dist/line-chart/utils/__tests__/get-annotations-data.test.d.ts +1 -0
- package/dist/line-chart/utils/__tests__/get-axes-data-from-metasets.test.d.ts +1 -0
- package/dist/line-chart/utils/__tests__/get-axes-type-from-key.test.d.ts +1 -0
- package/dist/line-chart/utils/__tests__/get-axis-range-by-type.test.d.ts +1 -0
- package/dist/line-chart/utils/__tests__/get-line-chart-tooltips.test.d.ts +1 -0
- package/dist/line-chart/utils/axis-formatting/axis-formatting.d.ts +2 -0
- package/dist/line-chart/utils/axis-formatting/axis-formatting.test.d.ts +1 -0
- package/dist/line-chart/utils/axis-scales/axis-scales.d.ts +11 -0
- package/dist/line-chart/utils/axis-scales/axis-scales.test.d.ts +1 -0
- package/dist/line-chart/utils/check-custom-option/check-custom-option.d.ts +12 -0
- package/dist/line-chart/utils/check-custom-option/check-custom-option.test.d.ts +1 -0
- package/dist/line-chart/utils/datalabels-alignment/__tests__/get-alignment-condition.test.d.ts +1 -0
- package/dist/line-chart/utils/datalabels-alignment/__tests__/get-alignment-data.test.d.ts +1 -0
- package/dist/line-chart/utils/datalabels-alignment/__tests__/get-datalabels-position.test.d.ts +1 -0
- package/dist/line-chart/utils/datalabels-alignment/datalabels-alignment.interface.d.ts +20 -0
- package/dist/line-chart/utils/datalabels-alignment/get-alignment-condition.d.ts +8 -0
- package/dist/line-chart/utils/datalabels-alignment/get-alignment-data.d.ts +11 -0
- package/dist/line-chart/utils/datalabels-alignment/get-datalabels-position.d.ts +6 -0
- package/dist/line-chart/utils/enums.d.ts +4 -0
- package/dist/line-chart/utils/generate-line-chart-datasets.d.ts +8 -0
- package/dist/line-chart/utils/get-annotations-data.d.ts +1 -0
- package/dist/line-chart/utils/get-axes-data-from-metasets.d.ts +1 -0
- package/dist/line-chart/utils/get-axes-ranges-from-chart.d.ts +9 -0
- package/dist/line-chart/utils/get-axis-range-by-type.d.ts +10 -0
- package/dist/line-chart/utils/get-generated-labels.d.ts +2 -0
- package/dist/line-chart/utils/get-line-chart-data-labels.d.ts +19 -0
- package/dist/line-chart/utils/get-line-chart-scales.d.ts +4 -0
- package/dist/line-chart/utils/get-line-chart-tooltips.d.ts +20 -0
- package/dist/line-chart/utils/line-chart-utils.d.ts +32 -0
- package/dist/line-chart/utils/translations/get-translations.d.ts +8 -0
- package/dist/line-chart/utils/translations/get-translations.test.d.ts +1 -0
- package/dist/pie-chart/pie-chart-defalut-props.interface.d.ts +50 -0
- package/dist/pie-chart/pie-chart-get-default-props.d.ts +3 -0
- package/dist/pie-chart/pie-chart.d.ts +3 -0
- package/dist/pie-chart/pie-chart.interface.d.ts +70 -0
- package/dist/pie-chart/pie-chart.stories.d.ts +263 -0
- package/dist/pie-chart/use-pie-chart-config.d.ts +41 -0
- package/dist/project.json +1 -1
- package/dist/sb-addons/actions-0/manager-bundle.js +3 -0
- package/dist/sb-addons/actions-0/manager-bundle.js.LEGAL.txt +0 -0
- package/dist/sb-addons/storybook-dark-mode-esm-preset-1/manager-bundle.js +5 -0
- package/dist/sb-addons/storybook-dark-mode-esm-preset-1/manager-bundle.js.LEGAL.txt +0 -0
- package/dist/sb-common-assets/fonts.css +31 -0
- package/dist/sb-manager/WithTooltip-V3YHNWJZ-MXTFSDU5.js +1 -0
- package/dist/sb-manager/chunk-5QAFKPS7.js +7 -0
- package/dist/sb-manager/chunk-7PRFHFSS.js +9 -0
- package/dist/sb-manager/chunk-XE6LDGTE.js +406 -0
- package/dist/sb-manager/chunk-YDUB7CS6.js +348 -0
- package/dist/sb-manager/chunk-ZEU7PDD3.js +1 -0
- package/dist/sb-manager/formatter-SWP5E3XI-7BGIK6BL.js +156 -0
- package/dist/sb-manager/globals-module-info.js +1 -1051
- package/dist/sb-manager/globals.js +1 -48
- package/dist/sb-manager/index.js +1 -0
- package/dist/sb-manager/runtime.js +1 -12048
- package/dist/sb-manager/syntaxhighlighter-MJWPISIS-JOSCT6CQ.js +1 -0
- package/dist/sb-preview/globals.js +1 -0
- package/dist/sb-preview/runtime.js +112 -0
- package/dist/scatter-chart/hooks/use-scatter-chart-config.d.ts +113 -0
- package/dist/scatter-chart/scatter-chart-default-props.interface.d.ts +71 -0
- package/dist/scatter-chart/scatter-chart-get-default-props.d.ts +3 -0
- package/dist/scatter-chart/scatter-chart.d.ts +3 -0
- package/dist/scatter-chart/scatter-chart.interface.d.ts +81 -0
- package/dist/scatter-chart/scatter-chart.stories.d.ts +279 -0
- package/dist/scatter-chart/utils/get-scales-config.d.ts +49 -0
- package/dist/scatter-chart/utils/get-tooltip-config.d.ts +21 -0
- package/dist/src/components/bar-chart/bar-chart-const.d.ts +2 -0
- package/dist/src/components/bar-chart/bar-chart-default-props.d.ts +2 -0
- package/dist/src/components/bar-chart/bar-chart.d.ts +3 -0
- package/dist/src/components/bar-chart/bar-chart.interface.d.ts +96 -0
- package/dist/src/components/bar-chart/utils/get-bar-chart-data-labels.d.ts +10 -0
- package/dist/src/components/bar-chart/utils/get-bar-chart-scales.d.ts +3 -0
- package/dist/src/components/bar-chart/utils/get-bar-chart-tooltips.d.ts +6 -0
- package/dist/src/components/bar-chart/utils/use-bar-chart-config.d.ts +13 -0
- package/dist/src/components/bar-chart/utils/use-bar-chart-options.d.ts +55 -0
- package/dist/src/components/common/common.interface.d.ts +206 -0
- package/dist/src/components/common/controls-portal.d.ts +7 -0
- package/dist/src/components/common/enums.d.ts +10 -0
- package/dist/src/components/common/helpers/chart-border-plugin.d.ts +16 -0
- package/dist/src/components/common/helpers/chart-consts.d.ts +39 -0
- package/dist/src/components/common/helpers/chart-utils.d.ts +84 -0
- package/dist/src/components/common/helpers/container.d.ts +18 -0
- package/dist/src/components/common/helpers/custom-format-number.d.ts +1 -0
- package/dist/src/components/common/helpers/download-pgn.d.ts +4 -0
- package/dist/src/components/common/helpers/enums.d.ts +80 -0
- package/dist/src/components/common/helpers/get-chart-annotation.d.ts +90 -0
- package/dist/src/components/common/helpers/get-custom-legend-plugin-example.d.ts +8 -0
- package/dist/src/components/common/helpers/get-draggableData.d.ts +18 -0
- package/dist/src/components/common/helpers/range/estimate-data-series-have-close-values.d.ts +8 -0
- package/dist/src/components/common/helpers/range/range.d.ts +33 -0
- package/dist/src/components/common/helpers/text.d.ts +1 -0
- package/dist/src/components/common/helpers/to-annotation.d.ts +4 -0
- package/dist/src/components/common/hooks/use-generated-labels.d.ts +4 -0
- package/dist/src/components/common/hooks/use-legend-state.d.ts +28 -0
- package/dist/src/components/common/hooks/use-legend.d.ts +4 -0
- package/dist/src/components/common/hooks/use-reset.d.ts +3 -0
- package/dist/src/components/common/legend-component/legend-dropzone.d.ts +3 -0
- package/dist/src/components/common/legend-component/legend-interface.d.ts +48 -0
- package/dist/src/components/common/legend-component/legend-item/LegendItemLine.d.ts +5 -0
- package/dist/src/components/common/legend-component/legend-item/legend-item.d.ts +3 -0
- package/dist/src/components/common/legend-component/legend-panel.d.ts +3 -0
- package/dist/src/components/common/legend-component/legend.d.ts +3 -0
- package/dist/src/components/common/legend-component/state/legend-action-types.d.ts +2 -0
- package/dist/src/components/common/legend-component/state/legend-context.d.ts +12 -0
- package/dist/src/components/common/legend-component/state/legend-state-reducer.d.ts +26 -0
- package/dist/src/components/common/legend-component/utils/create-style-object.d.ts +27 -0
- package/dist/src/components/common/legend-component/utils/get-generated-labels.d.ts +2 -0
- package/dist/src/components/common/plugins/annotation-dragger-plugin/annotation-dragger-plugin.d.ts +15 -0
- package/dist/src/components/common/plugins/annotation-dragger-plugin/enums.d.ts +20 -0
- package/dist/src/components/common/plugins/annotation-dragger-plugin/event-helpers.d.ts +6 -0
- package/dist/src/components/common/plugins/annotation-dragger-plugin/helpers.d.ts +53 -0
- package/dist/src/components/common/plugins/annotation-dragger-plugin/point-annotation-label.d.ts +5 -0
- package/dist/src/components/common/plugins/gradient-background-plugin/enums.d.ts +10 -0
- package/dist/src/components/common/plugins/gradient-background-plugin/gradient-background-plugin.d.ts +2 -0
- package/dist/src/components/line-chart/constants/default-translations.d.ts +25 -0
- package/dist/src/components/line-chart/constants/line-chart-consts.d.ts +13 -0
- package/dist/src/components/line-chart/controls/axes-options/action-types.d.ts +5 -0
- package/dist/src/components/line-chart/controls/axes-options/axes-options-form-state.d.ts +23 -0
- package/dist/src/components/line-chart/controls/axes-options/axes-options-interfaces.d.ts +54 -0
- package/dist/src/components/line-chart/controls/axes-options/axes-options.d.ts +6 -0
- package/dist/src/components/line-chart/controls/controls-interfaces.d.ts +20 -0
- package/dist/src/components/line-chart/controls/controls.d.ts +6 -0
- package/dist/src/components/line-chart/controls/drag-options-interfaces.d.ts +14 -0
- package/dist/src/components/line-chart/controls/drag-options.d.ts +23 -0
- package/dist/src/components/line-chart/controls/line-options.d.ts +19 -0
- package/dist/src/components/line-chart/hooks/use-chart-functions.d.ts +32 -0
- package/dist/src/components/line-chart/hooks/use-chart-options.d.ts +16 -0
- package/dist/src/components/line-chart/hooks/use-chart-plugins.d.ts +7 -0
- package/dist/src/components/line-chart/hooks/use-chart-state.d.ts +17 -0
- package/dist/src/components/line-chart/hooks/use-toggle-handler.d.ts +12 -0
- package/dist/src/components/line-chart/initialize/config.d.ts +12 -0
- package/dist/src/components/line-chart/initialize/initialize-line-chart.d.ts +12 -0
- package/dist/src/components/line-chart/line-chart-get-default-props.d.ts +2 -0
- package/dist/src/components/line-chart/line-chart.d.ts +3 -0
- package/dist/src/components/line-chart/line-chart.interface.d.ts +146 -0
- package/dist/src/components/line-chart/plugins/chart-area-text-plugin.d.ts +17 -0
- package/dist/src/components/line-chart/plugins/line-chart.minor-gridlines-plugin.d.ts +8 -0
- package/dist/src/components/line-chart/plugins/plugin-constants.d.ts +11 -0
- package/dist/src/components/line-chart/plugins/plugins.interface.d.ts +9 -0
- package/dist/src/components/line-chart/state/action-types.d.ts +12 -0
- package/dist/src/components/line-chart/state/initial-state.d.ts +14 -0
- package/dist/src/components/line-chart/state/line-chart-reducer.d.ts +2 -0
- package/dist/src/components/line-chart/state/manage-state-in-local-storage.d.ts +15 -0
- package/dist/src/components/line-chart/state/state.interfaces.d.ts +34 -0
- package/dist/src/components/line-chart/utils/axis-formatting/axis-formatting.d.ts +2 -0
- package/dist/src/components/line-chart/utils/axis-scales/axis-scales.d.ts +11 -0
- package/dist/src/components/line-chart/utils/check-custom-option/check-custom-option.d.ts +12 -0
- package/dist/src/components/line-chart/utils/datalabels-alignment/datalabels-alignment.interface.d.ts +20 -0
- package/dist/src/components/line-chart/utils/datalabels-alignment/get-alignment-condition.d.ts +8 -0
- package/dist/src/components/line-chart/utils/datalabels-alignment/get-alignment-data.d.ts +11 -0
- package/dist/src/components/line-chart/utils/datalabels-alignment/get-datalabels-position.d.ts +6 -0
- package/dist/src/components/line-chart/utils/enums.d.ts +4 -0
- package/dist/src/components/line-chart/utils/generate-line-chart-datasets.d.ts +8 -0
- package/dist/src/components/line-chart/utils/get-annotations-data.d.ts +1 -0
- package/dist/src/components/line-chart/utils/get-axes-data-from-metasets.d.ts +1 -0
- package/dist/src/components/line-chart/utils/get-axes-ranges-from-chart.d.ts +9 -0
- package/dist/src/components/line-chart/utils/get-axis-range-by-type.d.ts +10 -0
- package/dist/src/components/line-chart/utils/get-generated-labels.d.ts +2 -0
- package/dist/src/components/line-chart/utils/get-line-chart-data-labels.d.ts +19 -0
- package/dist/src/components/line-chart/utils/get-line-chart-scales.d.ts +4 -0
- package/dist/src/components/line-chart/utils/get-line-chart-tooltips.d.ts +20 -0
- package/dist/src/components/line-chart/utils/line-chart-utils.d.ts +32 -0
- package/dist/src/components/line-chart/utils/translations/get-translations.d.ts +8 -0
- package/dist/src/components/pie-chart/pie-chart-defalut-props.interface.d.ts +50 -0
- package/dist/src/components/pie-chart/pie-chart-get-default-props.d.ts +3 -0
- package/dist/src/components/pie-chart/pie-chart.d.ts +3 -0
- package/dist/src/components/pie-chart/pie-chart.interface.d.ts +70 -0
- package/dist/src/components/pie-chart/use-pie-chart-config.d.ts +41 -0
- package/dist/src/components/scatter-chart/hooks/use-scatter-chart-config.d.ts +113 -0
- package/dist/src/components/scatter-chart/scatter-chart-default-props.interface.d.ts +71 -0
- package/dist/src/components/scatter-chart/scatter-chart-get-default-props.d.ts +3 -0
- package/dist/src/components/scatter-chart/scatter-chart.d.ts +3 -0
- package/dist/src/components/scatter-chart/scatter-chart.interface.d.ts +81 -0
- package/dist/src/components/scatter-chart/utils/get-scales-config.d.ts +49 -0
- package/dist/src/components/scatter-chart/utils/get-tooltip-config.d.ts +21 -0
- package/dist/stories.json +1 -0
- package/package.json +3 -2
- package/dist/assets/Color-YHDXOIA2-D6i6tiFz.js +0 -1
- package/dist/assets/DocsRenderer-CFRXHY34-D88vu1Xb.js +0 -580
- package/dist/assets/client-9BU5HM4U.js +0 -1
- package/dist/assets/entry-preview-D2XJoWVM.js +0 -10
- package/dist/assets/entry-preview-docs-z3mMcuG4.js +0 -46
- package/dist/assets/get-draggableData-DO0Px5pc.js +0 -2
- package/dist/assets/iframe-DLnw2TiW.js +0 -217
- package/dist/assets/index-B-BONL6g.js +0 -1
- package/dist/assets/index-BGqSdrBK.js +0 -1
- package/dist/assets/index-CVdx34fM.js +0 -1
- package/dist/assets/index-D3-0uUTW.js +0 -24
- package/dist/assets/index-Dytf1aFS.js +0 -8
- package/dist/assets/index-eCxJ45ll.js +0 -9
- package/dist/assets/jsx-runtime-Y5Ju2SGo.js +0 -9
- package/dist/assets/legend-BI53UIaI.js +0 -1346
- package/dist/assets/legend-context-BNCYpFYh.js +0 -68
- package/dist/assets/line-chart-BdFuLh7N.js +0 -1
- package/dist/assets/line-chart.stories-BVsiy8CQ.js +0 -1130
- package/dist/assets/pie-chart.stories-BVurv17M.js +0 -45
- package/dist/assets/preview-CLM2f008.js +0 -2
- package/dist/assets/preview-DD_OYowb.js +0 -1
- package/dist/assets/preview-XObsormK.js +0 -3
- package/dist/assets/react-18-DZY5LW1V.js +0 -1
- package/dist/assets/react-CxVRKATl.js +0 -1
- package/dist/assets/scatter-chart.stories-DnivHhIH.js +0 -41
- package/dist/nunito-sans-bold-italic.woff2 +0 -0
- package/dist/nunito-sans-bold.woff2 +0 -0
- package/dist/nunito-sans-italic.woff2 +0 -0
- package/dist/nunito-sans-regular.woff2 +0 -0
- package/dist/sb-addons/actions-1/manager-bundle.js +0 -3
- package/dist/sb-addons/docs-2/manager-bundle.js +0 -242
- package/dist/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js +0 -3
- package/dist/sb-addons/storybook-dark-mode-esm-preset-3/manager-bundle.js +0 -5
- package/dist/sb-common-assets/favicon.svg +0 -1
- package/dist/sb-manager/globals-runtime.js +0 -41591
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { Chart } from 'chart.js';
|
|
2
|
+
import { AnnotationType } from '../plugins/annotation-dragger-plugin/enums';
|
|
3
|
+
import { Position } from './enums';
|
|
4
|
+
import { ICommonAnnotationElement, ICommonAnnotationsData, ICoordinates } from '../common.interface';
|
|
5
|
+
export interface IGetAnnotationsProps {
|
|
6
|
+
showAnnotations: boolean;
|
|
7
|
+
annotationsData: ICommonAnnotationsData[];
|
|
8
|
+
}
|
|
9
|
+
interface TChart extends Chart {
|
|
10
|
+
hoveredAnnotationId?: string | null;
|
|
11
|
+
}
|
|
12
|
+
declare const getAnnotation: ({ showAnnotations, annotationsData, }: IGetAnnotationsProps) => ICommonAnnotationElement[] | {
|
|
13
|
+
display: boolean | undefined;
|
|
14
|
+
annotationIndex: number;
|
|
15
|
+
id: string;
|
|
16
|
+
scaleID: "x" | "y";
|
|
17
|
+
label: {
|
|
18
|
+
content: string;
|
|
19
|
+
display: boolean;
|
|
20
|
+
font: {
|
|
21
|
+
weight: string;
|
|
22
|
+
};
|
|
23
|
+
} | {
|
|
24
|
+
backgroundColor: string;
|
|
25
|
+
content: string;
|
|
26
|
+
display: boolean;
|
|
27
|
+
position: Position;
|
|
28
|
+
color?: undefined;
|
|
29
|
+
font?: undefined;
|
|
30
|
+
borderWidth?: undefined;
|
|
31
|
+
padding?: undefined;
|
|
32
|
+
borderRadius?: undefined;
|
|
33
|
+
borderColor?: undefined;
|
|
34
|
+
} | {
|
|
35
|
+
backgroundColor: any;
|
|
36
|
+
content: string;
|
|
37
|
+
display: any;
|
|
38
|
+
position: any;
|
|
39
|
+
color: any;
|
|
40
|
+
font: any;
|
|
41
|
+
borderWidth: number;
|
|
42
|
+
padding: number;
|
|
43
|
+
borderRadius: number;
|
|
44
|
+
borderColor: any;
|
|
45
|
+
};
|
|
46
|
+
backgroundColor: string;
|
|
47
|
+
borderColor: string;
|
|
48
|
+
borderWidth: number;
|
|
49
|
+
borderDash: number[] | undefined;
|
|
50
|
+
type: AnnotationType;
|
|
51
|
+
adjustScaleRange: boolean;
|
|
52
|
+
enter: ({ element, }: {
|
|
53
|
+
element: ICommonAnnotationElement;
|
|
54
|
+
}, { chart, }: {
|
|
55
|
+
chart: TChart;
|
|
56
|
+
}) => void;
|
|
57
|
+
leave: ({ element, }: {
|
|
58
|
+
element: ICommonAnnotationElement;
|
|
59
|
+
}, { chart, }: {
|
|
60
|
+
chart: TChart;
|
|
61
|
+
}) => void;
|
|
62
|
+
onDragStart: () => (cord: ICoordinates, annotation: ICommonAnnotationsData) => void;
|
|
63
|
+
onDrag: () => (cord: ICoordinates, annotation: ICommonAnnotationsData) => void;
|
|
64
|
+
onDragEnd: () => (cord: ICoordinates, annotation: ICommonAnnotationsData) => void;
|
|
65
|
+
pointStyle: string;
|
|
66
|
+
resizable: boolean;
|
|
67
|
+
displayDragCoordinates: boolean;
|
|
68
|
+
hideLegend?: boolean;
|
|
69
|
+
annotationAxis: "x" | "y";
|
|
70
|
+
color: string;
|
|
71
|
+
endValue: number;
|
|
72
|
+
labelConfig?: Record<string, any>;
|
|
73
|
+
value: number;
|
|
74
|
+
xMin: number;
|
|
75
|
+
xMax: number;
|
|
76
|
+
yMin: number;
|
|
77
|
+
yMax: number;
|
|
78
|
+
xValue?: number;
|
|
79
|
+
yValue?: number;
|
|
80
|
+
radius?: number;
|
|
81
|
+
enableDrag?: boolean;
|
|
82
|
+
dragAxis?: import('../plugins/annotation-dragger-plugin/enums').DragAxis;
|
|
83
|
+
dragRange?: {
|
|
84
|
+
x?: [number, number];
|
|
85
|
+
y?: [number, number];
|
|
86
|
+
};
|
|
87
|
+
xScaleID?: string;
|
|
88
|
+
yScaleID?: string;
|
|
89
|
+
}[];
|
|
90
|
+
export default getAnnotation;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Chart, ChartConfiguration, Plugin } from 'chart.js';
|
|
2
|
+
/**
|
|
3
|
+
* Gets an example custom legend plugin for use in storybook.
|
|
4
|
+
* @param {string} customLegendContainerID - the id of the div container to put the generated legend in
|
|
5
|
+
*/
|
|
6
|
+
export declare const getCustomLegendPlugin: (customLegendContainerID: string) => {
|
|
7
|
+
afterUpdate(chart: Chart, _args: Plugin, _options: ChartConfiguration): void;
|
|
8
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ICommonOptions } from '../common.interface';
|
|
2
|
+
export interface IDraggableDataOptions {
|
|
3
|
+
dragX: boolean;
|
|
4
|
+
dragY: boolean;
|
|
5
|
+
round: boolean;
|
|
6
|
+
showTooltip: boolean;
|
|
7
|
+
onDragStart: () => void;
|
|
8
|
+
onDrag: () => void;
|
|
9
|
+
onDragEnd: () => void;
|
|
10
|
+
}
|
|
11
|
+
export interface IDraggableData {
|
|
12
|
+
dragData: IDraggableDataOptions;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* @param {ICommonChartOptions} options - line chart options object
|
|
16
|
+
*/
|
|
17
|
+
declare const getDraggableData: (options: ICommonOptions) => IDraggableData | object;
|
|
18
|
+
export default getDraggableData;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TGeneratedLineChartDatasets } from '../../../line-chart/line-chart.interface';
|
|
2
|
+
/**
|
|
3
|
+
* Estimates whether any of the data series has values that are all close together
|
|
4
|
+
* - checks only the first and last values in each series (i.e. assumes they are ordered)
|
|
5
|
+
* - uses an equality check with tolerance for decimal precision noise
|
|
6
|
+
* - this is just an inexpensive "guesstimate" (full min/max detection can be used afterwards)
|
|
7
|
+
*/
|
|
8
|
+
export declare const estimateDataSeriesHaveCloseValues: (generatedDatasets: TGeneratedLineChartDatasets) => boolean;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
interface IGetSuggestedAxisRange {
|
|
2
|
+
data: number[];
|
|
3
|
+
beginAtZero: boolean;
|
|
4
|
+
autoAxisPadding: boolean;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Overrides the default chart.js axis range for some edge-cases:
|
|
8
|
+
* - when no data -> default range
|
|
9
|
+
* - when all values are close to zero -> default range
|
|
10
|
+
* - when all values are close to each other -> custom 5% padding
|
|
11
|
+
* - when autoAxisPadding is set -> custom 5% padding
|
|
12
|
+
* - all other cases fall back to chart.js default behaviour
|
|
13
|
+
*
|
|
14
|
+
* `autoAxisPadding` feature requirements:
|
|
15
|
+
* - specified by Truls and ported by Mark+Oleg
|
|
16
|
+
* - numbers that are equal (within tolerance) shall be presented as a straight line
|
|
17
|
+
* - all other data series shall use 90% of width of axis (5% padding each side)
|
|
18
|
+
* - the padding on each side shall be symmetric
|
|
19
|
+
*
|
|
20
|
+
* @param {object} args
|
|
21
|
+
* @param {array<number|null>} args.data
|
|
22
|
+
* @param {boolean} [args.beginAtZero]
|
|
23
|
+
* @param {boolean>} [args.autoAxisPadding]
|
|
24
|
+
* @returns {object} returns {min, max} pair
|
|
25
|
+
*/
|
|
26
|
+
export declare const getSuggestedAxisRange: ({ data, beginAtZero, autoAxisPadding, }: IGetSuggestedAxisRange) => {
|
|
27
|
+
min: number;
|
|
28
|
+
max: number;
|
|
29
|
+
} | {
|
|
30
|
+
min: undefined;
|
|
31
|
+
max: undefined;
|
|
32
|
+
};
|
|
33
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getTextWidth: (text: string, font: string) => number | undefined;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
import { Chart, LegendItem } from 'chart.js';
|
|
3
|
+
import { UnusedParameter } from '../common.interface';
|
|
4
|
+
export interface IUseLegendStateProps {
|
|
5
|
+
chartRef: RefObject<Chart>;
|
|
6
|
+
options: any;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Custom hook to manage legend state.
|
|
10
|
+
*/
|
|
11
|
+
export declare const useLegendState: ({ chartRef, options }: IUseLegendStateProps) => {
|
|
12
|
+
legendClick: (_: UnusedParameter, legendItem: LegendItem) => void;
|
|
13
|
+
annotation: import('../common.interface').ICommonAnnotationElement[];
|
|
14
|
+
legend: {
|
|
15
|
+
position: any;
|
|
16
|
+
display: boolean | undefined;
|
|
17
|
+
align: "center" | "start" | "end";
|
|
18
|
+
labels: {
|
|
19
|
+
boxHeight: number;
|
|
20
|
+
boxWidth: number | undefined;
|
|
21
|
+
usePointStyle: boolean | undefined;
|
|
22
|
+
};
|
|
23
|
+
onClick: (_: UnusedParameter, legendItem: LegendItem) => void;
|
|
24
|
+
};
|
|
25
|
+
customLegendPlugin: {
|
|
26
|
+
htmlLegend: any;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { MouseEventHandler, RefObject } from 'react';
|
|
2
|
+
import { Chart, ChartArea } from 'chart.js';
|
|
3
|
+
import { IGeneratedScatterChartDataset, TGeneratedScatterChartDatasets, IScatterOptions } from '../../scatter-chart/scatter-chart.interface';
|
|
4
|
+
import { Position } from '../helpers/enums';
|
|
5
|
+
import { IGeneratedLineChartDataset, ILineChartOptions, TGeneratedLineChartDatasets } from '../../line-chart/line-chart.interface';
|
|
6
|
+
import { IBarOptions, IGenerateBarChartDataset, TGenerateBarChartDatasets } from '../../bar-chart/bar-chart.interface';
|
|
7
|
+
import { IGeneratedPieChartDataset, IPieOptions, TGeneratedPieChartDatasets } from '../../pie-chart/pie-chart.interface';
|
|
8
|
+
import { ChartType } from '../enums';
|
|
9
|
+
export interface ILegendDropZone {
|
|
10
|
+
position: Position;
|
|
11
|
+
onDrop: () => void;
|
|
12
|
+
placeholderSize?: {
|
|
13
|
+
width?: number;
|
|
14
|
+
height?: number;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export interface ILegendDropZones {
|
|
18
|
+
chartArea?: ChartArea;
|
|
19
|
+
setLegendPosition: (position: Position) => void;
|
|
20
|
+
isDragging: boolean;
|
|
21
|
+
placeholderSize?: {
|
|
22
|
+
width?: number;
|
|
23
|
+
height?: number;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export type TLegendDataset = IGeneratedLineChartDataset | IGenerateBarChartDataset | IGeneratedPieChartDataset | IGeneratedScatterChartDataset;
|
|
27
|
+
export type TLegendDatasets = TGeneratedLineChartDatasets | TGenerateBarChartDatasets | TGeneratedPieChartDatasets | TGeneratedScatterChartDatasets;
|
|
28
|
+
export type TChartsOption = ILineChartOptions | IBarOptions | IPieOptions | IScatterOptions;
|
|
29
|
+
export interface ILegendItem {
|
|
30
|
+
hidden: boolean;
|
|
31
|
+
dataset: TLegendDataset;
|
|
32
|
+
handleClick: MouseEventHandler<HTMLDivElement>;
|
|
33
|
+
chartType: ChartType;
|
|
34
|
+
index: number;
|
|
35
|
+
}
|
|
36
|
+
export interface ILegendConfig {
|
|
37
|
+
options: TChartsOption;
|
|
38
|
+
generatedDatasets: TLegendDatasets;
|
|
39
|
+
chartType: ChartType;
|
|
40
|
+
}
|
|
41
|
+
export interface ILegend {
|
|
42
|
+
chartRef: RefObject<Chart>;
|
|
43
|
+
legendConfig: ILegendConfig;
|
|
44
|
+
}
|
|
45
|
+
export interface ILegendPanel extends ILegend {
|
|
46
|
+
legendPosition: Position;
|
|
47
|
+
isDragging: boolean;
|
|
48
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { IGeneratedLineChartDataset } from '../../../line-chart/line-chart.interface';
|
|
2
|
+
export interface ILineLegendItemProp {
|
|
3
|
+
dataset: IGeneratedLineChartDataset;
|
|
4
|
+
}
|
|
5
|
+
export declare const LegendItemLine: ({ dataset }: Record<string, any>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { default as React, ReactNode } from 'react';
|
|
2
|
+
import { ILegendState } from './legend-state-reducer';
|
|
3
|
+
import { TChartsOption } from '../legend-interface';
|
|
4
|
+
export declare const LegendContext: React.Context<{
|
|
5
|
+
state: ILegendState;
|
|
6
|
+
dispatch: React.Dispatch<any>;
|
|
7
|
+
} | undefined>;
|
|
8
|
+
export interface ILegendProviderProps {
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
options: TChartsOption;
|
|
11
|
+
}
|
|
12
|
+
export declare const LegendProvider: ({ children, options }: ILegendProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Chart } from 'chart.js';
|
|
2
|
+
import { TLegendDataset, TLegendDatasets } from '../legend-interface';
|
|
3
|
+
import { RESET_STATE, TOGGLE_DATA_VISIBILITY } from './legend-action-types';
|
|
4
|
+
import { ICommonAnnotationElement } from '../../common.interface';
|
|
5
|
+
export interface ILegendState {
|
|
6
|
+
annotation: ICommonAnnotationElement[];
|
|
7
|
+
}
|
|
8
|
+
export type TLegendAction = {
|
|
9
|
+
type: typeof TOGGLE_DATA_VISIBILITY;
|
|
10
|
+
payload: {
|
|
11
|
+
chartInstance: Chart;
|
|
12
|
+
dsConfig: {
|
|
13
|
+
datasetIndex: number;
|
|
14
|
+
dataset: TLegendDataset;
|
|
15
|
+
datasets: TLegendDatasets;
|
|
16
|
+
};
|
|
17
|
+
annotationConfig: {
|
|
18
|
+
annotationIndex: number;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
} | {
|
|
22
|
+
type: typeof RESET_STATE;
|
|
23
|
+
payload: ILegendState;
|
|
24
|
+
};
|
|
25
|
+
export declare const legendInitialState: ILegendState;
|
|
26
|
+
export declare const legendReducer: (state: ILegendState, action: TLegendAction) => ILegendState;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Position } from '../../helpers/enums';
|
|
2
|
+
export declare const LEGEND_MARGIN = 4;
|
|
3
|
+
interface IChartArea {
|
|
4
|
+
top: number;
|
|
5
|
+
left: number;
|
|
6
|
+
bottom: number;
|
|
7
|
+
right: number;
|
|
8
|
+
}
|
|
9
|
+
interface IChart {
|
|
10
|
+
height?: number;
|
|
11
|
+
width?: number;
|
|
12
|
+
chartArea: IChartArea;
|
|
13
|
+
}
|
|
14
|
+
interface ILegendStyle {
|
|
15
|
+
left: number | undefined;
|
|
16
|
+
right: number | undefined;
|
|
17
|
+
top: number | undefined;
|
|
18
|
+
bottom: number | undefined;
|
|
19
|
+
maxHeight: number;
|
|
20
|
+
maxWidth: number;
|
|
21
|
+
margin: number;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Creates a style object for positioning and sizing the legend panel based on the chart dimensions and legend position.
|
|
25
|
+
*/
|
|
26
|
+
export declare const createLegendStyle: (legendPosition: Position, chart: IChart | null) => ILegendStyle;
|
|
27
|
+
export {};
|
package/dist/src/components/common/plugins/annotation-dragger-plugin/annotation-dragger-plugin.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ChartType, Plugin, Scale } from 'chart.js';
|
|
2
|
+
export interface IScales {
|
|
3
|
+
x: Scale;
|
|
4
|
+
y: Scale;
|
|
5
|
+
[key: string]: Scale;
|
|
6
|
+
}
|
|
7
|
+
export interface AnnotationDraggerPluginOptions {
|
|
8
|
+
enabled: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare module 'chart.js' {
|
|
11
|
+
interface PluginOptionsByType<TType extends ChartType> {
|
|
12
|
+
annotationDraggerPlugin?: AnnotationDraggerPluginOptions;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export declare const annotationDraggerPlugin: Plugin;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare enum FontStyle {
|
|
2
|
+
DEFAULT = "14px Arial",
|
|
3
|
+
CUSTOM = "16px Arial"
|
|
4
|
+
}
|
|
5
|
+
export declare enum MouseEvents {
|
|
6
|
+
MOUSEDOWN = "mousedown",
|
|
7
|
+
MOUSEMOVE = "mousemove",
|
|
8
|
+
MOUSEUP = "mouseup"
|
|
9
|
+
}
|
|
10
|
+
export declare enum AnnotationType {
|
|
11
|
+
POINT = "point",
|
|
12
|
+
BOX = "box",
|
|
13
|
+
LINE = "line",
|
|
14
|
+
ELLIPSE = "ellipse"
|
|
15
|
+
}
|
|
16
|
+
export declare enum DragAxis {
|
|
17
|
+
X = "x",
|
|
18
|
+
Y = "y",
|
|
19
|
+
Both = "both"
|
|
20
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Chart } from 'chart.js';
|
|
2
|
+
import { IScales } from './annotation-dragger-plugin';
|
|
3
|
+
import { ICommonAnnotationsData } from '../../common.interface';
|
|
4
|
+
export declare const handleAnnotationMouseDown: (event: MouseEvent, canvas: HTMLCanvasElement, scales: IScales, annotations: Record<string, ICommonAnnotationsData>, setDraggingState: (isDragging: boolean, annotation: ICommonAnnotationsData | null, dragStartX: number, dragStartY: number) => void, hoveredAnnotationId: string | null) => void;
|
|
5
|
+
export declare const handleAnnotationMouseMove: (event: MouseEvent, canvas: HTMLCanvasElement, scales: IScales, isDragging: boolean, activeAnnotation: ICommonAnnotationsData | null, dragStartX: number, dragStartY: number, chart: Chart) => void;
|
|
6
|
+
export declare const handleAnnotationMouseUp: (isDragging: boolean, activeAnnotation: ICommonAnnotationsData | null, chart: Chart, canvas: HTMLCanvasElement, setDraggingState: (isDragging: boolean, annotation: ICommonAnnotationsData | null) => void) => void;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Chart } from 'chart.js';
|
|
2
|
+
import { ICommonAnnotationsData } from '../../common.interface';
|
|
3
|
+
import { IScales } from './annotation-dragger-plugin';
|
|
4
|
+
import { AnnotationType, DragAxis } from './enums';
|
|
5
|
+
export declare const getMousePosition: (event: MouseEvent, canvas: HTMLCanvasElement) => {
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
};
|
|
9
|
+
export declare const getMousePositionInCoordinates: (event: MouseEvent, canvas: HTMLCanvasElement, scales: IScales, xScaleID: string, yScaleID: string) => {
|
|
10
|
+
x: number;
|
|
11
|
+
y: number;
|
|
12
|
+
};
|
|
13
|
+
export declare const calculateAnnotationMetricsInValues: (annotation: ICommonAnnotationsData) => {
|
|
14
|
+
centerX: number | undefined;
|
|
15
|
+
centerY: number | undefined;
|
|
16
|
+
width: number | undefined;
|
|
17
|
+
height: number | undefined;
|
|
18
|
+
};
|
|
19
|
+
export declare const calculateAnnotationMetricsInValuesInPixels: (annotation: ICommonAnnotationsData, scales: IScales, xScaleID: string, yScaleID: string) => {
|
|
20
|
+
centerX: number | undefined;
|
|
21
|
+
centerY: number | undefined;
|
|
22
|
+
width: number | undefined;
|
|
23
|
+
height: number | undefined;
|
|
24
|
+
};
|
|
25
|
+
export interface IIsWithinChartAreaProps {
|
|
26
|
+
x?: number;
|
|
27
|
+
y?: number;
|
|
28
|
+
chartArea: {
|
|
29
|
+
left: number;
|
|
30
|
+
right: number;
|
|
31
|
+
top: number;
|
|
32
|
+
bottom: number;
|
|
33
|
+
};
|
|
34
|
+
scales: IScales;
|
|
35
|
+
metrics: {
|
|
36
|
+
width?: number;
|
|
37
|
+
height?: number;
|
|
38
|
+
};
|
|
39
|
+
resizable?: boolean;
|
|
40
|
+
dragRange?: {
|
|
41
|
+
x?: [number, number];
|
|
42
|
+
y?: [number, number];
|
|
43
|
+
} | null;
|
|
44
|
+
annotationType: AnnotationType;
|
|
45
|
+
xScaleID: string;
|
|
46
|
+
yScaleID: string;
|
|
47
|
+
}
|
|
48
|
+
export declare const isWithinChartArea: ({ x, y, chartArea, scales, metrics, resizable, dragRange, annotationType, xScaleID, yScaleID, }: IIsWithinChartAreaProps) => boolean;
|
|
49
|
+
export declare const updateAnnotationPositionWithinBounds: (axis: DragAxis, newPosition: number, activeAnnotation: ICommonAnnotationsData, chart: Chart, scales: IScales, xScaleID: string, yScaleID: string, metrics?: {
|
|
50
|
+
width?: number;
|
|
51
|
+
height?: number;
|
|
52
|
+
}) => void;
|
|
53
|
+
export declare const setAnnotationBorderWidth: (chart: Chart, annotationId?: string, borderWidth?: number) => void;
|
package/dist/src/components/common/plugins/annotation-dragger-plugin/point-annotation-label.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { IScales } from './annotation-dragger-plugin';
|
|
2
|
+
import { ICommonAnnotationsData } from '../../common.interface';
|
|
3
|
+
export declare const annotationLabel: (ctx: CanvasRenderingContext2D, annotations: Record<string, ICommonAnnotationsData & {
|
|
4
|
+
label: Record<string, any>;
|
|
5
|
+
}>, scales: IScales) => void;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare enum defaultTranslations {
|
|
2
|
+
label = "Label",
|
|
3
|
+
pointsLines = "Points & lines",
|
|
4
|
+
linesOnly = "Lines only",
|
|
5
|
+
pointsOnly = "Points only",
|
|
6
|
+
axesOptions = "Axes options",
|
|
7
|
+
resetAxes = "Reset Axes",
|
|
8
|
+
done = "Done",
|
|
9
|
+
downloadAsPNG = "Download as PNG",
|
|
10
|
+
showChart = "Show chart",
|
|
11
|
+
showTable = "Show table",
|
|
12
|
+
dragToZoom = "Drag to zoom",
|
|
13
|
+
dragToPan = "Drag to pan",
|
|
14
|
+
dragToMovePoints = "Drag to move points",
|
|
15
|
+
dragToMoveAnnotation = "Drag to move annotation",
|
|
16
|
+
dragDisabled = "Drag disabled",
|
|
17
|
+
hideLegend = "Hide Legend",
|
|
18
|
+
showLegend = "Show Legend",
|
|
19
|
+
mustHaveAValue = "Must have a value",
|
|
20
|
+
mustBeANumber = "Must be a number",
|
|
21
|
+
mustBeLessThanMax = "Must be less than max",
|
|
22
|
+
mustBeGreaterThanMin = "Must be greater than min",
|
|
23
|
+
doubleClickToReset = "Double click on canvas to reset",
|
|
24
|
+
orDoubleClickToCanvas = "or double click on canvas"
|
|
25
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const DEFAULT_POINT_RADIUS = 2;
|
|
2
|
+
export declare const DEFAULT_HOVER_RADIUS = 5;
|
|
3
|
+
export declare const DEFAULT_BORDER_WIDTH = 1;
|
|
4
|
+
export declare const BORDER_JOIN_STYLE = "round";
|
|
5
|
+
export declare const DEFAULT_BACKGROUND_COLOR = "transparent";
|
|
6
|
+
export declare const ZOOM_BOX_BACKGROUND_COLOR = "rgba(0, 0, 0, 0.1)";
|
|
7
|
+
export declare const DOUBLE_CLICK = "dblclick";
|
|
8
|
+
export declare const INIT_KEYS: {
|
|
9
|
+
TRANSLATIONS: string;
|
|
10
|
+
LANGUAGE_KEY: string;
|
|
11
|
+
};
|
|
12
|
+
export declare const LOWER_BOUND = 0.0001;
|
|
13
|
+
export declare const UPPER_BOUND = 10000000;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { IState } from '../../state/state.interfaces';
|
|
2
|
+
import { IAction, IFormState, IInitializeAxisFormState } from './axes-options-interfaces.ts';
|
|
3
|
+
/**
|
|
4
|
+
* Initialize local component form state for a custom loads density table
|
|
5
|
+
*
|
|
6
|
+
* @param {Object} args
|
|
7
|
+
* @param {Object} args.initialAxesRanges
|
|
8
|
+
* @param {Array} [args.axes]
|
|
9
|
+
* @returns {Object} formState
|
|
10
|
+
*/
|
|
11
|
+
export declare const initializeFormState: ({ initialAxesRanges, axes, }: Partial<IState>) => IInitializeAxisFormState;
|
|
12
|
+
export declare const validateAxes: (formState: IFormState) => {
|
|
13
|
+
errors: never[];
|
|
14
|
+
valid: boolean;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Local component form state reducer for a axes options form
|
|
18
|
+
*
|
|
19
|
+
* @param {Object} state Local component form state
|
|
20
|
+
* @param {Action} action Action with type and payload
|
|
21
|
+
* @returns {Object} FormState
|
|
22
|
+
*/
|
|
23
|
+
export declare const reducer: (state: IFormState, action: IAction) => IInitializeAxisFormState;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { IUnitOptions } from '../../line-chart.interface.ts';
|
|
2
|
+
import { IAxisState, IInitAxisRange } from '../../state/state.interfaces.ts';
|
|
3
|
+
export interface IDepthType {
|
|
4
|
+
selectedDepthType?: string;
|
|
5
|
+
setSelectedDepthType?: (type: string) => void;
|
|
6
|
+
options?: Array<string>;
|
|
7
|
+
}
|
|
8
|
+
export interface IAxisControlLabel {
|
|
9
|
+
id: string;
|
|
10
|
+
label: string;
|
|
11
|
+
}
|
|
12
|
+
export interface IAxesOptions {
|
|
13
|
+
initialAxesRanges: IInitAxisRange[];
|
|
14
|
+
axes: IAxisState[];
|
|
15
|
+
controlsAxesLabels: IAxisControlLabel[];
|
|
16
|
+
onUpdateAxes: ({ axes }: {
|
|
17
|
+
axes: IAxisState;
|
|
18
|
+
}) => void;
|
|
19
|
+
onResetAxes: () => void;
|
|
20
|
+
depthType?: IDepthType | object;
|
|
21
|
+
close?: () => void;
|
|
22
|
+
}
|
|
23
|
+
export interface IOnEdit {
|
|
24
|
+
name?: string;
|
|
25
|
+
value?: string;
|
|
26
|
+
id?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface IAxisFormState {
|
|
29
|
+
id: string;
|
|
30
|
+
min: number | string;
|
|
31
|
+
max: number | string;
|
|
32
|
+
unit?: string | IUnitOptions;
|
|
33
|
+
}
|
|
34
|
+
export type IInitializeAxisFormState = IAxisFormState[];
|
|
35
|
+
export interface IError {
|
|
36
|
+
id: string;
|
|
37
|
+
min: string[];
|
|
38
|
+
max: string[];
|
|
39
|
+
}
|
|
40
|
+
export interface IFormState extends IInitializeAxisFormState {
|
|
41
|
+
errors?: IError[];
|
|
42
|
+
valid?: boolean;
|
|
43
|
+
}
|
|
44
|
+
type ActionType = 'reset' | 'valueUpdated' | 'unitUpdated';
|
|
45
|
+
export type AxisKey = 'min' | 'max' | 'unit';
|
|
46
|
+
interface ActionPayload extends IOnEdit {
|
|
47
|
+
initialAxesRanges?: IInitAxisRange[];
|
|
48
|
+
axes?: IAxisState[];
|
|
49
|
+
}
|
|
50
|
+
export interface IAction {
|
|
51
|
+
type: ActionType;
|
|
52
|
+
payload: ActionPayload;
|
|
53
|
+
}
|
|
54
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { IAxesOptions } from './axes-options-interfaces';
|
|
2
|
+
interface IAxesOptionsWithTranslations extends IAxesOptions {
|
|
3
|
+
translations: Record<string, string>;
|
|
4
|
+
}
|
|
5
|
+
export declare const AxesOptions: (optionsPopover: IAxesOptionsWithTranslations) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Dispatch, ReactNode, RefObject } from 'react';
|
|
2
|
+
import { Chart } from 'chart.js';
|
|
3
|
+
import { ILineChartOptions, TGeneratedLineChartDatasets } from '../line-chart.interface';
|
|
4
|
+
import { IState } from '../state/state.interfaces';
|
|
5
|
+
export interface IControls {
|
|
6
|
+
headerComponent?: ReactNode;
|
|
7
|
+
subheaderComponent?: Element;
|
|
8
|
+
table?: ReactNode;
|
|
9
|
+
chartRef: RefObject<Chart>;
|
|
10
|
+
state: IState;
|
|
11
|
+
options: ILineChartOptions;
|
|
12
|
+
dispatch: Dispatch<any>;
|
|
13
|
+
generatedDatasets: TGeneratedLineChartDatasets;
|
|
14
|
+
translations: Record<string, string>;
|
|
15
|
+
controlsPortalId?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface AxisControls {
|
|
18
|
+
id?: string;
|
|
19
|
+
label?: string;
|
|
20
|
+
}
|