@oliasoft-open-source/charts-library 3.4.0 → 3.4.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 +128 -113
- package/dist/index.js.map +1 -1
- package/dist/src/components/bar-chart/get-bar-chart-data-labels.d.ts +3 -2
- package/dist/src/components/bar-chart/get-bar-chart-tooltips.d.ts +2 -1
- package/dist/src/components/line-chart/constants/default-translations.d.ts +24 -24
- package/dist/src/components/line-chart/controls/axes-options/action-types.d.ts +5 -5
- package/dist/src/components/line-chart/hooks/use-chart-options.d.ts +4 -3
- package/dist/src/components/line-chart/legend/legend-interface.d.ts +33 -0
- package/dist/src/components/line-chart/line-chart-get-default-props.d.ts +4 -4
- package/dist/src/components/line-chart/utils/datalabels-alignment/get-datalabels-position.d.ts +2 -1
- package/dist/src/components/line-chart/utils/get-line-chart-data-labels.d.ts +1 -1
- package/dist/src/components/line-chart/utils/get-line-chart-tooltips.d.ts +2 -1
- package/dist/src/helpers/enums.d.ts +72 -86
- package/package.json +1 -1
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
import { AlignOptions } from '../../helpers/enums';
|
|
1
2
|
import { IBarChartOptions } from './bar-chart.interface';
|
|
2
3
|
/**
|
|
3
4
|
* @param {import('./bar-chart.interface').IBarChartOptions} options - bar chart options object
|
|
4
5
|
*/
|
|
5
6
|
declare const getBarChartDataLabels: (options: IBarChartOptions) => {
|
|
6
7
|
display: string;
|
|
7
|
-
align:
|
|
8
|
-
anchor:
|
|
8
|
+
align: AlignOptions;
|
|
9
|
+
anchor: AlignOptions;
|
|
9
10
|
formatter: (value: any, context: any) => string | number;
|
|
10
11
|
} | {
|
|
11
12
|
display: boolean;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { ChartHoverMode } from '../../helpers/enums';
|
|
1
2
|
/**
|
|
2
3
|
* @param {import('./bar-chart.interface').IBarChartOptions} options - bar chart options object
|
|
3
4
|
*/
|
|
4
5
|
declare const getBarChartToolTips: (options: any) => {
|
|
5
6
|
enabled: any;
|
|
6
|
-
mode:
|
|
7
|
+
mode: ChartHoverMode;
|
|
7
8
|
intersect: boolean;
|
|
8
9
|
padding: number;
|
|
9
10
|
callbacks: {
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
export declare
|
|
2
|
-
label
|
|
3
|
-
pointsLines
|
|
4
|
-
linesOnly
|
|
5
|
-
pointsOnly
|
|
6
|
-
axesOptions
|
|
7
|
-
resetAxes
|
|
8
|
-
done
|
|
9
|
-
downloadAsPNG
|
|
10
|
-
showChart
|
|
11
|
-
showTable
|
|
12
|
-
dragToZoom
|
|
13
|
-
dragToPan
|
|
14
|
-
dragToMovePoints
|
|
15
|
-
dragDisabled
|
|
16
|
-
hideLegend
|
|
17
|
-
showLegend
|
|
18
|
-
mustHaveAValue
|
|
19
|
-
mustBeANumber
|
|
20
|
-
mustBeLessThanMax
|
|
21
|
-
mustBeGreaterThanMin
|
|
22
|
-
doubleClickToReset
|
|
23
|
-
orDoubleClickToCanvas
|
|
24
|
-
}
|
|
1
|
+
export declare enum defaultTranslations {
|
|
2
|
+
label = "Label",
|
|
3
|
+
pointsLines = "Points & lines",
|
|
4
|
+
linesOnly = "Lines only",
|
|
5
|
+
pointsOnly = "Points only",
|
|
6
|
+
axesOptions = "Axes options",
|
|
7
|
+
resetAxes = "Reset Axes",
|
|
8
|
+
done = "Done",
|
|
9
|
+
downloadAsPNG = "Download as PNG",
|
|
10
|
+
showChart = "Show chart",
|
|
11
|
+
showTable = "Show table",
|
|
12
|
+
dragToZoom = "Drag to zoom",
|
|
13
|
+
dragToPan = "Drag to pan",
|
|
14
|
+
dragToMovePoints = "Drag to move points",
|
|
15
|
+
dragDisabled = "Drag disabled",
|
|
16
|
+
hideLegend = "Hide Legend",
|
|
17
|
+
showLegend = "Show Legend",
|
|
18
|
+
mustHaveAValue = "Must have a value",
|
|
19
|
+
mustBeANumber = "Must be a number",
|
|
20
|
+
mustBeLessThanMax = "Must be less than max",
|
|
21
|
+
mustBeGreaterThanMin = "Must be greater than min",
|
|
22
|
+
doubleClickToReset = "Double click on canvas to reset",
|
|
23
|
+
orDoubleClickToCanvas = "or double click on canvas"
|
|
24
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export declare
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
1
|
+
export declare enum actionTypes {
|
|
2
|
+
Reset = "reset",
|
|
3
|
+
ValueUpdated = "valueUpdated",
|
|
4
|
+
UnitUpdated = "unitUpdated"
|
|
5
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ChartHoverMode, Events, PointStyle } from '../../../helpers/enums';
|
|
1
2
|
import { IHooksInterface } from './hooks.interface';
|
|
2
3
|
/**
|
|
3
4
|
* Custom hook to generate chart options.
|
|
@@ -21,16 +22,16 @@ export declare const useChartOptions: ({ chartRef, state, options, dispatch, gen
|
|
|
21
22
|
onComplete: any;
|
|
22
23
|
};
|
|
23
24
|
hover: {
|
|
24
|
-
mode:
|
|
25
|
+
mode: ChartHoverMode;
|
|
25
26
|
intersect: boolean;
|
|
26
27
|
};
|
|
27
28
|
elements: {
|
|
28
29
|
line: {
|
|
29
|
-
pointStyle:
|
|
30
|
+
pointStyle: PointStyle;
|
|
30
31
|
showLine: any;
|
|
31
32
|
};
|
|
32
33
|
};
|
|
33
34
|
scales: any;
|
|
34
35
|
plugins: any;
|
|
35
|
-
events:
|
|
36
|
+
events: Events[];
|
|
36
37
|
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Position } from '../../../helpers/enums';
|
|
2
|
+
export interface ILegendDropZone {
|
|
3
|
+
position: string;
|
|
4
|
+
onDrop: () => any;
|
|
5
|
+
placeholderSize: any;
|
|
6
|
+
}
|
|
7
|
+
export interface ILegendDropZones {
|
|
8
|
+
chartArea: any;
|
|
9
|
+
setLegendPosition: (position: Position) => void;
|
|
10
|
+
isDragging: any;
|
|
11
|
+
placeholderSize: {
|
|
12
|
+
width: string;
|
|
13
|
+
height: string;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export interface ILegendItem {
|
|
17
|
+
hidden: boolean;
|
|
18
|
+
dataset: any;
|
|
19
|
+
handleClick: (e: Event) => any;
|
|
20
|
+
}
|
|
21
|
+
export interface ILegend {
|
|
22
|
+
chartRef: {
|
|
23
|
+
current: any;
|
|
24
|
+
};
|
|
25
|
+
state: any;
|
|
26
|
+
options: any;
|
|
27
|
+
dispatch: () => any;
|
|
28
|
+
generatedDatasets: any;
|
|
29
|
+
}
|
|
30
|
+
export interface ILegendPanel extends ILegend {
|
|
31
|
+
legendPosition: Position;
|
|
32
|
+
isDragging: boolean;
|
|
33
|
+
}
|
|
@@ -79,10 +79,10 @@ export declare const getDefaultProps: (props: ILineChartProps) => {
|
|
|
79
79
|
depthType: import("./line-chart.interface").IDepthType;
|
|
80
80
|
dragData: {
|
|
81
81
|
enableDragData: boolean;
|
|
82
|
-
showTooltip:
|
|
83
|
-
roundPoints:
|
|
84
|
-
dragX:
|
|
85
|
-
dragY:
|
|
82
|
+
showTooltip: boolean;
|
|
83
|
+
roundPoints: boolean;
|
|
84
|
+
dragX: boolean;
|
|
85
|
+
dragY: boolean;
|
|
86
86
|
onDragStart: () => any;
|
|
87
87
|
onDrag: () => any;
|
|
88
88
|
onDragEnd: () => any;
|
package/dist/src/components/line-chart/utils/datalabels-alignment/get-datalabels-position.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { AlignOptions } from '../../../../helpers/enums';
|
|
1
2
|
/** returning position depends on condition
|
|
2
3
|
*
|
|
3
4
|
* @return {string} - position
|
|
4
5
|
*/
|
|
5
|
-
export declare const getPosition: () => (context: any) =>
|
|
6
|
+
export declare const getPosition: () => (context: any) => AlignOptions.End | AlignOptions.Start | AlignOptions.Right | AlignOptions.Left;
|
|
@@ -7,7 +7,7 @@ import { ILineChartOptions } from '../line-chart.interface';
|
|
|
7
7
|
*/
|
|
8
8
|
declare const getLineChartDataLabels: (options: ILineChartOptions) => {
|
|
9
9
|
display: string;
|
|
10
|
-
align: (context: any) => "
|
|
10
|
+
align: (context: any) => import("../../../helpers/enums").AlignOptions.End | import("../../../helpers/enums").AlignOptions.Start | import("../../../helpers/enums").AlignOptions.Right | import("../../../helpers/enums").AlignOptions.Left;
|
|
11
11
|
formatter: (_value: any, context: any) => any;
|
|
12
12
|
} | {
|
|
13
13
|
display: boolean;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { ChartHoverMode } from '../../../helpers/enums';
|
|
1
2
|
import { ILineChartOptions } from '../line-chart.interface';
|
|
2
3
|
/**
|
|
3
4
|
* @param {import('../line-chart.interface').ILineChartOptions} options - line chart options object
|
|
4
5
|
*/
|
|
5
6
|
declare const getLineChartToolTips: (options: ILineChartOptions) => {
|
|
6
7
|
enabled: boolean;
|
|
7
|
-
mode:
|
|
8
|
+
mode: ChartHoverMode;
|
|
8
9
|
intersect: boolean;
|
|
9
10
|
padding: number;
|
|
10
11
|
callbacks: {
|
|
@@ -1,86 +1,72 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
export declare
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
Circle: "circle";
|
|
74
|
-
}>;
|
|
75
|
-
export declare const ChartHoverMode: Readonly<{
|
|
76
|
-
Nearest: "nearest";
|
|
77
|
-
}>;
|
|
78
|
-
export declare const PanZoomMode: Readonly<{
|
|
79
|
-
X: "x";
|
|
80
|
-
Y: "y";
|
|
81
|
-
XY: "xy";
|
|
82
|
-
}>;
|
|
83
|
-
export declare const Key: Readonly<{
|
|
84
|
-
Shift: "Shift";
|
|
85
|
-
}>;
|
|
86
|
-
export declare const Events: readonly string[];
|
|
1
|
+
export declare enum AxisType {
|
|
2
|
+
X = "x",
|
|
3
|
+
Y = "y"
|
|
4
|
+
}
|
|
5
|
+
export declare enum Position {
|
|
6
|
+
Bottom = "bottom",
|
|
7
|
+
Top = "top",
|
|
8
|
+
Left = "left",
|
|
9
|
+
Right = "right",
|
|
10
|
+
TopRight = "top-right",
|
|
11
|
+
TopLeft = "top-left",
|
|
12
|
+
BottomLeft = "bottom-left",
|
|
13
|
+
BottomRight = "bottom-right"
|
|
14
|
+
}
|
|
15
|
+
export declare enum ChartType {
|
|
16
|
+
Line = "line",
|
|
17
|
+
Bar = "bar"
|
|
18
|
+
}
|
|
19
|
+
export declare enum CursorStyle {
|
|
20
|
+
Pointer = "pointer",
|
|
21
|
+
Initial = "initial"
|
|
22
|
+
}
|
|
23
|
+
export declare enum ScaleType {
|
|
24
|
+
Category = "category",
|
|
25
|
+
Linear = "linear",
|
|
26
|
+
Logarithmic = "logarithmic"
|
|
27
|
+
}
|
|
28
|
+
export declare enum ChartDirection {
|
|
29
|
+
Vertical = "vertical"
|
|
30
|
+
}
|
|
31
|
+
export declare enum TooltipLabel {
|
|
32
|
+
Y = "yLabel",
|
|
33
|
+
X = "xLabel"
|
|
34
|
+
}
|
|
35
|
+
export declare enum AlignOptions {
|
|
36
|
+
End = "end",
|
|
37
|
+
Start = "start",
|
|
38
|
+
Center = "center",
|
|
39
|
+
Right = "right",
|
|
40
|
+
Left = "left"
|
|
41
|
+
}
|
|
42
|
+
export declare enum PointType {
|
|
43
|
+
Casing = "casing"
|
|
44
|
+
}
|
|
45
|
+
export declare enum AnnotationType {
|
|
46
|
+
Box = "box",
|
|
47
|
+
Ellipse = "ellipse",
|
|
48
|
+
Line = "line",
|
|
49
|
+
Text = "text"
|
|
50
|
+
}
|
|
51
|
+
export declare enum PointStyle {
|
|
52
|
+
Circle = "circle"
|
|
53
|
+
}
|
|
54
|
+
export declare enum ChartHoverMode {
|
|
55
|
+
Nearest = "nearest"
|
|
56
|
+
}
|
|
57
|
+
export declare enum PanZoomMode {
|
|
58
|
+
X = "x",
|
|
59
|
+
Y = "y",
|
|
60
|
+
XY = "xy"
|
|
61
|
+
}
|
|
62
|
+
export declare enum Key {
|
|
63
|
+
Shift = "Shift"
|
|
64
|
+
}
|
|
65
|
+
export declare enum Events {
|
|
66
|
+
Mousemove = "mousemove",
|
|
67
|
+
Mouseout = "mouseout",
|
|
68
|
+
Click = "click",
|
|
69
|
+
Touchstart = "touchstart",
|
|
70
|
+
Touchmove = "touchmove",
|
|
71
|
+
Dblclick = "dblclick"
|
|
72
|
+
}
|
package/package.json
CHANGED