@hpcc-js/chart 3.7.4 → 3.7.6

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.
Files changed (80) hide show
  1. package/LICENSE +43 -43
  2. package/README.md +93 -93
  3. package/dist/index.js +1 -1
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.umd.cjs +1 -1
  6. package/dist/index.umd.cjs.map +1 -1
  7. package/package.json +9 -7
  8. package/src/Area.md +176 -176
  9. package/src/Area.ts +12 -12
  10. package/src/Axis.css +35 -35
  11. package/src/Axis.ts +781 -781
  12. package/src/Bar.md +90 -90
  13. package/src/Bar.ts +9 -9
  14. package/src/Bubble.css +16 -16
  15. package/src/Bubble.md +69 -69
  16. package/src/Bubble.ts +196 -196
  17. package/src/BubbleXY.ts +14 -14
  18. package/src/Bullet.css +59 -59
  19. package/src/Bullet.md +104 -104
  20. package/src/Bullet.ts +176 -176
  21. package/src/Column.css +44 -44
  22. package/src/Column.md +90 -90
  23. package/src/Column.ts +684 -684
  24. package/src/Contour.md +88 -88
  25. package/src/Contour.ts +97 -97
  26. package/src/D3Cloud.ts +403 -403
  27. package/src/Gantt.md +119 -119
  28. package/src/Gantt.ts +14 -14
  29. package/src/Gauge.md +148 -148
  30. package/src/Gauge.ts +368 -368
  31. package/src/HalfPie.md +62 -62
  32. package/src/HalfPie.ts +26 -26
  33. package/src/Heat.md +42 -42
  34. package/src/Heat.ts +283 -283
  35. package/src/HexBin.css +8 -8
  36. package/src/HexBin.md +88 -88
  37. package/src/HexBin.ts +144 -144
  38. package/src/Line.css +4 -4
  39. package/src/Line.md +170 -170
  40. package/src/Line.ts +14 -14
  41. package/src/Pie.css +50 -50
  42. package/src/Pie.md +88 -88
  43. package/src/Pie.ts +546 -546
  44. package/src/QuarterPie.md +61 -61
  45. package/src/QuarterPie.ts +35 -35
  46. package/src/QuartileCandlestick.md +129 -129
  47. package/src/QuartileCandlestick.ts +349 -349
  48. package/src/Radar.css +14 -14
  49. package/src/Radar.md +104 -104
  50. package/src/Radar.ts +336 -336
  51. package/src/RadialBar.css +25 -25
  52. package/src/RadialBar.md +91 -91
  53. package/src/RadialBar.ts +217 -217
  54. package/src/Scatter.css +42 -42
  55. package/src/Scatter.md +163 -163
  56. package/src/Scatter.ts +412 -412
  57. package/src/StatChart.md +117 -117
  58. package/src/StatChart.ts +261 -261
  59. package/src/Step.md +163 -163
  60. package/src/Step.ts +12 -12
  61. package/src/Summary.css +55 -55
  62. package/src/Summary.md +219 -219
  63. package/src/Summary.ts +322 -322
  64. package/src/SummaryC.md +154 -154
  65. package/src/SummaryC.ts +240 -240
  66. package/src/WordCloud.css +2 -2
  67. package/src/WordCloud.md +144 -144
  68. package/src/WordCloud.ts +268 -268
  69. package/src/XYAxis.css +40 -40
  70. package/src/XYAxis.md +149 -149
  71. package/src/XYAxis.ts +809 -809
  72. package/src/__package__.ts +3 -3
  73. package/src/__tests__/heat.ts +71 -71
  74. package/src/__tests__/index.ts +3 -3
  75. package/src/__tests__/pie.ts +20 -20
  76. package/src/__tests__/stat.ts +16 -16
  77. package/src/__tests__/test3.ts +68 -68
  78. package/src/index.ts +28 -28
  79. package/src/test.ts +70 -70
  80. package/src/timeFormats.ts +26 -26
