@oliasoft-open-source/charts-library 4.3.0-beta-2 → 4.3.0-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 +826 -231
- package/dist/index.js.map +1 -1
- package/dist/src/components/common/common.interface.d.ts +4 -3
- package/dist/src/components/common/helpers/chart-consts.d.ts +2 -0
- package/dist/src/components/common/helpers/enums.d.ts +5 -1
- package/dist/src/components/common/helpers/get-chart-annotation.d.ts +23 -8
- package/dist/src/components/common/plugins/annotation-dragger-plugin/helpers.test.d.ts +1 -0
- package/dist/src/components/common/plugins/annotation-dragger-plugin/point-annotation-label.d.ts +9 -0
- package/dist/src/components/line-chart/line-chart.stories.d.ts +11 -4
- package/package.json +1 -1
|
@@ -52,6 +52,7 @@ export interface ICommonAnnotationsData {
|
|
|
52
52
|
color: string;
|
|
53
53
|
endValue: number;
|
|
54
54
|
label: string;
|
|
55
|
+
labelConfig?: Record<string, any>;
|
|
55
56
|
type: string;
|
|
56
57
|
value: number;
|
|
57
58
|
xMin: number;
|
|
@@ -62,9 +63,9 @@ export interface ICommonAnnotationsData {
|
|
|
62
63
|
yValue?: number;
|
|
63
64
|
radius?: number;
|
|
64
65
|
enableDrag?: boolean;
|
|
65
|
-
onDragStart?: (coordinates: ICoordinates) => void;
|
|
66
|
-
onDrag?: (coordinates: ICoordinates) => void;
|
|
67
|
-
onDragEnd?: (coordinates: ICoordinates) => void;
|
|
66
|
+
onDragStart?: (coordinates: ICoordinates, annotation: ICommonAnnotationsData) => void;
|
|
67
|
+
onDrag?: (coordinates: ICoordinates, annotation: ICommonAnnotationsData) => void;
|
|
68
|
+
onDragEnd?: (coordinates: ICoordinates, annotation: ICommonAnnotationsData) => void;
|
|
68
69
|
}
|
|
69
70
|
export interface ICommonStyling {
|
|
70
71
|
width?: number | string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export declare const BORDER_WIDTH: {
|
|
2
2
|
INITIAL: number;
|
|
3
3
|
HOVERED: number;
|
|
4
|
+
POINT_HOVERED: number;
|
|
4
5
|
};
|
|
5
6
|
export declare const BORDER_COLOR = "rgba(0,0,0,0.1)";
|
|
6
7
|
export declare const ANNOTATION_DASH: number[];
|
|
@@ -10,6 +11,7 @@ export declare const DEFAULT_COLOR = "hsl(60, 10.34482759%, 12.5%)";
|
|
|
10
11
|
export declare const LEGEND_LABEL_BOX_SIZE = 12;
|
|
11
12
|
export declare const TOOLTIP_PADDING = 8;
|
|
12
13
|
export declare const TOOLTIP_BOX_PADDING = 4;
|
|
14
|
+
export declare const TRANSPARENT = "transparent";
|
|
13
15
|
export declare const LOGARITHMIC_STEPS: number[];
|
|
14
16
|
export declare const COLORS: string[];
|
|
15
17
|
/**
|
|
@@ -18,7 +18,11 @@ export declare enum ChartType {
|
|
|
18
18
|
}
|
|
19
19
|
export declare enum CursorStyle {
|
|
20
20
|
Pointer = "pointer",
|
|
21
|
-
Initial = "initial"
|
|
21
|
+
Initial = "initial",
|
|
22
|
+
Grab = "grab",
|
|
23
|
+
Grabbing = "grabbing",
|
|
24
|
+
Crosshair = "crosshair",
|
|
25
|
+
Move = "move"
|
|
22
26
|
}
|
|
23
27
|
export declare enum ScaleType {
|
|
24
28
|
Category = "category",
|
|
@@ -14,19 +14,33 @@ declare const getAnnotation: ({ showAnnotations, annotationsData, }: IGetAnnotat
|
|
|
14
14
|
id: string;
|
|
15
15
|
scaleID: "x" | "y";
|
|
16
16
|
label: {
|
|
17
|
+
content: string;
|
|
18
|
+
display: boolean;
|
|
19
|
+
font: {
|
|
20
|
+
weight: string;
|
|
21
|
+
};
|
|
22
|
+
} | {
|
|
17
23
|
backgroundColor: string;
|
|
18
24
|
content: string;
|
|
19
25
|
display: boolean;
|
|
20
26
|
position: Position;
|
|
27
|
+
color?: undefined;
|
|
21
28
|
font?: undefined;
|
|
29
|
+
borderWidth?: undefined;
|
|
30
|
+
padding?: undefined;
|
|
31
|
+
borderRadius?: undefined;
|
|
32
|
+
borderColor?: undefined;
|
|
22
33
|
} | {
|
|
34
|
+
backgroundColor: any;
|
|
23
35
|
content: string;
|
|
24
36
|
display: boolean;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
37
|
+
position: any;
|
|
38
|
+
color: any;
|
|
39
|
+
font: any;
|
|
40
|
+
borderWidth: number;
|
|
41
|
+
padding: number;
|
|
42
|
+
borderRadius: number;
|
|
43
|
+
borderColor: any;
|
|
30
44
|
};
|
|
31
45
|
backgroundColor: string;
|
|
32
46
|
borderColor: string;
|
|
@@ -44,13 +58,14 @@ declare const getAnnotation: ({ showAnnotations, annotationsData, }: IGetAnnotat
|
|
|
44
58
|
}, { chart, }: {
|
|
45
59
|
chart: TChart;
|
|
46
60
|
}) => void;
|
|
47
|
-
onDragStart: () => (cord: ICoordinates) => void;
|
|
48
|
-
onDrag: () => (cord: ICoordinates) => void;
|
|
49
|
-
onDragEnd: () => (cord: ICoordinates) => void;
|
|
61
|
+
onDragStart: () => (cord: ICoordinates, annotation: ICommonAnnotationsData) => void;
|
|
62
|
+
onDrag: () => (cord: ICoordinates, annotation: ICommonAnnotationsData) => void;
|
|
63
|
+
onDragEnd: () => (cord: ICoordinates, annotation: ICommonAnnotationsData) => void;
|
|
50
64
|
hideLegend?: boolean | undefined;
|
|
51
65
|
annotationAxis: "x" | "y";
|
|
52
66
|
color: string;
|
|
53
67
|
endValue: number;
|
|
68
|
+
labelConfig?: Record<string, any> | undefined;
|
|
54
69
|
value: number;
|
|
55
70
|
xMin: number;
|
|
56
71
|
xMax: number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/src/components/common/plugins/annotation-dragger-plugin/point-annotation-label.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Scale } from 'chart.js';
|
|
2
|
+
import { ICommonAnnotationsData } from '../../common.interface';
|
|
3
|
+
export interface IScales {
|
|
4
|
+
x: Scale;
|
|
5
|
+
y: Scale;
|
|
6
|
+
}
|
|
7
|
+
export declare const annotationLabel: (ctx: CanvasRenderingContext2D, annotations: Record<string, ICommonAnnotationsData & {
|
|
8
|
+
label: Record<string, any>;
|
|
9
|
+
}>, scales: IScales) => void;
|
|
@@ -1259,6 +1259,7 @@ export namespace DragAnnotations {
|
|
|
1259
1259
|
xValue?: undefined;
|
|
1260
1260
|
yValue?: undefined;
|
|
1261
1261
|
radius?: undefined;
|
|
1262
|
+
labelConfig?: undefined;
|
|
1262
1263
|
} | {
|
|
1263
1264
|
enableDrag: boolean;
|
|
1264
1265
|
type: string;
|
|
@@ -1267,15 +1268,16 @@ export namespace DragAnnotations {
|
|
|
1267
1268
|
yMin: number;
|
|
1268
1269
|
yMax: number;
|
|
1269
1270
|
color: string;
|
|
1270
|
-
onDragStart: (cord: any) => void;
|
|
1271
|
-
onDrag: (cord: any) => void;
|
|
1272
|
-
onDragEnd: (cord: any) => void;
|
|
1271
|
+
onDragStart: (cord: any, ann: any) => void;
|
|
1272
|
+
onDrag: (cord: any, ann: any) => void;
|
|
1273
|
+
onDragEnd: (cord: any, ann: any) => void;
|
|
1273
1274
|
annotationAxis?: undefined;
|
|
1274
1275
|
label?: undefined;
|
|
1275
1276
|
value?: undefined;
|
|
1276
1277
|
xValue?: undefined;
|
|
1277
1278
|
yValue?: undefined;
|
|
1278
1279
|
radius?: undefined;
|
|
1280
|
+
labelConfig?: undefined;
|
|
1279
1281
|
} | {
|
|
1280
1282
|
enableDrag: boolean;
|
|
1281
1283
|
type: string;
|
|
@@ -1293,6 +1295,7 @@ export namespace DragAnnotations {
|
|
|
1293
1295
|
xValue?: undefined;
|
|
1294
1296
|
yValue?: undefined;
|
|
1295
1297
|
radius?: undefined;
|
|
1298
|
+
labelConfig?: undefined;
|
|
1296
1299
|
} | {
|
|
1297
1300
|
type: string;
|
|
1298
1301
|
enableDrag: boolean;
|
|
@@ -1300,11 +1303,15 @@ export namespace DragAnnotations {
|
|
|
1300
1303
|
yValue: number;
|
|
1301
1304
|
radius: number;
|
|
1302
1305
|
color: string;
|
|
1306
|
+
label: string;
|
|
1307
|
+
labelConfig: {
|
|
1308
|
+
font: string;
|
|
1309
|
+
color: string;
|
|
1310
|
+
};
|
|
1303
1311
|
onDragStart: (cord: any) => void;
|
|
1304
1312
|
onDrag: (cord: any) => void;
|
|
1305
1313
|
onDragEnd: (cord: any) => void;
|
|
1306
1314
|
annotationAxis?: undefined;
|
|
1307
|
-
label?: undefined;
|
|
1308
1315
|
value?: undefined;
|
|
1309
1316
|
xMin?: undefined;
|
|
1310
1317
|
xMax?: undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oliasoft-open-source/charts-library",
|
|
3
|
-
"version": "4.3.0-beta-
|
|
3
|
+
"version": "4.3.0-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": {
|