@d3plus/core 3.0.15 → 3.1.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.
Files changed (167) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +88482 -2998
  3. package/es/index.js +1 -1
  4. package/es/src/charts/AreaPlot.js +1 -3
  5. package/es/src/charts/BarChart.js +1 -3
  6. package/es/src/charts/BoxWhisker.js +2 -4
  7. package/es/src/charts/BumpChart.js +4 -5
  8. package/es/src/charts/Donut.js +1 -3
  9. package/es/src/charts/Geomap.js +47 -88
  10. package/es/src/charts/LinePlot.js +1 -3
  11. package/es/src/charts/Matrix.js +27 -46
  12. package/es/src/charts/Network.js +87 -81
  13. package/es/src/charts/Pack.js +21 -34
  14. package/es/src/charts/Pie.js +12 -24
  15. package/es/src/charts/Plot.js +226 -321
  16. package/es/src/charts/Priestley.js +18 -36
  17. package/es/src/charts/Radar.js +100 -47
  18. package/es/src/charts/RadialMatrix.js +35 -47
  19. package/es/src/charts/Rings.js +99 -90
  20. package/es/src/charts/Sankey.js +85 -75
  21. package/es/src/charts/StackedArea.js +1 -3
  22. package/es/src/charts/Tree.js +27 -28
  23. package/es/src/charts/Treemap.js +117 -71
  24. package/es/src/charts/Viz.js +297 -493
  25. package/es/src/charts/drawSteps/drawAttribution.js +1 -1
  26. package/es/src/charts/drawSteps/drawBack.js +1 -2
  27. package/es/src/charts/drawSteps/drawColorScale.js +1 -2
  28. package/es/src/charts/drawSteps/drawLegend.js +8 -10
  29. package/es/src/charts/drawSteps/drawSubtitle.js +1 -3
  30. package/es/src/charts/drawSteps/drawTimeline.js +12 -9
  31. package/es/src/charts/drawSteps/drawTitle.js +1 -3
  32. package/es/src/charts/drawSteps/drawTotal.js +1 -3
  33. package/es/src/charts/drawSteps/zoomControls.js +19 -21
  34. package/es/src/charts/events/click.legend.js +2 -3
  35. package/es/src/charts/events/click.shape.js +2 -4
  36. package/es/src/charts/events/mouseenter.js +7 -8
  37. package/es/src/charts/events/mouseleave.js +1 -3
  38. package/es/src/charts/events/mousemove.legend.js +3 -4
  39. package/es/src/charts/events/mousemove.shape.js +2 -4
  40. package/es/src/charts/events/touchstart.body.js +1 -1
  41. package/es/src/charts/helpers/matrixData.js +11 -4
  42. package/es/src/charts/helpers/tileAttributions.js +2 -1
  43. package/es/src/charts/plotBuffers/Bar.js +55 -12
  44. package/es/src/charts/plotBuffers/Box.js +55 -12
  45. package/es/src/charts/plotBuffers/Circle.js +9 -11
  46. package/es/src/charts/plotBuffers/Line.js +4 -6
  47. package/es/src/charts/plotBuffers/Rect.js +10 -12
  48. package/es/src/charts/plotBuffers/discreteBuffer.js +4 -2
  49. package/es/src/charts/plotBuffers/numericBuffer.js +7 -6
  50. package/es/src/components/Axis.js +298 -426
  51. package/es/src/components/AxisBottom.js +1 -3
  52. package/es/src/components/AxisLeft.js +1 -3
  53. package/es/src/components/AxisRight.js +1 -3
  54. package/es/src/components/AxisTop.js +1 -3
  55. package/es/src/components/ColorScale.js +80 -197
  56. package/es/src/components/Legend.js +82 -135
  57. package/es/src/components/Message.js +27 -19
  58. package/es/src/components/TextBox.js +106 -262
  59. package/es/src/components/Timeline.js +88 -155
  60. package/es/src/components/Tooltip.js +301 -330
  61. package/es/src/shapes/Area.js +95 -74
  62. package/es/src/shapes/Bar.js +46 -86
  63. package/es/src/shapes/Box.js +104 -118
  64. package/es/src/shapes/Circle.js +29 -30
  65. package/es/src/shapes/Image.js +44 -102
  66. package/es/src/shapes/Line.js +74 -40
  67. package/es/src/shapes/Path.js +23 -25
  68. package/es/src/shapes/Rect.js +29 -41
  69. package/es/src/shapes/Shape.js +152 -369
  70. package/es/src/shapes/Whisker.js +89 -90
  71. package/es/src/utils/AccessorFn.js +4 -0
  72. package/es/src/utils/BaseClass.js +53 -82
  73. package/es/src/utils/D3plusConfig.js +1 -0
  74. package/es/src/utils/RESET.js +2 -4
  75. package/es/src/utils/accessor.js +4 -5
  76. package/es/src/utils/configPrep.js +13 -12
  77. package/es/src/utils/constant.js +2 -3
  78. package/es/src/utils/getProp.js +4 -4
  79. package/es/src/utils/index.js +0 -1
  80. package/package.json +29 -22
  81. package/types/index.d.ts +5 -0
  82. package/types/src/charts/AreaPlot.d.ts +16 -0
  83. package/types/src/charts/BarChart.d.ts +16 -0
  84. package/types/src/charts/BoxWhisker.d.ts +11 -0
  85. package/types/src/charts/BumpChart.d.ts +36 -0
  86. package/types/src/charts/Donut.d.ts +11 -0
  87. package/types/src/charts/Geomap.d.ts +120 -0
  88. package/types/src/charts/LinePlot.d.ts +15 -0
  89. package/types/src/charts/Matrix.d.ts +74 -0
  90. package/types/src/charts/Network.d.ts +78 -0
  91. package/types/src/charts/Pack.d.ts +47 -0
  92. package/types/src/charts/Pie.d.ts +44 -0
  93. package/types/src/charts/Plot.d.ts +199 -0
  94. package/types/src/charts/Priestley.d.ts +37 -0
  95. package/types/src/charts/Radar.d.ts +38 -0
  96. package/types/src/charts/RadialMatrix.d.ts +78 -0
  97. package/types/src/charts/Rings.d.ts +74 -0
  98. package/types/src/charts/Sankey.d.ts +81 -0
  99. package/types/src/charts/StackedArea.d.ts +14 -0
  100. package/types/src/charts/Tree.d.ts +33 -0
  101. package/types/src/charts/Treemap.d.ts +51 -0
  102. package/types/src/charts/Viz.d.ts +402 -0
  103. package/types/src/charts/drawSteps/drawAttribution.d.ts +7 -0
  104. package/types/src/charts/drawSteps/drawBack.d.ts +6 -0
  105. package/types/src/charts/drawSteps/drawColorScale.d.ts +6 -0
  106. package/types/src/charts/drawSteps/drawLegend.d.ts +12 -0
  107. package/types/src/charts/drawSteps/drawSubtitle.d.ts +7 -0
  108. package/types/src/charts/drawSteps/drawTimeline.d.ts +7 -0
  109. package/types/src/charts/drawSteps/drawTitle.d.ts +7 -0
  110. package/types/src/charts/drawSteps/drawTotal.d.ts +7 -0
  111. package/types/src/charts/drawSteps/zoomControls.d.ts +7 -0
  112. package/types/src/charts/events/click.legend.d.ts +8 -0
  113. package/types/src/charts/events/click.shape.d.ts +8 -0
  114. package/types/src/charts/events/mouseenter.d.ts +8 -0
  115. package/types/src/charts/events/mouseleave.d.ts +8 -0
  116. package/types/src/charts/events/mousemove.legend.d.ts +9 -0
  117. package/types/src/charts/events/mousemove.shape.d.ts +9 -0
  118. package/types/src/charts/events/touchstart.body.d.ts +7 -0
  119. package/types/src/charts/helpers/matrixData.d.ts +11 -0
  120. package/types/src/charts/helpers/tileAttributions.d.ts +6 -0
  121. package/types/src/charts/index.d.ts +21 -0
  122. package/types/src/charts/plotBuffers/Bar.d.ts +16 -0
  123. package/types/src/charts/plotBuffers/Box.d.ts +16 -0
  124. package/types/src/charts/plotBuffers/Circle.d.ts +20 -0
  125. package/types/src/charts/plotBuffers/Line.d.ts +16 -0
  126. package/types/src/charts/plotBuffers/Rect.d.ts +19 -0
  127. package/types/src/charts/plotBuffers/discreteBuffer.d.ts +7 -0
  128. package/types/src/charts/plotBuffers/numericBuffer.d.ts +5 -0
  129. package/types/src/components/Axis.d.ts +309 -0
  130. package/types/src/components/AxisBottom.d.ts +11 -0
  131. package/types/src/components/AxisLeft.d.ts +11 -0
  132. package/types/src/components/AxisRight.d.ts +11 -0
  133. package/types/src/components/AxisTop.d.ts +11 -0
  134. package/types/src/components/ColorScale.d.ts +208 -0
  135. package/types/src/components/Legend.d.ts +157 -0
  136. package/types/src/components/Message.d.ts +40 -0
  137. package/types/src/components/TextBox.d.ts +278 -0
  138. package/types/src/components/Timeline.d.ts +157 -0
  139. package/types/src/components/Tooltip.d.ts +297 -0
  140. package/types/src/components/index.d.ts +11 -0
  141. package/types/src/shapes/Area.d.ts +81 -0
  142. package/types/src/shapes/Bar.d.ts +104 -0
  143. package/types/src/shapes/Box.d.ts +121 -0
  144. package/types/src/shapes/Circle.d.ts +44 -0
  145. package/types/src/shapes/Image.d.ts +124 -0
  146. package/types/src/shapes/Line.d.ts +48 -0
  147. package/types/src/shapes/Path.d.ts +38 -0
  148. package/types/src/shapes/Rect.d.ts +54 -0
  149. package/types/src/shapes/Shape.d.ts +378 -0
  150. package/types/src/shapes/Whisker.d.ts +96 -0
  151. package/types/src/shapes/index.d.ts +10 -0
  152. package/types/src/utils/AccessorFn.d.ts +6 -0
  153. package/types/src/utils/BaseClass.d.ts +76 -0
  154. package/types/src/utils/D3plusConfig.d.ts +164 -0
  155. package/types/src/utils/RESET.d.ts +3 -0
  156. package/types/src/utils/accessor.d.ts +13 -0
  157. package/types/src/utils/configPrep.d.ts +28 -0
  158. package/types/src/utils/constant.d.ts +11 -0
  159. package/types/src/utils/getProp.d.ts +9 -0
  160. package/types/src/utils/index.d.ts +8 -0
  161. package/umd/d3plus-core.full.js +20134 -18708
  162. package/umd/d3plus-core.full.js.map +1 -1
  163. package/umd/d3plus-core.full.min.js +2922 -5396
  164. package/umd/d3plus-core.js +1927 -4081
  165. package/umd/d3plus-core.js.map +1 -1
  166. package/umd/d3plus-core.min.js +1607 -3939
  167. package/es/src/utils/uuid.js +0 -13
