@oliasoft-open-source/charts-library 5.2.0 → 5.2.1-beta-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.
Files changed (172) hide show
  1. package/dist/assets/Color-YHDXOIA2-BH-AgNhy.js +1 -0
  2. package/dist/assets/DocsRenderer-CFRXHY34-Dx3M1XwG.js +1 -0
  3. package/dist/assets/bar-chart-const-DT-Qreyz.js +1 -0
  4. package/dist/assets/bar-chart.stories-BGngamFz.js +145 -0
  5. package/dist/assets/chunk-2PTXLE6R-BSsKYLj_.js +1 -0
  6. package/dist/assets/chunk-H6MOWX77-Ds8Hqw1O.js +1 -0
  7. package/dist/assets/chunk-NUUEMKO5-2vSX1C-f.js +56 -0
  8. package/dist/assets/chunk-PRSJUHPQ-ClaE-lMK.js +2 -0
  9. package/dist/assets/chunk-XP5HYGXS-DyEAuB1b.js +1 -0
  10. package/dist/assets/client-mhWrpqNE.js +1 -0
  11. package/dist/assets/components-BTILpkCb.js +1 -0
  12. package/dist/assets/components-BUMWgrws.js +534 -0
  13. package/dist/assets/docs-tools-C8juKH9v.js +8 -0
  14. package/dist/assets/entry-preview-D8bkngdo.js +2 -0
  15. package/dist/assets/entry-preview-docs-DkpGzTK0.js +48 -0
  16. package/dist/assets/fast-deep-equal-GJSfJzsC.js +1 -0
  17. package/dist/assets/get-custom-legend-plugin-example-DlEN0LEe.js +1 -0
  18. package/dist/assets/get-draggableData-DyVot8Zl.js +2 -0
  19. package/dist/assets/iframe-BC9QdfhZ.js +226 -0
  20. package/dist/assets/jsx-runtime-BNVfsWEC.js +1 -0
  21. package/dist/assets/legend-Be3VjYcC.js +1266 -0
  22. package/dist/assets/legend-context-Bh42wyEh.js +47 -0
  23. package/dist/assets/line-chart-B0hmsdC3.js +1 -0
  24. package/dist/assets/line-chart.stories-tGGdFPhQ.js +1162 -0
  25. package/dist/assets/line-chart.test-case.stories-Cv2J7QkQ.js +430 -0
  26. package/dist/assets/pie-chart.stories-Cmh7O_JI.js +45 -0
  27. package/dist/assets/preview-Ba4CwQIJ.js +1 -0
  28. package/dist/assets/preview-Dihi2lh7.js +3 -0
  29. package/dist/assets/preview-xQjOlnQG.js +1 -0
  30. package/dist/assets/react-18-D9p-ZSzh.js +1 -0
  31. package/dist/assets/react-B_00WdD4.js +1 -0
  32. package/dist/assets/react-CJCPsloc.js +1 -0
  33. package/dist/assets/react-dom-BggwCd6n.js +8 -0
  34. package/dist/assets/react-lj49T_jL.js +1 -0
  35. package/dist/assets/scatter-chart.stories-Ch-mWz43.js +41 -0
  36. package/dist/assets/test-utils-D1bSFP61.js +1 -0
  37. package/dist/bar-chart/bar-chart-const.d.ts +2 -0
  38. package/dist/bar-chart/bar-chart-default-props.d.ts +2 -0
  39. package/dist/bar-chart/bar-chart.d.ts +3 -0
  40. package/dist/bar-chart/bar-chart.interface.d.ts +96 -0
  41. package/dist/bar-chart/utils/get-bar-chart-data-labels.d.ts +10 -0
  42. package/dist/bar-chart/utils/get-bar-chart-scales.d.ts +3 -0
  43. package/dist/bar-chart/utils/get-bar-chart-tooltips.d.ts +6 -0
  44. package/dist/bar-chart/utils/use-bar-chart-config.d.ts +13 -0
  45. package/dist/bar-chart/utils/use-bar-chart-options.d.ts +55 -0
  46. package/dist/common/common.interface.d.ts +210 -0
  47. package/dist/common/controls-portal.d.ts +7 -0
  48. package/dist/common/enums.d.ts +10 -0
  49. package/dist/common/helpers/chart-border-plugin.d.ts +16 -0
  50. package/dist/common/helpers/chart-consts.d.ts +39 -0
  51. package/dist/common/helpers/chart-utils.d.ts +86 -0
  52. package/dist/common/helpers/container.d.ts +18 -0
  53. package/dist/common/helpers/custom-format-number.d.ts +1 -0
  54. package/dist/common/helpers/download-pgn.d.ts +3 -0
  55. package/dist/common/helpers/enums.d.ts +80 -0
  56. package/dist/common/helpers/get-chart-annotation.d.ts +91 -0
  57. package/dist/common/helpers/get-custom-legend-plugin-example.d.ts +8 -0
  58. package/dist/common/helpers/get-draggableData.d.ts +18 -0
  59. package/dist/common/helpers/range/estimate-data-series-have-close-values.d.ts +8 -0
  60. package/dist/common/helpers/range/range.d.ts +33 -0
  61. package/dist/common/helpers/text.d.ts +1 -0
  62. package/dist/common/helpers/to-annotation.d.ts +4 -0
  63. package/dist/common/hooks/use-generated-labels.d.ts +4 -0
  64. package/dist/common/hooks/use-legend-state.d.ts +28 -0
  65. package/dist/common/hooks/use-legend.d.ts +4 -0
  66. package/dist/common/hooks/use-reset.d.ts +3 -0
  67. package/dist/common/hooks/use-update-annotations.d.ts +7 -0
  68. package/dist/common/legend-component/legend-dropzone.d.ts +3 -0
  69. package/dist/common/legend-component/legend-interface.d.ts +48 -0
  70. package/dist/common/legend-component/legend-item/LegendItemLine.d.ts +5 -0
  71. package/dist/common/legend-component/legend-item/legend-item.d.ts +3 -0
  72. package/dist/common/legend-component/legend-panel.d.ts +3 -0
  73. package/dist/common/legend-component/legend.d.ts +3 -0
  74. package/dist/common/legend-component/state/legend-action-types.d.ts +3 -0
  75. package/dist/common/legend-component/state/legend-context.d.ts +14 -0
  76. package/dist/common/legend-component/state/legend-state-reducer.d.ts +30 -0
  77. package/dist/common/legend-component/utils/create-style-object.d.ts +27 -0
  78. package/dist/common/legend-component/utils/get-generated-labels.d.ts +2 -0
  79. package/dist/common/plugins/annotation-dragger-plugin/annotation-dragger-plugin.d.ts +15 -0
  80. package/dist/common/plugins/annotation-dragger-plugin/enums.d.ts +20 -0
  81. package/dist/common/plugins/annotation-dragger-plugin/event-helpers.d.ts +6 -0
  82. package/dist/common/plugins/annotation-dragger-plugin/helpers.d.ts +53 -0
  83. package/dist/common/plugins/annotation-dragger-plugin/point-annotation-label.d.ts +5 -0
  84. package/dist/common/plugins/ellipsis-annotation-plugin/compute-ellipse-geometry.d.ts +9 -0
  85. package/dist/common/plugins/ellipsis-annotation-plugin/ellipsis-annotation-plugin.d.ts +18 -0
  86. package/dist/common/plugins/gradient-background-plugin/enums.d.ts +10 -0
  87. package/dist/common/plugins/gradient-background-plugin/gradient-background-plugin.d.ts +2 -0
  88. package/dist/favicon.svg +1 -0
  89. package/dist/iframe.html +666 -0
  90. package/dist/index.html +149 -0
  91. package/dist/index.js +21 -4
  92. package/dist/index.json +1 -0
  93. package/dist/line-chart/constants/default-translations.d.ts +25 -0
  94. package/dist/line-chart/constants/line-chart-consts.d.ts +13 -0
  95. package/dist/line-chart/controls/axes-options/axes-options-interfaces.d.ts +57 -0
  96. package/dist/line-chart/controls/axes-options/axes-options.d.ts +6 -0
  97. package/dist/line-chart/controls/axes-options/axes-validation.d.ts +8 -0
  98. package/dist/line-chart/controls/controls-interfaces.d.ts +20 -0
  99. package/dist/line-chart/controls/controls.d.ts +3 -0
  100. package/dist/line-chart/controls/drag-options-interfaces.d.ts +14 -0
  101. package/dist/line-chart/controls/drag-options.d.ts +23 -0
  102. package/dist/line-chart/controls/line-options.d.ts +19 -0
  103. package/dist/line-chart/hooks/use-chart-functions.d.ts +33 -0
  104. package/dist/line-chart/hooks/use-chart-options.d.ts +16 -0
  105. package/dist/line-chart/hooks/use-chart-plugins.d.ts +7 -0
  106. package/dist/line-chart/hooks/use-chart-state.d.ts +12 -0
  107. package/dist/line-chart/hooks/use-toggle-handler.d.ts +12 -0
  108. package/dist/line-chart/initialize/config.d.ts +12 -0
  109. package/dist/line-chart/initialize/initialize-line-chart.d.ts +12 -0
  110. package/dist/line-chart/line-chart-get-default-props.d.ts +2 -0
  111. package/dist/line-chart/line-chart.d.ts +3 -0
  112. package/dist/line-chart/line-chart.interface.d.ts +150 -0
  113. package/dist/line-chart/plugins/chart-area-text-plugin.d.ts +17 -0
  114. package/dist/line-chart/plugins/line-chart.minor-gridlines-plugin.d.ts +8 -0
  115. package/dist/line-chart/plugins/plugin-constants.d.ts +11 -0
  116. package/dist/line-chart/plugins/plugins.interface.d.ts +9 -0
  117. package/dist/line-chart/state/action-types.d.ts +12 -0
  118. package/dist/line-chart/state/helpers.d.ts +13 -0
  119. package/dist/line-chart/state/initial-state.d.ts +11 -0
  120. package/dist/line-chart/state/line-chart-reducer.d.ts +2 -0
  121. package/dist/line-chart/state/manage-state-in-local-storage.d.ts +15 -0
  122. package/dist/line-chart/state/state.interfaces.d.ts +26 -0
  123. package/dist/line-chart/utils/axis-formatting/axis-formatting.d.ts +2 -0
  124. package/dist/line-chart/utils/axis-scales/axis-scales.d.ts +9 -0
  125. package/dist/line-chart/utils/check-custom-option/check-custom-option.d.ts +12 -0
  126. package/dist/line-chart/utils/datalabels-alignment/datalabels-alignment.interface.d.ts +20 -0
  127. package/dist/line-chart/utils/datalabels-alignment/get-alignment-condition.d.ts +8 -0
  128. package/dist/line-chart/utils/datalabels-alignment/get-alignment-data.d.ts +11 -0
  129. package/dist/line-chart/utils/datalabels-alignment/get-datalabels-position.d.ts +6 -0
  130. package/dist/line-chart/utils/enums.d.ts +4 -0
  131. package/dist/line-chart/utils/generate-line-chart-datasets.d.ts +8 -0
  132. package/dist/line-chart/utils/get-annotations-data.d.ts +1 -0
  133. package/dist/line-chart/utils/get-axes-data-from-metasets.d.ts +1 -0
  134. package/dist/line-chart/utils/get-axes-ranges-from-chart.d.ts +9 -0
  135. package/dist/line-chart/utils/get-axis-range-by-type.d.ts +10 -0
  136. package/dist/line-chart/utils/get-generated-labels.d.ts +2 -0
  137. package/dist/line-chart/utils/get-line-chart-data-labels.d.ts +16 -0
  138. package/dist/line-chart/utils/get-line-chart-scales.d.ts +4 -0
  139. package/dist/line-chart/utils/get-line-chart-tooltips.d.ts +34 -0
  140. package/dist/line-chart/utils/line-chart-utils.d.ts +24 -0
  141. package/dist/line-chart/utils/translations/get-translations.d.ts +8 -0
  142. package/dist/nunito-sans-bold-italic.woff2 +0 -0
  143. package/dist/nunito-sans-bold.woff2 +0 -0
  144. package/dist/nunito-sans-italic.woff2 +0 -0
  145. package/dist/nunito-sans-regular.woff2 +0 -0
  146. package/dist/pie-chart/pie-chart-defalut-props.interface.d.ts +50 -0
  147. package/dist/pie-chart/pie-chart-get-default-props.d.ts +3 -0
  148. package/dist/pie-chart/pie-chart.d.ts +3 -0
  149. package/dist/pie-chart/pie-chart.interface.d.ts +70 -0
  150. package/dist/pie-chart/use-pie-chart-config.d.ts +42 -0
  151. package/dist/project.json +1 -0
  152. package/dist/sb-addons/actions-1/manager-bundle.js +3 -0
  153. package/dist/sb-addons/docs-2/manager-bundle.js +242 -0
  154. package/dist/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js +3 -0
  155. package/dist/sb-addons/storybook-dark-mode-esm-preset-3/manager-bundle.js +5 -0
  156. package/dist/sb-common-assets/favicon.svg +1 -0
  157. package/dist/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
  158. package/dist/sb-common-assets/nunito-sans-bold.woff2 +0 -0
  159. package/dist/sb-common-assets/nunito-sans-italic.woff2 +0 -0
  160. package/dist/sb-common-assets/nunito-sans-regular.woff2 +0 -0
  161. package/dist/sb-manager/globals-module-info.js +1051 -0
  162. package/dist/sb-manager/globals-runtime.js +41591 -0
  163. package/dist/sb-manager/globals.js +48 -0
  164. package/dist/sb-manager/runtime.js +12048 -0
  165. package/dist/scatter-chart/hooks/use-scatter-chart-config.d.ts +113 -0
  166. package/dist/scatter-chart/scatter-chart-default-props.interface.d.ts +71 -0
  167. package/dist/scatter-chart/scatter-chart-get-default-props.d.ts +3 -0
  168. package/dist/scatter-chart/scatter-chart.d.ts +3 -0
  169. package/dist/scatter-chart/scatter-chart.interface.d.ts +81 -0
  170. package/dist/scatter-chart/utils/get-scales-config.d.ts +49 -0
  171. package/dist/scatter-chart/utils/get-tooltip-config.d.ts +21 -0
  172. package/package.json +1 -1
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Retrieve the value for the given key from the config object.
3
+ * @param {string} key - The key to access the corresponding value in the config object.
4
+ * @returns {*} - The value associated with the given key in the config object or config.
5
+ */
6
+ export declare const getConfig: (key?: string) => any;
7
+ /**
8
+ * Set a new value for the given key in the config object.
9
+ * @param {string} key - The key to access the corresponding value in the config object.
10
+ * @param {*} newValue - The new value to be set for the given key.
11
+ */
12
+ export declare const setConfig: (key: string, newValue: string | Record<string, string>) => void;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Initialize the charts library with the provided configurations.
3
+ * This function will store the configuration options in a config object.
4
+ * @param {object} options - An object containing the configuration options for the library.
5
+ * @param {object} options.translations - The translations to be used in the library.
6
+ * @param {string} options.languageKey - The language key to be stored in the config object, used for translations.
7
+ * @param {...object} options - Any additional options to be stored in the config object.
8
+ */
9
+ export declare const initializeLineChart: ({ languageKey, ...options }: {
10
+ [x: string]: any;
11
+ languageKey?: string | undefined;
12
+ }) => void;
@@ -0,0 +1,2 @@
1
+ import { ILineChartData, ILineChartProps } from './line-chart.interface';
2
+ export declare const getDefaultProps: (props: ILineChartProps) => ILineChartData;
@@ -0,0 +1,3 @@
1
+ import { ILineChartProps } from './line-chart.interface';
2
+ declare const LineChartWithLegend: (props: ILineChartProps) => import("react/jsx-runtime").JSX.Element;
3
+ export { LineChartWithLegend as LineChart };
@@ -0,0 +1,150 @@
1
+ import { ReactNode } from '../../../node_modules/react';
2
+ import { ICommonAnnotations, ICommonChartOptions, ICommonCustomLegend, ICommonData, ICommonDataset, ICommonDataValue, ICommonDragData, ICommonInteractions, ICommonLegend, ICommonOptions, ICommonScales, ICommonStyling, ICommonTooltip } from '../common/common.interface';
3
+ export interface ILChartOptions extends ICommonChartOptions {
4
+ showPoints: boolean;
5
+ closeOnOutsideClick: boolean;
6
+ showLine: boolean;
7
+ enableDragAnnotation?: boolean;
8
+ }
9
+ export interface ILineChartGraph {
10
+ lineTension: number;
11
+ spanGaps: boolean;
12
+ showDataLabels: boolean;
13
+ showMinorGridlines: boolean;
14
+ }
15
+ export interface ILineChartTooltip extends ICommonTooltip {
16
+ hideSimulationName: boolean;
17
+ scientificNotation: boolean;
18
+ }
19
+ export interface ILineChartRange {
20
+ min: number;
21
+ max: number;
22
+ }
23
+ export interface ILineRange {
24
+ [key: string]: ILineChartRange;
25
+ }
26
+ export interface ILineChartAdditionalAxesOptions {
27
+ chartScaleType: 'linear' | 'logarithmic';
28
+ reverse: boolean;
29
+ beginAtZero: boolean;
30
+ stepSize?: number;
31
+ suggestedMin?: number;
32
+ suggestedMax?: number;
33
+ range?: ILineRange;
34
+ autoAxisPadding: boolean;
35
+ }
36
+ export interface IUnitOptions {
37
+ options: string[];
38
+ selectedUnit: string;
39
+ setSelectedUnit: () => void;
40
+ }
41
+ export interface ILineChartAxis<PositionType = any> {
42
+ id?: string;
43
+ label: string;
44
+ position: PositionType;
45
+ color: string | string[];
46
+ unit?: IUnitOptions;
47
+ stepSize?: number;
48
+ gridLines?: ILineChartGraph;
49
+ min?: number | string;
50
+ max?: number | string;
51
+ }
52
+ export interface ILineChartAxes {
53
+ x: ILineChartAxis<'top' | 'bottom'>[];
54
+ y: ILineChartAxis<'left' | 'right'>[];
55
+ [key: string]: ILineChartAxis[];
56
+ }
57
+ export interface IDepthType {
58
+ options: string[];
59
+ selectedUnit: string;
60
+ setSelectedUnit: () => void;
61
+ }
62
+ export interface ILineChartStyling extends ICommonStyling {
63
+ squareAspectRatio?: number | boolean;
64
+ layoutPadding?: number | {
65
+ top: number;
66
+ bottom: number;
67
+ left: number;
68
+ right: number;
69
+ };
70
+ }
71
+ export interface ILineInteractions extends ICommonInteractions {
72
+ onAnimationComplete?: () => void;
73
+ }
74
+ export interface ILineLegend extends ICommonLegend {
75
+ customLegend?: ICommonCustomLegend<any>;
76
+ usePointStyle?: boolean;
77
+ }
78
+ export interface ILineChartOptions extends ICommonOptions {
79
+ title?: string | string[];
80
+ axes: ILineChartAxes;
81
+ scales: ICommonScales;
82
+ additionalAxesOptions: ILineChartAdditionalAxesOptions;
83
+ chartStyling: ILineChartStyling;
84
+ tooltip: ILineChartTooltip;
85
+ graph: ILineChartGraph;
86
+ annotations: ICommonAnnotations;
87
+ legend: ILineLegend;
88
+ chartOptions: ILChartOptions;
89
+ interactions: ILineInteractions;
90
+ dragData?: ICommonDragData;
91
+ depthType?: IDepthType | object;
92
+ }
93
+ export interface ILineChartDataset extends ICommonDataset {
94
+ lineTension?: number;
95
+ pointBackgroundColor?: string;
96
+ pointRadius?: number;
97
+ pointHoverRadius?: number;
98
+ pointHitRadius?: number;
99
+ fill?: boolean;
100
+ xAxisID?: string;
101
+ yAxisID?: string;
102
+ formation?: boolean;
103
+ displayGroup?: string | number;
104
+ pointStyle?: string;
105
+ }
106
+ export interface ILineChartData extends ICommonData {
107
+ data?: {
108
+ datasets: ILineChartDataset[];
109
+ };
110
+ options: ILineChartOptions;
111
+ persistenceId?: string;
112
+ controlsPortalId?: string;
113
+ }
114
+ export interface ILineChartProps {
115
+ chart: ILineChartData;
116
+ table?: ReactNode;
117
+ headerComponent?: ReactNode;
118
+ subheaderComponent?: ReactNode;
119
+ }
120
+ export interface IGeneratedLineChartDataset {
121
+ label?: string;
122
+ data: ICommonDataValue[];
123
+ showLine?: boolean;
124
+ lineTension: number;
125
+ spanGaps: boolean;
126
+ borderWidth: number;
127
+ borderDash: number[];
128
+ borderJoinStyle: 'round' | 'bevel' | 'miter';
129
+ borderColor: string;
130
+ backgroundColor: string | string[];
131
+ pointBackgroundColor: string;
132
+ pointRadius: number;
133
+ pointHoverRadius: number;
134
+ pointHitRadius: number;
135
+ isAnnotation?: boolean;
136
+ annotationType?: string;
137
+ annotationIndex?: number;
138
+ annotationLabel?: string;
139
+ annotationBackgroundColor?: string;
140
+ annotationPointBackgroundColor?: string;
141
+ annotationBorderColor?: string;
142
+ annotationBorderDash?: number[];
143
+ annotationBorderWidth?: number;
144
+ displayGroup?: string | number;
145
+ hideLegend?: boolean;
146
+ pointStyle?: string;
147
+ xAxisID?: string;
148
+ yAxisID?: string;
149
+ }
150
+ export type TGeneratedLineChartDatasets = IGeneratedLineChartDataset[];
@@ -0,0 +1,17 @@
1
+ import { Chart, ChartConfiguration, Plugin } from 'chart.js';
2
+ import { Position } from '../../common/helpers/enums';
3
+ interface CustomChartConfiguration extends ChartConfiguration {
4
+ showLabel?: boolean;
5
+ text: string;
6
+ fontSize: number;
7
+ xOffset: number;
8
+ yOffset: number;
9
+ lineHeight: number;
10
+ maxWidth: number;
11
+ position: Position;
12
+ }
13
+ export declare const chartAreaTextPlugin: {
14
+ id: string;
15
+ beforeDraw: (chart: Chart, _args: Plugin, options: CustomChartConfiguration) => void;
16
+ };
17
+ export {};
@@ -0,0 +1,8 @@
1
+ import { Chart, Scale } from 'chart.js';
2
+ export declare const getLargestMajorTickWidth: (majorTickPositions: number[]) => number;
3
+ export declare const isValidPosition: (minorTickPosition: number, majorTickPositions: number[], scale: Scale) => boolean;
4
+ export declare const getMinorTickPositions: (majorTickPositions: number[], scale: Scale) => number[];
5
+ export declare const chartMinorGridlinesPlugin: {
6
+ id: string;
7
+ beforeDatasetsDraw: (chart: Chart) => void;
8
+ };
@@ -0,0 +1,11 @@
1
+ export declare const TextLabelPosition: {
2
+ TOP_LEFT: string;
3
+ TOP_CENTER: string;
4
+ TOP_RIGHT: string;
5
+ MIDDLE_LEFT: string;
6
+ MIDDLE_CENTER: string;
7
+ MIDDLE_RIGHT: string;
8
+ BOTTOM_LEFT: string;
9
+ BOTTOM_CENTER: string;
10
+ BOTTOM_RIGHT: string;
11
+ };
@@ -0,0 +1,9 @@
1
+ import { Position } from '../../common/helpers/enums';
2
+ export interface IDrawText {
3
+ ctx: CanvasRenderingContext2D;
4
+ lines: Array<string>;
5
+ lineHeight: number;
6
+ x: number;
7
+ y: number;
8
+ position: Position;
9
+ }
@@ -0,0 +1,12 @@
1
+ export declare const TOGGLE_ZOOM = "TOGGLE_ZOOM";
2
+ export declare const TOGGLE_PAN = "TOGGLE_PAN";
3
+ export declare const TOGGLE_POINTS = "TOGGLE_POINTS";
4
+ export declare const TOGGLE_LINE = "TOGGLE_LINE";
5
+ export declare const TOGGLE_LEGEND = "TOGGLE_LEGEND";
6
+ export declare const TOGGLE_TABLE = "TOGGLE_TABLE";
7
+ export declare const RESET_AXES_RANGES = "RESET_AXES_RANGES";
8
+ export declare const UPDATE_AXES_RANGES = "UPDATE_AXES_RANGES";
9
+ export declare const TOGGLE_DRAG_POINTS = "TOGGLE_DRAG_POINTS";
10
+ export declare const TOGGLE_DRAG_ANNOTATION = "TOGGLE_DRAG_ANNOTATION";
11
+ export declare const DISABLE_DRAG_OPTIONS = "DISABLE_DRAG_OPTIONS";
12
+ export declare const UPDATE_EDITED = "UPDATE_EDITED";
@@ -0,0 +1,13 @@
1
+ import { Chart } from 'chart.js';
2
+ import { RefObject } from '../../../../node_modules/react';
3
+ import { IState } from './state.interfaces';
4
+ export interface IGetInitAxes {
5
+ chartRef: RefObject<Chart>;
6
+ state: IState;
7
+ }
8
+ export declare const getInitAxes: ({ chartRef, state }: IGetInitAxes) => {
9
+ id: string;
10
+ min: number;
11
+ max: number;
12
+ unit: string | import('../line-chart.interface').IUnitOptions | undefined;
13
+ }[];
@@ -0,0 +1,11 @@
1
+ import { IState } from './state.interfaces';
2
+ import { ILineChartOptions } from '../line-chart.interface';
3
+ interface inputInitState {
4
+ options: ILineChartOptions;
5
+ persistenceId?: string;
6
+ }
7
+ /**
8
+ Initial chart state for the line chart.
9
+ */
10
+ declare const initialState: ({ options, persistenceId }: inputInitState) => IState;
11
+ export default initialState;
@@ -0,0 +1,2 @@
1
+ import { IAction, IState } from './state.interfaces';
2
+ export declare const reducer: (state: IState, action: IAction) => IState;
@@ -0,0 +1,15 @@
1
+ import { IState } from './state.interfaces';
2
+ /**
3
+ * Retrieves the chart state from local storage.
4
+ *
5
+ * @param {string|''} persistenceId - The chart persistenceId.
6
+ * @returns {object|null} The chart state object or null if not found.
7
+ */
8
+ export declare const getChartStateFromStorage: (persistenceId?: string) => any;
9
+ /**
10
+ * Stores the chart state in local storage.
11
+ *
12
+ * @param {object} state - The chart state object to store.
13
+ * @param {string|''} persistenceId - The chart persistenceId.
14
+ */
15
+ export declare const storeChartStateInStorage: (state: IState, persistenceId?: string) => void;
@@ -0,0 +1,26 @@
1
+ import { IUnitOptions } from '../line-chart.interface';
2
+ export interface IAxisState {
3
+ id?: string;
4
+ label?: string;
5
+ min?: number | string;
6
+ max?: number | string;
7
+ unit?: IUnitOptions | string;
8
+ axisType?: string;
9
+ }
10
+ export interface IState {
11
+ zoomEnabled: boolean;
12
+ panEnabled: boolean;
13
+ pointsEnabled: boolean;
14
+ lineEnabled: boolean;
15
+ legendEnabled: boolean;
16
+ axes: IAxisState[];
17
+ showAnnotationLineIndex?: number[];
18
+ showTable: boolean;
19
+ enableDragPoints: boolean;
20
+ enableDragAnnotation: boolean;
21
+ edited: boolean;
22
+ }
23
+ export interface IAction<T = string, P = any> {
24
+ type: T;
25
+ payload?: P;
26
+ }
@@ -0,0 +1,2 @@
1
+ import { Tick } from 'chart.js';
2
+ export declare const formatAxisLabelNumbers: (tickValue: string | number, ticks: Tick[]) => string;
@@ -0,0 +1,9 @@
1
+ import { ILineChartOptions, TGeneratedLineChartDatasets } from '../../line-chart.interface';
2
+ import { IState } from '../../state/state.interfaces';
3
+ /**
4
+ * Auto scales axis ranges (mix, max) if no explicit range is set
5
+ * - overrides some edge cases not handled well by default chart.js
6
+ * - supports optional padding when `autoAxisPadding` is set
7
+ * - otherwise does not set min/max (falls back to chart.js default)
8
+ */
9
+ export declare const autoScale: (options: ILineChartOptions, state: IState, generatedDatasets: TGeneratedLineChartDatasets) => {};
@@ -0,0 +1,12 @@
1
+ import { IGeneratedLineChartDataset, TGeneratedLineChartDatasets } from '../../line-chart.interface';
2
+ type TCustomOptionType = {
3
+ [key: string]: string;
4
+ } | string | string[];
5
+ type TDataType = IGeneratedLineChartDataset | Partial<IGeneratedLineChartDataset> | TGeneratedLineChartDatasets | Partial<TGeneratedLineChartDatasets> | any[];
6
+ /**
7
+ * Checks if a single dataset or an array of datasets has a custom option.
8
+ * Iterates through each custom option defined in the customOptions parameter.
9
+ * Returns true if any dataset has any custom option, otherwise returns false.
10
+ */
11
+ export declare const checkCustomOption: (data: TDataType, customOptions: TCustomOptionType) => boolean;
12
+ export {};
@@ -0,0 +1,20 @@
1
+ interface IChartArea {
2
+ left: number | null;
3
+ right: number | null;
4
+ bottom: number | null;
5
+ }
6
+ interface IChartMeta {
7
+ data: Array<{
8
+ x: number | null;
9
+ y: number | null;
10
+ }>;
11
+ }
12
+ export interface IAlignmentContext {
13
+ chart: {
14
+ chartArea: IChartArea;
15
+ getDatasetMeta: (datasetIndex: number) => IChartMeta;
16
+ };
17
+ dataIndex: number;
18
+ datasetIndex: number;
19
+ }
20
+ export {};
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Returning boolean condition depends on label position and chart area
3
+ */
4
+ export declare const getCondition: (x: number | null, y: number | null, left: number | null, right: number | null, bottom: number | null) => {
5
+ overLeftSide: boolean;
6
+ overRightSide: boolean;
7
+ overBottomSide: boolean;
8
+ };
@@ -0,0 +1,11 @@
1
+ import { IAlignmentContext } from './datalabels-alignment.interface';
2
+ /**
3
+ * Safely extracts coordinates and chart area info for alignment
4
+ */
5
+ export declare const getAlignmentData: (context: IAlignmentContext) => {
6
+ x: number | null;
7
+ y: number | null;
8
+ left: number | null;
9
+ right: number | null;
10
+ bottom: number | null;
11
+ };
@@ -0,0 +1,6 @@
1
+ import { AlignOptions } from '../../../common/helpers/enums';
2
+ import { IAlignmentContext } from './datalabels-alignment.interface.ts';
3
+ /**
4
+ * Returning position depends on condition
5
+ */
6
+ export declare const getPosition: () => (context: IAlignmentContext) => AlignOptions.End | AlignOptions.Start | AlignOptions.Right | AlignOptions.Left;
@@ -0,0 +1,4 @@
1
+ export declare enum CUSTOM_OPTION {
2
+ showLine = "showLine",
3
+ showPoints = "showPoints"
4
+ }
@@ -0,0 +1,8 @@
1
+ import { IState } from '../state/state.interfaces';
2
+ import { ILineChartOptions, TGeneratedLineChartDatasets } from '../line-chart.interface';
3
+ /**
4
+ * Generates line chart datasets based on the provided datasets, state, and options.
5
+ */
6
+ export declare const generateLineChartDatasets: (datasets: Array<any>, state: IState, options: ILineChartOptions, { label }: {
7
+ label: string;
8
+ }) => TGeneratedLineChartDatasets;
@@ -0,0 +1 @@
1
+ export function getAnnotationsData(data: any[]): Object;
@@ -0,0 +1 @@
1
+ export function getAxesDataFromMetasets(generatedDatasets: any, scalesKeys: any, annotationsData: any): any;
@@ -0,0 +1,9 @@
1
+ import { Chart } from 'chart.js';
2
+ import { RefObject } from '../../../../node_modules/react';
3
+ import { ILineChartAxes } from '../line-chart.interface';
4
+ export declare const getAxesRangesFromChart: (chartRef: RefObject<Chart>, axes: ILineChartAxes) => {
5
+ unit?: import('../line-chart.interface').IUnitOptions | undefined;
6
+ id: string;
7
+ min: number;
8
+ max: number;
9
+ }[];
@@ -0,0 +1,10 @@
1
+ import { RefObject } from '../../../../node_modules/react';
2
+ import { Chart } from 'chart.js';
3
+ import { ICommonAnnotationsData } from '../../common/common.interface.ts';
4
+ export type TAxisType = 'x' | 'y' | 'x1' | 'y1';
5
+ interface IMinMax {
6
+ min: number;
7
+ max: number;
8
+ }
9
+ export declare const getAxisRangeByType: (chartRef: RefObject<Chart>, axesType: TAxisType, annotationsData: ICommonAnnotationsData[]) => IMinMax | null;
10
+ export {};
@@ -0,0 +1,2 @@
1
+ import { Chart, LegendItem } from 'chart.js';
2
+ export declare const getGeneratedLabels: (chart: Chart) => LegendItem[];
@@ -0,0 +1,16 @@
1
+ import { TooltipItem } from 'chart.js';
2
+ import { ILineChartOptions } from '../line-chart.interface';
3
+ import { UnusedParameter } from '../../common/common.interface';
4
+ /**
5
+ * adjusts the position of the label depends on chart area
6
+ */
7
+ declare const getLineChartDataLabels: (options: ILineChartOptions) => {
8
+ display: string;
9
+ align: (context: import('./datalabels-alignment/datalabels-alignment.interface').IAlignmentContext) => import("../../common/helpers/enums").AlignOptions.End | import("../../common/helpers/enums").AlignOptions.Start | import("../../common/helpers/enums").AlignOptions.Right | import("../../common/helpers/enums").AlignOptions.Left;
10
+ formatter: (_: UnusedParameter, context: TooltipItem<any>) => any;
11
+ } | {
12
+ display: boolean;
13
+ align?: undefined;
14
+ formatter?: undefined;
15
+ };
16
+ export default getLineChartDataLabels;
@@ -0,0 +1,4 @@
1
+ import { IState } from '../state/state.interfaces';
2
+ import { ILineChartOptions } from '../line-chart.interface';
3
+ declare const getLineChartScales: (options: ILineChartOptions, state: IState) => {};
4
+ export default getLineChartScales;
@@ -0,0 +1,34 @@
1
+ import { TooltipItem } from 'chart.js';
2
+ import { ChartHoverMode } from '../../common/helpers/enums';
3
+ import { ILineChartOptions } from '../line-chart.interface';
4
+ export declare const getUnitsFromLabel: (label: string) => string;
5
+ declare const getLineChartToolTips: (options: ILineChartOptions) => {
6
+ enabled: boolean;
7
+ callbacks: {
8
+ title?: undefined;
9
+ label?: undefined;
10
+ afterLabel?: undefined;
11
+ };
12
+ mode?: undefined;
13
+ intersect?: undefined;
14
+ padding?: undefined;
15
+ usePointStyle?: undefined;
16
+ boxWidth?: undefined;
17
+ boxHeight?: undefined;
18
+ boxPadding?: undefined;
19
+ } | {
20
+ enabled: boolean;
21
+ mode: ChartHoverMode;
22
+ intersect: boolean;
23
+ padding: number;
24
+ usePointStyle: boolean;
25
+ boxWidth: number;
26
+ boxHeight: number;
27
+ boxPadding: number;
28
+ callbacks: {
29
+ title: (tooltipItem: TooltipItem<any>[]) => string;
30
+ label: (tooltipItem: TooltipItem<any>) => string;
31
+ afterLabel: (tooltipItem: Record<string, any>) => string;
32
+ };
33
+ };
34
+ export default getLineChartToolTips;
@@ -0,0 +1,24 @@
1
+ import { TPrimitive } from '../../common/common.interface';
2
+ import { IState } from '../state/state.interfaces';
3
+ export declare const toNum: (value: string | number) => any;
4
+ export declare const isLessThanMax: (value: string | number, max: string | number) => boolean;
5
+ export declare const isGreaterThanMin: (value: string | number, min: string | number) => boolean;
6
+ /**
7
+ *
8
+ * @param {'x'|'y'} axisType
9
+ * @param {number} [index] - axis index; optional, 0 by default
10
+ * @param {boolean} [hasMultiAxes] - optional, false by default
11
+ * @return {string} - e.g. x if chart has singular axes; x, x2 - in case of multiple axes
12
+ */
13
+ export declare const generateAxisId: (axisType: string, index?: number, hasMultiAxes?: boolean) => string;
14
+ /**
15
+ Get axis type from a key string.
16
+ @param {string} string - The key string to extract from.
17
+ @returns {string} e.g. x1 => x
18
+ */
19
+ export declare const getAxisTypeFromKey: (string: string) => string;
20
+ /**
21
+ * Checks if a value is a primitive value (which includes strings, numbers, booleans, and null).
22
+ */
23
+ export declare const isPrimitiveValue: (value: TPrimitive) => value is string | number | boolean | null;
24
+ export declare const getChartKey: (state: IState, languageKey: string) => string;
@@ -0,0 +1,8 @@
1
+ import { defaultTranslations } from '../../constants/default-translations';
2
+ /**
3
+ * Merges custom getTranslations with the default getTranslations.
4
+ * If a custom translation is provided for a key, it will override the default one.
5
+ * @param {object} translations - Custom getTranslations.
6
+ * @returns {object} - The resulting getTranslations object, containing both default and custom getTranslations.
7
+ */
8
+ export declare const getTranslations: (translations?: Partial<Record<keyof typeof defaultTranslations, string>>) => {};
Binary file
Binary file
Binary file
@@ -0,0 +1,50 @@
1
+ import { ChartEvent } from 'chart.js';
2
+ import { ICommonTooltip } from '../common/common.interface';
3
+ import { IPieChartDataset, IPieOptions } from './pie-chart.interface';
4
+ import { AlignOptions, Position } from '../common/helpers/enums';
5
+ export interface IDefaultChartStyling {
6
+ width?: number | string;
7
+ height?: number | string;
8
+ maintainAspectRatio: boolean;
9
+ staticChartHeight: boolean;
10
+ performanceMode: boolean;
11
+ }
12
+ interface IDefaultPieGraph {
13
+ showDataLabels: boolean;
14
+ stacked: boolean;
15
+ cutout: number | string;
16
+ }
17
+ interface IDefaultPieLegend {
18
+ display: boolean;
19
+ useDataset: boolean;
20
+ position: Position;
21
+ align: AlignOptions;
22
+ }
23
+ interface IDefaultChartOptions {
24
+ enableZoom: boolean;
25
+ enablePan: boolean;
26
+ }
27
+ interface IDefaultInteractions {
28
+ onLegendClick?: (text: string, hidden: boolean) => void;
29
+ onHover?: (event?: ChartEvent, datasetIndex?: number, index?: number, generatedDataset?: IPieChartDataset[]) => void;
30
+ onUnhover?: (event?: ChartEvent, datasetIndex?: number, index?: number, generatedDataset?: IPieChartDataset[]) => void;
31
+ }
32
+ interface IDefaultChartData {
33
+ labels: string[];
34
+ datasets: IPieChartDataset[];
35
+ }
36
+ interface IDefaultPieOptions extends IPieOptions {
37
+ title: string | string[];
38
+ chartStyling: IDefaultChartStyling;
39
+ tooltip: ICommonTooltip;
40
+ graph: IDefaultPieGraph;
41
+ legend: IDefaultPieLegend;
42
+ chartOptions: IDefaultChartOptions;
43
+ interactions: IDefaultInteractions;
44
+ }
45
+ export interface IPieChartDefaultProps {
46
+ testId: string | null;
47
+ data: IDefaultChartData;
48
+ options: IDefaultPieOptions;
49
+ }
50
+ export {};
@@ -0,0 +1,3 @@
1
+ import { IPieChartProps } from './pie-chart.interface';
2
+ import { IPieChartDefaultProps } from './pie-chart-defalut-props.interface';
3
+ export declare const getDefaultProps: (props: IPieChartProps) => IPieChartDefaultProps;
@@ -0,0 +1,3 @@
1
+ import { IPieChartProps } from './pie-chart.interface';
2
+ declare const PieChartWithLegend: (props: IPieChartProps) => import("react/jsx-runtime").JSX.Element;
3
+ export { PieChartWithLegend as PieChart };