@kiwibit/chart 1.0.3 → 1.0.8
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/README.md +8 -11
- package/esm2020/lib/chart.component.mjs +139 -81
- package/esm2020/lib/constants/chart.constants.mjs +3 -3
- package/esm2020/lib/models/chart.models.mjs +1 -6
- package/fesm2015/kiwibit-chart.mjs +144 -91
- package/fesm2015/kiwibit-chart.mjs.map +1 -1
- package/fesm2020/kiwibit-chart.mjs +140 -87
- package/fesm2020/kiwibit-chart.mjs.map +1 -1
- package/lib/chart.component.d.ts +60 -5
- package/lib/constants/chart.constants.d.ts +2 -2
- package/lib/models/chart.models.d.ts +94 -7
- package/package.json +1 -1
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interface to define the Chart model.
|
|
3
|
+
*
|
|
4
|
+
* @export
|
|
5
|
+
* @interface Chart
|
|
6
|
+
*/
|
|
1
7
|
export interface Chart {
|
|
2
8
|
title: string;
|
|
3
9
|
showLegend?: boolean;
|
|
@@ -7,29 +13,115 @@ export interface Chart {
|
|
|
7
13
|
yAxisType: AxisType;
|
|
8
14
|
yAxisName: string;
|
|
9
15
|
yAxisUom?: string;
|
|
16
|
+
/**
|
|
17
|
+
* If the chart should have rendering animations.
|
|
18
|
+
*
|
|
19
|
+
* @type {boolean}
|
|
20
|
+
* @memberof Chart
|
|
21
|
+
*/
|
|
10
22
|
hasAnimations?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* The list of Shapes that the chart must render.
|
|
25
|
+
* Each Shape corrisponds to a single chart component.
|
|
26
|
+
*
|
|
27
|
+
* @type {Shape[]}
|
|
28
|
+
* @memberof Chart
|
|
29
|
+
*/
|
|
11
30
|
shapes: Shape[];
|
|
31
|
+
/**
|
|
32
|
+
* Adds interaction with the chart, so that when clicking
|
|
33
|
+
* everywhere in the chart area a point gets added and it's coordinate are
|
|
34
|
+
* emitted with an event to the parent component.
|
|
35
|
+
*
|
|
36
|
+
* @type {boolean}
|
|
37
|
+
* @memberof Chart
|
|
38
|
+
*/
|
|
12
39
|
clickToAddPoint?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Custom name for the "clickToAddPoint" event related button.
|
|
42
|
+
*
|
|
43
|
+
* @type {string}
|
|
44
|
+
* @memberof Chart
|
|
45
|
+
*/
|
|
13
46
|
addPointCustomName?: string;
|
|
47
|
+
/**
|
|
48
|
+
* Adds the possibility to use the scroll
|
|
49
|
+
* to zoom in/out the chart area.
|
|
50
|
+
*
|
|
51
|
+
* @type {boolean}
|
|
52
|
+
* @memberof Chart
|
|
53
|
+
*/
|
|
14
54
|
scrollToZoom?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Tells the chart to render or not the grid lines.
|
|
57
|
+
*
|
|
58
|
+
* @type {boolean}
|
|
59
|
+
* @memberof Chart
|
|
60
|
+
*/
|
|
15
61
|
showGrid?: boolean;
|
|
16
62
|
}
|
|
17
63
|
export declare type Shape = Trace;
|
|
18
64
|
export interface Trace {
|
|
19
65
|
name?: string;
|
|
66
|
+
/**
|
|
67
|
+
* The variant of the Shape, must be of type Trace.
|
|
68
|
+
*
|
|
69
|
+
* @type {ShapeVariant}
|
|
70
|
+
* @memberof Trace
|
|
71
|
+
*/
|
|
20
72
|
variant: ShapeVariant;
|
|
21
73
|
color?: string;
|
|
74
|
+
/**
|
|
75
|
+
* The type of the Trace drawn by the chart.
|
|
76
|
+
* Can be a line or a scatter.
|
|
77
|
+
*
|
|
78
|
+
* @type {TraceType}
|
|
79
|
+
* @memberof Trace
|
|
80
|
+
*/
|
|
22
81
|
type: TraceType;
|
|
23
82
|
width?: number;
|
|
83
|
+
/**
|
|
84
|
+
* The list of points that define the Trace.
|
|
85
|
+
*
|
|
86
|
+
* @type {Point[]}
|
|
87
|
+
* @memberof Trace
|
|
88
|
+
*/
|
|
24
89
|
points: Point[];
|
|
90
|
+
/**
|
|
91
|
+
* Whether to show a smooth curve or a segmented curve.
|
|
92
|
+
*
|
|
93
|
+
* @type {boolean}
|
|
94
|
+
* @memberof Trace
|
|
95
|
+
*/
|
|
25
96
|
smooth?: boolean;
|
|
97
|
+
/**
|
|
98
|
+
* The style of the Trace.
|
|
99
|
+
* Can be solid, dashed or dotted.
|
|
100
|
+
*
|
|
101
|
+
* @type {TraceStyle}
|
|
102
|
+
* @memberof Trace
|
|
103
|
+
*/
|
|
26
104
|
style?: TraceStyle;
|
|
105
|
+
/**
|
|
106
|
+
* Option to make the Trace selected/deselected by default.
|
|
107
|
+
* A deselected Trace is obscured from the chart and can be toggled from the legend.
|
|
108
|
+
*
|
|
109
|
+
* @type {boolean}
|
|
110
|
+
* @memberof Trace
|
|
111
|
+
*/
|
|
27
112
|
selectedByDefault?: boolean;
|
|
28
113
|
}
|
|
29
114
|
export interface Point extends BasePoint {
|
|
30
115
|
name?: string;
|
|
116
|
+
/**
|
|
117
|
+
* Symbol used to represent the point in the chart.
|
|
118
|
+
*
|
|
119
|
+
* @type {PointSymbol}
|
|
120
|
+
* @memberof Point
|
|
121
|
+
*/
|
|
31
122
|
symbol?: PointSymbol;
|
|
32
123
|
symbolSize?: number;
|
|
124
|
+
color?: string;
|
|
33
125
|
}
|
|
34
126
|
export interface BasePoint {
|
|
35
127
|
x: number;
|
|
@@ -52,13 +144,8 @@ export declare enum TraceStyle {
|
|
|
52
144
|
DOTTED = "dotted"
|
|
53
145
|
}
|
|
54
146
|
export declare enum AxisType {
|
|
55
|
-
VALUE = "value"
|
|
56
|
-
CATEGORY = "category",
|
|
57
|
-
TIME = "time",
|
|
58
|
-
LOG = "log"
|
|
147
|
+
VALUE = "value"
|
|
59
148
|
}
|
|
60
149
|
export declare enum ShapeVariant {
|
|
61
|
-
TRACE = 0
|
|
62
|
-
POLYGON = 1,
|
|
63
|
-
CIRCLE = 2
|
|
150
|
+
TRACE = 0
|
|
64
151
|
}
|