@@ -0,0 +1,199 @@
1
+ import Viz from "./Viz.js";
2
+ /**
3
+ Creates an x/y plot based on an array of data.
4
+ */
5
+ export default class Plot extends Viz {
6
+ [key: string]: any;
7
+ /**
8
+ Invoked when creating a new class instance, and sets any default parameters.
9
+ @private
10
+ */
11
+ constructor();
12
+ /**
13
+ Extends the preDraw behavior of the abstract Viz class.
14
+ @private
15
+ */
16
+ _preDraw(): void;
17
+ /**
18
+ Extends the draw behavior of the abstract Viz class.
19
+ @private
20
+ */
21
+ _draw(callback?: () => void): this;
22
+ /**
23
+ Allows drawing custom shapes to be used as annotations in the provided x/y plot. This method accepts custom config objects for the [Shape](http://d3plus.org/docs/#Shape) class, either a single config object or an array of config objects. Each config object requires an additional parameter, the "shape", which denotes which [Shape](http://d3plus.org/docs/#Shape) sub-class to use ([Rect](http://d3plus.org/docs/#Rect), [Line](http://d3plus.org/docs/#Line), etc).
24
+
25
+ Additionally, each config object can also contain an optional "layer" key, which defines whether the annotations will be displayed in "front" or in "back" of the primary visualization shapes. This value defaults to "back" if not present.
26
+ */
27
+ annotations(_: any): any;
28
+ /**
29
+ Determines whether the x and y axes should have their scales persist while users filter the data, the timeline being the prime example (set this to `true` to make the axes stay consistent when the timeline changes).
30
+ */
31
+ axisPersist(_: any): any;
32
+ /**
33
+ A d3plus-shape configuration Object used for styling the background rectangle of the inner x/y plot (behind all of the shapes and gridlines).
34
+ */
35
+ backgroundConfig(_: any): any;
36
+ /**
37
+ The pixel space between each bar in a group of bars.
38
+ */
39
+ barPadding(_: any): any;
40
+ /**
41
+ The baseline for the x/y plot.
42
+ */
43
+ baseline(_: any): any;
44
+ /**
45
+ Determines whether or not to add additional padding at the ends of x or y scales. The most commone use for this is in Scatter Plots, so that the shapes do not appear directly on the axis itself. The value provided can either be `true` or `false` to toggle the behavior for all shape types, or a keyed Object for each shape type (ie. `{Bar: false, Circle: true, Line: false}`).
46
+ */
47
+ buffer(_: any): any;
48
+ /**
49
+ The confidence interval as an array of [lower, upper] bounds.
50
+
51
+ @example <caption>Can be called with accessor functions or static keys:</caption>
52
+ var data = {id: "alpha", value: 10, lci: 9, hci: 11};
53
+ ...
54
+ // Accessor functions
55
+ .confidence([function(d) { return d.lci }, function(d) { return d.hci }])
56
+
57
+ // Or static keys
58
+ .confidence(["lci", "hci"])
59
+ */
60
+ confidence(_: any): any;
61
+ /**
62
+ Configuration object for shapes rendered as confidence intervals.
63
+ */
64
+ confidenceConfig(_: any): any;
65
+ /**
66
+ When the width or height of the chart is less than or equal to this pixel value, the discrete axis will not be shown. This helps produce slick sparklines. Set this value to `0` to disable the behavior entirely.
67
+ */
68
+ discreteCutoff(_: any): any;
69
+ /**
70
+ The pixel space between groups of bars.
71
+ */
72
+ groupPadding(_: any): any;
73
+ /**
74
+ The d3plus-shape config used on the Line shapes created to connect lineLabels to the end of their associated Line path.
75
+ */
76
+ labelConnectorConfig(_: any): any;
77
+ /**
78
+ The behavior to be used when calculating the position and size of each shape's label(s). The value passed can either be the _String_ name of the behavior to be used for all shapes, or an accessor _Function_ that will be provided each data point and will be expected to return the behavior to be used for that data point. The availability and options for this method depend on the default logic for each Shape. As an example, the values "outside" or "inside" can be set for Bar shapes, whose "auto" default will calculate the best position dynamically based on the available space.
79
+ */
80
+ labelPosition(_: any): any;
81
+ /**
82
+ Draws labels on the right side of any Line shapes that are drawn on the plot.
83
+ */
84
+ lineLabels(_: any): any;
85
+ /**
86
+ Shape config for the Circle shapes drawn by the lineMarkers method.
87
+ */
88
+ lineMarkerConfig(_: any): any;
89
+ /**
90
+ Draws circle markers on each vertex of a Line.
91
+ */
92
+ lineMarkers(_: any): any;
93
+ /**
94
+ A JavaScript [sort comparator function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) that receives each shape Class (ie. "Circle", "Line", etc) as it's comparator arguments. Shapes are drawn in groups based on their type, so you are defining the layering order for all shapes of said type.
95
+ */
96
+ shapeSort(_: any): any;
97
+ /**
98
+ Sets the size of bubbles to the given Number, data key, or function.
99
+ */
100
+ size(_: any): any;
101
+ /**
102
+ Sets the size scale maximum to the specified number.
103
+ */
104
+ sizeMax(_: any): any;
105
+ /**
106
+ Sets the size scale minimum to the specified number.
107
+ */
108
+ sizeMin(_: any): any;
109
+ /**
110
+ Sets the size scale to the specified string.
111
+ */
112
+ sizeScale(_: any): any;
113
+ /**
114
+ If *value* is specified, toggles shape stacking. If *value* is not specified, returns the current stack value.
115
+ */
116
+ stacked(_: any): any;
117
+ /**
118
+ Sets the stack offset. If *value* is not specified, returns the current stack offset function.
119
+ */
120
+ stackOffset(_: any): any;
121
+ /**
122
+ Sets the stack order. If *value* is not specified, returns the current stack order function.
123
+ */
124
+ stackOrder(_: any): any;
125
+ /**
126
+ Accessor function or string key for the x-axis value of each data point.
127
+ */
128
+ x(_: any): any;
129
+ /**
130
+ Accessor function or string key for the secondary x-axis value of each data point.
131
+ */
132
+ x2(_: any): any;
133
+ /**
134
+ A pass-through to the underlying [Axis](http://d3plus.org/docs/#Axis) config used for the x-axis. Includes additional functionality where passing "auto" as the value for the [scale](http://d3plus.org/docs/#Axis.scale) method will determine if the scale should be "linear" or "log" based on the provided data.
135
+ */
136
+ xConfig(_: any): any;
137
+ /**
138
+ When the width of the chart is less than or equal to this pixel value, and the x-axis is not the discrete axis, it will not be shown. This helps produce slick sparklines. Set this value to `0` to disable the behavior entirely.
139
+ */
140
+ xCutoff(_: any): any;
141
+ /**
142
+ A pass-through to the underlying [Axis](http://d3plus.org/docs/#Axis) config used for the secondary x-axis. Includes additional functionality where passing "auto" as the value for the [scale](http://d3plus.org/docs/#Axis.scale) method will determine if the scale should be "linear" or "log" based on the provided data.
143
+ */
144
+ x2Config(_: any): any;
145
+ /**
146
+ The x domain as an array. If either value is undefined, it will be calculated from the data.
147
+ */
148
+ xDomain(_: any): any;
149
+ /**
150
+ The x2 domain as an array. If either value is undefined, it will be calculated from the data.
151
+ */
152
+ x2Domain(_: any): any;
153
+ /**
154
+ Defines a custom sorting comparitor function to be used for discrete x axes.
155
+ */
156
+ xSort(_: any): any;
157
+ /**
158
+ Defines a custom sorting comparitor function to be used for discrete x2 axes.
159
+ */
160
+ x2Sort(_: any): any;
161
+ /**
162
+ Accessor function or string key for the y-axis value of each data point.
163
+ */
164
+ y(_: any): any;
165
+ /**
166
+ Accessor function or string key for the secondary y-axis value of each data point.
167
+ */
168
+ y2(_: any): any;
169
+ /**
170
+ A pass-through to the underlying [Axis](http://d3plus.org/docs/#Axis) config used for the y-axis. Includes additional functionality where passing "auto" as the value for the [scale](http://d3plus.org/docs/#Axis.scale) method will determine if the scale should be "linear" or "log" based on the provided data.
171
+
172
+ *Note:* If a "domain" array is passed to the y-axis config, it will be reversed.
173
+ */
174
+ yConfig(_: any): any;
175
+ /**
176
+ When the height of the chart is less than or equal to this pixel value, and the y-axis is not the discrete axis, it will not be shown. This helps produce slick sparklines. Set this value to `0` to disable the behavior entirely.
177
+ */
178
+ yCutoff(_: any): any;
179
+ /**
180
+ A pass-through to the underlying [Axis](http://d3plus.org/docs/#Axis) config used for the secondary y-axis. Includes additional functionality where passing "auto" as the value for the [scale](http://d3plus.org/docs/#Axis.scale) method will determine if the scale should be "linear" or "log" based on the provided data.
181
+ */
182
+ y2Config(_: any): any;
183
+ /**
184
+ The y domain as an array. If either value is undefined, it will be calculated from the data.
185
+ */
186
+ yDomain(_: any): any;
187
+ /**
188
+ The y2 domain as an array. If either value is undefined, it will be calculated from the data.
189
+ */
190
+ y2Domain(_: any): any;
191
+ /**
192
+ Defines a custom sorting comparitor function to be used for discrete y axes.
193
+ */
194
+ ySort(_: any): any;
195
+ /**
196
+ Defines a custom sorting comparitor function to be used for discrete y2 axes.
197
+ */
198
+ y2Sort(_: any): any;
199
+ }
@@ -0,0 +1,37 @@
1
+ import Viz from "./Viz.js";
2
+ /**
3
+ Creates a priestley timeline based on an array of data.
4
+ */
5
+ export default class Priestley extends Viz {
6
+ [key: string]: any;
7
+ /**
8
+ Invoked when creating a new class instance, and sets any default parameters.
9
+ @private
10
+ */
11
+ constructor();
12
+ /**
13
+ Extends the render behavior of the abstract Viz class.
14
+ @private
15
+ */
16
+ _draw(callback?: () => void): this;
17
+ /**
18
+ Configuration object for the axis.
19
+ */
20
+ axisConfig(_: any): any;
21
+ /**
22
+ Accessor function or string key for the end date of each data point.
23
+ */
24
+ end(_: any): any;
25
+ /**
26
+ The [paddingInner](https://github.com/d3/d3-scale#band_paddingInner) value of the underlining [Band Scale](https://github.com/d3/d3-scale#band-scales) used to determine the height of each bar. Values should be a ratio between 0 and 1 representing the space in between each rectangle.
27
+ */
28
+ paddingInner(_: any): any;
29
+ /**
30
+ The [paddingOuter](https://github.com/d3/d3-scale#band_paddingOuter) value of the underlining [Band Scale](https://github.com/d3/d3-scale#band-scales) used to determine the height of each bar. Values should be a ratio between 0 and 1 representing the space around the outer rectangles.
31
+ */
32
+ paddingOuter(_: any): any;
33
+ /**
34
+ Accessor function or string key for the start date of each data point.
35
+ */
36
+ start(_: any): any;
37
+ }
@@ -0,0 +1,38 @@
1
+ import Viz from "./Viz.js";
2
+ /**
3
+ Creates a radar visualization based on an array of data.
4
+ */
5
+ export default class Radar extends Viz {
6
+ [key: string]: any;
7
+ /**
8
+ Invoked when creating a new class instance, and overrides any default parameters inherited from Viz.
9
+ @private
10
+ */
11
+ constructor();
12
+ /**
13
+ Extends the draw behavior of the abstract Viz class.
14
+ @private
15
+ */
16
+ _draw(callback?: () => void): this;
17
+ /**
18
+ Configuration object for the radial spokes, circles, and labels.
19
+ */
20
+ axisConfig(_: any): any;
21
+ /**
22
+ Accessor function for the metric value used as each axis.
23
+ */
24
+ metric(_: any): any;
25
+ /**
26
+ Determines how much pixel spaces to give the outer labels.
27
+ */
28
+ outerPadding(_: any): any;
29
+ /**
30
+ The value accessor used to determine each data point's position along each axis.
31
+
32
+ @example
33
+ function value(d) {
34
+ return d.value;
35
+ }
36
+ */
37
+ value(_: any): any;
38
+ }
@@ -0,0 +1,78 @@
1
+ import Viz from "./Viz.js";
2
+ /**
3
+ Creates a radial layout of a rows/columns Matrix of any dataset. See [this example](https://d3plus.org/examples/d3plus-matrix/radial-matrix/) for help getting started using the Matrix class.
4
+ */
5
+ export default class RadialMatrix extends Viz {
6
+ [key: string]: any;
7
+ /**
8
+ Invoked when creating a new class instance, and sets any default parameters.
9
+ @private
10
+ */
11
+ constructor();
12
+ /**
13
+ Extends the draw behavior of the abstract Viz class.
14
+ @private
15
+ */
16
+ _draw(callback?: () => void): this;
17
+ /**
18
+ The pixel padding in between each cell.
19
+ */
20
+ cellPadding(_: any): any;
21
+ /**
22
+ Determines which key in your data should be used for each column in the matrix. Can be either a String that matches a key used in every data point, or an accessor function that receives a data point and it's index in the data array, and is expected to return it's column value.
23
+
24
+ @example
25
+ function column(d) {
26
+ return d.name;
27
+ }
28
+ */
29
+ column(_: any): any;
30
+ /**
31
+ A pass-through to the underlying [Axis](http://d3plus.org/docs/#Axis) config used for the column labels.
32
+ */
33
+ columnConfig(_: any): any;
34
+ /**
35
+ A manual list of IDs to be used for rows.
36
+ */
37
+ columnList(_: any): any;
38
+ /**
39
+ A sort comparator function that is run on the unique set of column values.
40
+
41
+ @example
42
+ function column(a, b) {
43
+ return a.localeCompare(b);
44
+ }
45
+ */
46
+ columnSort(_: any): any;
47
+ /**
48
+ The radius (in pixels) for the inner donut hole of the diagram. Can either be a static Number, or an accessor function that receives the outer radius as it's only argument.
49
+
50
+ @example
51
+ function(outerRadius) {
52
+ return outerRadius / 5;
53
+ }
54
+ */
55
+ innerRadius(_: any): any;
56
+ /**
57
+ Determines which key in your data should be used for each row in the matrix. Can be either a String that matches a key used in every data point, or an accessor function that receives a data point and it's index in the data array, and is expected to return it's row value.
58
+
59
+ @example
60
+ function row(d) {
61
+ return d.name;
62
+ }
63
+ */
64
+ row(_: any): any;
65
+ /**
66
+ A manual list of IDs to be used for rows.
67
+ */
68
+ rowList(_: any): any;
69
+ /**
70
+ A sort comparator function that is run on the unique set of row values.
71
+
72
+ @example
73
+ function row(a, b) {
74
+ return a.localeCompare(b);
75
+ }
76
+ */
77
+ rowSort(_: any): any;
78
+ }
@@ -0,0 +1,74 @@
1
+ import Viz from "./Viz.js";
2
+ /**
3
+ Creates a ring visualization based on a defined set of nodes and edges. [Click here](http://d3plus.org/examples/d3plus-network/simple-rings/) for help getting started using the Rings class.
4
+ */
5
+ export default class Rings extends Viz {
6
+ [key: string]: any;
7
+ /**
8
+ Invoked when creating a new class instance, and sets any default parameters.
9
+ @private
10
+ */
11
+ constructor();
12
+ /**
13
+ Extends the draw behavior of the abstract Viz class.
14
+ @private
15
+ */
16
+ _draw(callback?: () => void): this;
17
+ /**
18
+ The center node, specified by id.
19
+ */
20
+ center(_: any): any;
21
+ /**
22
+ The hover callback function for highlighting shapes on mouseover.
23
+ */
24
+ hover(_: any): this;
25
+ /**
26
+ A predefined *Array* of edges that connect each object passed to the [node](#Rings.node) method. The `source` and `target` keys in each link need to map to the nodes in one of three ways:
27
+ 1. The index of the node in the nodes array (as in [this](http://d3plus.org/examples/d3plus-network/getting-started/) example).
28
+ 2. The actual node *Object* itself.
29
+ 3. A *String* value matching the `id` of the node.
30
+
31
+ The value passed should either be an *Array* of data or a *String* representing a filepath or URL to be loaded. An optional formatting function can be passed as a second argument to this method. This custom function will be passed the data that has been loaded, as long as there are no errors. This function should return the final links *Array*.
32
+ @param f Array of link objects or a URL to load links from.
33
+ */
34
+ links(_: any, f?: any): any;
35
+ /**
36
+ Defines the thickness of the links connecting each node. The value provided can be either a pixel Number to be used for all links, or an accessor function that returns a specific data value to be used in an automatically calculated linear scale.
37
+ */
38
+ linkSize(_: any): any;
39
+ /**
40
+ Defines the minimum pixel stroke width used in link sizing.
41
+ */
42
+ linkSizeMin(_: any): any;
43
+ /**
44
+ The type of [continuous d3-scale](https://github.com/d3/d3-scale#continuous-scales) used when calculating the pixel size of links in the network.
45
+ */
46
+ linkSizeScale(_: any): any;
47
+ /**
48
+ The node group accessor(s). This method overrides the default .groupBy() function from being used with the data passed to .nodes().
49
+ */
50
+ nodeGroupBy(_: any): any;
51
+ /**
52
+ The list of nodes to be used for drawing the rings network. The value passed should either be an *Array* of data or a *String* representing a filepath or URL to be loaded.
53
+
54
+ Additionally, a custom formatting function can be passed as a second argument to this method. This custom function will be passed the data that has been loaded, as long as there are no errors. This function should return the final node *Array*.
55
+ @param f Array of node objects or a URL to load nodes from.
56
+ */
57
+ nodes(_: any, f?: any): any;
58
+ /**
59
+ The size accessor for each node in the rings layout.
60
+ */
61
+ size(_: any): any;
62
+ /**
63
+ The size scale maximum. By default, the maximum size is determined by half the distance of the two closest nodes.
64
+ */
65
+ sizeMax(_: any): any;
66
+ /**
67
+ The size scale minimum.
68
+ */
69
+ sizeMin(_: any): any;
70
+ /**
71
+ The size scale.
72
+ */
73
+ sizeScale(_: any): any;
74
+ }
@@ -0,0 +1,81 @@
1
+ import Viz from "./Viz.js";
2
+ /**
3
+ Creates a sankey visualization based on a defined set of nodes and links. [Click here](http://d3plus.org/examples/d3plus-network/sankey-diagram/) for help getting started using the Sankey class.
4
+ */
5
+ export default class Sankey extends Viz {
6
+ [key: string]: any;
7
+ /**
8
+ Invoked when creating a new class instance, and sets any default parameters.
9
+ @private
10
+ */
11
+ constructor();
12
+ /**
13
+ Extends the draw behavior of the abstract Viz class.
14
+ @private
15
+ */
16
+ _draw(callback?: () => void): this;
17
+ /**
18
+ The hover callback function for highlighting shapes on mouseover.
19
+ */
20
+ hover(_: any): this;
21
+ /**
22
+ A pass-through for the d3-sankey [iterations](https://github.com/d3/d3-sankey?tab=readme-ov-file#sankey_iterations) function.
23
+ */
24
+ iterations(_: any): any;
25
+ /**
26
+ A predefined *Array* of edges that connect each object passed to the [node](#Sankey.node) method. The `source` and `target` keys in each link need to map to the nodes in one of one way:
27
+ 1. A *String* value matching the `id` of the node.
28
+
29
+ The value passed should be an *Array* of data. An optional formatting function can be passed as a second argument to this method. This custom function will be passed the data that has been loaded, as long as there are no errors. This function should return the final links *Array*.
30
+ @param f Array of link objects or a URL to load links from.
31
+ */
32
+ links(_: any, f?: any): any;
33
+ /**
34
+ A pass-through for the d3-sankey [linkSort](https://github.com/d3/d3-sankey?tab=readme-ov-file#sankey_linkSort) function.
35
+ */
36
+ linkSort(_: any): any;
37
+ /**
38
+ The key inside of each link Object that references the source node.
39
+ */
40
+ linksSource(_: any): any;
41
+ /**
42
+ The key inside of each link Object that references the target node.
43
+ */
44
+ linksTarget(_: any): any;
45
+ /**
46
+ The nodeAlign property of the sankey layout, which can be "left", "right", "center", or "justify".
47
+ */
48
+ nodeAlign(_: any): any;
49
+ /**
50
+ The node id accessor(s).
51
+ */
52
+ nodeId(_: any): any;
53
+ /**
54
+ The list of nodes to be used for drawing the network. The value passed must be an *Array* of data.
55
+
56
+ Additionally, a custom formatting function can be passed as a second argument to this method. This custom function will be passed the data that has been loaded, as long as there are no errors. This function should return the final node *Array*.
57
+ @param f Array of node objects or a URL to load nodes from.
58
+ */
59
+ nodes(_: any, f?: any): any;
60
+ /**
61
+ Padding of the node. By default, the nodePadding size is 8.
62
+ */
63
+ nodePadding(_: any): any;
64
+ /**
65
+ A pass-through for the d3-sankey [nodeSort](https://github.com/d3/d3-sankey?tab=readme-ov-file#sankey_nodeSort) function.
66
+ */
67
+ nodeSort(_: any): any;
68
+ /**
69
+ Width of the node. By default, the nodeWidth size is 30.
70
+ */
71
+ nodeWidth(_: any): any;
72
+ /**
73
+ Width of the links.
74
+
75
+ @example
76
+ function value(d) {
77
+ return d.value;
78
+ }
79
+ */
80
+ value(_: any): any;
81
+ }
@@ -0,0 +1,14 @@
1
+ import { default as AreaPlot } from "./AreaPlot.js";
2
+ /**
3
+ Creates a stacked area plot based on an array of data.
4
+ @example <caption>the equivalent of calling:</caption>
5
+ new d3plus.AreaPlot()
6
+ .stacked(true)
7
+ */
8
+ export default class StackedArea extends AreaPlot {
9
+ /**
10
+ Invoked when creating a new class instance, and overrides any default parameters inherited from Plot.
11
+ @private
12
+ */
13
+ constructor();
14
+ }
@@ -0,0 +1,33 @@
1
+ import Viz from "./Viz.js";
2
+ /**
3
+ Uses d3's [tree layout](https://github.com/d3/d3-hierarchy#tree) to create a tidy tree chart based on an array of data.
4
+ */
5
+ export default class Tree extends Viz {
6
+ [key: string]: any;
7
+ /**
8
+ Invoked when creating a new class instance, and sets any default parameters.
9
+ @private
10
+ */
11
+ constructor();
12
+ /**
13
+ Extends the draw behavior of the abstract Viz class.
14
+ @private
15
+ */
16
+ _draw(callback?: () => void): this;
17
+ /**
18
+ Changes the orientation of the entire Tree, either "vertical" (top to bottom) or "horizontal" (left to right).
19
+ */
20
+ orient(_: any): any;
21
+ /**
22
+ The separation function between neighboring nodes.
23
+
24
+ From the [d3-hierarchy documentation](https://github.com/d3/d3-hierarchy#tree_separation):
25
+ > The separation accessor is used to separate neighboring nodes. The separation function is passed two nodes a and b, and must return the desired separation. The nodes are typically siblings, though the nodes may be more distantly related if the layout decides to place such nodes adjacent.
26
+
27
+ @example
28
+ function separation(a, b) {
29
+ return a.parent === b.parent ? 1 : 2;
30
+ }
31
+ */
32
+ separation(_: any): any;
33
+ }
@@ -0,0 +1,51 @@
1
+ import Viz from "./Viz.js";
2
+ /**
3
+ Uses the [d3 treemap layout](https://github.com/mbostock/d3/wiki/Treemap-Layout) to creates SVG rectangles based on an array of data. See [this example](https://d3plus.org/examples/d3plus-hierarchy/getting-started/) for help getting started using the treemap generator.
4
+ */
5
+ export default class Treemap extends Viz {
6
+ [key: string]: any;
7
+ /**
8
+ Invoked when creating a new class instance, and sets any default parameters.
9
+ @private
10
+ */
11
+ constructor();
12
+ /**
13
+ Extends the draw behavior of the abstract Viz class.
14
+ @private
15
+ */
16
+ _draw(callback?: () => void): this;
17
+ /**
18
+ * Applies the threshold algorithm for Treemaps.
19
+ * @param {Array} data The data to process.
20
+ * @private
21
+ */
22
+ _thresholdFunction(data: any): any;
23
+ /**
24
+ The inner and outer padding.
25
+ */
26
+ layoutPadding(_: any): any;
27
+ /**
28
+ Sort comparator function for the treemap layout. Defaults to descending order by the associated input data's numeric value attribute.
29
+
30
+ @example
31
+ function comparator(a, b) {
32
+ return b.value - a.value;
33
+ }
34
+ */
35
+ sort(_: any): any;
36
+ /**
37
+ The sum accessor used for sizing each rectangle in the treemap.
38
+
39
+ @example
40
+ function sum(d) {
41
+ return d.sum;
42
+ }
43
+ */
44
+ sum(_: any): any;
45
+ /**
46
+ The tiling method used when calculating the size and position of the rectangles.
47
+
48
+ Can either be a string referring to a d3-hierarchy [tiling method](https://github.com/d3/d3-hierarchy#treemap-tiling), or a custom function in the same format.
49
+ */
50
+ tile(_: any): any;
51
+ }