@oliasoft-open-source/charts-library 6.0.0 → 7.0.0-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.
- package/dist/index.d.ts +1266 -15
- package/dist/index.js +327 -303
- package/package.json +21 -20
- 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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oliasoft-open-source/charts-library",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0-beta-1",
|
|
4
4
|
"description": "React Chart Library (based on Chart.js and react-chart-js-2)",
|
|
5
5
|
"homepage": "https://gitlab.com/oliasoft-open-source/charts-library",
|
|
6
6
|
"bugs": {
|
|
@@ -41,17 +41,18 @@
|
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@dnd-kit/sortable": "^10.0.0",
|
|
44
|
+
"@microsoft/api-extractor": "^7.59.0",
|
|
44
45
|
"@oliasoft-open-source/react-ui-library": "^7.2.0",
|
|
45
46
|
"@oliasoft-open-source/units": "^5.6.0",
|
|
46
|
-
"@storybook/addon-docs": "^10.
|
|
47
|
-
"@storybook/addon-themes": "^10.
|
|
48
|
-
"@storybook/react-vite": "^10.
|
|
47
|
+
"@storybook/addon-docs": "^10.5.10",
|
|
48
|
+
"@storybook/addon-themes": "^10.5.10",
|
|
49
|
+
"@storybook/react-vite": "^10.5.10",
|
|
49
50
|
"@types/node": "^22.15.17",
|
|
50
51
|
"@types/object-hash": "^3.0.6",
|
|
51
|
-
"@types/react": "^
|
|
52
|
-
"@types/react-dom": "^
|
|
53
|
-
"@vitejs/plugin-react": "^6.0
|
|
54
|
-
"@vitest/coverage-v8": "4.1.
|
|
52
|
+
"@types/react": "^19.2.18",
|
|
53
|
+
"@types/react-dom": "^19.2.5",
|
|
54
|
+
"@vitejs/plugin-react": "^6.1.0",
|
|
55
|
+
"@vitest/coverage-v8": "^4.1.11",
|
|
55
56
|
"classnames": "^2.5.1",
|
|
56
57
|
"es-toolkit": "^1.44.0",
|
|
57
58
|
"http-server": "^14.1.1",
|
|
@@ -61,17 +62,17 @@
|
|
|
61
62
|
"less": "^4.3.0",
|
|
62
63
|
"lint-staged": "^15.5.2",
|
|
63
64
|
"normalize.css": "^8.0.1",
|
|
64
|
-
"oxfmt": "^0.
|
|
65
|
-
"oxlint": "^1.
|
|
66
|
-
"react": "^
|
|
67
|
-
"react-dom": "^
|
|
68
|
-
"storybook": "^10.
|
|
65
|
+
"oxfmt": "^0.64.0",
|
|
66
|
+
"oxlint": "^1.79.0",
|
|
67
|
+
"react": "^19.2.8",
|
|
68
|
+
"react-dom": "^19.2.8",
|
|
69
|
+
"storybook": "^10.5.10",
|
|
69
70
|
"typescript": "^6.0.3",
|
|
70
|
-
"vite": "8.
|
|
71
|
-
"vite-plugin-css-injected-by-js": "^5.0.
|
|
72
|
-
"vite-plugin-dts": "^5.0.
|
|
71
|
+
"vite": "^8.2.2",
|
|
72
|
+
"vite-plugin-css-injected-by-js": "^5.0.2",
|
|
73
|
+
"vite-plugin-dts": "^5.0.3",
|
|
73
74
|
"vite-plugin-svgr": "^5.2.0",
|
|
74
|
-
"vitest": "^4.1.
|
|
75
|
+
"vitest": "^4.1.11",
|
|
75
76
|
"node": "runtime:26.6.0"
|
|
76
77
|
},
|
|
77
78
|
"peerDependencies": {
|
|
@@ -80,12 +81,12 @@
|
|
|
80
81
|
"classnames": "^2.5.1",
|
|
81
82
|
"es-toolkit": "^1",
|
|
82
83
|
"immer": "^9 || ^10",
|
|
83
|
-
"react": "^
|
|
84
|
-
"react-dom": "^
|
|
84
|
+
"react": "^19",
|
|
85
|
+
"react-dom": "^19"
|
|
85
86
|
},
|
|
86
87
|
"lint-staged": {
|
|
87
88
|
"*": [
|
|
88
|
-
"oxlint
|
|
89
|
+
"oxlint --fix --no-error-on-unmatched-pattern",
|
|
89
90
|
"oxfmt --no-error-on-unmatched-pattern"
|
|
90
91
|
]
|
|
91
92
|
},
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { IBarChartProps, IBarDefaultProps, IBarOptionsInput } from './bar-chart.interface';
|
|
2
|
-
export declare const normalizeBarOptions: (options?: IBarOptionsInput) => IBarDefaultProps["options"];
|
|
3
|
-
export declare const getDefaultProps: (props: IBarChartProps) => IBarDefaultProps;
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
import { ChartDataset } from 'chart.js';
|
|
2
|
-
import { DeepPartial, ICommonAdditionalAxesOptions, ICommonAnnotations, ICommonAnnotationsData, ICommonAxis, ICommonChartOptions, ICommonCustomLegend, ICommonData, ICommonDataset, ICommonDataValue, ICommonDragData, ICommonGraph, ICommonInteractions, ICommonLegend, ICommonOptions, ICommonScales, ICommonStyling, ICommonTooltip } from '../common/common.interface';
|
|
3
|
-
import { IChartGraph } from '../common/helpers/chart-utils';
|
|
4
|
-
import { ChartType } from '../common/enums';
|
|
5
|
-
export interface IBarStyling extends ICommonStyling {
|
|
6
|
-
squareAspectRatio?: boolean;
|
|
7
|
-
layoutPadding?: string | number | {
|
|
8
|
-
top: number;
|
|
9
|
-
bottom: number;
|
|
10
|
-
left: number;
|
|
11
|
-
right: number;
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
export interface IBarLegend extends ICommonLegend {
|
|
15
|
-
customLegend?: ICommonCustomLegend<any>;
|
|
16
|
-
}
|
|
17
|
-
export interface IBarAxes {
|
|
18
|
-
x: ICommonAxis<'top' | 'bottom'>[];
|
|
19
|
-
y: ICommonAxis<'left' | 'right'>[];
|
|
20
|
-
[key: string]: ICommonAxis[];
|
|
21
|
-
}
|
|
22
|
-
export interface IBarAdditionalAxesOptions extends ICommonAdditionalAxesOptions {
|
|
23
|
-
stackedX?: boolean;
|
|
24
|
-
stackedY?: boolean;
|
|
25
|
-
}
|
|
26
|
-
export interface IBarOptions extends ICommonOptions {
|
|
27
|
-
direction?: 'vertical' | 'horizontal';
|
|
28
|
-
axes: IBarAxes;
|
|
29
|
-
scales?: ICommonScales;
|
|
30
|
-
additionalAxesOptions?: IBarAdditionalAxesOptions;
|
|
31
|
-
chartStyling: IBarStyling;
|
|
32
|
-
graph?: ICommonGraph;
|
|
33
|
-
annotations?: ICommonAnnotations;
|
|
34
|
-
legend?: IBarLegend;
|
|
35
|
-
dragData?: ICommonDragData;
|
|
36
|
-
}
|
|
37
|
-
export interface IBarChartDataset extends ICommonDataset {
|
|
38
|
-
isAnnotation?: boolean;
|
|
39
|
-
annotationIndex?: number;
|
|
40
|
-
borderSkipped?: boolean;
|
|
41
|
-
borderRadius?: number;
|
|
42
|
-
xAxisID?: string;
|
|
43
|
-
yAxisID?: string;
|
|
44
|
-
hidden?: boolean;
|
|
45
|
-
displayGroup?: string | number;
|
|
46
|
-
type?: ChartType.BAR;
|
|
47
|
-
}
|
|
48
|
-
export interface IBarChartBaseData {
|
|
49
|
-
labels: string[];
|
|
50
|
-
datasets: IBarChartDataset[];
|
|
51
|
-
}
|
|
52
|
-
export interface IBarChartData extends ICommonData {
|
|
53
|
-
testId?: string;
|
|
54
|
-
controlsPortalId?: string;
|
|
55
|
-
data: IBarChartBaseData;
|
|
56
|
-
options: IBarOptions;
|
|
57
|
-
}
|
|
58
|
-
type ILooseBarAxis = Omit<DeepPartial<ICommonAxis<string>>, 'gridLines'> & {
|
|
59
|
-
[key: string]: unknown;
|
|
60
|
-
gridLines?: unknown;
|
|
61
|
-
};
|
|
62
|
-
type ILooseBarAnnotation = Omit<DeepPartial<ICommonAnnotationsData>, 'annotationAxis'> & {
|
|
63
|
-
[key: string]: unknown;
|
|
64
|
-
annotationAxis?: string;
|
|
65
|
-
type?: string;
|
|
66
|
-
value?: number | string | null;
|
|
67
|
-
};
|
|
68
|
-
export type IBarOptionsInput = Omit<DeepPartial<IBarOptions>, 'title' | 'direction' | 'axes' | 'legend' | 'chartStyling' | 'interactions' | 'annotations' | 'additionalAxesOptions' | 'scales'> & {
|
|
69
|
-
[key: string]: unknown;
|
|
70
|
-
title?: unknown;
|
|
71
|
-
direction?: string;
|
|
72
|
-
axes?: {
|
|
73
|
-
x?: ILooseBarAxis[];
|
|
74
|
-
y?: ILooseBarAxis[];
|
|
75
|
-
[key: string]: ILooseBarAxis[] | undefined;
|
|
76
|
-
};
|
|
77
|
-
legend?: Omit<DeepPartial<IBarLegend>, 'position' | 'align'> & {
|
|
78
|
-
position?: string;
|
|
79
|
-
align?: string;
|
|
80
|
-
[key: string]: unknown;
|
|
81
|
-
};
|
|
82
|
-
chartStyling?: DeepPartial<IBarStyling> & {
|
|
83
|
-
hideControls?: boolean;
|
|
84
|
-
minHeight?: number | string;
|
|
85
|
-
[key: string]: unknown;
|
|
86
|
-
};
|
|
87
|
-
additionalAxesOptions?: Omit<DeepPartial<IBarAdditionalAxesOptions>, 'chartScaleType'> & {
|
|
88
|
-
chartScaleType?: string;
|
|
89
|
-
[key: string]: unknown;
|
|
90
|
-
};
|
|
91
|
-
scales?: Record<string, unknown>;
|
|
92
|
-
interactions?: DeepPartial<ICommonInteractions> & {
|
|
93
|
-
enableZoom?: boolean;
|
|
94
|
-
enablePan?: boolean;
|
|
95
|
-
[key: string]: unknown;
|
|
96
|
-
};
|
|
97
|
-
annotations?: (Omit<DeepPartial<ICommonAnnotations>, 'annotationsData'> & {
|
|
98
|
-
annotationsData?: ILooseBarAnnotation[];
|
|
99
|
-
}) | null;
|
|
100
|
-
};
|
|
101
|
-
export interface IBarChartDataInput extends Omit<IBarChartData, 'options' | 'data'> {
|
|
102
|
-
data?: Omit<DeepPartial<IBarChartData['data']>, 'datasets'> & {
|
|
103
|
-
datasets?: Array<DeepPartial<IBarChartDataset> | object | null>;
|
|
104
|
-
};
|
|
105
|
-
options?: IBarOptionsInput;
|
|
106
|
-
}
|
|
107
|
-
export interface IBarChartProps {
|
|
108
|
-
chart: IBarChartDataInput;
|
|
109
|
-
}
|
|
110
|
-
export interface IBarDefaultProps {
|
|
111
|
-
testId: string;
|
|
112
|
-
controlsPortalId: string;
|
|
113
|
-
data: IBarChartBaseData;
|
|
114
|
-
options: {
|
|
115
|
-
title?: string | string[];
|
|
116
|
-
direction: 'vertical' | 'horizontal';
|
|
117
|
-
axes: IBarAxes;
|
|
118
|
-
additionalAxesOptions: IBarAdditionalAxesOptions;
|
|
119
|
-
chartStyling: IBarStyling;
|
|
120
|
-
tooltip: ICommonTooltip;
|
|
121
|
-
graph: IChartGraph;
|
|
122
|
-
scales?: ICommonScales;
|
|
123
|
-
annotations: {
|
|
124
|
-
showAnnotations: boolean;
|
|
125
|
-
controlAnnotation: boolean;
|
|
126
|
-
annotationsData: ICommonAnnotationsData[];
|
|
127
|
-
};
|
|
128
|
-
legend: IBarLegend;
|
|
129
|
-
chartOptions: ICommonChartOptions;
|
|
130
|
-
interactions: ICommonInteractions;
|
|
131
|
-
dragData: ICommonDragData;
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
export interface IGenerateBarChartDataset extends ChartDataset<'bar', ICommonDataValue[]> {
|
|
135
|
-
borderColor: string;
|
|
136
|
-
backgroundColor: string | string[];
|
|
137
|
-
borderDash?: number[];
|
|
138
|
-
borderWidth?: number;
|
|
139
|
-
annotationType?: string;
|
|
140
|
-
hideLegend?: boolean;
|
|
141
|
-
displayGroup?: string | number;
|
|
142
|
-
isAnnotation?: boolean;
|
|
143
|
-
annotationIndex?: number;
|
|
144
|
-
}
|
|
145
|
-
export type TGenerateBarChartDatasets = IGenerateBarChartDataset[];
|
|
146
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { IBarOptions } from '../bar-chart.interface.ts';
|
|
2
|
-
type ExtendedDisplayOptions = 'auto' | boolean;
|
|
3
|
-
export interface IExtendedDataLabelsOptions {
|
|
4
|
-
display: ExtendedDisplayOptions;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* Returns the data labels configuration for a bar chart.
|
|
8
|
-
*/
|
|
9
|
-
declare const getBarChartDataLabels: (options: IBarOptions) => IExtendedDataLabelsOptions;
|
|
10
|
-
export default getBarChartDataLabels;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { RefObject } from 'react';
|
|
2
|
-
import { ActiveElement, Chart, ChartEvent } from 'chart.js';
|
|
3
|
-
import { IBarDefaultProps, IBarOptions, TGenerateBarChartDatasets } from '../bar-chart.interface';
|
|
4
|
-
import { ICommonHoveredItems } from '../../common/common.interface';
|
|
5
|
-
export interface IGenerateBarChartDatasetsProps {
|
|
6
|
-
datasets: TGenerateBarChartDatasets;
|
|
7
|
-
options: IBarOptions;
|
|
8
|
-
}
|
|
9
|
-
export declare const useBarChartConfig: (_chartRef: RefObject<Chart>, chart: IBarDefaultProps) => {
|
|
10
|
-
generatedDatasets: TGenerateBarChartDatasets;
|
|
11
|
-
onClick: (_evt: ChartEvent, _elements: ActiveElement[], chartInstance: Chart) => void;
|
|
12
|
-
onHover: (evt: ChartEvent, hoveredItems: ICommonHoveredItems[]) => void;
|
|
13
|
-
};
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { MutableRefObject } from 'react';
|
|
2
|
-
import { AnimationSpec, Chart } from 'chart.js';
|
|
3
|
-
import { AxisType, ChartHoverMode } from '../../common/enums';
|
|
4
|
-
import { IBarDefaultProps } from '../bar-chart.interface';
|
|
5
|
-
export interface IUseBarChartOptionsProps {
|
|
6
|
-
chart: IBarDefaultProps;
|
|
7
|
-
chartRef: MutableRefObject<Chart | null>;
|
|
8
|
-
}
|
|
9
|
-
export declare const getBarChartAnimation: (performanceMode?: boolean) => false | Partial<AnimationSpec<"bar">>;
|
|
10
|
-
export declare const useBarChartOptions: ({ chart, chartRef }: IUseBarChartOptionsProps) => {
|
|
11
|
-
onClick: (_evt: import('chart.js').ChartEvent, _elements: import('chart.js').ActiveElement[], chartInstance: Chart) => void;
|
|
12
|
-
onHover: (evt: import('chart.js').ChartEvent, hoveredItems: import('../../common/common.interface').ICommonHoveredItems[]) => void;
|
|
13
|
-
indexAxis: AxisType;
|
|
14
|
-
maintainAspectRatio: boolean | undefined;
|
|
15
|
-
animation: false | Partial<AnimationSpec<"bar">>;
|
|
16
|
-
hover: {
|
|
17
|
-
mode: ChartHoverMode;
|
|
18
|
-
intersect: boolean;
|
|
19
|
-
};
|
|
20
|
-
scales: Record<string, import('../../common/common.interface').ICommonScaleOptions>;
|
|
21
|
-
plugins: {
|
|
22
|
-
title: {
|
|
23
|
-
display: boolean;
|
|
24
|
-
text: string | string[];
|
|
25
|
-
} | {
|
|
26
|
-
display?: undefined;
|
|
27
|
-
text?: undefined;
|
|
28
|
-
};
|
|
29
|
-
datalabels: import('./get-bar-chart-data-labels').IExtendedDataLabelsOptions;
|
|
30
|
-
annotation: {
|
|
31
|
-
annotations: {};
|
|
32
|
-
};
|
|
33
|
-
tooltip: Record<string, any>;
|
|
34
|
-
legend: {
|
|
35
|
-
display: boolean;
|
|
36
|
-
events: never[];
|
|
37
|
-
position: any;
|
|
38
|
-
align: "center" | "start" | "end";
|
|
39
|
-
labels: {
|
|
40
|
-
boxHeight: number;
|
|
41
|
-
boxWidth: number | undefined;
|
|
42
|
-
usePointStyle: boolean | undefined;
|
|
43
|
-
};
|
|
44
|
-
onClick: (_: import('../../common/common.interface').UnusedParameter, legendItem: import('chart.js').LegendItem) => void;
|
|
45
|
-
};
|
|
46
|
-
customLegendPlugin: {
|
|
47
|
-
htmlLegend: any;
|
|
48
|
-
};
|
|
49
|
-
chartAreaBorder: {
|
|
50
|
-
borderColor: string;
|
|
51
|
-
};
|
|
52
|
-
dragData: false | object | import('../../common/helpers/get-draggableData').IDraggableData | undefined;
|
|
53
|
-
};
|
|
54
|
-
};
|
|
@@ -1,273 +0,0 @@
|
|
|
1
|
-
import { ChartEvent, ChartTypeRegistry, Plugin, ScaleOptions } from 'chart.js';
|
|
2
|
-
import { LabelOptions } from 'chartjs-plugin-annotation';
|
|
3
|
-
import { GradientDirection } from './plugins/gradient-background-plugin/enums';
|
|
4
|
-
import { AnnotationType as DraggableAnnotationType, DragAxis } from './plugins/annotation-dragger-plugin/enums';
|
|
5
|
-
import { AlignOptions, Position } from './enums';
|
|
6
|
-
import { ILineMarkersAnnotation } from '../line-chart/plugins/line-markers-plugin/types';
|
|
7
|
-
export type TAxisPosition = 'top' | 'bottom' | 'left' | 'right';
|
|
8
|
-
export type DeepPartial<T> = T extends (...args: any[]) => any ? T : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends object ? {
|
|
9
|
-
[K in keyof T]?: DeepPartial<T[K]>;
|
|
10
|
-
} : T;
|
|
11
|
-
export interface ICommonDataValue {
|
|
12
|
-
x: number | string;
|
|
13
|
-
y: number | string;
|
|
14
|
-
label?: string;
|
|
15
|
-
}
|
|
16
|
-
export interface ICommonDataset {
|
|
17
|
-
label?: string;
|
|
18
|
-
borderColor?: string;
|
|
19
|
-
backgroundColor?: string | string[];
|
|
20
|
-
borderWidth?: number;
|
|
21
|
-
data: ICommonDataValue[];
|
|
22
|
-
hidden?: boolean;
|
|
23
|
-
}
|
|
24
|
-
export type ICommonScaleOptions = ScaleOptions<'category'> | ScaleOptions<'linear'> | ScaleOptions<'logarithmic'> | ScaleOptions<'time'> | ScaleOptions<'timeseries'>;
|
|
25
|
-
export type ICommonScales = Partial<Record<string, ICommonScaleOptions>>;
|
|
26
|
-
export interface ICommonAnnotationElement {
|
|
27
|
-
id?: string;
|
|
28
|
-
display: boolean;
|
|
29
|
-
annotationIndex: number;
|
|
30
|
-
label: {
|
|
31
|
-
options: LabelOptions;
|
|
32
|
-
content: string;
|
|
33
|
-
};
|
|
34
|
-
options: {
|
|
35
|
-
id?: string;
|
|
36
|
-
scaleID?: string;
|
|
37
|
-
borderColor?: string;
|
|
38
|
-
borderWidth?: number;
|
|
39
|
-
radius?: number;
|
|
40
|
-
label?: {
|
|
41
|
-
content?: string;
|
|
42
|
-
position?: string;
|
|
43
|
-
enabled?: boolean;
|
|
44
|
-
xAdjust?: number;
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
export interface ICoordinates {
|
|
49
|
-
x: number;
|
|
50
|
-
y: number;
|
|
51
|
-
}
|
|
52
|
-
export interface ICalloutLabelConfig {
|
|
53
|
-
enabled?: boolean;
|
|
54
|
-
color?: string;
|
|
55
|
-
font?: string;
|
|
56
|
-
borderColor?: string;
|
|
57
|
-
strokeStyle?: string;
|
|
58
|
-
lineWidth?: number;
|
|
59
|
-
startOffset?: number;
|
|
60
|
-
endOffset?: number;
|
|
61
|
-
margin?: number;
|
|
62
|
-
xValue?: number;
|
|
63
|
-
yValue?: number;
|
|
64
|
-
xAdjust?: number;
|
|
65
|
-
yAdjust?: number;
|
|
66
|
-
onDragStart?: (coordinates: ICoordinates, annotation: ICommonAnnotationsData) => void;
|
|
67
|
-
onDrag?: (coordinates: ICoordinates, annotation: ICommonAnnotationsData) => void;
|
|
68
|
-
onDragEnd?: (coordinates: ICoordinates, annotation: ICommonAnnotationsData) => void;
|
|
69
|
-
}
|
|
70
|
-
export interface IAnnotationLabelConfig {
|
|
71
|
-
backgroundColor?: string;
|
|
72
|
-
display?: boolean;
|
|
73
|
-
position?: string;
|
|
74
|
-
color?: string;
|
|
75
|
-
font?: string;
|
|
76
|
-
borderColor?: string;
|
|
77
|
-
callout?: Record<string, unknown>;
|
|
78
|
-
[key: string]: unknown;
|
|
79
|
-
}
|
|
80
|
-
export interface ICommonAnnotationsData {
|
|
81
|
-
display?: boolean;
|
|
82
|
-
hideLegend?: boolean;
|
|
83
|
-
labelOffsetPx?: number;
|
|
84
|
-
id?: string;
|
|
85
|
-
adjustScaleRange?: boolean;
|
|
86
|
-
annotationAxis?: 'x' | 'y';
|
|
87
|
-
rotation?: number;
|
|
88
|
-
color?: string;
|
|
89
|
-
endValue?: number;
|
|
90
|
-
borderWidth?: number;
|
|
91
|
-
backgroundColor?: string;
|
|
92
|
-
label?: string;
|
|
93
|
-
labelConfig?: IAnnotationLabelConfig;
|
|
94
|
-
type?: DraggableAnnotationType;
|
|
95
|
-
value?: number;
|
|
96
|
-
xMin?: number;
|
|
97
|
-
xMax?: number;
|
|
98
|
-
yMin?: number;
|
|
99
|
-
yMax?: number;
|
|
100
|
-
xValue?: number;
|
|
101
|
-
yValue?: number;
|
|
102
|
-
radius?: number;
|
|
103
|
-
enableDrag?: boolean;
|
|
104
|
-
onDragStart?: (coordinates: ICoordinates, annotation: ICommonAnnotationsData) => void;
|
|
105
|
-
onDrag?: (coordinates: ICoordinates, annotation: ICommonAnnotationsData) => void;
|
|
106
|
-
onDragEnd?: (coordinates: ICoordinates, annotation: ICommonAnnotationsData) => void;
|
|
107
|
-
dragAxis?: DragAxis;
|
|
108
|
-
pointStyle?: string;
|
|
109
|
-
resizable?: boolean;
|
|
110
|
-
dragRange?: {
|
|
111
|
-
x?: [number, number];
|
|
112
|
-
y?: [number, number];
|
|
113
|
-
};
|
|
114
|
-
displayDragCoordinates?: boolean;
|
|
115
|
-
xScaleID?: string;
|
|
116
|
-
yScaleID?: string;
|
|
117
|
-
opacity?: number;
|
|
118
|
-
}
|
|
119
|
-
export interface ICommonGradientColor {
|
|
120
|
-
offset: number;
|
|
121
|
-
color: string;
|
|
122
|
-
}
|
|
123
|
-
export interface ICommonGradient {
|
|
124
|
-
display: boolean;
|
|
125
|
-
gradientColors?: ICommonGradientColor[];
|
|
126
|
-
direction?: GradientDirection;
|
|
127
|
-
}
|
|
128
|
-
export interface ICommonStyling {
|
|
129
|
-
width?: number | string;
|
|
130
|
-
height?: number | string;
|
|
131
|
-
maintainAspectRatio?: boolean;
|
|
132
|
-
staticChartHeight?: boolean;
|
|
133
|
-
performanceMode?: boolean;
|
|
134
|
-
gradient?: ICommonGradient;
|
|
135
|
-
}
|
|
136
|
-
export interface ICommonLegend {
|
|
137
|
-
display: boolean;
|
|
138
|
-
position?: Position;
|
|
139
|
-
align?: AlignOptions;
|
|
140
|
-
}
|
|
141
|
-
export interface ICommonTooltipCallbacks {
|
|
142
|
-
title?: (...args: unknown[]) => unknown;
|
|
143
|
-
label?: (...args: unknown[]) => unknown;
|
|
144
|
-
afterLabel?: (...args: unknown[]) => unknown;
|
|
145
|
-
}
|
|
146
|
-
export interface ICommonTooltip {
|
|
147
|
-
tooltips?: boolean;
|
|
148
|
-
showLabelsInTooltips?: boolean;
|
|
149
|
-
scientificNotation?: boolean;
|
|
150
|
-
callbacks?: ICommonTooltipCallbacks;
|
|
151
|
-
}
|
|
152
|
-
export interface ICommonAdditionalAxesOptions {
|
|
153
|
-
chartScaleType?: 'linear' | 'logarithmic' | 'time' | 'timeseries';
|
|
154
|
-
reverse?: boolean;
|
|
155
|
-
beginAtZero?: boolean;
|
|
156
|
-
stepSize?: number;
|
|
157
|
-
stacked?: boolean;
|
|
158
|
-
suggestedMin?: number;
|
|
159
|
-
suggestedMax?: number;
|
|
160
|
-
min?: number | string;
|
|
161
|
-
max?: number | string;
|
|
162
|
-
}
|
|
163
|
-
export interface ICommonAnnotation {
|
|
164
|
-
showLabel?: boolean;
|
|
165
|
-
text?: string | string[];
|
|
166
|
-
position?: string;
|
|
167
|
-
fontSize?: number;
|
|
168
|
-
xOffset?: number;
|
|
169
|
-
yOffset?: number;
|
|
170
|
-
maxWidth?: number;
|
|
171
|
-
lineHeight?: number;
|
|
172
|
-
}
|
|
173
|
-
export interface ICommonAnnotations {
|
|
174
|
-
showAnnotations?: boolean;
|
|
175
|
-
controlAnnotation?: boolean;
|
|
176
|
-
enableDragAnnotation?: boolean;
|
|
177
|
-
enableCalloutAnnotation?: boolean;
|
|
178
|
-
lineMarkersAnnotation?: ILineMarkersAnnotation;
|
|
179
|
-
annotationsData?: ICommonAnnotationsData[];
|
|
180
|
-
labelAnnotation?: ICommonAnnotation;
|
|
181
|
-
}
|
|
182
|
-
export interface ICommonGraph {
|
|
183
|
-
lineTension?: number;
|
|
184
|
-
spanGaps?: boolean;
|
|
185
|
-
showDataLabels?: boolean;
|
|
186
|
-
showMinorGridlines?: boolean;
|
|
187
|
-
}
|
|
188
|
-
export interface ICommonInteractions {
|
|
189
|
-
onLegendClick?: (text: string, hidden: boolean) => void;
|
|
190
|
-
onHover?: (event: ChartEvent, datasetIndex: number, index: number, generatedDataset: any[]) => void;
|
|
191
|
-
onUnhover?: (event?: ChartEvent, datasetIndex?: number, index?: number, generatedDataset?: any[]) => void;
|
|
192
|
-
}
|
|
193
|
-
export interface ICommonCustomLegend<T extends keyof ChartTypeRegistry> {
|
|
194
|
-
customLegendPlugin: Plugin<T> | null;
|
|
195
|
-
customLegendContainerID: string;
|
|
196
|
-
}
|
|
197
|
-
export interface ICommonChartOptions {
|
|
198
|
-
enableZoom?: boolean;
|
|
199
|
-
enablePan?: boolean;
|
|
200
|
-
}
|
|
201
|
-
export interface ICommonDragData {
|
|
202
|
-
enableDragData?: boolean;
|
|
203
|
-
showTooltip?: boolean;
|
|
204
|
-
roundPoints?: boolean;
|
|
205
|
-
dragX?: boolean;
|
|
206
|
-
dragY?: boolean;
|
|
207
|
-
onDragStart?: (event: unknown, element: unknown) => unknown;
|
|
208
|
-
onDrag?: (event: unknown, datasetIndex: number, index: number, value: unknown) => unknown;
|
|
209
|
-
onDragEnd?: (event: unknown, datasetIndex: number, index: number, value: unknown) => unknown;
|
|
210
|
-
}
|
|
211
|
-
export interface ICommonOptions {
|
|
212
|
-
title?: string | string[];
|
|
213
|
-
chartStyling?: ICommonStyling;
|
|
214
|
-
tooltip?: ICommonTooltip;
|
|
215
|
-
legend?: ICommonLegend;
|
|
216
|
-
chartOptions?: ICommonChartOptions;
|
|
217
|
-
interactions?: ICommonInteractions;
|
|
218
|
-
dragData?: ICommonDragData;
|
|
219
|
-
annotations?: ICommonAnnotations;
|
|
220
|
-
plugins?: {
|
|
221
|
-
lineMarkersPlugin?: {
|
|
222
|
-
enabled?: boolean;
|
|
223
|
-
};
|
|
224
|
-
};
|
|
225
|
-
}
|
|
226
|
-
export interface ICommonData {
|
|
227
|
-
testId?: string;
|
|
228
|
-
data?: {
|
|
229
|
-
labels?: string[];
|
|
230
|
-
datasets?: ICommonDataset[];
|
|
231
|
-
};
|
|
232
|
-
options: ICommonOptions;
|
|
233
|
-
}
|
|
234
|
-
export interface ICommonHoveredItems {
|
|
235
|
-
index: number;
|
|
236
|
-
datasetIndex: number;
|
|
237
|
-
}
|
|
238
|
-
export interface ICommonChartPlugins {
|
|
239
|
-
legend: {
|
|
240
|
-
position: TAxisPosition;
|
|
241
|
-
};
|
|
242
|
-
title: {
|
|
243
|
-
display: boolean;
|
|
244
|
-
text: string;
|
|
245
|
-
};
|
|
246
|
-
}
|
|
247
|
-
export interface ICommonAxis<PositionType = string> {
|
|
248
|
-
label?: string;
|
|
249
|
-
position?: PositionType;
|
|
250
|
-
color?: string | string[];
|
|
251
|
-
unit?: string;
|
|
252
|
-
gridLines?: boolean;
|
|
253
|
-
stepSize?: number;
|
|
254
|
-
}
|
|
255
|
-
export interface IChartGeneratedLabel {
|
|
256
|
-
text: string;
|
|
257
|
-
fillStyle: string;
|
|
258
|
-
strokeStyle: string;
|
|
259
|
-
index: number;
|
|
260
|
-
}
|
|
261
|
-
export interface IChartLegendItemFilter {
|
|
262
|
-
index: number;
|
|
263
|
-
datasetIndex: number;
|
|
264
|
-
hidden: boolean;
|
|
265
|
-
}
|
|
266
|
-
export interface IChartDataLabelsOptions {
|
|
267
|
-
display?: 'auto' | boolean;
|
|
268
|
-
align?: 'center';
|
|
269
|
-
anchor?: 'center';
|
|
270
|
-
formatter?: (_value: unknown, context: unknown) => unknown;
|
|
271
|
-
}
|
|
272
|
-
export type UnusedParameter = unknown;
|
|
273
|
-
export type TPrimitive = string | number | boolean | null;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ReactElement } from 'react';
|
|
2
|
-
interface ControlsPortalProps {
|
|
3
|
-
children: ReactElement;
|
|
4
|
-
controlsPortalId: string;
|
|
5
|
-
}
|
|
6
|
-
declare const ControlsPortal: ({ children, controlsPortalId }: ControlsPortalProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export default ControlsPortal;
|