@hpcc-js/chart 2.77.0 → 2.79.0

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/src/Step.md ADDED
@@ -0,0 +1,163 @@
1
+ # Step
2
+
3
+ <!--meta
4
+
5
+ -->
6
+
7
+ Step, [Area](./Area.md), [Line](./Line.md) and [Scatter](./Scatter.md) serve a similar purpose. They display continuous data along a categorical or continuous axis.
8
+
9
+ <ClientOnly>
10
+ <hpcc-vitepress style="width:100%;height:600px">
11
+ <div id="placeholder" style="height:400px">
12
+ </div>
13
+ <script type="module">
14
+ import { Step } from "@hpcc-js/chart";
15
+
16
+ new Step()
17
+ .target("placeholder")
18
+ .columns(["Category", "Value"])
19
+ .data([
20
+ ["A", 34],
21
+ ["B", 55],
22
+ ["C", 89],
23
+ ["D", 144]
24
+ ])
25
+ .render()
26
+ ;
27
+ </script>
28
+ </hpcc-vitepress>
29
+ </ClientOnly>
30
+
31
+ Step supports n-number of numeric values per data row. A series is created for each column as needed.
32
+
33
+ <ClientOnly>
34
+ <hpcc-vitepress style="width:100%;height:600px">
35
+ <div id="placeholder" style="height:400px">
36
+ </div>
37
+ <script type="module">
38
+ import { Step } from "@hpcc-js/chart";
39
+
40
+ new Step()
41
+ .target("placeholder")
42
+ .columns(["Category", "Value 1", "Value 2", "Value 3"])
43
+ .data([
44
+ ["A", 34, 90, 82],
45
+ ["B", 55, 50, 65],
46
+ ["C", 89, 75, 43],
47
+ ["D", 144, 66, 56]
48
+ ])
49
+ .render()
50
+ ;
51
+ </script>
52
+ </hpcc-vitepress>
53
+ </ClientOnly>
54
+
55
+ _pointShape_ can be used to specify the shape of each data point (see the property list below for potential values).
56
+
57
+ _pointSize_ can be used to set the size of each data point's shape.
58
+
59
+ _showValue_ specifies whether or not to display the value above each data point.
60
+
61
+ _yAxisDomainPadding_ can be used to reserve a percentage of the top and bottom edges for white space.
62
+
63
+ <ClientOnly>
64
+ <hpcc-vitepress style="width:100%;height:600px">
65
+ <div id="placeholder" style="height:400px">
66
+ </div>
67
+ <script type="module">
68
+ import { Step } from "@hpcc-js/chart";
69
+
70
+ new Step()
71
+ .target("placeholder")
72
+ .columns(["Category", "Value", "Value 2"])
73
+ .data([
74
+ ["A", 34, 350],
75
+ ["B", 55, 380],
76
+ ["C", 89, 390],
77
+ ["D", 98, 410]
78
+ ])
79
+ .pointShape("circle")
80
+ .pointSize(2)
81
+ .showValue(true)
82
+ .yAxisDomainPadding(10)
83
+ .render()
84
+ ;
85
+ </script>
86
+ </hpcc-vitepress>
87
+ </ClientOnly>
88
+
89
+ _interpolate_ can be used to specify which line interpolation mode is used to draw the connecting line between data points (see the property list below for potential values).
90
+
91
+ _pointDarken_ can be set to 'false' to disable the slight darkening effect applied to each data point.
92
+
93
+ _showValue_ along with _valueBaseline("central")_ places the values at the center of each data point.
94
+
95
+ _xAxisDomainPadding_ can be used to reserve a percentage of the left and right edges for white space.
96
+
97
+ <ClientOnly>
98
+ <hpcc-vitepress style="width:100%;height:600px">
99
+ <div id="placeholder" style="height:400px">
100
+ </div>
101
+ <script type="module">
102
+ import { Step } from "@hpcc-js/chart";
103
+
104
+ new Step()
105
+ .target("placeholder")
106
+ .columns(["Value 1", "Value 2"])
107
+ .data([
108
+ [144, 90],
109
+ [89, 50],
110
+ [55, 75],
111
+ [34, 66]
112
+ ])
113
+ .paletteID("FlatUI_German")
114
+ .xAxisType("linear")
115
+ .pointShape("rectangle")
116
+ .pointSize(20)
117
+ .pointDarken(false)
118
+ .showValue(true)
119
+ .valueBaseline("central")
120
+ .xAxisDomainPadding(5)
121
+ .render()
122
+ ;
123
+ </script>
124
+ </hpcc-vitepress>
125
+ </ClientOnly>
126
+
127
+ For documentation on axis-specific properties, like those used in the below example, take a look at the [Axis Documentation](./XYAxis.md).
128
+
129
+ <ClientOnly>
130
+ <hpcc-vitepress style="width:100%;height:600px">
131
+ <div id="placeholder" style="height:400px">
132
+ </div>
133
+ <script type="module">
134
+ import { Step } from "@hpcc-js/chart";
135
+
136
+ new Step()
137
+ .target("placeholder")
138
+ .columns(["Value 1", "Value 2"])
139
+ .data([
140
+ [144, 90],
141
+ [89, 50],
142
+ [55, 75],
143
+ [34, 66]
144
+ ])
145
+ .xAxisType("linear")
146
+ .xAxisTitle("X-Axis Title")
147
+ .yAxisTitle("Y-Axis Title")
148
+ .xAxisTickCount(30)
149
+ .xAxisOverlapMode("rotate")
150
+ .xAxisLabelRotation(90)
151
+ .pointShape("circle")
152
+ .render()
153
+ ;
154
+ </script>
155
+ </hpcc-vitepress>
156
+ </ClientOnly>
157
+
158
+ ## API
159
+
160
+ ## Published Properties
161
+
162
+ ```@hpcc-js/chart:Step
163
+ ```
package/src/Summary.md ADDED
@@ -0,0 +1,219 @@
1
+ # Summary
2
+
3
+ <!--meta
4
+
5
+ -->
6
+
7
+ Summary is commonly used to emphasize significant data points within a dashboard. It requires _labelColumn_ and _valueColumn_ to be specified.
8
+
9
+ <ClientOnly>
10
+ <hpcc-vitepress style="width:100%;height:600px">
11
+ <div id="placeholder" style="height:400px">
12
+ </div>
13
+ <script type="module">
14
+ import { Summary } from "@hpcc-js/chart";
15
+
16
+ new Summary()
17
+ .target("placeholder")
18
+ .columns(["Summary", "Score"])
19
+ .data([
20
+ ["Cars", 128]
21
+ ])
22
+ .labelColumn("Summary")
23
+ .valueColumn("Score")
24
+ .render()
25
+ ;
26
+ </script>
27
+ </hpcc-vitepress>
28
+ </ClientOnly>
29
+
30
+ _icon_ can be set to an empty string to prevent the default icon from displaying.
31
+
32
+ _hideMoreWrapper_ can hide the 'more info' section.
33
+
34
+ _textFontSize_ can be used to set the label font size.
35
+
36
+ _headerFontSize_ can be used to set the value font size.
37
+
38
+ <ClientOnly>
39
+ <hpcc-vitepress style="width:100%;height:600px">
40
+ <div id="placeholder" style="height:400px">
41
+ </div>
42
+ <script type="module">
43
+ import { Summary } from "@hpcc-js/chart";
44
+
45
+ new Summary()
46
+ .target("placeholder")
47
+ .columns(["Summary", "Score"])
48
+ .data([
49
+ ["Cars", 128]
50
+ ])
51
+ .labelColumn("Summary")
52
+ .valueColumn("Score")
53
+ .icon("")
54
+ .hideMoreWrapper(true)
55
+ .headerFontSize(120)
56
+ .textFontSize(20)
57
+ .render()
58
+ ;
59
+ </script>
60
+ </hpcc-vitepress>
61
+ </ClientOnly>
62
+
63
+ _icon_ can also be used to specify a class to be given to the icon's html element. In the example below a FontAwesome class is assigned.
64
+
65
+ _colorFill_ sets the background color.
66
+
67
+ _colorStroke_ sets the text and icon color.
68
+
69
+ <ClientOnly>
70
+ <hpcc-vitepress style="width:100%;height:600px">
71
+ <div id="placeholder" style="height:400px">
72
+ </div>
73
+ <script type="module">
74
+ import { Summary } from "@hpcc-js/chart";
75
+
76
+ new Summary()
77
+ .target("placeholder")
78
+ .columns(["Summary", "Score"])
79
+ .data([
80
+ ["Users", 256]
81
+ ])
82
+ .labelColumn("Summary")
83
+ .valueColumn("Score")
84
+ .icon("fa-users")
85
+ .colorFill("#eeeeee")
86
+ .colorStroke("#30336b")
87
+ .hideMoreWrapper(true)
88
+ .render()
89
+ ;
90
+ </script>
91
+ </hpcc-vitepress>
92
+ </ClientOnly>
93
+
94
+ _moreIcon_ can be used to specify a class to be given to the 'more info' icon's html element. In the example below a FontAwesome class is assigned.
95
+
96
+ _moreText_ can be used to specify content for the 'more info' section.
97
+
98
+ <ClientOnly>
99
+ <hpcc-vitepress style="width:100%;height:600px">
100
+ <div id="placeholder" style="height:400px">
101
+ </div>
102
+ <script type="module">
103
+ import { Summary } from "@hpcc-js/chart";
104
+
105
+ new Summary()
106
+ .target("placeholder")
107
+ .columns(["Summary", "Score"])
108
+ .data([
109
+ ["Users", 256]
110
+ ])
111
+ .labelColumn("Summary")
112
+ .valueColumn("Score")
113
+ .icon("fa-users")
114
+ .colorFill("#eeeeee")
115
+ .colorStroke("#30336b")
116
+ .moreIcon("fa-user-md")
117
+ .moreText("32 doctors")
118
+ .render()
119
+ ;
120
+ </script>
121
+ </hpcc-vitepress>
122
+ </ClientOnly>
123
+
124
+ _moreIcon_ can also be set to an empty string to prevent the default icon from displaying.
125
+
126
+ If _moreTextHTML_ is set to _true_ then the content within _moreText_ will be rendered as HTML.
127
+
128
+ <ClientOnly>
129
+ <hpcc-vitepress style="width:100%;height:600px">
130
+ <div id="placeholder" style="height:400px">
131
+ </div>
132
+ <script type="module">
133
+ import { Summary } from "@hpcc-js/chart";
134
+
135
+ new Summary()
136
+ .target("placeholder")
137
+ .columns(["Summary", "Score"])
138
+ .data([
139
+ ["Tweets", 512]
140
+ ])
141
+ .labelColumn("Summary")
142
+ .valueColumn("Score")
143
+ .icon("fa-twitter")
144
+ .colorFill("#eeeeee")
145
+ .colorStroke("#30336b")
146
+ .moreIcon("")
147
+ .moreText("<button onclick=\"alert('More info here')\">Click for more info</button>")
148
+ .moreTextHTML(true)
149
+ .render()
150
+ ;
151
+ </script>
152
+ </hpcc-vitepress>
153
+ </ClientOnly>
154
+
155
+ _playInterval_ can be used to cycle through multiple data rows. In the below example the play interval is set to 2000 milliseconds (two seconds).
156
+
157
+ <ClientOnly>
158
+ <hpcc-vitepress style="width:100%;height:600px">
159
+ <div id="placeholder" style="height:400px">
160
+ </div>
161
+ <script type="module">
162
+ import { Summary } from "@hpcc-js/chart";
163
+
164
+ new Summary()
165
+ .target("placeholder")
166
+ .columns(["Summary", "Score"])
167
+ .data([
168
+ ["Cars", 128],
169
+ ["Trucks", 64]
170
+ ])
171
+ .labelColumn("Summary")
172
+ .valueColumn("Score")
173
+ .icon("")
174
+ .hideMoreWrapper(true)
175
+ .headerFontSize(120)
176
+ .textFontSize(20)
177
+ .playInterval(2000)
178
+ .render()
179
+ ;
180
+ </script>
181
+ </hpcc-vitepress>
182
+ </ClientOnly>
183
+
184
+ _iconColumn_, _moreIconColumn_, _moreTextColumn_, _colorFillColumn_ and _colorStrokeColumn_ can be set to designate data row columns for these properties. This allows the properties to change for each data row.
185
+
186
+ <ClientOnly>
187
+ <hpcc-vitepress style="width:100%;height:600px">
188
+ <div id="placeholder" style="height:400px">
189
+ </div>
190
+ <script type="module">
191
+ import { Summary } from "@hpcc-js/chart";
192
+
193
+ new Summary()
194
+ .target("placeholder")
195
+ .columns(["Summary", "Score", "Icon", "MoreIcon", "Details", "Background", "TextColor"])
196
+ .data([
197
+ ["Cars", 128, "fa-automobile", "fa-truck", "64 Trucks", "grey", "black"],
198
+ ["Cold days", 256, "fa-thermometer-empty", "fa-thermometer", "16 Hot days", "#30336b", "white"]
199
+ ])
200
+ .labelColumn("Summary")
201
+ .valueColumn("Score")
202
+ .iconColumn("Icon")
203
+ .moreTextColumn("Details")
204
+ .moreIconColumn("MoreIcon")
205
+ .colorFillColumn("Background")
206
+ .colorStrokeColumn("TextColor")
207
+ .playInterval(2000)
208
+ .render()
209
+ ;
210
+ </script>
211
+ </hpcc-vitepress>
212
+ </ClientOnly>
213
+
214
+ ## API
215
+
216
+ ## Published Properties
217
+
218
+ ```@hpcc-js/chart:Summary
219
+ ```
@@ -0,0 +1,154 @@
1
+ # SummaryC
2
+
3
+ <!--meta
4
+
5
+ -->
6
+
7
+ SummaryC is commonly used to emphasize significant data points within a dashboard. It requires _labelColumn_ and _valueColumn_ to be specified.
8
+
9
+ <ClientOnly>
10
+ <hpcc-vitepress style="width:100%;height:600px">
11
+ <div id="placeholder" style="height:400px">
12
+ </div>
13
+ <script type="module">
14
+ import { SummaryC } from "@hpcc-js/chart";
15
+
16
+ new SummaryC()
17
+ .target("placeholder")
18
+ .columns(["Summary", "Score"])
19
+ .data([
20
+ ["Cars", 128]
21
+ ])
22
+ .labelColumn("Summary")
23
+ .valueColumn("Score")
24
+ .render()
25
+ ;
26
+ </script>
27
+ </hpcc-vitepress>
28
+ </ClientOnly>
29
+
30
+ _icon_ can be set to an empty string to prevent the default icon from displaying.
31
+
32
+ _fontSizeRatio_ can be used to set the font size ration between the value size and the label size.
33
+
34
+ <ClientOnly>
35
+ <hpcc-vitepress style="width:100%;height:600px">
36
+ <div id="placeholder" style="height:400px">
37
+ </div>
38
+ <script type="module">
39
+ import { SummaryC } from "@hpcc-js/chart";
40
+
41
+ new SummaryC()
42
+ .target("placeholder")
43
+ .columns(["Summary", "Score"])
44
+ .data([
45
+ ["Cars", 128]
46
+ ])
47
+ .labelColumn("Summary")
48
+ .valueColumn("Score")
49
+ .icon("")
50
+ .fontSizeRatio(0.38)
51
+ .render()
52
+ ;
53
+ </script>
54
+ </hpcc-vitepress>
55
+ </ClientOnly>
56
+
57
+ _icon_ can also be used to assign a FontAwesome icon by class.
58
+
59
+ _iconSizeRatio_ can be used to control the icon's size relative to the overall height.
60
+
61
+ _colorFill_ sets the background color.
62
+
63
+ _colorStroke_ sets the text and icon color.
64
+
65
+ _iconBaseline_ controls the vertical placement of the icon.
66
+
67
+ <ClientOnly>
68
+ <hpcc-vitepress style="width:100%;height:600px">
69
+ <div id="placeholder" style="height:400px">
70
+ </div>
71
+ <script type="module">
72
+ import { SummaryC } from "@hpcc-js/chart";
73
+
74
+ new SummaryC()
75
+ .target("placeholder")
76
+ .columns(["Summary", "Score"])
77
+ .data([
78
+ ["Users", 256]
79
+ ])
80
+ .labelColumn("Summary")
81
+ .valueColumn("Score")
82
+ .icon("fa-users")
83
+ .colorFill("#eeeeee")
84
+ .colorStroke("#30336b")
85
+ .iconSizeRatio(0.5)
86
+ .iconBaseline("middle")
87
+ .render()
88
+ ;
89
+ </script>
90
+ </hpcc-vitepress>
91
+ </ClientOnly>
92
+
93
+ _playInterval_ can be used to cycle through multiple data rows. In the below example the play interval is set to 2000 milliseconds (two seconds).
94
+
95
+ <ClientOnly>
96
+ <hpcc-vitepress style="width:100%;height:600px">
97
+ <div id="placeholder" style="height:400px">
98
+ </div>
99
+ <script type="module">
100
+ import { SummaryC } from "@hpcc-js/chart";
101
+
102
+ new SummaryC()
103
+ .target("placeholder")
104
+ .columns(["Summary", "Score", "Icon"])
105
+ .data([
106
+ ["Cars", 128, "fa-automobile"],
107
+ ["Trucks", 64, "fa-truck"]
108
+ ])
109
+ .labelColumn("Summary")
110
+ .valueColumn("Score")
111
+ .iconColumn("Icon")
112
+ .playInterval(2000)
113
+ .render()
114
+ ;
115
+ </script>
116
+ </hpcc-vitepress>
117
+ </ClientOnly>
118
+
119
+ _iconColumn_, _colorFillColumn_ and _colorStrokeColumn_ can be set to designate data row columns for these properties. This allows the properties to change for each data row.
120
+
121
+ <ClientOnly>
122
+ <hpcc-vitepress style="width:100%;height:600px">
123
+ <div id="placeholder" style="height:400px">
124
+ </div>
125
+ <script type="module">
126
+ import { SummaryC } from "@hpcc-js/chart";
127
+
128
+ new SummaryC()
129
+ .target("placeholder")
130
+ .columns(["Summary", "Score", "Icon", "Background", "TextColor"])
131
+ .data([
132
+ ["Cold days", 56, "fa-thermometer-0", "#95a5a6", "#34495e"],
133
+ ["Cool days", 120, "fa-thermometer-1", "white", "#2980b9"],
134
+ ["Warm days", 130, "fa-thermometer-2", "#f1c40f", "#d35400"],
135
+ ["Hot days", 59, "fa-thermometer-3", "#c0392b", "#ecf0f1"]
136
+ ])
137
+ .labelColumn("Summary")
138
+ .valueColumn("Score")
139
+ .iconColumn("Icon")
140
+ .colorFillColumn("Background")
141
+ .colorStrokeColumn("TextColor")
142
+ .playInterval(2000)
143
+ .render()
144
+ ;
145
+ </script>
146
+ </hpcc-vitepress>
147
+ </ClientOnly>
148
+
149
+ ## API
150
+
151
+ ## Published Properties
152
+
153
+ ```@hpcc-js/chart:SummaryC
154
+ ```
@@ -0,0 +1,144 @@
1
+ # WordCloud
2
+
3
+ <!--meta
4
+
5
+ -->
6
+
7
+ A word cloud chart displays words with prominence relative to the word’s given weight. The larger the weight value, relative to the other word weights, the bigger it appears in the word cloud.
8
+
9
+ <ClientOnly>
10
+ <hpcc-vitepress style="width:100%;height:600px">
11
+ <div id="placeholder" style="height:400px">
12
+ </div>
13
+ <script type="module">
14
+ import { WordCloud } from "@hpcc-js/chart";
15
+
16
+ new WordCloud()
17
+ .target("placeholder")
18
+ .columns(["Category", "Value"])
19
+ .data([
20
+ ["Apples", 34],
21
+ ["Bananas", 55],
22
+ ["Carrots", 89],
23
+ ["Danishes", 144],
24
+ ["Eggs", 60],
25
+ ["Figs", 72],
26
+ ["Ginger", 92],
27
+ ["Hazelnut", 102],
28
+ ["Incaberries", 52],
29
+ ["Jambalaya", 42],
30
+ ])
31
+ .render()
32
+ ;
33
+ </script>
34
+ </hpcc-vitepress>
35
+ </ClientOnly>
36
+
37
+ Use _fontFamily_ to set the font family. _fontSizeFrom_ and _fontSizeTo_ can be used to control the range of font sizes from the minimum word weight to the maximum word weight.
38
+
39
+ <ClientOnly>
40
+ <hpcc-vitepress style="width:100%;height:600px">
41
+ <div id="placeholder" style="height:400px">
42
+ </div>
43
+ <script type="module">
44
+ import { WordCloud } from "@hpcc-js/chart";
45
+
46
+ new WordCloud()
47
+ .target("placeholder")
48
+ .columns(["Category", "Value"])
49
+ .data([
50
+ ["Apples", 34],
51
+ ["Bananas", 55],
52
+ ["Carrots", 89],
53
+ ["Danishes", 144],
54
+ ["Eggs", 60],
55
+ ["Figs", 72],
56
+ ["Ginger", 92],
57
+ ["Hazelnut", 102],
58
+ ["Incaberries", 52],
59
+ ["Jambalaya", 42],
60
+ ])
61
+ .fontFamily("Chilanka")
62
+ .fontSizeFrom(12)
63
+ .fontSizeTo(24)
64
+ .render()
65
+ ;
66
+ </script>
67
+ </hpcc-vitepress>
68
+ </ClientOnly>
69
+
70
+ The rotation of the words are not bound to their weight. Use _angleFrom_ and _angleTo_ to set the minimum and maximum assigned angles. Use _angleCount_ to set the number of potential angles.
71
+
72
+ <ClientOnly>
73
+ <hpcc-vitepress style="width:100%;height:600px">
74
+ <div id="placeholder" style="height:400px">
75
+ </div>
76
+ <script type="module">
77
+ import { WordCloud } from "@hpcc-js/chart";
78
+
79
+ new WordCloud()
80
+ .target("placeholder")
81
+ .columns(["Category", "Value"])
82
+ .data([
83
+ ["Apples", 34],
84
+ ["Bananas", 55],
85
+ ["Carrots", 89],
86
+ ["Danishes", 144],
87
+ ["Eggs", 60],
88
+ ["Figs", 72],
89
+ ["Ginger", 92],
90
+ ["Hazelnut", 102],
91
+ ["Incaberries", 52],
92
+ ["Jambalaya", 42],
93
+ ])
94
+ .angleFrom(90)
95
+ .angleTo(0)
96
+ .angleCount(2)
97
+ .render()
98
+ ;
99
+ </script>
100
+ </hpcc-vitepress>
101
+ </ClientOnly>
102
+
103
+ Below is an example with a single angle of 45 degrees and font sizes ranging from 18 to 28 pixels.
104
+
105
+ <ClientOnly>
106
+ <hpcc-vitepress style="width:100%;height:600px">
107
+ <div id="placeholder" style="height:400px">
108
+ </div>
109
+ <script type="module">
110
+ import { WordCloud } from "@hpcc-js/chart";
111
+
112
+ new WordCloud()
113
+ .target("placeholder")
114
+ .columns(["Category", "Value"])
115
+ .data([
116
+ ["Apples", 34],
117
+ ["Bananas", 55],
118
+ ["Carrots", 89],
119
+ ["Danishes", 144],
120
+ ["Eggs", 60],
121
+ ["Figs", 72],
122
+ ["Ginger", 92],
123
+ ["Hazelnut", 102],
124
+ ["Incaberries", 52],
125
+ ["Jambalaya", 42],
126
+ ])
127
+ .fontFamily("Chilanka")
128
+ .angleFrom(45)
129
+ .angleTo(45)
130
+ .angleCount(1)
131
+ .fontSizeFrom(18)
132
+ .fontSizeTo(28)
133
+ .render()
134
+ ;
135
+ </script>
136
+ </hpcc-vitepress>
137
+ </ClientOnly>
138
+
139
+ ## API
140
+
141
+ ## Published Properties
142
+
143
+ ```@hpcc-js/chart:WordCloud
144
+ ```