@oliasoft-open-source/charts-library 4.8.3-beta-2 → 4.8.3-beta-4
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.js +2174 -2142
- package/dist/index.js.map +1 -1
- package/dist/src/components/common/helpers/chart-utils.d.ts +1 -0
- package/dist/src/components/common/legend-component/state/legend-state-reducer.d.ts +1 -1
- package/dist/src/components/line-chart/controls/axes-options/axes-options-form-state.d.ts +6 -17
- package/dist/src/components/line-chart/controls/axes-options/axes-options-interfaces.d.ts +6 -4
- package/dist/src/components/line-chart/hooks/use-chart-state.d.ts +2 -3
- package/dist/src/components/line-chart/line-chart.stories.d.ts +1 -1
- package/package.json +47 -49
|
@@ -81,4 +81,5 @@ export declare const getTooltipLabel: (tooltipItem: Record<string, any>, showLab
|
|
|
81
81
|
export declare const getChartFileName: (axes?: IAxis[]) => string;
|
|
82
82
|
export declare const setDefaultTheme: () => void;
|
|
83
83
|
export declare const isNilOrEmpty: <T>(value: T | null | undefined) => boolean;
|
|
84
|
+
export declare const generateRandomKey: () => string;
|
|
84
85
|
export {};
|
|
@@ -23,4 +23,4 @@ export type TLegendAction = {
|
|
|
23
23
|
payload: ILegendState;
|
|
24
24
|
};
|
|
25
25
|
export declare const legendInitialState: ILegendState;
|
|
26
|
-
export declare const legendReducer: (state: ILegendState, action: TLegendAction) =>
|
|
26
|
+
export declare const legendReducer: (state: ILegendState, action: TLegendAction) => ILegendState;
|
|
@@ -1,23 +1,12 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
import { Chart } from 'chart.js';
|
|
1
3
|
import { IState } from '../../state/state.interfaces';
|
|
2
|
-
import { IAction, IFormState, IInitializeAxisFormState } from './axes-options-interfaces
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* @param {Object} args
|
|
7
|
-
* @param {Object} args.initialAxesRanges
|
|
8
|
-
* @param {Array} [args.axes]
|
|
9
|
-
* @returns {Object} formState
|
|
10
|
-
*/
|
|
11
|
-
export declare const initializeFormState: ({ initialAxesRanges, axes, }: Partial<IState>) => IInitializeAxisFormState;
|
|
4
|
+
import { IAction, IFormState, IInitializeAxisFormState } from './axes-options-interfaces';
|
|
5
|
+
export declare const initializeFormState: ({ chartRef, axes, }: Partial<IState> & {
|
|
6
|
+
chartRef?: RefObject<Chart>;
|
|
7
|
+
}) => IInitializeAxisFormState;
|
|
12
8
|
export declare const validateAxes: (formState: IFormState) => {
|
|
13
9
|
errors: never[];
|
|
14
10
|
valid: boolean;
|
|
15
11
|
};
|
|
16
|
-
/**
|
|
17
|
-
* Local component form state reducer for a axes options form
|
|
18
|
-
*
|
|
19
|
-
* @param {Object} state Local component form state
|
|
20
|
-
* @param {Action} action Action with type and payload
|
|
21
|
-
* @returns {Object} FormState
|
|
22
|
-
*/
|
|
23
12
|
export declare const reducer: (state: IFormState, action: IAction) => IInitializeAxisFormState;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
import { Chart } from 'chart.js';
|
|
3
|
+
import { IUnitOptions } from '../../line-chart.interface';
|
|
4
|
+
import { IAxisState } from '../../state/state.interfaces';
|
|
3
5
|
export interface IDepthType {
|
|
4
6
|
selectedDepthType?: string;
|
|
5
7
|
setSelectedDepthType?: (type: string) => void;
|
|
@@ -10,7 +12,7 @@ export interface IAxisControlLabel {
|
|
|
10
12
|
label: string;
|
|
11
13
|
}
|
|
12
14
|
export interface IAxesOptions {
|
|
13
|
-
|
|
15
|
+
chartRef: RefObject<Chart>;
|
|
14
16
|
axes: IAxisState[];
|
|
15
17
|
controlsAxesLabels: IAxisControlLabel[];
|
|
16
18
|
onUpdateAxes: ({ axes }: {
|
|
@@ -44,8 +46,8 @@ export interface IFormState extends IInitializeAxisFormState {
|
|
|
44
46
|
type ActionType = 'reset' | 'valueUpdated' | 'unitUpdated';
|
|
45
47
|
export type AxisKey = 'min' | 'max' | 'unit';
|
|
46
48
|
interface ActionPayload extends IOnEdit {
|
|
47
|
-
initialAxesRanges?: IInitAxisRange[];
|
|
48
49
|
axes?: IAxisState[];
|
|
50
|
+
chartRef?: RefObject<Chart>;
|
|
49
51
|
}
|
|
50
52
|
export interface IAction {
|
|
51
53
|
type: ActionType;
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import { Dispatch, RefObject } from 'react';
|
|
2
2
|
import { Chart } from 'chart.js';
|
|
3
3
|
import { IState } from '../state/state.interfaces';
|
|
4
|
-
import {
|
|
4
|
+
import { ILineChartOptions } from '../line-chart.interface';
|
|
5
5
|
interface IUseChartState {
|
|
6
6
|
chartRef: RefObject<Chart>;
|
|
7
7
|
options: ILineChartOptions;
|
|
8
8
|
state: IState;
|
|
9
9
|
dispatch: Dispatch<any>;
|
|
10
10
|
persistenceId?: string;
|
|
11
|
-
generatedDatasets: ILineChartDataset[];
|
|
12
11
|
}
|
|
13
12
|
/**
|
|
14
13
|
* Hook for managing the state of the chart.
|
|
15
14
|
*/
|
|
16
|
-
export declare const useChartState: ({ chartRef, options, state, dispatch, persistenceId,
|
|
15
|
+
export declare const useChartState: ({ chartRef, options, state, dispatch, persistenceId, }: IUseChartState) => void;
|
|
17
16
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oliasoft-open-source/charts-library",
|
|
3
|
-
"version": "4.8.3-beta-
|
|
3
|
+
"version": "4.8.3-beta-4",
|
|
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
|
"resolutions": {
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
"build:package": "vite build --config vite.config.ts",
|
|
27
27
|
"build": "yarn build:package && storybook build --quiet --output-dir ./public",
|
|
28
28
|
"dev:storybook": "storybook dev -p 6006",
|
|
29
|
-
"lint:check": "eslint
|
|
30
|
-
"lint:fix": "eslint
|
|
31
|
-
"prepare": "husky",
|
|
29
|
+
"lint:check": "eslint \"**/*.{js,jsx,ts,tsx}\"",
|
|
30
|
+
"lint:fix": "eslint --fix \"**/*.{js,jsx,ts,tsx}\"",
|
|
31
|
+
"prepare": "husky install",
|
|
32
32
|
"prettier:check": "prettier --check \"**/*.{ts,tsx,js,jsx,json,css,less}\"",
|
|
33
33
|
"prettier:fix": "prettier --write \"**/*.{ts,tsx,js,jsx,json,css,less}\"",
|
|
34
34
|
"preview:storybook": " http-server ./public -o -p 9002 -c-1",
|
|
@@ -43,15 +43,14 @@
|
|
|
43
43
|
]
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@
|
|
47
|
-
"
|
|
48
|
-
"chart.js": "^4.4.8",
|
|
46
|
+
"@fontsource/noto-sans": "^5.0.18",
|
|
47
|
+
"chart.js": "^4.4.7",
|
|
49
48
|
"chartjs-plugin-annotation": "^3.1.0",
|
|
50
49
|
"chartjs-plugin-datalabels": "^2.2.0",
|
|
51
50
|
"chartjs-plugin-dragdata": "2.2.5",
|
|
52
|
-
"chartjs-plugin-zoom": "2.0.1",
|
|
51
|
+
"chartjs-plugin-zoom": "^2.0.1",
|
|
53
52
|
"fast-deep-equal": "^3.1.3",
|
|
54
|
-
"html-to-image": "^1.11.
|
|
53
|
+
"html-to-image": "^1.11.12",
|
|
55
54
|
"react-base64-downloader": "^2.1.7",
|
|
56
55
|
"react-chartjs-2": "^5.3.0",
|
|
57
56
|
"react-dnd": "^16.0.1",
|
|
@@ -60,68 +59,67 @@
|
|
|
60
59
|
"react-use": "^17.6.0"
|
|
61
60
|
},
|
|
62
61
|
"devDependencies": {
|
|
63
|
-
"@oliasoft-open-source/react-ui-library": "^
|
|
64
|
-
"@oliasoft-open-source/units": "^4.
|
|
65
|
-
"@storybook/addon-actions": "^
|
|
66
|
-
"@storybook/addon-docs": "^
|
|
67
|
-
"@storybook/addon-mdx-gfm": "^
|
|
68
|
-
"@storybook/react": "^
|
|
69
|
-
"@storybook/react-vite": "^
|
|
62
|
+
"@oliasoft-open-source/react-ui-library": "^4.20.8",
|
|
63
|
+
"@oliasoft-open-source/units": "^4.2.4",
|
|
64
|
+
"@storybook/addon-actions": "^7.0.18",
|
|
65
|
+
"@storybook/addon-docs": "^7.0.18",
|
|
66
|
+
"@storybook/addon-mdx-gfm": "^7.0.23",
|
|
67
|
+
"@storybook/react": "^7.0.18",
|
|
68
|
+
"@storybook/react-vite": "^7.0.18",
|
|
70
69
|
"@storybook/testing-library": "^0.2.2",
|
|
71
|
-
"@types/jest": "^29.5.
|
|
70
|
+
"@types/jest": "^29.5.6",
|
|
72
71
|
"@types/react": "^18.2.24",
|
|
73
72
|
"@typescript-eslint/parser": "^6.7.4",
|
|
74
|
-
"@vitejs/plugin-react-swc": "^3.
|
|
75
|
-
"ajv": "^8.
|
|
73
|
+
"@vitejs/plugin-react-swc": "^3.3.2",
|
|
74
|
+
"ajv": "^8.12.0",
|
|
76
75
|
"ajv-errors": "^3.0.0",
|
|
77
76
|
"ajv-keywords": "^5.1.0",
|
|
78
|
-
"classnames": "^2.
|
|
79
|
-
"eslint": "^
|
|
77
|
+
"classnames": "^2.3.2",
|
|
78
|
+
"eslint": "^8.55.0",
|
|
80
79
|
"eslint-config-airbnb": "^19.0.4",
|
|
81
|
-
"eslint-config-prettier": "^
|
|
80
|
+
"eslint-config-prettier": "^9.0.0",
|
|
82
81
|
"eslint-import-resolver-alias": "^1.1.2",
|
|
83
|
-
"eslint-import-resolver-typescript": "^3.
|
|
84
|
-
"eslint-plugin-import": "^2.
|
|
85
|
-
"eslint-plugin-jsx-a11y": "^6.
|
|
86
|
-
"eslint-plugin-react": "^7.
|
|
87
|
-
"eslint-plugin-react-hooks": "^
|
|
88
|
-
"eslint-plugin-storybook": "^0.
|
|
89
|
-
"eslint-plugin-vitest": "^0.
|
|
90
|
-
"eslint-plugin-vitest-globals": "^1.
|
|
82
|
+
"eslint-import-resolver-typescript": "^3.6.1",
|
|
83
|
+
"eslint-plugin-import": "^2.26.0",
|
|
84
|
+
"eslint-plugin-jsx-a11y": "^6.6.1",
|
|
85
|
+
"eslint-plugin-react": "^7.31.1",
|
|
86
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
|
87
|
+
"eslint-plugin-storybook": "^0.6.12",
|
|
88
|
+
"eslint-plugin-vitest": "^0.3.2",
|
|
89
|
+
"eslint-plugin-vitest-globals": "^1.3.1",
|
|
91
90
|
"http-server": "^14.1.1",
|
|
92
|
-
"husky": "^
|
|
91
|
+
"husky": "^8.0.1",
|
|
93
92
|
"immer": "^10",
|
|
94
93
|
"jsdom": "^22.1.0",
|
|
95
|
-
"less": "^4.
|
|
94
|
+
"less": "^4.1.3",
|
|
96
95
|
"lint-staged": "^15.4.3",
|
|
97
96
|
"lodash": "^4.17.21",
|
|
98
97
|
"micromatch": "^4",
|
|
99
|
-
"prettier": "3.
|
|
98
|
+
"prettier": "3.0.3",
|
|
100
99
|
"prop-types": "^15",
|
|
101
100
|
"react": "^18.2.0",
|
|
102
101
|
"react-dom": "^18.2.0",
|
|
103
102
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
104
|
-
"storybook": "^
|
|
105
|
-
"storybook-dark-mode": "^
|
|
106
|
-
"vite": "^
|
|
107
|
-
"vite-plugin-css-injected-by-js": "^3.
|
|
108
|
-
"vite-plugin-dts": "^4.5.
|
|
109
|
-
"vite-plugin-
|
|
110
|
-
"vite-
|
|
111
|
-
"
|
|
112
|
-
"vitest": "^3.0.8"
|
|
103
|
+
"storybook": "^7.0.18",
|
|
104
|
+
"storybook-dark-mode": "^3.0.0",
|
|
105
|
+
"vite": "^5.4.11",
|
|
106
|
+
"vite-plugin-css-injected-by-js": "^3.1.1",
|
|
107
|
+
"vite-plugin-dts": "^4.5.0",
|
|
108
|
+
"vite-plugin-svgr": "^4.2.0",
|
|
109
|
+
"vite-tsconfig-paths": "^4.2.0",
|
|
110
|
+
"vitest": "^2.1.4"
|
|
113
111
|
},
|
|
114
112
|
"peerDependencies": {
|
|
115
|
-
"@oliasoft-open-source/react-ui-library": "
|
|
116
|
-
"@oliasoft-open-source/units": "^4.
|
|
117
|
-
"ajv": "^8.
|
|
113
|
+
"@oliasoft-open-source/react-ui-library": "^4.20.8",
|
|
114
|
+
"@oliasoft-open-source/units": "^4.2.4",
|
|
115
|
+
"ajv": "^8.12.0",
|
|
118
116
|
"ajv-errors": "^3.0.0",
|
|
119
117
|
"ajv-keywords": "^5.1.0",
|
|
120
|
-
"classnames": "^2.
|
|
121
|
-
"immer": "^9
|
|
118
|
+
"classnames": "^2.3.2",
|
|
119
|
+
"immer": "^9||^10",
|
|
122
120
|
"lodash": "^4.17.21",
|
|
123
121
|
"prop-types": "^15",
|
|
124
|
-
"react": "^17
|
|
125
|
-
"react-dom": "^17
|
|
122
|
+
"react": "^17",
|
|
123
|
+
"react-dom": "^17"
|
|
126
124
|
}
|
|
127
125
|
}
|