@oliasoft-open-source/charts-library 6.1.0 → 7.0.0-beta-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1266 -15
- package/dist/index.js +33 -21
- package/package.json +12 -11
- package/dist/src/components/bar-chart/bar-chart-const.d.ts +0 -2
- package/dist/src/components/bar-chart/bar-chart-default-props.d.ts +0 -3
- package/dist/src/components/bar-chart/bar-chart.d.ts +0 -3
- package/dist/src/components/bar-chart/bar-chart.interface.d.ts +0 -146
- package/dist/src/components/bar-chart/utils/get-bar-chart-data-labels.d.ts +0 -10
- package/dist/src/components/bar-chart/utils/get-bar-chart-scales.d.ts +0 -4
- package/dist/src/components/bar-chart/utils/get-bar-chart-tooltips.d.ts +0 -6
- package/dist/src/components/bar-chart/utils/use-bar-chart-config.d.ts +0 -13
- package/dist/src/components/bar-chart/utils/use-bar-chart-options.d.ts +0 -54
- package/dist/src/components/common/common.interface.d.ts +0 -273
- package/dist/src/components/common/controls-portal.d.ts +0 -7
- package/dist/src/components/common/enums.d.ts +0 -89
- package/dist/src/components/common/helpers/add-transparency/add-transparency.d.ts +0 -1
- package/dist/src/components/common/helpers/callout-helpers/callout-helpers.d.ts +0 -25
- package/dist/src/components/common/helpers/chart-border-plugin.d.ts +0 -16
- package/dist/src/components/common/helpers/chart-consts.d.ts +0 -39
- package/dist/src/components/common/helpers/chart-utils.d.ts +0 -86
- package/dist/src/components/common/helpers/container.d.ts +0 -18
- package/dist/src/components/common/helpers/custom-format-number.d.ts +0 -1
- package/dist/src/components/common/helpers/download-pgn.d.ts +0 -3
- package/dist/src/components/common/helpers/get-cartesian-scale-options.d.ts +0 -28
- package/dist/src/components/common/helpers/get-chart-annotation.d.ts +0 -139
- package/dist/src/components/common/helpers/get-chart-from-ctx.d.ts +0 -1
- package/dist/src/components/common/helpers/get-custom-legend-plugin-example.d.ts +0 -6
- package/dist/src/components/common/helpers/get-draggableData.d.ts +0 -18
- package/dist/src/components/common/helpers/get-grouped-color-scheme/get-grouped-color-scheme.d.ts +0 -1
- package/dist/src/components/common/helpers/input-normalizers.d.ts +0 -15
- package/dist/src/components/common/helpers/range/estimate-data-series-have-close-values.d.ts +0 -8
- package/dist/src/components/common/helpers/range/range.d.ts +0 -33
- package/dist/src/components/common/helpers/text.d.ts +0 -1
- package/dist/src/components/common/helpers/to-annotation.d.ts +0 -4
- package/dist/src/components/common/hooks/use-generated-labels.d.ts +0 -4
- package/dist/src/components/common/hooks/use-legend-state.d.ts +0 -28
- package/dist/src/components/common/hooks/use-legend.d.ts +0 -4
- package/dist/src/components/common/hooks/use-update-annotations.d.ts +0 -4
- package/dist/src/components/common/legend-component/legend-dropzone.d.ts +0 -3
- package/dist/src/components/common/legend-component/legend-interface.d.ts +0 -47
- package/dist/src/components/common/legend-component/legend-item/LegendItemLine.d.ts +0 -5
- package/dist/src/components/common/legend-component/legend-item/legend-item.d.ts +0 -3
- package/dist/src/components/common/legend-component/legend-panel.d.ts +0 -3
- package/dist/src/components/common/legend-component/legend.d.ts +0 -3
- package/dist/src/components/common/legend-component/state/legend-action-types.d.ts +0 -3
- package/dist/src/components/common/legend-component/state/legend-context.d.ts +0 -14
- package/dist/src/components/common/legend-component/state/legend-state-reducer.d.ts +0 -30
- package/dist/src/components/common/legend-component/utils/create-style-object.d.ts +0 -27
- package/dist/src/components/common/legend-component/utils/get-generated-labels.d.ts +0 -2
- package/dist/src/components/common/plugins/annotation-dragger-plugin/annotation-dragger-plugin.d.ts +0 -15
- package/dist/src/components/common/plugins/annotation-dragger-plugin/annotation-position-storage.d.ts +0 -7
- package/dist/src/components/common/plugins/annotation-dragger-plugin/enums.d.ts +0 -21
- package/dist/src/components/common/plugins/annotation-dragger-plugin/event-helpers.d.ts +0 -6
- package/dist/src/components/common/plugins/annotation-dragger-plugin/helpers.d.ts +0 -53
- package/dist/src/components/common/plugins/annotation-dragger-plugin/point-annotation-label.d.ts +0 -5
- package/dist/src/components/common/plugins/ellipsis-annotation-plugin/compute-ellipse-geometry.d.ts +0 -9
- package/dist/src/components/common/plugins/ellipsis-annotation-plugin/ellipsis-annotation-plugin.d.ts +0 -18
- package/dist/src/components/common/plugins/gradient-background-plugin/enums.d.ts +0 -10
- package/dist/src/components/common/plugins/gradient-background-plugin/gradient-background-plugin.d.ts +0 -2
- package/dist/src/components/line-chart/constants/default-translations.d.ts +0 -25
- package/dist/src/components/line-chart/constants/line-chart-consts.d.ts +0 -13
- package/dist/src/components/line-chart/controls/axes-options/axes-options-interfaces.d.ts +0 -57
- package/dist/src/components/line-chart/controls/axes-options/axes-options.d.ts +0 -6
- package/dist/src/components/line-chart/controls/axes-options/axes-validation.d.ts +0 -8
- package/dist/src/components/line-chart/controls/controls-interfaces.d.ts +0 -19
- package/dist/src/components/line-chart/controls/controls.d.ts +0 -3
- package/dist/src/components/line-chart/controls/drag-options-interfaces.d.ts +0 -14
- package/dist/src/components/line-chart/controls/drag-options.d.ts +0 -23
- package/dist/src/components/line-chart/controls/line-options.d.ts +0 -19
- package/dist/src/components/line-chart/hooks/use-chart-functions.d.ts +0 -32
- package/dist/src/components/line-chart/hooks/use-chart-options.d.ts +0 -19
- package/dist/src/components/line-chart/hooks/use-chart-plugins.d.ts +0 -7
- package/dist/src/components/line-chart/hooks/use-chart-state.d.ts +0 -12
- package/dist/src/components/line-chart/hooks/use-toggle-handler.d.ts +0 -12
- package/dist/src/components/line-chart/initialize/config.d.ts +0 -12
- package/dist/src/components/line-chart/initialize/initialize-line-chart.d.ts +0 -12
- package/dist/src/components/line-chart/line-chart-get-default-props.d.ts +0 -3
- package/dist/src/components/line-chart/line-chart.d.ts +0 -3
- package/dist/src/components/line-chart/line-chart.interface.d.ts +0 -241
- package/dist/src/components/line-chart/plugins/callout-plugin/callout-plugin.d.ts +0 -11
- package/dist/src/components/line-chart/plugins/callout-plugin/helpers.d.ts +0 -42
- package/dist/src/components/line-chart/plugins/chart-area-text-plugin.d.ts +0 -17
- package/dist/src/components/line-chart/plugins/line-chart.minor-gridlines-plugin.d.ts +0 -8
- package/dist/src/components/line-chart/plugins/line-markers-plugin/draw.d.ts +0 -39
- package/dist/src/components/line-chart/plugins/line-markers-plugin/line-markers-plugin.d.ts +0 -10
- package/dist/src/components/line-chart/plugins/line-markers-plugin/types.d.ts +0 -109
- package/dist/src/components/line-chart/plugins/line-markers-plugin/utils.d.ts +0 -40
- package/dist/src/components/line-chart/plugins/plugin-constants.d.ts +0 -11
- package/dist/src/components/line-chart/plugins/plugins.interface.d.ts +0 -9
- package/dist/src/components/line-chart/state/action-types.d.ts +0 -12
- package/dist/src/components/line-chart/state/helpers.d.ts +0 -13
- package/dist/src/components/line-chart/state/initial-state.d.ts +0 -11
- package/dist/src/components/line-chart/state/line-chart-reducer.d.ts +0 -2
- package/dist/src/components/line-chart/state/manage-state-in-local-storage.d.ts +0 -15
- package/dist/src/components/line-chart/state/state.interfaces.d.ts +0 -26
- package/dist/src/components/line-chart/utils/axis-formatting/axis-formatting.d.ts +0 -2
- package/dist/src/components/line-chart/utils/axis-scales/axis-scales.d.ts +0 -18
- package/dist/src/components/line-chart/utils/check-custom-option/check-custom-option.d.ts +0 -12
- package/dist/src/components/line-chart/utils/datalabels-alignment/datalabels-alignment.interface.d.ts +0 -20
- package/dist/src/components/line-chart/utils/datalabels-alignment/get-alignment-condition.d.ts +0 -8
- package/dist/src/components/line-chart/utils/datalabels-alignment/get-alignment-data.d.ts +0 -11
- package/dist/src/components/line-chart/utils/datalabels-alignment/get-datalabels-position.d.ts +0 -6
- package/dist/src/components/line-chart/utils/enums.d.ts +0 -4
- package/dist/src/components/line-chart/utils/generate-line-chart-datasets.d.ts +0 -8
- package/dist/src/components/line-chart/utils/get-annotations-data.d.ts +0 -1
- package/dist/src/components/line-chart/utils/get-axes-data-from-metasets.d.ts +0 -1
- package/dist/src/components/line-chart/utils/get-axes-ranges-from-chart.d.ts +0 -9
- package/dist/src/components/line-chart/utils/get-axis-range-by-type.d.ts +0 -10
- package/dist/src/components/line-chart/utils/get-generated-labels.d.ts +0 -2
- package/dist/src/components/line-chart/utils/get-line-chart-data-labels.d.ts +0 -16
- package/dist/src/components/line-chart/utils/get-line-chart-scales.d.ts +0 -5
- package/dist/src/components/line-chart/utils/get-line-chart-tooltips.d.ts +0 -30
- package/dist/src/components/line-chart/utils/line-chart-utils.d.ts +0 -24
- package/dist/src/components/line-chart/utils/translations/get-translations.d.ts +0 -8
- package/dist/src/components/pie-chart/pie-chart-defalut-props.interface.d.ts +0 -50
- package/dist/src/components/pie-chart/pie-chart-get-default-props.d.ts +0 -3
- package/dist/src/components/pie-chart/pie-chart.d.ts +0 -3
- package/dist/src/components/pie-chart/pie-chart.interface.d.ts +0 -85
- package/dist/src/components/pie-chart/use-pie-chart-config.d.ts +0 -42
- package/dist/src/components/scatter-chart/hooks/use-scatter-chart-config.d.ts +0 -69
- package/dist/src/components/scatter-chart/scatter-chart-default-props.interface.d.ts +0 -73
- package/dist/src/components/scatter-chart/scatter-chart-get-default-props.d.ts +0 -4
- package/dist/src/components/scatter-chart/scatter-chart.d.ts +0 -3
- package/dist/src/components/scatter-chart/scatter-chart.interface.d.ts +0 -111
- package/dist/src/components/scatter-chart/utils/get-scales-config.d.ts +0 -5
- package/dist/src/components/scatter-chart/utils/get-tooltip-config.d.ts +0 -21
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
export declare enum LineMarkerSide {
|
|
2
|
-
Left = "left",
|
|
3
|
-
Right = "right"
|
|
4
|
-
}
|
|
5
|
-
export declare enum LineMarkerDirection {
|
|
6
|
-
Vertical = "vertical",
|
|
7
|
-
Horizontal = "horizontal"
|
|
8
|
-
}
|
|
9
|
-
export declare enum LineMarkerLabelPosition {
|
|
10
|
-
Left = "left",
|
|
11
|
-
Right = "right",
|
|
12
|
-
Top = "top",
|
|
13
|
-
Bottom = "bottom",
|
|
14
|
-
OnLine = "onLine"
|
|
15
|
-
}
|
|
16
|
-
export declare enum LineMarkerTextAlign {
|
|
17
|
-
Left = "left",
|
|
18
|
-
Right = "right",
|
|
19
|
-
Center = "center"
|
|
20
|
-
}
|
|
21
|
-
export type TStickSide = LineMarkerSide;
|
|
22
|
-
export type TLineMarkerDirection = LineMarkerDirection;
|
|
23
|
-
export type TLineMarkerLabelPosition = LineMarkerLabelPosition;
|
|
24
|
-
export type TLineMarkerTextAlign = LineMarkerTextAlign;
|
|
25
|
-
export type TLineMarkerTick = {
|
|
26
|
-
enabled?: boolean;
|
|
27
|
-
label?: string | string[];
|
|
28
|
-
color?: string;
|
|
29
|
-
font?: string;
|
|
30
|
-
labelOffsetPx?: number;
|
|
31
|
-
labelPosition?: TLineMarkerLabelPosition;
|
|
32
|
-
side?: TStickSide;
|
|
33
|
-
reverse?: boolean;
|
|
34
|
-
sizePx?: number;
|
|
35
|
-
};
|
|
36
|
-
export type TMarkerExtraItem = {
|
|
37
|
-
id?: string;
|
|
38
|
-
display?: boolean;
|
|
39
|
-
yScaleID?: string;
|
|
40
|
-
yValue?: number;
|
|
41
|
-
value?: number;
|
|
42
|
-
lengthPx?: number;
|
|
43
|
-
side?: TStickSide;
|
|
44
|
-
reverse?: boolean;
|
|
45
|
-
color?: string;
|
|
46
|
-
opacity?: number;
|
|
47
|
-
lineWidth?: number;
|
|
48
|
-
lineDash?: number[];
|
|
49
|
-
tick?: TLineMarkerTick;
|
|
50
|
-
};
|
|
51
|
-
export type TLineMarkerItem = {
|
|
52
|
-
id?: string;
|
|
53
|
-
direction?: TLineMarkerDirection;
|
|
54
|
-
xScaleID?: string;
|
|
55
|
-
yScaleID?: string;
|
|
56
|
-
xValue?: number;
|
|
57
|
-
yValue?: number;
|
|
58
|
-
yStartValue?: number;
|
|
59
|
-
yEndValue?: number;
|
|
60
|
-
xStartValue?: number;
|
|
61
|
-
xEndValue?: number;
|
|
62
|
-
lengthPx?: number;
|
|
63
|
-
value?: number;
|
|
64
|
-
label?: string | string[];
|
|
65
|
-
font?: string;
|
|
66
|
-
labelOffsetPx?: number;
|
|
67
|
-
stickToEdge?: boolean;
|
|
68
|
-
stickToGroup?: boolean;
|
|
69
|
-
stickSide?: TStickSide;
|
|
70
|
-
groupOffsetPx?: number;
|
|
71
|
-
reverse?: boolean;
|
|
72
|
-
color?: string;
|
|
73
|
-
opacity?: number;
|
|
74
|
-
lineWidth?: number;
|
|
75
|
-
lineDash?: number[];
|
|
76
|
-
startTick?: TLineMarkerTick;
|
|
77
|
-
endTick?: TLineMarkerTick;
|
|
78
|
-
extras?: TMarkerExtraItem[];
|
|
79
|
-
display?: boolean;
|
|
80
|
-
};
|
|
81
|
-
export type TLineMarkersOptions = {
|
|
82
|
-
enabled?: boolean;
|
|
83
|
-
itemGapPx?: number;
|
|
84
|
-
edgePaddingPx?: number;
|
|
85
|
-
horizontalLineLengthPx?: number;
|
|
86
|
-
lineDirection?: TLineMarkerDirection;
|
|
87
|
-
labelCollisionPx?: number;
|
|
88
|
-
labelCollisionClusterXPx?: number;
|
|
89
|
-
enableLabelCollisionResolver?: boolean;
|
|
90
|
-
stickToEdge?: boolean;
|
|
91
|
-
stickToGroup?: boolean;
|
|
92
|
-
stickSide?: TStickSide;
|
|
93
|
-
reverse?: boolean;
|
|
94
|
-
xValue?: number;
|
|
95
|
-
yValue?: number;
|
|
96
|
-
yEndValue?: number;
|
|
97
|
-
xStartValue?: number;
|
|
98
|
-
xEndValue?: number;
|
|
99
|
-
lengthPx?: number;
|
|
100
|
-
yStartValue?: number;
|
|
101
|
-
color?: string;
|
|
102
|
-
opacity?: number;
|
|
103
|
-
lineWidth?: number;
|
|
104
|
-
lineDash?: number[];
|
|
105
|
-
startTick?: TLineMarkerTick;
|
|
106
|
-
endTick?: TLineMarkerTick;
|
|
107
|
-
items?: TLineMarkerItem[];
|
|
108
|
-
};
|
|
109
|
-
export type ILineMarkersAnnotation = TLineMarkersOptions;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { Chart, Scale } from 'chart.js';
|
|
2
|
-
import { TStickSide } from './types';
|
|
3
|
-
export declare const isFiniteNumber: (v: unknown) => v is number;
|
|
4
|
-
export declare const asArray: <T>(v: unknown) => T[];
|
|
5
|
-
export declare const asObject: <T extends object>(v: unknown) => T | undefined;
|
|
6
|
-
export declare const getFirstScaleByAxis: (chart: Chart, axis: "x" | "y") => Scale | undefined;
|
|
7
|
-
export declare const resolveScale: (chart: Chart, scaleID: string | undefined, axis: "x" | "y") => Scale | undefined;
|
|
8
|
-
export declare const getPixelForValueSafe: (scale: Scale | undefined, value: unknown) => number | undefined;
|
|
9
|
-
export declare const clamp: (v: number, min: number, max: number) => number;
|
|
10
|
-
export declare const crispLinePx: (v: number) => number;
|
|
11
|
-
export type TChartArea = {
|
|
12
|
-
top: number;
|
|
13
|
-
bottom: number;
|
|
14
|
-
};
|
|
15
|
-
export declare const computeYRange: ({ chartArea, yStartPx, yEndPx, }: {
|
|
16
|
-
chartArea: TChartArea;
|
|
17
|
-
yStartPx?: number;
|
|
18
|
-
yEndPx?: number;
|
|
19
|
-
}) => {
|
|
20
|
-
y1: number;
|
|
21
|
-
y2: number;
|
|
22
|
-
};
|
|
23
|
-
export declare const toLines: (label?: string | string[]) => string[];
|
|
24
|
-
export declare const lineHeightPx: (font: string) => number;
|
|
25
|
-
export type TLabelCollisionItem = {
|
|
26
|
-
id: string;
|
|
27
|
-
side: TStickSide;
|
|
28
|
-
x: number;
|
|
29
|
-
y: number;
|
|
30
|
-
height: number;
|
|
31
|
-
};
|
|
32
|
-
type TResolveLabelCollisionArgs = {
|
|
33
|
-
labels: TLabelCollisionItem[];
|
|
34
|
-
chartTop: number;
|
|
35
|
-
chartBottom: number;
|
|
36
|
-
clusterXPx: number;
|
|
37
|
-
gapPx: number;
|
|
38
|
-
};
|
|
39
|
-
export declare const resolveLabelCollisions: ({ labels, chartTop, chartBottom, clusterXPx, gapPx, }: TResolveLabelCollisionArgs) => Record<string, number>;
|
|
40
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
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";
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Chart } from 'chart.js';
|
|
2
|
-
import { RefObject } from '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
|
-
}[];
|
|
@@ -1,11 +0,0 @@
|
|
|
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;
|
|
@@ -1,15 +0,0 @@
|
|
|
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;
|
|
@@ -1,26 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { ILineChartOptions, TGeneratedLineChartDatasets } from '../../line-chart.interface';
|
|
2
|
-
import { IState } from '../../state/state.interfaces';
|
|
3
|
-
interface IScaleValue {
|
|
4
|
-
min?: number;
|
|
5
|
-
max?: number;
|
|
6
|
-
[key: string]: unknown;
|
|
7
|
-
}
|
|
8
|
-
interface IScales {
|
|
9
|
-
[key: string]: IScaleValue;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Auto scales axis ranges (mix, max) if no explicit range is set
|
|
13
|
-
* - overrides some edge cases not handled well by default chart.js
|
|
14
|
-
* - supports optional padding when `autoAxisPadding` is set
|
|
15
|
-
* - otherwise does not set min/max (falls back to chart.js default)
|
|
16
|
-
*/
|
|
17
|
-
export declare const autoScale: (options: ILineChartOptions, state: IState, generatedDatasets: TGeneratedLineChartDatasets) => IScales;
|
|
18
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
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 {};
|
|
@@ -1,20 +0,0 @@
|
|
|
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 {};
|
package/dist/src/components/line-chart/utils/datalabels-alignment/get-alignment-condition.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
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
|
-
};
|
package/dist/src/components/line-chart/utils/datalabels-alignment/get-datalabels-position.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { AlignOptions } from '../../../common/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;
|
|
@@ -1,8 +0,0 @@
|
|
|
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;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export function getAnnotationsData(data: any[]): Object;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export function getAxesDataFromMetasets(generatedDatasets: any, scalesKeys: any, annotationsData: any): any;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Chart } from 'chart.js';
|
|
2
|
-
import { RefObject } from 'react';
|
|
3
|
-
import { ILineChartAxes } from '../line-chart.interface';
|
|
4
|
-
export declare const getAxesRangesFromChart: (chartRef: RefObject<Chart>, axes: ILineChartAxes) => {
|
|
5
|
-
unit?: string | import('../line-chart.interface').IUnitOptions | undefined;
|
|
6
|
-
id: string;
|
|
7
|
-
min: number;
|
|
8
|
-
max: number;
|
|
9
|
-
}[];
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { RefObject } from '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 {};
|
|
@@ -1,16 +0,0 @@
|
|
|
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/enums").AlignOptions.End | import("../../common/enums").AlignOptions.Start | import("../../common/enums").AlignOptions.Right | import("../../common/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;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { IState } from '../state/state.interfaces';
|
|
2
|
-
import { ILineChartOptions } from '../line-chart.interface';
|
|
3
|
-
import { ICommonScaleOptions } from '../../common/common.interface';
|
|
4
|
-
declare const getLineChartScales: (options: ILineChartOptions, state: IState) => Record<string, ICommonScaleOptions>;
|
|
5
|
-
export default getLineChartScales;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { TooltipItem } from 'chart.js';
|
|
2
|
-
import { ChartHoverMode } from '../../common/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
|
-
mode?: undefined;
|
|
9
|
-
intersect?: undefined;
|
|
10
|
-
padding?: undefined;
|
|
11
|
-
usePointStyle?: undefined;
|
|
12
|
-
boxWidth?: undefined;
|
|
13
|
-
boxHeight?: undefined;
|
|
14
|
-
boxPadding?: undefined;
|
|
15
|
-
} | {
|
|
16
|
-
enabled: boolean | undefined;
|
|
17
|
-
mode: ChartHoverMode;
|
|
18
|
-
intersect: boolean;
|
|
19
|
-
padding: number;
|
|
20
|
-
usePointStyle: boolean;
|
|
21
|
-
boxWidth: number;
|
|
22
|
-
boxHeight: number;
|
|
23
|
-
boxPadding: number;
|
|
24
|
-
callbacks: {
|
|
25
|
-
title: ((...args: unknown[]) => unknown) | ((tooltipItem: TooltipItem<any>[]) => string);
|
|
26
|
-
label: ((...args: unknown[]) => unknown) | ((tooltipItem: TooltipItem<any>) => string);
|
|
27
|
-
afterLabel: ((...args: unknown[]) => unknown) | ((tooltipItem: Record<string, any>) => string);
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
export default getLineChartToolTips;
|
|
@@ -1,24 +0,0 @@
|
|
|
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;
|
|
@@ -1,8 +0,0 @@
|
|
|
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>>) => {};
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { ChartEvent } from 'chart.js';
|
|
2
|
-
import { ICommonTooltip } from '../common/common.interface';
|
|
3
|
-
import { AlignOptions, Position } from '../common/enums';
|
|
4
|
-
import { IPieChartDataset, IPieOptions } from './pie-chart.interface';
|
|
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 {};
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { DeepPartial, IChartDataLabelsOptions, IChartGeneratedLabel, IChartLegendItemFilter, ICommonChartOptions, ICommonData, ICommonDataValue, ICommonDataset, ICommonLegend, ICommonOptions, ICommonStyling, ICommonTooltip } from '../common/common.interface';
|
|
2
|
-
export interface IPieLegend extends ICommonLegend {
|
|
3
|
-
useDataset?: boolean;
|
|
4
|
-
}
|
|
5
|
-
export interface IPieGraph {
|
|
6
|
-
showDataLabels?: boolean;
|
|
7
|
-
stacked?: boolean;
|
|
8
|
-
cutout?: number | string;
|
|
9
|
-
}
|
|
10
|
-
export interface IPieOptions extends ICommonOptions {
|
|
11
|
-
graph?: IPieGraph;
|
|
12
|
-
legend?: IPieLegend;
|
|
13
|
-
axes?: unknown;
|
|
14
|
-
[key: string]: unknown;
|
|
15
|
-
}
|
|
16
|
-
export interface IPieDataValue extends ICommonDataValue {
|
|
17
|
-
label: string;
|
|
18
|
-
borderWidth: string | number;
|
|
19
|
-
value: number;
|
|
20
|
-
backgroundColor?: string | string[];
|
|
21
|
-
borderColor?: string;
|
|
22
|
-
labels: string[];
|
|
23
|
-
}
|
|
24
|
-
export interface IPieChartDataset extends ICommonDataset {
|
|
25
|
-
data: IPieDataValue[];
|
|
26
|
-
hideLegend?: boolean;
|
|
27
|
-
}
|
|
28
|
-
export interface IPieData {
|
|
29
|
-
labels?: string[];
|
|
30
|
-
datasets?: IPieChartDataset[];
|
|
31
|
-
xUnit?: string;
|
|
32
|
-
yUnit?: string;
|
|
33
|
-
}
|
|
34
|
-
export interface IPieChartData extends ICommonData {
|
|
35
|
-
data: IPieData;
|
|
36
|
-
options: IPieOptions;
|
|
37
|
-
}
|
|
38
|
-
export type IPieOptionsInput = Omit<DeepPartial<IPieOptions>, 'title' | 'graph' | 'legend' | 'chartStyling' | 'tooltip' | 'chartOptions' | 'interactions'> & {
|
|
39
|
-
[key: string]: unknown;
|
|
40
|
-
title?: unknown;
|
|
41
|
-
graph?: DeepPartial<IPieGraph>;
|
|
42
|
-
legend?: Omit<DeepPartial<IPieLegend>, 'position' | 'align'> & {
|
|
43
|
-
position?: string;
|
|
44
|
-
align?: string;
|
|
45
|
-
[key: string]: unknown;
|
|
46
|
-
};
|
|
47
|
-
chartStyling?: DeepPartial<ICommonStyling> & {
|
|
48
|
-
[key: string]: unknown;
|
|
49
|
-
};
|
|
50
|
-
tooltip?: DeepPartial<ICommonTooltip>;
|
|
51
|
-
chartOptions?: DeepPartial<ICommonChartOptions>;
|
|
52
|
-
interactions?: DeepPartial<ICommonOptions['interactions']> & {
|
|
53
|
-
[key: string]: unknown;
|
|
54
|
-
};
|
|
55
|
-
};
|
|
56
|
-
export interface IPieChartDataInput extends Omit<IPieChartData, 'data' | 'options'> {
|
|
57
|
-
data?: Omit<DeepPartial<IPieChartData['data']>, 'datasets'> & {
|
|
58
|
-
datasets?: Array<(Omit<DeepPartial<IPieChartDataset>, 'data'> & {
|
|
59
|
-
data?: Array<DeepPartial<IPieDataValue> | number>;
|
|
60
|
-
[key: string]: unknown;
|
|
61
|
-
}) | object | null>;
|
|
62
|
-
};
|
|
63
|
-
options?: IPieOptionsInput;
|
|
64
|
-
}
|
|
65
|
-
export interface IPieChartProps {
|
|
66
|
-
chart: IPieChartDataInput;
|
|
67
|
-
testId?: string | null;
|
|
68
|
-
}
|
|
69
|
-
export type IPieGeneratedLabel = IChartGeneratedLabel;
|
|
70
|
-
export type IPieLegendItemFilter = IChartLegendItemFilter;
|
|
71
|
-
export type IPiesDataLabelsOptions = IChartDataLabelsOptions;
|
|
72
|
-
export interface IGeneratedPieChartDataset {
|
|
73
|
-
label: string;
|
|
74
|
-
backgroundColor: string[];
|
|
75
|
-
borderColor: string;
|
|
76
|
-
borderWidth: number;
|
|
77
|
-
borderDash: number[];
|
|
78
|
-
annotationType?: string;
|
|
79
|
-
data: IPieDataValue[];
|
|
80
|
-
hideLegend?: boolean;
|
|
81
|
-
displayGroup?: string | number;
|
|
82
|
-
isAnnotation?: boolean;
|
|
83
|
-
annotationIndex?: number;
|
|
84
|
-
}
|
|
85
|
-
export type TGeneratedPieChartDatasets = IGeneratedPieChartDataset[];
|