@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.
@@ -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) => any;
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.ts';
3
- /**
4
- * Initialize local component form state for a custom loads density table
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 { IUnitOptions } from '../../line-chart.interface.ts';
2
- import { IAxisState, IInitAxisRange } from '../../state/state.interfaces.ts';
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
- initialAxesRanges: IInitAxisRange[];
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 { ILineChartDataset, ILineChartOptions } from '../line-chart.interface';
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, generatedDatasets, }: IUseChartState) => void;
15
+ export declare const useChartState: ({ chartRef, options, state, dispatch, persistenceId, }: IUseChartState) => void;
17
16
  export {};
@@ -1045,7 +1045,7 @@ export namespace TestManyLines {
1045
1045
  export namespace data_17 {
1046
1046
  let datasets_17: {
1047
1047
  label: string;
1048
- pointStyle: any;
1048
+ pointStyle: string | undefined;
1049
1049
  pointRadius: number;
1050
1050
  data: {
1051
1051
  x: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oliasoft-open-source/charts-library",
3
- "version": "4.8.3-beta-2",
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 . --fix",
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
- "@eslint/js": "^9.22.0",
47
- "@fontsource/noto-sans": "^5.2.5",
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.13",
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": "^5.0.2",
64
- "@oliasoft-open-source/units": "^4.3.1",
65
- "@storybook/addon-actions": "^8.6.4",
66
- "@storybook/addon-docs": "^8.6.4",
67
- "@storybook/addon-mdx-gfm": "^8.6.4",
68
- "@storybook/react": "^8.6.4",
69
- "@storybook/react-vite": "^8.6.4",
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.14",
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.8.0",
75
- "ajv": "^8.17.1",
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.5.1",
79
- "eslint": "^9.22.0",
77
+ "classnames": "^2.3.2",
78
+ "eslint": "^8.55.0",
80
79
  "eslint-config-airbnb": "^19.0.4",
81
- "eslint-config-prettier": "^10.1.1",
80
+ "eslint-config-prettier": "^9.0.0",
82
81
  "eslint-import-resolver-alias": "^1.1.2",
83
- "eslint-import-resolver-typescript": "^3.8.5",
84
- "eslint-plugin-import": "^2.31.0",
85
- "eslint-plugin-jsx-a11y": "^6.10.2",
86
- "eslint-plugin-react": "^7.37.4",
87
- "eslint-plugin-react-hooks": "^5.2.0",
88
- "eslint-plugin-storybook": "^0.11.4",
89
- "eslint-plugin-vitest": "^0.5.4",
90
- "eslint-plugin-vitest-globals": "^1.5.0",
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": "^9.1.7",
91
+ "husky": "^8.0.1",
93
92
  "immer": "^10",
94
93
  "jsdom": "^22.1.0",
95
- "less": "^4.2.2",
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.5.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": "^8.6.4",
105
- "storybook-dark-mode": "^4.0.2",
106
- "vite": "^6.2.1",
107
- "vite-plugin-css-injected-by-js": "^3.5.2",
108
- "vite-plugin-dts": "^4.5.3",
109
- "vite-plugin-optimize-persist": "^0.1.2",
110
- "vite-plugin-svgr": "^4.3.0",
111
- "vite-tsconfig-paths": "^5.1.4",
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": ">=4.20.8 <6.0.0",
116
- "@oliasoft-open-source/units": "^4.3.1",
117
- "ajv": "^8.17.1",
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.5.1",
121
- "immer": "^9 || ^10",
118
+ "classnames": "^2.3.2",
119
+ "immer": "^9||^10",
122
120
  "lodash": "^4.17.21",
123
121
  "prop-types": "^15",
124
- "react": "^17 || ^18",
125
- "react-dom": "^17 || ^18"
122
+ "react": "^17",
123
+ "react-dom": "^17"
126
124
  }
127
125
  }