@oliasoft-open-source/charts-library 3.8.0-beta-1 → 3.8.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.js +191 -106
- package/dist/index.js.map +1 -1
- package/dist/src/components/common/helpers/chart-consts.d.ts +3 -3
- package/dist/src/components/line-chart/hooks/use-chart-state.d.ts +4 -3
- package/dist/src/components/line-chart/line-chart.interface.d.ts +24 -1
- package/dist/src/components/line-chart/line-chart.stories.d.ts +387 -275
- package/dist/src/components/line-chart/plugins/custom-point-ellipsis-plugin.d.ts +6 -0
- package/dist/src/components/line-chart/plugins/plugin-constants.d.ts +1 -0
- package/package.json +3 -2
|
@@ -4,9 +4,9 @@ export declare const BORDER_WIDTH: {
|
|
|
4
4
|
};
|
|
5
5
|
export declare const BORDER_COLOR = "rgba(0,0,0,0.1)";
|
|
6
6
|
export declare const ANNOTATION_DASH: number[];
|
|
7
|
-
export declare const DEFAULT_FONT_SIZE =
|
|
8
|
-
export declare const DEFAULT_FONT_FAMILY = "\"
|
|
9
|
-
export declare const DEFAULT_COLOR = "
|
|
7
|
+
export declare const DEFAULT_FONT_SIZE = 13;
|
|
8
|
+
export declare const DEFAULT_FONT_FAMILY = "\"Lato\", sans-serif";
|
|
9
|
+
export declare const DEFAULT_COLOR = "rgba(0,0,0,.87)";
|
|
10
10
|
export declare const LEGEND_LABEL_BOX_SIZE = 12;
|
|
11
11
|
export declare const TOOLTIP_PADDING = 8;
|
|
12
12
|
export declare const TOOLTIP_BOX_PADDING = 4;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { Dispatch, RefObject } from 'react';
|
|
2
2
|
import { Chart } from 'chart.js';
|
|
3
3
|
import { IState } from '../state/state.interfaces';
|
|
4
|
-
import { ILineChartOptions } from '../line-chart.interface';
|
|
4
|
+
import { ILineChartDataset, 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[];
|
|
11
12
|
}
|
|
12
13
|
/**
|
|
13
14
|
* Hook for managing the state of the chart.
|
|
@@ -15,9 +16,9 @@ interface IUseChartState {
|
|
|
15
16
|
* @param chartRef - The reference to the chart.
|
|
16
17
|
* @param options - The chart options.
|
|
17
18
|
* @param state - The chart state.
|
|
18
|
-
* @param {Array} generatedDatasets - An array of generated datasets for the chart.
|
|
19
19
|
* @param dispatch - The dispatch function for state management.
|
|
20
20
|
* @param persistenceId - The chart persistenceId.
|
|
21
|
+
* @param {ILineChartDataset[]} generatedDatasets - An array of generated datasets for the chart.
|
|
21
22
|
*/
|
|
22
|
-
export declare const useChartState: ({ chartRef, options, state, dispatch, persistenceId, }: IUseChartState) => void;
|
|
23
|
+
export declare const useChartState: ({ chartRef, options, state, dispatch, persistenceId, generatedDatasets, }: IUseChartState) => void;
|
|
23
24
|
export {};
|
|
@@ -67,6 +67,16 @@ export interface ILineLegend extends ICommonLegend {
|
|
|
67
67
|
customLegend?: ICommonCustomLegend<any>;
|
|
68
68
|
usePointStyle?: boolean;
|
|
69
69
|
}
|
|
70
|
+
interface IPointEllipsisAnnotation {
|
|
71
|
+
radiusX?: number;
|
|
72
|
+
radiusY?: number;
|
|
73
|
+
color?: string;
|
|
74
|
+
rotation?: number;
|
|
75
|
+
lineWidth?: number;
|
|
76
|
+
}
|
|
77
|
+
export interface ILineAnnotation extends ICommonAnnotations {
|
|
78
|
+
pointEllipsisAnnotation?: IPointEllipsisAnnotation;
|
|
79
|
+
}
|
|
70
80
|
export interface ILineChartOptions extends ICommonOptions {
|
|
71
81
|
title?: string | string[];
|
|
72
82
|
axes: ILineChartAxes;
|
|
@@ -75,7 +85,7 @@ export interface ILineChartOptions extends ICommonOptions {
|
|
|
75
85
|
chartStyling: ILineChartStyling;
|
|
76
86
|
tooltip: ILineChartTooltip;
|
|
77
87
|
graph: ILineChartGraph;
|
|
78
|
-
annotations:
|
|
88
|
+
annotations: ILineAnnotation;
|
|
79
89
|
legend: ILineLegend;
|
|
80
90
|
chartOptions: ILChartOptions;
|
|
81
91
|
interactions: ILineInteractions;
|
|
@@ -106,3 +116,16 @@ export interface ILineChartProps {
|
|
|
106
116
|
chart: ILineChartData;
|
|
107
117
|
table?: any;
|
|
108
118
|
}
|
|
119
|
+
export interface IEllipseOptions {
|
|
120
|
+
radiusX?: number;
|
|
121
|
+
radiusY?: number;
|
|
122
|
+
rotation?: number;
|
|
123
|
+
lineWidth?: number;
|
|
124
|
+
color?: string;
|
|
125
|
+
}
|
|
126
|
+
export interface IDatasetDataPoint {
|
|
127
|
+
x: number;
|
|
128
|
+
y: number;
|
|
129
|
+
ellipseOptions?: IEllipseOptions;
|
|
130
|
+
}
|
|
131
|
+
export {};
|