@oliasoft-open-source/charts-library 3.4.7-beta-1 → 3.4.8-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 (60) hide show
  1. package/dist/declaration.d.ts +0 -2
  2. package/dist/index.js +612 -659
  3. package/dist/index.js.map +1 -1
  4. package/dist/src/components/bar-chart/bar-chart-default-props.d.ts +26 -30
  5. package/dist/src/components/bar-chart/bar-chart.interface.d.ts +70 -37
  6. package/dist/src/components/bar-chart/get-bar-chart-data-labels.d.ts +14 -11
  7. package/dist/src/components/bar-chart/get-bar-chart-scales.d.ts +2 -3
  8. package/dist/src/components/bar-chart/get-bar-chart-tooltips.d.ts +16 -3
  9. package/dist/src/components/controls/axes-options/axes-options-interfaces.d.ts +19 -0
  10. package/dist/src/components/{line-chart/controls → controls}/axes-options/axes-options.d.ts +1 -1
  11. package/dist/src/components/line-chart/controls/axes-options/axes-options-form-state.d.ts +3 -8
  12. package/dist/src/components/line-chart/controls/controls-interfaces.d.ts +32 -18
  13. package/dist/src/components/line-chart/controls/controls-portal.d.ts +1 -6
  14. package/dist/src/components/line-chart/controls/controls.d.ts +1 -1
  15. package/dist/src/components/line-chart/controls/drag-options-interfaces.d.ts +5 -5
  16. package/dist/src/components/line-chart/controls/line-options.d.ts +1 -9
  17. package/dist/src/components/line-chart/hooks/hooks.interface.d.ts +13 -0
  18. package/dist/src/components/line-chart/hooks/use-chart-functions.d.ts +6 -28
  19. package/dist/src/components/line-chart/hooks/use-chart-options.d.ts +37 -0
  20. package/dist/src/components/line-chart/hooks/use-toggle-handler.d.ts +1 -2
  21. package/dist/src/components/line-chart/initialize/config.d.ts +2 -2
  22. package/dist/src/components/line-chart/legend/legend-interface.d.ts +18 -24
  23. package/dist/src/components/line-chart/legend/legend-panel.d.ts +2 -2
  24. package/dist/src/components/line-chart/line-chart-get-default-props.d.ts +30 -38
  25. package/dist/src/components/line-chart/line-chart.interface.d.ts +61 -48
  26. package/dist/src/components/line-chart/plugins/chart-area-text-plugin.d.ts +1 -14
  27. package/dist/src/components/line-chart/plugins/line-chart.minor-gridlines-plugin.d.ts +4 -5
  28. package/dist/src/components/line-chart/plugins/plugins.interface.d.ts +2 -2
  29. package/dist/src/components/line-chart/state/initial-state.d.ts +2 -20
  30. package/dist/src/components/line-chart/state/line-chart-reducer.d.ts +1 -2
  31. package/dist/src/components/line-chart/state/manage-state-in-local-storage.d.ts +2 -3
  32. package/dist/src/components/line-chart/state/state.interfaces.d.ts +7 -32
  33. package/dist/src/components/line-chart/{hooks → state}/use-chart-state.d.ts +1 -13
  34. package/dist/src/components/line-chart/utils/datalabels-alignment/get-datalabels-position.d.ts +1 -1
  35. package/dist/src/components/line-chart/utils/generate-line-chart-datasets.d.ts +1 -3
  36. package/dist/src/components/line-chart/utils/get-axes-ranges-from-chart.d.ts +2 -9
  37. package/dist/src/components/line-chart/utils/get-line-chart-data-labels.d.ts +2 -3
  38. package/dist/src/components/line-chart/utils/get-line-chart-scales.d.ts +4 -4
  39. package/dist/src/components/line-chart/utils/get-line-chart-tooltips.d.ts +2 -2
  40. package/dist/src/components/line-chart/utils/translations/get-translations.d.ts +1 -2
  41. package/dist/src/components/pie-chart/pie-chart-get-default-props.d.ts +8 -12
  42. package/dist/src/components/pie-chart/pie-chart-utils.d.ts +2 -0
  43. package/dist/src/components/pie-chart/pie-chart.d.ts +2 -1
  44. package/dist/src/components/pie-chart/pie-chart.interface.d.ts +51 -52
  45. package/dist/src/components/scatter-chart/scatter-chart.d.ts +1 -1
  46. package/dist/src/components/scatter-chart/scatter-chart.intefrace.d.ts +16 -6
  47. package/dist/src/helpers/chart-border-plugin.d.ts +7 -0
  48. package/dist/src/helpers/chart-interface.d.ts +85 -0
  49. package/dist/src/{components/common/helpers → helpers}/enums.d.ts +1 -2
  50. package/dist/src/helpers/get-chart-annotation.d.ts +12 -0
  51. package/dist/src/helpers/get-draggableData.d.ts +18 -0
  52. package/dist/src/{components/common/helpers → helpers}/range/range.d.ts +6 -6
  53. package/package.json +1 -1
  54. package/dist/src/components/common/common.interface.d.ts +0 -139
  55. package/dist/src/components/common/helpers/chart-border-plugin.d.ts +0 -8
  56. package/dist/src/components/common/helpers/get-chart-annotation.d.ts +0 -27
  57. package/dist/src/components/common/helpers/get-draggableData.d.ts +0 -18
  58. package/dist/src/components/line-chart/controls/axes-options/axes-options-interfaces.d.ts +0 -52
  59. /package/dist/src/{components/common/helpers → helpers}/chart-consts.d.ts +0 -0
  60. /package/dist/src/{components/common/helpers → helpers}/range/estimate-data-series-have-close-values.d.ts +0 -0