package/src/Gantt.md CHANGED
@@ -1,119 +1,119 @@
1
- # Gantt
2
-
3
- <!--meta
4
-
5
- -->
6
-
7
- Gantt compares ranges of continuous data. Each range is represented by an array of two numeric values. The first column of each data row must contain a string or number to represent that row's category. Each additional column must contain an array of two numbers.
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 { Gantt } from "@hpcc-js/chart";
15
-
16
- new Gantt()
17
- .target("placeholder")
18
- .columns(["Category", "Range"])
19
- .data([
20
- ["A", [34, 90]],
21
- ["B", [55, 75]],
22
- ["C", [75, 89]],
23
- ["D", [66, 99]]
24
- ])
25
- .render()
26
- ;
27
- </script>
28
- </hpcc-vitepress>
29
- </ClientOnly>
30
-
31
- Gantt also supports multiple ranges per data row.
32
-
33
- The _orientation_ is set to 'horizontal' by default so _yAxisTitle_ is used to assign the horizontal axis' label.
34
-
35
- _xAxisSeriesPaddingInner_ can be used to set the ratio between white space and bar size (per series).
36
-
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 { Gantt } from "@hpcc-js/chart";
44
-
45
- new Gantt()
46
- .target("placeholder")
47
- .columns(["State Changes", "Iron", "Aluminum", "Lead", "Gold"])
48
- .data([
49
- ["Solid", [0, 1811], [0, 933], [0, 600], [0,1337]],
50
- ["Liquid", [1811, 3134], [933, 2743], [600, 2022], [1337, 3243]],
51
- ["Gas", [3134, 5000], [2743, 5000], [2022, 5000], [3243, 5000]]
52
- ])
53
- .xAxisSeriesPaddingInner(0.3)
54
- .yAxisTitle("Kelvin")
55
- .render()
56
- ;
57
- </script>
58
- </hpcc-vitepress>
59
- </ClientOnly>
60
-
61
-
62
- It also supports duplicate category values.
63
-
64
-
65
- <ClientOnly>
66
- <hpcc-vitepress style="width:100%;height:600px">
67
- <div id="placeholder" style="height:400px">
68
- </div>
69
- <script type="module">
70
- import { Gantt } from "@hpcc-js/chart";
71
-
72
- new Gantt()
73
- .target("placeholder")
74
- .columns(["Category", "Range"])
75
- .data([
76
- ["A", [34, 90]],
77
- ["B", [55, 75]],
78
- ["A", [95, 120]],
79
- ["B", [85, 175]]
80
- ])
81
- .render()
82
- ;
83
- </script>
84
- </hpcc-vitepress>
85
- </ClientOnly>
86
-
87
-
88
- For documentation on axis-specific properties, like those used in the below example, take a look at the [Axis Documentation](./XYAxis.md).
89
-
90
-
91
- <ClientOnly>
92
- <hpcc-vitepress style="width:100%;height:600px">
93
- <div id="placeholder" style="height:400px">
94
- </div>
95
- <script type="module">
96
- import { Gantt } from "@hpcc-js/chart";
97
-
98
- new Gantt()
99
- .target("placeholder")
100
- .columns(["Project", "Date Range"])
101
- .data([
102
- ["Docs", ["2012-09-09", "2012-10-09"]],
103
- ["Coding", ["2011-08-09", "2012-09-09"]],
104
- ["Specs", ["2010-07-09", "2011-08-09"]]
105
- ])
106
- .yAxisType("time")
107
- .yAxisTypeTimePattern("%Y-%m-%d")
108
- .render()
109
- ;
110
- </script>
111
- </hpcc-vitepress>
112
- </ClientOnly>
113
-
114
-
115
- ## API
116
-
117
- ## Published Properties
118
- ```@hpcc-js/chart:Gantt
119
- ```
1
+ # Gantt
2
+
3
+ <!--meta
4
+
5
+ -->
6
+
7
+ Gantt compares ranges of continuous data. Each range is represented by an array of two numeric values. The first column of each data row must contain a string or number to represent that row's category. Each additional column must contain an array of two numbers.
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 { Gantt } from "@hpcc-js/chart";
15
+
16
+ new Gantt()
17
+ .target("placeholder")
18
+ .columns(["Category", "Range"])
19
+ .data([
20
+ ["A", [34, 90]],
21
+ ["B", [55, 75]],
22
+ ["C", [75, 89]],
23
+ ["D", [66, 99]]
24
+ ])
25
+ .render()
26
+ ;
27
+ </script>
28
+ </hpcc-vitepress>
29
+ </ClientOnly>
30
+
31
+ Gantt also supports multiple ranges per data row.
32
+
33
+ The _orientation_ is set to 'horizontal' by default so _yAxisTitle_ is used to assign the horizontal axis' label.
34
+
35
+ _xAxisSeriesPaddingInner_ can be used to set the ratio between white space and bar size (per series).
36
+
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 { Gantt } from "@hpcc-js/chart";
44
+
45
+ new Gantt()
46
+ .target("placeholder")
47
+ .columns(["State Changes", "Iron", "Aluminum", "Lead", "Gold"])
48
+ .data([
49
+ ["Solid", [0, 1811], [0, 933], [0, 600], [0,1337]],
50
+ ["Liquid", [1811, 3134], [933, 2743], [600, 2022], [1337, 3243]],
51
+ ["Gas", [3134, 5000], [2743, 5000], [2022, 5000], [3243, 5000]]
52
+ ])
53
+ .xAxisSeriesPaddingInner(0.3)
54
+ .yAxisTitle("Kelvin")
55
+ .render()
56
+ ;
57
+ </script>
58
+ </hpcc-vitepress>
59
+ </ClientOnly>
60
+
61
+
62
+ It also supports duplicate category values.
63
+
64
+
65
+ <ClientOnly>
66
+ <hpcc-vitepress style="width:100%;height:600px">
67
+ <div id="placeholder" style="height:400px">
68
+ </div>
69
+ <script type="module">
70
+ import { Gantt } from "@hpcc-js/chart";
71
+
72
+ new Gantt()
73
+ .target("placeholder")
74
+ .columns(["Category", "Range"])
75
+ .data([
76
+ ["A", [34, 90]],
77
+ ["B", [55, 75]],
78
+ ["A", [95, 120]],
79
+ ["B", [85, 175]]
80
+ ])
81
+ .render()
82
+ ;
83
+ </script>
84
+ </hpcc-vitepress>
85
+ </ClientOnly>
86
+
87
+
88
+ For documentation on axis-specific properties, like those used in the below example, take a look at the [Axis Documentation](./XYAxis.md).
89
+
90
+
91
+ <ClientOnly>
92
+ <hpcc-vitepress style="width:100%;height:600px">
93
+ <div id="placeholder" style="height:400px">
94
+ </div>
95
+ <script type="module">
96
+ import { Gantt } from "@hpcc-js/chart";
97
+
98
+ new Gantt()
99
+ .target("placeholder")
100
+ .columns(["Project", "Date Range"])
101
+ .data([
102
+ ["Docs", ["2012-09-09", "2012-10-09"]],
103
+ ["Coding", ["2011-08-09", "2012-09-09"]],
104
+ ["Specs", ["2010-07-09", "2011-08-09"]]
105
+ ])
106
+ .yAxisType("time")
107
+ .yAxisTypeTimePattern("%Y-%m-%d")
108
+ .render()
109
+ ;
110
+ </script>
111
+ </hpcc-vitepress>
112
+ </ClientOnly>
113
+
114
+
115
+ ## API
116
+
117
+ ## Published Properties
118
+ ```@hpcc-js/chart:Gantt
119
+ ```
package/src/Gantt.ts CHANGED
@@ -1,14 +1,14 @@
1
- import { Bar } from "./Bar.ts";
2
-
3
- export class Gantt extends Bar {
4
- constructor() {
5
- super();
6
-
7
- this
8
- .orientation_default("vertical")
9
- .xAxisType_default("ordinal")
10
- .yAxisType_default("time")
11
- ;
12
- }
13
- }
14
- Gantt.prototype._class += " chart_Gantt";
1
+ import { Bar } from "./Bar.ts";
2
+
3
+ export class Gantt extends Bar {
4
+ constructor() {
5
+ super();
6
+
7
+ this
8
+ .orientation_default("vertical")
9
+ .xAxisType_default("ordinal")
10
+ .yAxisType_default("time")
11
+ ;
12
+ }
13
+ }
14
+ Gantt.prototype._class += " chart_Gantt";
package/src/Gauge.md CHANGED
@@ -1,148 +1,148 @@
1
- # Gauge
2
-
3
- <!--meta
4
-
5
- -->
6
-
7
- A gauge chart displays a value between 0 and 1 as a percentage.
8
-
9
-
10
- <ClientOnly>
11
- <hpcc-vitepress style="width:100%;height:600px">
12
- <div id="placeholder" style="height:400px">
13
- </div>
14
- <script type="module">
15
- import { Gauge } from "@hpcc-js/chart";
16
-
17
- var gauge = new Gauge()
18
- .target("placeholder")
19
- .title("Example")
20
- .value(.38)
21
- .render()
22
- ;
23
- </script>
24
- </hpcc-vitepress>
25
- </ClientOnly>
26
-
27
-
28
- _tickValue_ can be used to display a point of interest. _showTick_ must be set to _true_ in order for the tick to be visible.
29
-
30
-
31
- <ClientOnly>
32
- <hpcc-vitepress style="width:100%;height:600px">
33
- <div id="placeholder" style="height:400px">
34
- </div>
35
- <script type="module">
36
- import { Gauge } from "@hpcc-js/chart";
37
-
38
- var gauge = new Gauge()
39
- .target("placeholder")
40
- .title("Gauge w/ Tick")
41
- .value(.38)
42
- .showTick(true)
43
- .tickValue(.62)
44
- .render()
45
- ;
46
- </script>
47
- </hpcc-vitepress>
48
- </ClientOnly>
49
-
50
-
51
- _titleDescription_, _valueDescription_ and _tickValueDescription_ can be used to specify hover text that displays while the cursor hovers the title, value or tick respectively.
52
-
53
- <ClientOnly>
54
- <hpcc-vitepress style="width:100%;height:600px">
55
- <div id="placeholder" style="height:400px">
56
- </div>
57
- <script type="module">
58
- import { Gauge } from "@hpcc-js/chart";
59
-
60
- var gauge = new Gauge()
61
- .target("placeholder")
62
- .title("Tick & Descriptions")
63
- .titleDescription("My Title Description")
64
- .value(.38)
65
- .valueDescription("My Value Description")
66
- .showTick(true)
67
- .tickValue(.62)
68
- .tickValueDescription("My Tick Description")
69
- .render()
70
- ;
71
- </script>
72
- </hpcc-vitepress>
73
- </ClientOnly>
74
-
75
-
76
- Custom colors can be specified using two properties. _colorRange_ expects an array of valid css color style strings. _colorDomain_ expects an array of threshold values from 0 to 1. For the best results these two arrays should have the same number of elements.
77
-
78
-
79
- <ClientOnly>
80
- <hpcc-vitepress style="width:100%;height:600px">
81
- <div id="placeholder" style="height:400px">
82
- </div>
83
- <script type="module">
84
- import { Gauge } from "@hpcc-js/chart";
85
-
86
- var gauge = new Gauge()
87
- .target("placeholder")
88
- .title("Custom Color Gauge")
89
- .value(0)
90
- .tickValue(0.5)
91
- .showTick(true)
92
- .colorDomain([0,0.25,0.5,0.75,1])
93
- .colorRange(["#0000FF","dodgerblue","goldenrod","orange","rgb(255,0,0)"])
94
- .emptyColor("#FFFFFF")
95
- .tickColor("red")
96
- .render()
97
- ;
98
-
99
- setInterval(function () {
100
- const v = gauge.value() + 0.25;
101
- gauge
102
- .value(v <= 1 ? v : 0)
103
- .lazyRender()
104
- ;
105
- }, 1000);
106
- </script>
107
- </hpcc-vitepress>
108
- </ClientOnly>
109
-
110
-
111
- When the values change, the gauge animates to display the new values.
112
-
113
-
114
- <ClientOnly>
115
- <hpcc-vitepress style="width:100%;height:600px">
116
- <div id="placeholder" style="height:400px">
117
- </div>
118
- <script type="module">
119
- import { Gauge } from "@hpcc-js/chart";
120
-
121
- var gauge = new Gauge()
122
- .target("placeholder")
123
- .title("My Gauge")
124
- .titleDescription("@hpcc-js/chart")
125
- .value(.66)
126
- .valueDescription("Main")
127
- .showTick(true)
128
- .tickValue(.33)
129
- .tickValueDescription("Average")
130
- .render()
131
- ;
132
-
133
- setInterval(function () {
134
- gauge
135
- .value(Math.random())
136
- .tickValue(Math.random())
137
- .lazyRender()
138
- ;
139
- }, 3000);
140
- </script>
141
- </hpcc-vitepress>
142
- </ClientOnly>
143
-
144
- ## API
145
-
146
- ## Published Properties
147
- ```@hpcc-js/chart:Gauge
148
- ```
1
+ # Gauge
2
+
3
+ <!--meta
4
+
5
+ -->
6
+
7
+ A gauge chart displays a value between 0 and 1 as a percentage.
8
+
9
+
10
+ <ClientOnly>
11
+ <hpcc-vitepress style="width:100%;height:600px">
12
+ <div id="placeholder" style="height:400px">
13
+ </div>
14
+ <script type="module">
15
+ import { Gauge } from "@hpcc-js/chart";
16
+
17
+ var gauge = new Gauge()
18
+ .target("placeholder")
19
+ .title("Example")
20
+ .value(.38)
21
+ .render()
22
+ ;
23
+ </script>
24
+ </hpcc-vitepress>
25
+ </ClientOnly>
26
+
27
+
28
+ _tickValue_ can be used to display a point of interest. _showTick_ must be set to _true_ in order for the tick to be visible.
29
+
30
+
31
+ <ClientOnly>
32
+ <hpcc-vitepress style="width:100%;height:600px">
33
+ <div id="placeholder" style="height:400px">
34
+ </div>
35
+ <script type="module">
36
+ import { Gauge } from "@hpcc-js/chart";
37
+
38
+ var gauge = new Gauge()
39
+ .target("placeholder")
40
+ .title("Gauge w/ Tick")
41
+ .value(.38)
42
+ .showTick(true)
43
+ .tickValue(.62)
44
+ .render()
45
+ ;
46
+ </script>
47
+ </hpcc-vitepress>
48
+ </ClientOnly>
49
+
50
+
51
+ _titleDescription_, _valueDescription_ and _tickValueDescription_ can be used to specify hover text that displays while the cursor hovers the title, value or tick respectively.
52
+
53
+ <ClientOnly>
54
+ <hpcc-vitepress style="width:100%;height:600px">
55
+ <div id="placeholder" style="height:400px">
56
+ </div>
57
+ <script type="module">
58
+ import { Gauge } from "@hpcc-js/chart";
59
+
60
+ var gauge = new Gauge()
61
+ .target("placeholder")
62
+ .title("Tick & Descriptions")
63
+ .titleDescription("My Title Description")
64
+ .value(.38)
65
+ .valueDescription("My Value Description")
66
+ .showTick(true)
67
+ .tickValue(.62)
68
+ .tickValueDescription("My Tick Description")
69
+ .render()
70
+ ;
71
+ </script>
72
+ </hpcc-vitepress>
73
+ </ClientOnly>
74
+
75
+
76
+ Custom colors can be specified using two properties. _colorRange_ expects an array of valid css color style strings. _colorDomain_ expects an array of threshold values from 0 to 1. For the best results these two arrays should have the same number of elements.
77
+
78
+
79
+ <ClientOnly>
80
+ <hpcc-vitepress style="width:100%;height:600px">
81
+ <div id="placeholder" style="height:400px">
82
+ </div>
83
+ <script type="module">
84
+ import { Gauge } from "@hpcc-js/chart";
85
+
86
+ var gauge = new Gauge()
87
+ .target("placeholder")
88
+ .title("Custom Color Gauge")
89
+ .value(0)
90
+ .tickValue(0.5)
91
+ .showTick(true)
92
+ .colorDomain([0,0.25,0.5,0.75,1])
93
+ .colorRange(["#0000FF","dodgerblue","goldenrod","orange","rgb(255,0,0)"])
94
+ .emptyColor("#FFFFFF")
95
+ .tickColor("red")
96
+ .render()
97
+ ;
98
+
99
+ setInterval(function () {
100
+ const v = gauge.value() + 0.25;
101
+ gauge
102
+ .value(v <= 1 ? v : 0)
103
+ .lazyRender()
104
+ ;
105
+ }, 1000);
106
+ </script>
107
+ </hpcc-vitepress>
108
+ </ClientOnly>
109
+
110
+
111
+ When the values change, the gauge animates to display the new values.
112
+
113
+
114
+ <ClientOnly>
115
+ <hpcc-vitepress style="width:100%;height:600px">
116
+ <div id="placeholder" style="height:400px">
117
+ </div>
118
+ <script type="module">
119
+ import { Gauge } from "@hpcc-js/chart";
120
+
121
+ var gauge = new Gauge()
122
+ .target("placeholder")
123
+ .title("My Gauge")
124
+ .titleDescription("@hpcc-js/chart")
125
+ .value(.66)
126
+ .valueDescription("Main")
127
+ .showTick(true)
128
+ .tickValue(.33)
129
+ .tickValueDescription("Average")
130
+ .render()
131
+ ;
132
+
133
+ setInterval(function () {
134
+ gauge
135
+ .value(Math.random())
136
+ .tickValue(Math.random())
137
+ .lazyRender()
138
+ ;
139
+ }, 3000);
140
+ </script>
141
+ </hpcc-vitepress>
142
+ </ClientOnly>
143
+
144
+ ## API
145
+
146
+ ## Published Properties
147
+ ```@hpcc-js/chart:Gauge
148
+ ```