@oliasoft-open-source/charts-library 4.8.3-beta-4 → 4.8.3-beta-6
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 +398 -520
- package/dist/index.js.map +1 -1
- package/dist/src/components/common/helpers/chart-utils.d.ts +1 -1
- package/dist/src/components/line-chart/controls/axes-options/axes-options-interfaces.d.ts +2 -2
- package/dist/src/components/line-chart/controls/axes-options/axes-validation.d.ts +8 -0
- package/dist/src/components/line-chart/controls/controls-interfaces.d.ts +1 -1
- package/dist/src/components/line-chart/controls/controls.d.ts +1 -4
- package/dist/src/components/line-chart/line-chart.interface.d.ts +4 -0
- package/dist/src/components/line-chart/state/action-types.d.ts +0 -1
- package/dist/src/components/line-chart/state/helpers.d.ts +13 -0
- package/dist/src/components/line-chart/state/state.interfaces.d.ts +3 -12
- package/package.json +2 -2
- package/dist/src/components/line-chart/controls/axes-options/action-types.d.ts +0 -5
- package/dist/src/components/line-chart/controls/axes-options/axes-options-form-state.d.ts +0 -12
- package/dist/src/components/line-chart/controls/axes-options/axes-options-form-state.test.d.ts +0 -1
|
@@ -81,5 +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
|
|
84
|
+
export declare const isEmptyString: (value: string) => value is "";
|
|
85
85
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { RefObject } from 'react';
|
|
2
2
|
import { Chart } from 'chart.js';
|
|
3
3
|
import { IUnitOptions } from '../../line-chart.interface';
|
|
4
|
-
import { IAxisState } from '../../state/state.interfaces';
|
|
4
|
+
import { IAxisState, IState } from '../../state/state.interfaces';
|
|
5
5
|
export interface IDepthType {
|
|
6
6
|
selectedDepthType?: string;
|
|
7
7
|
setSelectedDepthType?: (type: string) => void;
|
|
@@ -13,7 +13,7 @@ export interface IAxisControlLabel {
|
|
|
13
13
|
}
|
|
14
14
|
export interface IAxesOptions {
|
|
15
15
|
chartRef: RefObject<Chart>;
|
|
16
|
-
|
|
16
|
+
state: IState;
|
|
17
17
|
controlsAxesLabels: IAxisControlLabel[];
|
|
18
18
|
onUpdateAxes: ({ axes }: {
|
|
19
19
|
axes: IAxisState;
|
|
@@ -4,7 +4,7 @@ import { ILineChartOptions, TGeneratedLineChartDatasets } from '../line-chart.in
|
|
|
4
4
|
import { IState } from '../state/state.interfaces';
|
|
5
5
|
export interface IControls {
|
|
6
6
|
headerComponent?: ReactNode;
|
|
7
|
-
subheaderComponent?:
|
|
7
|
+
subheaderComponent?: ReactNode;
|
|
8
8
|
table?: ReactNode;
|
|
9
9
|
chartRef: RefObject<Chart>;
|
|
10
10
|
state: IState;
|
|
@@ -1,6 +1,3 @@
|
|
|
1
1
|
import { IControls } from './controls-interfaces';
|
|
2
|
-
|
|
3
|
-
* @param {import('./controls-interfaces').IControls} obj
|
|
4
|
-
*/
|
|
5
|
-
declare const Controls: ({ headerComponent, subheaderComponent, table, chartRef, state, options, dispatch, generatedDatasets, translations, controlsPortalId, }: IControls) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare const Controls: ({ table, headerComponent, subheaderComponent, chartRef, state, options, dispatch, generatedDatasets, translations, controlsPortalId, }: IControls) => import("react/jsx-runtime").JSX.Element;
|
|
6
3
|
export default Controls;
|
|
@@ -46,6 +46,8 @@ export interface ILineChartAxis<PositionType = any> {
|
|
|
46
46
|
unit?: IUnitOptions;
|
|
47
47
|
stepSize?: number;
|
|
48
48
|
gridLines?: ILineChartGraph;
|
|
49
|
+
min?: number | string;
|
|
50
|
+
max?: number | string;
|
|
49
51
|
}
|
|
50
52
|
export interface ILineChartAxes {
|
|
51
53
|
x: ILineChartAxis<'top' | 'bottom'>[];
|
|
@@ -112,6 +114,8 @@ export interface ILineChartData extends ICommonData {
|
|
|
112
114
|
export interface ILineChartProps {
|
|
113
115
|
chart: ILineChartData;
|
|
114
116
|
table?: ReactNode;
|
|
117
|
+
headerComponent?: ReactNode;
|
|
118
|
+
subheaderComponent?: ReactNode;
|
|
115
119
|
}
|
|
116
120
|
export interface IGeneratedLineChartDataset {
|
|
117
121
|
label?: string;
|
|
@@ -4,7 +4,6 @@ export declare const TOGGLE_POINTS = "TOGGLE_POINTS";
|
|
|
4
4
|
export declare const TOGGLE_LINE = "TOGGLE_LINE";
|
|
5
5
|
export declare const TOGGLE_LEGEND = "TOGGLE_LEGEND";
|
|
6
6
|
export declare const TOGGLE_TABLE = "TOGGLE_TABLE";
|
|
7
|
-
export declare const SAVE_INITIAL_AXES_RANGES = "SAVE_INITIAL_AXES_RANGES";
|
|
8
7
|
export declare const RESET_AXES_RANGES = "RESET_AXES_RANGES";
|
|
9
8
|
export declare const UPDATE_AXES_RANGES = "UPDATE_AXES_RANGES";
|
|
10
9
|
export declare const TOGGLE_DRAG_POINTS = "TOGGLE_DRAG_POINTS";
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
}[];
|
|
@@ -2,12 +2,12 @@ import { IUnitOptions } from '../line-chart.interface';
|
|
|
2
2
|
export interface IAxisState {
|
|
3
3
|
id?: string;
|
|
4
4
|
label?: string;
|
|
5
|
-
min?: number;
|
|
6
|
-
max?: number;
|
|
5
|
+
min?: number | string;
|
|
6
|
+
max?: number | string;
|
|
7
7
|
unit?: IUnitOptions | string;
|
|
8
8
|
axisType?: string;
|
|
9
9
|
}
|
|
10
|
-
export interface
|
|
10
|
+
export interface IState {
|
|
11
11
|
zoomEnabled: boolean;
|
|
12
12
|
panEnabled: boolean;
|
|
13
13
|
pointsEnabled: boolean;
|
|
@@ -19,15 +19,6 @@ export interface InitialState {
|
|
|
19
19
|
enableDragPoints: boolean;
|
|
20
20
|
enableDragAnnotation: boolean;
|
|
21
21
|
}
|
|
22
|
-
export interface IInitAxisRange {
|
|
23
|
-
id: string;
|
|
24
|
-
min: number;
|
|
25
|
-
max: number;
|
|
26
|
-
unit?: string;
|
|
27
|
-
}
|
|
28
|
-
export interface IState extends InitialState {
|
|
29
|
-
initialAxesRanges: IInitAxisRange[];
|
|
30
|
-
}
|
|
31
22
|
export interface IAction<T = string, P = any> {
|
|
32
23
|
type: T;
|
|
33
24
|
payload?: P;
|
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-6",
|
|
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": {
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"dist"
|
|
24
24
|
],
|
|
25
25
|
"scripts": {
|
|
26
|
-
"build:package": "vite build --config vite.config.ts",
|
|
26
|
+
"build:package": "tsc && 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
29
|
"lint:check": "eslint \"**/*.{js,jsx,ts,tsx}\"",
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { RefObject } from 'react';
|
|
2
|
-
import { Chart } from 'chart.js';
|
|
3
|
-
import { IState } from '../../state/state.interfaces';
|
|
4
|
-
import { IAction, IFormState, IInitializeAxisFormState } from './axes-options-interfaces';
|
|
5
|
-
export declare const initializeFormState: ({ chartRef, axes, }: Partial<IState> & {
|
|
6
|
-
chartRef?: RefObject<Chart>;
|
|
7
|
-
}) => IInitializeAxisFormState;
|
|
8
|
-
export declare const validateAxes: (formState: IFormState) => {
|
|
9
|
-
errors: never[];
|
|
10
|
-
valid: boolean;
|
|
11
|
-
};
|
|
12
|
-
export declare const reducer: (state: IFormState, action: IAction) => IInitializeAxisFormState;
|
package/dist/src/components/line-chart/controls/axes-options/axes-options-form-state.test.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|