@@ -1,32 +1,28 @@
1
1
  import { IBarChartProps } from './bar-chart.interface';
2
- import { AlignOptions, Position } from '../common/helpers/enums';
3
2
  export declare const getDefaultProps: (props: IBarChartProps) => {
4
- testId: string;
5
- data: {
6
- labels: string[];
7
- datasets: import("./bar-chart.interface").IBarChartDataset[];
8
- };
3
+ testId: string | null;
4
+ data: any;
9
5
  options: {
10
6
  title: string | string[];
11
7
  direction: "vertical" | "horizontal";
12
8
  axes: {
13
- x: [{}] | import("../common/common.interface").ICommonAxis<"top" | "bottom">[];
14
- y: [{}] | import("../common/common.interface").ICommonAxis<"left" | "right">[];
9
+ x: import("./bar-chart.interface").IBarChartAxes<"top" | "bottom">[];
10
+ y: import("./bar-chart.interface").IBarChartAxes<"left" | "right">[];
15
11
  };
16
12
  additionalAxesOptions: {
17
13
  chartScaleType: "linear" | "logarithmic";
18
14
  reverse: boolean;
19
15
  stacked: boolean;
20
16
  beginAtZero: boolean;
21
- stepSize: number | undefined;
22
- suggestedMin: number | undefined;
23
- suggestedMax: number | undefined;
24
- min: number | undefined;
25
- max: number | undefined;
17
+ stepSize: number;
18
+ suggestedMin: number;
19
+ suggestedMax: number;
20
+ min: number;
21
+ max: number;
26
22
  };
27
23
  chartStyling: {
28
- width: string | number | undefined;
29
- height: string | number | undefined;
24
+ width: string | number;
25
+ height: string | number;
30
26
  maintainAspectRatio: boolean;
31
27
  staticChartHeight: boolean;
32
28
  performanceMode: boolean;
@@ -42,32 +38,32 @@ export declare const getDefaultProps: (props: IBarChartProps) => {
42
38
  annotations: {
43
39
  showAnnotations: boolean;
44
40
  controlAnnotation: boolean;
45
- annotationsData: import("../common/common.interface").ICommonAnnotationsData[];
41
+ annotationsData: import("../../helpers/chart-interface").IChartAnnotationsData[];
46
42
  };
47
43
  legend: {
48
44
  display: boolean;
49
- position: Position;
50
- align: AlignOptions;
51
- customLegend: import("../common/common.interface").ICommonCustomLegend<any>;
45
+ position: "top" | "bottom" | "right";
46
+ align: "start" | "center" | "end";
47
+ customLegend: import("../../helpers/chart-interface").ICustomLegend;
52
48
  };
53
49
  chartOptions: {
54
50
  enableZoom: boolean;
55
51
  enablePan: boolean;
56
52
  };
57
53
  interactions: {
58
- onLegendClick: ((text: string, hidden: boolean) => void) | undefined;
59
- onHover: ((event?: import("chart.js").ChartEvent | undefined, datasetIndex?: number | undefined, index?: number | undefined, generatedDataset?: any[] | undefined) => void) | undefined;
60
- onUnhover: ((event?: import("chart.js").ChartEvent | undefined, datasetIndex?: number | undefined, index?: number | undefined, generatedDataset?: any[] | undefined) => void) | undefined;
54
+ onLegendClick: () => any;
55
+ onBarHover: any;
56
+ onBarUnhover: any;
61
57
  };
62
58
  dragData: {
63
- enableDragData: boolean;
64
- showTooltip: boolean;
65
- roundPoints: boolean;
66
- dragX: boolean;
67
- dragY: boolean;
68
- onDragStart: (() => void) | undefined;
69
- onDrag: (() => void) | undefined;
70
- onDragEnd: (() => void) | undefined;
59
+ enableDragData: any;
60
+ showTooltip: any;
61
+ roundPoints: any;
62
+ dragX: any;
63
+ dragY: any;
64
+ onDragStart: any;
65
+ onDrag: any;
66
+ onDragEnd: any;
71
67
  };
72
68
  };
73
69
  };
@@ -1,49 +1,82 @@
1
- import { ICommonAdditionalAxesOptions, ICommonAnnotations, ICommonAxis, ICommonCustomLegend, ICommonData, ICommonDataset, ICommonDragData, ICommonGraph, ICommonLegend, ICommonOptions, ICommonScales, ICommonStyling } from '../common/common.interface';
2
- export interface IBarStyling extends ICommonStyling {
3
- squareAspectRatio?: boolean;
4
- layoutPadding?: string | number | {
5
- top: number;
6
- bottom: number;
7
- left: number;
8
- right: number;
9
- };
1
+ import { LinearScaleOptions } from 'chart.js';
2
+ import { IChartAnnotations, IChartDraggableData, IChartInteractions, IChartLegend, IChartStyling } from '../../helpers/chart-interface';
3
+ export interface IChartOptions {
4
+ enableZoom: boolean;
5
+ enablePan: boolean;
6
+ }
7
+ export interface IBarChartGraph {
8
+ showDataLabels: boolean;
9
+ showMinorGridlines: boolean;
10
+ }
11
+ export interface IBarChartTooltip {
12
+ tooltips: boolean;
13
+ showLabelsInTooltips: boolean;
14
+ }
15
+ export interface IBarChartAdditionalAxesOptions {
16
+ chartScaleType: 'linear' | 'logarithmic';
17
+ reverse: boolean;
18
+ beginAtZero: boolean;
19
+ stepSize: number;
20
+ stacked: boolean;
21
+ suggestedMin: number;
22
+ suggestedMax: number;
23
+ min: number;
24
+ max: number;
10
25
  }
11
- export interface IBarLegend extends ICommonLegend {
12
- customLegend?: ICommonCustomLegend<any>;
26
+ export interface IBarChartAxes<PositionType> {
27
+ label: string;
28
+ position: PositionType;
29
+ color: string;
30
+ unit: string;
13
31
  }
14
- export interface IBarAxes {
15
- x: ICommonAxis<'top' | 'bottom'>[] | [{}];
16
- y: ICommonAxis<'left' | 'right'>[] | [{}];
17
- [key: string]: ICommonAxis<any>[] | [{}];
32
+ export interface IBarScales {
33
+ x: LinearScaleOptions;
34
+ y: LinearScaleOptions;
18
35
  }
19
- export interface IBarOptions extends ICommonOptions {
36
+ export interface IBarChartOptions {
37
+ title: string | string[];
20
38
  direction: 'vertical' | 'horizontal';
21
- axes: IBarAxes;
22
- scales?: ICommonScales;
23
- additionalAxesOptions?: ICommonAdditionalAxesOptions;
24
- chartStyling: IBarStyling;
25
- graph?: ICommonGraph;
26
- annotations?: ICommonAnnotations;
27
- legend?: IBarLegend;
28
- dragData?: ICommonDragData;
29
- }
30
- export interface IBarChartDataset extends ICommonDataset {
31
- isAnnotation?: boolean;
32
- annotationIndex?: number;
33
- borderSkipped?: any;
39
+ axes: {
40
+ x: IBarChartAxes<'top' | 'bottom'>[];
41
+ y: IBarChartAxes<'left' | 'right'>[];
42
+ };
43
+ scales: IBarScales;
44
+ additionalAxesOptions: IBarChartAdditionalAxesOptions;
45
+ chartStyling: IChartStyling;
46
+ tooltip: IBarChartTooltip;
47
+ graph: IBarChartGraph;
48
+ annotations: IChartAnnotations;
49
+ legend: IChartLegend;
50
+ chartOptions: IChartOptions;
51
+ interactions: IChartInteractions;
52
+ draggableData: IChartDraggableData;
53
+ }
54
+ export interface IBarDataPoint {
55
+ x: number;
56
+ y: number;
57
+ label?: string;
58
+ }
59
+ export interface IBarChartDataset {
60
+ label?: string;
61
+ data: number[] | number[][] | IBarDataPoint[];
62
+ borderSkipped?: string;
63
+ backgroundColor?: string[];
64
+ borderColor?: string[];
34
65
  borderRadius?: number;
35
- xAxisID?: string;
66
+ borderWidth?: number;
36
67
  yAxisID?: string;
37
- hidden?: boolean;
38
- displayGroup?: any;
39
- type?: 'bar';
68
+ stack?: number;
69
+ isAnnotation: boolean;
70
+ annotationIndex: number | string;
71
+ type: 'bar' | 'line';
40
72
  }
41
- export interface IBarChartData extends ICommonData {
73
+ export interface IBarChartData {
74
+ testId: string | null;
42
75
  data: {
43
- labels: string[];
76
+ labels?: string[];
44
77
  datasets: IBarChartDataset[];
45
- };
46
- options: IBarOptions;
78
+ } | any;
79
+ options: IBarChartOptions;
47
80
  }
48
81
  export interface IBarChartProps {
49
82
  chart: IBarChartData;
@@ -1,14 +1,17 @@
1
- import { Options } from 'chartjs-plugin-datalabels';
2
- import { IBarOptions } from './bar-chart.interface';
3
- type ExtendedDisplayOptions = 'auto' | boolean;
4
- interface IExtendedDataLabelsOptions extends Options {
5
- display: ExtendedDisplayOptions;
6
- }
1
+ import { AlignOptions } from '../../helpers/enums';
2
+ import { IBarChartOptions } from './bar-chart.interface';
7
3
  /**
8
- * Returns the data labels configuration for a bar chart.
9
- *
10
- * @param {IBarChartOptions} options - The options for the bar chart.
11
- * @returns {Object} The data labels configuration for the chart.
4
+ * @param {import('./bar-chart.interface').IBarChartOptions} options - bar chart options object
12
5
  */
13
- declare const getBarChartDataLabels: (options: IBarOptions) => IExtendedDataLabelsOptions;
6
+ declare const getBarChartDataLabels: (options: IBarChartOptions) => {
7
+ display: string;
8
+ align: AlignOptions;
9
+ anchor: AlignOptions;
10
+ formatter: (value: any, context: any) => string | number;
11
+ } | {
12
+ display: boolean;
13
+ align?: undefined;
14
+ anchor?: undefined;
15
+ formatter?: undefined;
16
+ };
14
17
  export default getBarChartDataLabels;
@@ -1,6 +1,5 @@
1
- import { Chart } from 'chart.js';
2
1
  /**
3
- * @param {IBarChartData} chart - chart data
2
+ * @param {import('./bar-chart.interface').IBarChartData} chart - chart data
4
3
  */
5
- declare const getBarChartScales: (chart: Chart) => any;
4
+ declare const getBarChartScales: (chart: any) => any;
6
5
  export default getBarChartScales;
@@ -1,6 +1,19 @@
1
- import { IBarOptions } from './bar-chart.interface';
1
+ import { ChartHoverMode } from '../../helpers/enums';
2
2
  /**
3
- * @param {IBarOptions} options - bar chart options object
3
+ * @param {import('./bar-chart.interface').IBarChartOptions} options - bar chart options object
4
4
  */
5
- declare const getBarChartToolTips: (options: IBarOptions) => Record<string, any>;
5
+ declare const getBarChartToolTips: (options: any) => {
6
+ enabled: any;
7
+ mode: ChartHoverMode;
8
+ intersect: boolean;
9
+ padding: number;
10
+ boxWidth: number;
11
+ boxHeight: number;
12
+ boxPadding: number;
13
+ callbacks: {
14
+ title: (tooltipItem: any, data: any) => string;
15
+ label: (tooltipItem: any) => string;
16
+ afterLabel: (tooltipItem: any) => string;
17
+ };
18
+ };
6
19
  export default getBarChartToolTips;
@@ -0,0 +1,19 @@
1
+ export interface IDepthType {
2
+ selectedDepthType: string;
3
+ setSelectedDepthType: (obj: any) => any;
4
+ options: Array<string>;
5
+ }
6
+ export interface IAxesOptions {
7
+ initialAxesRanges: Array<Object>;
8
+ axes: Array<any>;
9
+ controlsAxesLabels: Array<Object>;
10
+ onUpdateAxes: (obj: any) => any;
11
+ onResetAxes: () => any;
12
+ depthType: IDepthType;
13
+ close?: () => any;
14
+ }
15
+ export interface IOnEdit {
16
+ name: string;
17
+ value: string;
18
+ id: string;
19
+ }
@@ -1,6 +1,6 @@
1
1
  import { IAxesOptions } from './axes-options-interfaces';
2
2
  interface IAxesOptionsWithTranslations extends IAxesOptions {
3
- translations: Record<string, string>;
3
+ translations: any;
4
4
  }
5
5
  export declare const AxesOptions: (optionsPopover: IAxesOptionsWithTranslations) => JSX.Element;
6
6
  export {};
@@ -1,5 +1,3 @@
1
- import { IState } from '../../state/state.interfaces';
2
- import { IAction, IFormState, IInitializeAxisFormState } from './axes-options-interfaces.ts';
3
1
  /**
4
2
  * Initialize local component form state for a custom loads density table
5
3
  *
@@ -8,11 +6,8 @@ import { IAction, IFormState, IInitializeAxisFormState } from './axes-options-in
8
6
  * @param {Array} [args.axes]
9
7
  * @returns {Object} formState
10
8
  */
11
- export declare const initializeFormState: ({ initialAxesRanges, axes, }: Partial<IState>) => IInitializeAxisFormState;
12
- export declare const validateAxes: (formState: IFormState) => {
13
- errors: never[];
14
- valid: boolean;
15
- };
9
+ export declare const initializeFormState: ({ initialAxesRanges, axes }: any) => any;
10
+ export declare const validateAxes: (formState: any) => any;
16
11
  /**
17
12
  * Local component form state reducer for a axes options form
18
13
  *
@@ -20,4 +15,4 @@ export declare const validateAxes: (formState: IFormState) => {
20
15
  * @param {Action} action Action with type and payload
21
16
  * @returns {Object} FormState
22
17
  */
23
- export declare const reducer: (state: IFormState, action: IAction) => IInitializeAxisFormState;
18
+ export declare const reducer: (state: any, action: any) => any;
@@ -1,20 +1,34 @@
1
- import { Dispatch, RefObject } from 'react';
2
- import { Chart } from 'chart.js';
3
- import { ILineChartDataset, ILineChartOptions } from '../line-chart.interface';
4
- import { IState } from '../state/state.interfaces';
5
- export interface IControls {
6
- headerComponent?: Element;
7
- subheaderComponent?: Element;
8
- table?: Element;
9
- chartRef: RefObject<Chart>;
10
- state: IState;
11
- options: ILineChartOptions;
12
- dispatch: Dispatch<any>;
13
- generatedDatasets: ILineChartDataset[];
14
- translations: Record<string, string>;
15
- controlsPortalId?: string;
1
+ interface IControlsProps {
2
+ headerComponent: Element;
3
+ subheaderComponent: Element;
4
+ table: Element;
5
+ controlsPortalId: string;
6
+ }
7
+ interface IControlsState {
8
+ enableDragPoints: boolean;
9
+ initialAxesRanges: Array<object>;
10
+ legendEnabled: boolean;
11
+ lineEnabled: boolean;
12
+ panEnabled: boolean;
13
+ pointsEnabled: boolean;
14
+ showTable: boolean;
15
+ zoomEnabled: boolean;
16
16
  }
17
- export interface AxisControls {
18
- id?: string;
19
- label?: string;
17
+ interface IControlsOptions {
18
+ dragData: {
19
+ enableDragData: boolean;
20
+ };
21
+ title: string;
22
+ depthType: any;
23
+ }
24
+ export interface IControls {
25
+ props: IControlsProps;
26
+ chartRef: any;
27
+ state: IControlsState;
28
+ options: IControlsOptions;
29
+ dispatch: () => any;
30
+ generatedDatasets: Array<object>;
31
+ translations: any;
32
+ controlsPortalId: any;
20
33
  }
34
+ export {};
@@ -1,7 +1,2 @@
1
- import { ReactElement } from 'react';
2
- interface ControlsPortalProps {
3
- children: ReactElement;
4
- controlsPortalId: string;
5
- }
6
- declare const ControlsPortal: ({ children, controlsPortalId, }: ControlsPortalProps) => JSX.Element;
1
+ declare const ControlsPortal: ({ children, controlsPortalId }: any) => any;
7
2
  export default ControlsPortal;
@@ -2,5 +2,5 @@ import { IControls } from './controls-interfaces';
2
2
  /**
3
3
  * @param {import('./controls-interfaces').IControls} obj
4
4
  */
5
- declare const Controls: ({ headerComponent, subheaderComponent, table, chartRef, state, options, dispatch, generatedDatasets, translations, controlsPortalId, }: IControls) => JSX.Element;
5
+ declare const Controls: ({ props: { headerComponent, subheaderComponent, table }, chartRef, state, options, dispatch, generatedDatasets, translations, controlsPortalId, }: IControls) => JSX.Element;
6
6
  export default Controls;
@@ -1,11 +1,11 @@
1
1
  export interface IDragOptions {
2
- onTogglePan: () => void;
3
- onToggleZoom: () => void;
2
+ onTogglePan: () => any;
3
+ onToggleZoom: () => any;
4
4
  panEnabled: boolean;
5
5
  zoomEnabled: boolean;
6
6
  enableDragPoints: boolean;
7
7
  isDragDataAllowed: boolean;
8
- onToggleDragPoints: () => void;
9
- onDisableDragOptions: () => void;
10
- translations: Record<string, string>;
8
+ onToggleDragPoints: () => any;
9
+ onDisableDragOptions: () => any;
10
+ translations: any;
11
11
  }
@@ -1,9 +1 @@
1
- interface ILineOptions {
2
- lineEnabled: boolean;
3
- onToggleLine: () => void;
4
- onTogglePoints: () => void;
5
- pointsEnabled: boolean;
6
- translations: Record<string, string>;
7
- }
8
- export declare const LineOptions: ({ lineEnabled, onToggleLine, onTogglePoints, pointsEnabled, translations, }: ILineOptions) => JSX.Element;
9
- export {};
1
+ export declare const LineOptions: ({ lineEnabled, onToggleLine, onTogglePoints, pointsEnabled, translations, }: any) => JSX.Element;
@@ -0,0 +1,13 @@
1
+ export interface IHooksInterface {
2
+ chartRef: {
3
+ current: any;
4
+ };
5
+ state: any;
6
+ options: any;
7
+ dispatch: (obj: object) => any;
8
+ generatedDatasets: Array<Object>;
9
+ }
10
+ export interface IUseChartPluginsInterface {
11
+ options: any;
12
+ resetZoom: any;
13
+ }
@@ -1,15 +1,4 @@
1
- import { Dispatch, RefObject } from 'react';
2
- import { Chart, ChartEvent } from 'chart.js';
3
- import { ICommonHoveredItems } from '../../common/common.interface';
4
- import { ILineChartDataset, ILineChartOptions } from '../line-chart.interface';
5
- import { IState } from '../state/state.interfaces';
6
- interface IUseChartFunctions {
7
- chartRef: RefObject<Chart>;
8
- state: IState;
9
- options: ILineChartOptions;
10
- dispatch: Dispatch<any>;
11
- generatedDatasets: ILineChartDataset[];
12
- }
1
+ import { IHooksInterface } from './hooks.interface';
13
2
  /**
14
3
  * Custom hook that encapsulates the chart-related functions and their dependencies
15
4
  * @param {Object} chartRef - Chart reference
@@ -19,27 +8,16 @@ interface IUseChartFunctions {
19
8
  * @param {Array} generatedDatasets - Chart datasets
20
9
  * @returns {Object} An object containing the chart-related functions
21
10
  */
22
- export declare const useChartFunctions: ({ chartRef, state, options, dispatch, generatedDatasets, }: IUseChartFunctions) => {
23
- legendClick: (_e: ChartEvent, legendItem: any) => void;
11
+ export declare const useChartFunctions: ({ chartRef, state, options, dispatch, generatedDatasets, }: IHooksInterface) => {
12
+ legendClick: (e: any, legendItem: any) => void;
24
13
  resetZoom: () => void;
25
- onHover: (hoveredPoint: any, setHoveredPoint: any) => (evt: ChartEvent, hoveredItems: ICommonHoveredItems[]) => void;
14
+ onHover: (hoveredPoint: any, setHoveredPoint: any) => (evt: Event, hoveredItems: Array<any>) => void;
26
15
  handleDownload: () => void;
27
16
  handleKeyDown: (evt: any) => void;
28
17
  handleKeyUp: (evt: any) => void;
29
- controlsAxes: {
30
- max?: number | undefined;
31
- min?: number | undefined;
32
- id?: string | undefined;
33
- label?: string | undefined;
34
- unit?: string | import("../line-chart.interface").IUnitOptions | undefined;
35
- axisType?: string | undefined;
36
- }[];
37
- controlsAxesLabels: {
38
- id: string;
39
- label: string;
40
- }[];
18
+ controlsAxes: any;
19
+ controlsAxesLabels: any[];
41
20
  updateAxesRangesFromChart: () => void;
42
21
  onResetAxes: () => void;
43
22
  onUpdateAxes: ({ axes }: any) => void;
44
23
  };
45
- export {};
@@ -0,0 +1,37 @@
1
+ import { ChartHoverMode, Events, PointStyle } from '../../../helpers/enums';
2
+ import { IHooksInterface } from './hooks.interface';
3
+ /**
4
+ * Custom hook to generate chart options.
5
+ * @function
6
+ * @param {Object} chartRef - The chart reference.
7
+ * @param {Object} state - The chart state.
8
+ * @param {Object} options - The chart options.
9
+ * @param {Function} dispatch - The dispatch function for state management.
10
+ * @param {Array} generatedDatasets - The generated datasets.
11
+ * @returns {Object} The chart options object.
12
+ */
13
+ export declare const useChartOptions: ({ chartRef, state, options, dispatch, generatedDatasets, }: IHooksInterface) => {
14
+ layout: {
15
+ padding: any;
16
+ };
17
+ onHover: (evt: Event, hoveredItems: any[]) => void;
18
+ maintainAspectRatio: any;
19
+ aspectRatio: number | null;
20
+ animation: boolean | {
21
+ duration: number;
22
+ onComplete: any;
23
+ };
24
+ hover: {
25
+ mode: ChartHoverMode;
26
+ intersect: boolean;
27
+ };
28
+ elements: {
29
+ line: {
30
+ pointStyle: PointStyle;
31
+ showLine: any;
32
+ };
33
+ };
34
+ scales: any;
35
+ plugins: any;
36
+ events: Events[];
37
+ };
@@ -1,5 +1,4 @@
1
- import { Dispatch } from 'react';
2
- export declare const useToggleHandlers: (dispatch: Dispatch<any>) => {
1
+ export declare const useToggleHandlers: (dispatch: any) => {
3
2
  onToggleLegend: () => void;
4
3
  onToggleLine: () => void;
5
4
  onTogglePan: () => void;
@@ -3,10 +3,10 @@
3
3
  * @param {string} key - The key to access the corresponding value in the config object.
4
4
  * @returns {*} - The value associated with the given key in the config object or config.
5
5
  */
6
- export declare const getConfig: (key?: string) => any;
6
+ export declare const getConfig: any;
7
7
  /**
8
8
  * Set a new value for the given key in the config object.
9
9
  * @param {string} key - The key to access the corresponding value in the config object.
10
10
  * @param {*} newValue - The new value to be set for the given key.
11
11
  */
12
- export declare const setConfig: (key: string, newValue: string | Record<string, string>) => void;
12
+ export declare const setConfig: (key: string, newValue: any) => void;
@@ -1,37 +1,31 @@
1
- import { Dispatch, MouseEventHandler, RefObject } from 'react';
2
- import { Chart, ChartArea } from 'chart.js';
3
- import { IState } from '../state/state.interfaces';
4
- import { ILineChartDataset, ILineChartOptions } from '../line-chart.interface';
5
- import { Position } from '../../common/helpers/enums';
1
+ import { Position } from '../../../helpers/enums';
6
2
  export interface ILegendDropZone {
7
- position: Position;
8
- onDrop: () => void;
9
- placeholderSize?: {
10
- width?: number;
11
- height?: number;
12
- };
3
+ position: string;
4
+ onDrop: () => any;
5
+ placeholderSize: any;
13
6
  }
14
7
  export interface ILegendDropZones {
15
- chartArea: ChartArea;
8
+ chartArea: any;
16
9
  setLegendPosition: (position: Position) => void;
17
- isDragging: boolean;
18
- placeholderSize?: {
19
- width?: number;
20
- height?: number;
10
+ isDragging: any;
11
+ placeholderSize: {
12
+ width: string;
13
+ height: string;
21
14
  };
22
15
  }
23
16
  export interface ILegendItem {
24
17
  hidden: boolean;
25
- dataset: ILineChartDataset;
26
- handleClick: MouseEventHandler<HTMLDivElement>;
18
+ dataset: any;
19
+ handleClick: (e: Event) => any;
27
20
  }
28
21
  export interface ILegend {
29
- chartRef: RefObject<Chart>;
30
- state: IState;
31
- options: ILineChartOptions;
32
- dispatch: Dispatch<any>;
33
- generatedDatasets: ILineChartDataset[];
34
- translations: Record<string, string>;
22
+ chartRef: {
23
+ current: any;
24
+ };
25
+ state: any;
26
+ options: any;
27
+ dispatch: () => any;
28
+ generatedDatasets: any;
35
29
  }
36
30
  export interface ILegendPanel extends ILegend {
37
31
  legendPosition: Position;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { ILegendPanel } from './legend-interface';
3
- declare const LegendPanel: import("react").ForwardRefExoticComponent<ILegendPanel & import("react").RefAttributes<HTMLDivElement>>;
3
+ declare const LegendPanel: React.ForwardRefExoticComponent<ILegendPanel & React.RefAttributes<unknown>>;
4
4
  export default LegendPanel;