@kiwibit/chart 1.0.2 → 1.0.7

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.
@@ -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,27 +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
+ */
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
+ */
13
54
  scrollToZoom?: boolean;
55
+ /**
56
+ * Tells the chart to render or not the grid lines.
57
+ *
58
+ * @type {boolean}
59
+ * @memberof Chart
60
+ */
61
+ showGrid?: boolean;
14
62
  }
15
63
  export declare type Shape = Trace;
16
64
  export interface Trace {
17
65
  name?: string;
66
+ /**
67
+ * The variant of the Shape, must be of type Trace.
68
+ *
69
+ * @type {ShapeVariant}
70
+ * @memberof Trace
71
+ */
18
72
  variant: ShapeVariant;
19
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
+ */
20
81
  type: TraceType;
21
82
  width?: number;
83
+ /**
84
+ * The list of points that define the Trace.
85
+ *
86
+ * @type {Point[]}
87
+ * @memberof Trace
88
+ */
22
89
  points: Point[];
90
+ /**
91
+ * Whether to show a smooth curve or a segmented curve.
92
+ *
93
+ * @type {boolean}
94
+ * @memberof Trace
95
+ */
23
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
+ */
24
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
+ */
25
112
  selectedByDefault?: boolean;
26
113
  }
27
114
  export interface Point extends BasePoint {
28
115
  name?: string;
116
+ /**
117
+ * Symbol used to represent the point in the chart.
118
+ *
119
+ * @type {PointSymbol}
120
+ * @memberof Point
121
+ */
29
122
  symbol?: PointSymbol;
30
123
  symbolSize?: number;
124
+ color?: string;
31
125
  }
32
126
  export interface BasePoint {
33
127
  x: number;
@@ -50,13 +144,8 @@ export declare enum TraceStyle {
50
144
  DOTTED = "dotted"
51
145
  }
52
146
  export declare enum AxisType {
53
- VALUE = "value",
54
- CATEGORY = "category",
55
- TIME = "time",
56
- LOG = "log"
147
+ VALUE = "value"
57
148
  }
58
149
  export declare enum ShapeVariant {
59
- TRACE = 0,
60
- POLYGON = 1,
61
- CIRCLE = 2
150
+ TRACE = 0
62
151
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiwibit/chart",
3
- "version": "1.0.2",
3
+ "version": "1.0.7",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^13.2.0",
6
6
  "@angular/core": "^13.2.0"