@d3plus/docs 3.0.0-alpha.3

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 (225) hide show
  1. package/.storybook/main.js +51 -0
  2. package/.storybook/manager-head.html +46 -0
  3. package/.storybook/manager.js +10 -0
  4. package/.storybook/preview-head.html +69 -0
  5. package/.storybook/preview.jsx +134 -0
  6. package/.storybook/theme.js +16 -0
  7. package/README.md +1 -0
  8. package/args/color/colorAdd.args.jsx +71 -0
  9. package/args/color/colorAssign.args.jsx +40 -0
  10. package/args/color/colorContrast.args.jsx +40 -0
  11. package/args/color/colorDefaults.args.jsx +8 -0
  12. package/args/color/colorLegible.args.jsx +24 -0
  13. package/args/color/colorLighter.args.jsx +40 -0
  14. package/args/color/colorSubtract.args.jsx +71 -0
  15. package/args/core/charts/AreaPlot.args.jsx +72 -0
  16. package/args/core/charts/BarChart.args.jsx +88 -0
  17. package/args/core/charts/BoxWhisker.args.jsx +73 -0
  18. package/args/core/charts/BumpChart.args.jsx +133 -0
  19. package/args/core/charts/Donut.args.jsx +58 -0
  20. package/args/core/charts/Geomap.args.jsx +363 -0
  21. package/args/core/charts/LinePlot.args.jsx +57 -0
  22. package/args/core/charts/Matrix.args.jsx +194 -0
  23. package/args/core/charts/Network.args.jsx +310 -0
  24. package/args/core/charts/Pack.args.jsx +171 -0
  25. package/args/core/charts/Pie.args.jsx +148 -0
  26. package/args/core/charts/Plot.args.jsx +685 -0
  27. package/args/core/charts/Priestley.args.jsx +118 -0
  28. package/args/core/charts/Radar.args.jsx +120 -0
  29. package/args/core/charts/RadialMatrix.args.jsx +197 -0
  30. package/args/core/charts/Rings.args.jsx +228 -0
  31. package/args/core/charts/Sankey.args.jsx +248 -0
  32. package/args/core/charts/StackedArea.args.jsx +26 -0
  33. package/args/core/charts/Tree.args.jsx +88 -0
  34. package/args/core/charts/Treemap.args.jsx +181 -0
  35. package/args/core/charts/Viz.args.jsx +1383 -0
  36. package/args/core/components/Axis.args.jsx +600 -0
  37. package/args/core/components/AxisBottom.args.jsx +42 -0
  38. package/args/core/components/AxisLeft.args.jsx +42 -0
  39. package/args/core/components/AxisRight.args.jsx +42 -0
  40. package/args/core/components/AxisTop.args.jsx +42 -0
  41. package/args/core/components/ColorScale.args.jsx +456 -0
  42. package/args/core/components/Legend.args.jsx +289 -0
  43. package/args/core/components/TextBox.args.jsx +554 -0
  44. package/args/core/components/Timeline.args.jsx +401 -0
  45. package/args/core/components/Tooltip.args.jsx +453 -0
  46. package/args/core/shapes/Area.args.jsx +190 -0
  47. package/args/core/shapes/Bar.args.jsx +176 -0
  48. package/args/core/shapes/Box.args.jsx +248 -0
  49. package/args/core/shapes/Circle.args.jsx +84 -0
  50. package/args/core/shapes/Image.args.jsx +177 -0
  51. package/args/core/shapes/Line.args.jsx +127 -0
  52. package/args/core/shapes/Path.args.jsx +84 -0
  53. package/args/core/shapes/Rect.args.jsx +85 -0
  54. package/args/core/shapes/Shape.args.jsx +633 -0
  55. package/args/core/shapes/Whisker.args.jsx +204 -0
  56. package/args/core/utils/BaseClass.args.jsx +65 -0
  57. package/args/core/utils/RESET.args.jsx +8 -0
  58. package/args/core/utils/accessor.args.jsx +39 -0
  59. package/args/core/utils/configPrep.args.jsx +56 -0
  60. package/args/core/utils/constant.args.jsx +24 -0
  61. package/args/core/utils/uuid.args.jsx +8 -0
  62. package/args/data/dataConcat.args.jsx +40 -0
  63. package/args/data/dataFold.args.jsx +56 -0
  64. package/args/data/dataLoad.args.jsx +65 -0
  65. package/args/data/isData.args.jsx +24 -0
  66. package/args/data/merge.args.jsx +39 -0
  67. package/args/data/unique.args.jsx +37 -0
  68. package/args/dom/assign.args.jsx +23 -0
  69. package/args/dom/attrize.args.jsx +39 -0
  70. package/args/dom/date.args.jsx +23 -0
  71. package/args/dom/elem.args.jsx +135 -0
  72. package/args/dom/fontExists.args.jsx +24 -0
  73. package/args/dom/htmlDecode.args.jsx +23 -0
  74. package/args/dom/isObject.args.jsx +23 -0
  75. package/args/dom/parseSides.args.jsx +24 -0
  76. package/args/dom/prefix.args.jsx +8 -0
  77. package/args/dom/rtl.args.jsx +8 -0
  78. package/args/dom/stylize.args.jsx +39 -0
  79. package/args/dom/textWidth.args.jsx +39 -0
  80. package/args/export/saveElement.args.jsx +99 -0
  81. package/args/format/format.args.jsx +24 -0
  82. package/args/format/formatAbbreviate.args.jsx +39 -0
  83. package/args/format/formatDate.args.jsx +53 -0
  84. package/args/format/formatDefaultLocale.args.jsx +24 -0
  85. package/args/locales/dictionaries/formatLocale.args.jsx +8 -0
  86. package/args/math/closest.args.jsx +39 -0
  87. package/args/math/largestRect.args.jsx +56 -0
  88. package/args/math/lineIntersection.args.jsx +69 -0
  89. package/args/math/path2polygon.args.jsx +40 -0
  90. package/args/math/pointDistance.args.jsx +39 -0
  91. package/args/math/pointDistanceSquared.args.jsx +39 -0
  92. package/args/math/pointRotate.args.jsx +55 -0
  93. package/args/math/polygonInside.args.jsx +39 -0
  94. package/args/math/polygonRayCast.args.jsx +55 -0
  95. package/args/math/polygonRotate.args.jsx +55 -0
  96. package/args/math/segmentBoxContains.args.jsx +54 -0
  97. package/args/math/segmentsIntersect.args.jsx +69 -0
  98. package/args/math/shapeEdgePoint.args.jsx +39 -0
  99. package/args/react/D3plusContext.args.jsx +8 -0
  100. package/args/react/Renderer.args.jsx +53 -0
  101. package/args/text/fontFamily.args.jsx +8 -0
  102. package/args/text/fontFamilyStringify.args.jsx +23 -0
  103. package/args/text/stringify.args.jsx +23 -0
  104. package/args/text/strip.args.jsx +38 -0
  105. package/args/text/textSplit.args.jsx +23 -0
  106. package/args/text/textWrap.args.jsx +8 -0
  107. package/args/text/titleCase.args.jsx +24 -0
  108. package/args/text/trim.args.jsx +23 -0
  109. package/args/text/trimLeft.args.jsx +23 -0
  110. package/args/text/trimRight.args.jsx +23 -0
  111. package/docs/Accessibility.mdx +70 -0
  112. package/docs/HomeChart.jsx +38 -0
  113. package/docs/Introduction.mdx +130 -0
  114. package/docs/Logo-Frames.js +352 -0
  115. package/docs/Logo.jsx +30 -0
  116. package/helpers/configify.js +18 -0
  117. package/helpers/funcify.js +14 -0
  118. package/helpers/stringify.js +30 -0
  119. package/package.json +44 -0
  120. package/packages/color/colorAdd.stories.jsx +23 -0
  121. package/packages/color/colorAssign.stories.jsx +23 -0
  122. package/packages/color/colorContrast.stories.jsx +23 -0
  123. package/packages/color/colorDefaults.stories.jsx +23 -0
  124. package/packages/color/colorLegible.stories.jsx +23 -0
  125. package/packages/color/colorLighter.stories.jsx +23 -0
  126. package/packages/color/colorSubtract.stories.jsx +23 -0
  127. package/packages/core/charts/AreaPlot.stories.jsx +74 -0
  128. package/packages/core/charts/BarChart.stories.jsx +307 -0
  129. package/packages/core/charts/BoxWhisker.stories.jsx +204 -0
  130. package/packages/core/charts/BumpChart.stories.jsx +52 -0
  131. package/packages/core/charts/Donut.stories.jsx +41 -0
  132. package/packages/core/charts/Geomap.stories.jsx +186 -0
  133. package/packages/core/charts/LinePlot.stories.jsx +564 -0
  134. package/packages/core/charts/Matrix.stories.jsx +36 -0
  135. package/packages/core/charts/Network.stories.jsx +99 -0
  136. package/packages/core/charts/Pack.stories.jsx +40 -0
  137. package/packages/core/charts/Pie.stories.jsx +40 -0
  138. package/packages/core/charts/Plot.stories.jsx +180 -0
  139. package/packages/core/charts/Priestley.stories.jsx +60 -0
  140. package/packages/core/charts/Radar.stories.jsx +60 -0
  141. package/packages/core/charts/RadialMatrix.stories.jsx +36 -0
  142. package/packages/core/charts/Rings.stories.jsx +41 -0
  143. package/packages/core/charts/Sankey.stories.jsx +41 -0
  144. package/packages/core/charts/StackedArea.stories.jsx +107 -0
  145. package/packages/core/charts/Tree.stories.jsx +27 -0
  146. package/packages/core/charts/Treemap.stories.jsx +81 -0
  147. package/packages/core/charts/Viz.stories.jsx +27 -0
  148. package/packages/core/components/Axis.stories.jsx +27 -0
  149. package/packages/core/components/AxisBottom.stories.jsx +27 -0
  150. package/packages/core/components/AxisLeft.stories.jsx +27 -0
  151. package/packages/core/components/AxisRight.stories.jsx +27 -0
  152. package/packages/core/components/AxisTop.stories.jsx +27 -0
  153. package/packages/core/components/ColorScale.stories.jsx +44 -0
  154. package/packages/core/components/Legend.stories.jsx +49 -0
  155. package/packages/core/components/TextBox.stories.jsx +222 -0
  156. package/packages/core/components/Timeline.stories.jsx +37 -0
  157. package/packages/core/components/Tooltip.stories.jsx +40 -0
  158. package/packages/core/shapes/Area.stories.jsx +27 -0
  159. package/packages/core/shapes/Bar.stories.jsx +27 -0
  160. package/packages/core/shapes/Box.stories.jsx +27 -0
  161. package/packages/core/shapes/Circle.stories.jsx +27 -0
  162. package/packages/core/shapes/Image.stories.jsx +27 -0
  163. package/packages/core/shapes/Line.stories.jsx +27 -0
  164. package/packages/core/shapes/Path.stories.jsx +27 -0
  165. package/packages/core/shapes/Rect.stories.jsx +27 -0
  166. package/packages/core/shapes/Shape.stories.jsx +27 -0
  167. package/packages/core/shapes/Whisker.stories.jsx +27 -0
  168. package/packages/core/utils/BaseClass.stories.jsx +27 -0
  169. package/packages/core/utils/RESET.stories.jsx +23 -0
  170. package/packages/core/utils/accessor.stories.jsx +23 -0
  171. package/packages/core/utils/configPrep.stories.jsx +23 -0
  172. package/packages/core/utils/constant.stories.jsx +23 -0
  173. package/packages/core/utils/uuid.stories.jsx +23 -0
  174. package/packages/data/dataConcat.stories.jsx +23 -0
  175. package/packages/data/dataFold.stories.jsx +23 -0
  176. package/packages/data/dataLoad.stories.jsx +23 -0
  177. package/packages/data/isData.stories.jsx +23 -0
  178. package/packages/data/merge.stories.jsx +23 -0
  179. package/packages/data/unique.stories.jsx +23 -0
  180. package/packages/dom/assign.stories.jsx +23 -0
  181. package/packages/dom/attrize.stories.jsx +23 -0
  182. package/packages/dom/date.stories.jsx +23 -0
  183. package/packages/dom/elem.stories.jsx +23 -0
  184. package/packages/dom/fontExists.stories.jsx +23 -0
  185. package/packages/dom/htmlDecode.stories.jsx +23 -0
  186. package/packages/dom/isObject.stories.jsx +23 -0
  187. package/packages/dom/parseSides.stories.jsx +23 -0
  188. package/packages/dom/prefix.stories.jsx +23 -0
  189. package/packages/dom/rtl.stories.jsx +23 -0
  190. package/packages/dom/stylize.stories.jsx +23 -0
  191. package/packages/dom/textWidth.stories.jsx +23 -0
  192. package/packages/export/saveElement.stories.jsx +23 -0
  193. package/packages/format/format.stories.jsx +23 -0
  194. package/packages/format/formatAbbreviate.stories.jsx +23 -0
  195. package/packages/format/formatDate.stories.jsx +23 -0
  196. package/packages/format/formatDefaultLocale.stories.jsx +23 -0
  197. package/packages/locales/dictionaries/formatLocale.stories.jsx +23 -0
  198. package/packages/math/closest.stories.jsx +23 -0
  199. package/packages/math/largestRect.stories.jsx +23 -0
  200. package/packages/math/lineIntersection.stories.jsx +23 -0
  201. package/packages/math/path2polygon.stories.jsx +23 -0
  202. package/packages/math/pointDistance.stories.jsx +23 -0
  203. package/packages/math/pointDistanceSquared.stories.jsx +23 -0
  204. package/packages/math/pointRotate.stories.jsx +23 -0
  205. package/packages/math/polygonInside.stories.jsx +23 -0
  206. package/packages/math/polygonRayCast.stories.jsx +23 -0
  207. package/packages/math/polygonRotate.stories.jsx +23 -0
  208. package/packages/math/segmentBoxContains.stories.jsx +23 -0
  209. package/packages/math/segmentsIntersect.stories.jsx +23 -0
  210. package/packages/math/shapeEdgePoint.stories.jsx +23 -0
  211. package/packages/react/D3plusContext.stories.jsx +23 -0
  212. package/packages/react/Renderer.stories.jsx +23 -0
  213. package/packages/text/fontFamily.stories.jsx +23 -0
  214. package/packages/text/fontFamilyStringify.stories.jsx +23 -0
  215. package/packages/text/stringify.stories.jsx +23 -0
  216. package/packages/text/strip.stories.jsx +23 -0
  217. package/packages/text/textSplit.stories.jsx +23 -0
  218. package/packages/text/textWrap.stories.jsx +23 -0
  219. package/packages/text/titleCase.stories.jsx +23 -0
  220. package/packages/text/trim.stories.jsx +23 -0
  221. package/packages/text/trimLeft.stories.jsx +23 -0
  222. package/packages/text/trimRight.stories.jsx +23 -0
  223. package/static/data/city_coords.json +224 -0
  224. package/static/images/favicon.ico +0 -0
  225. package/static/images/touchicon.png +0 -0
@@ -0,0 +1,248 @@
1
+ // WARNING: do not edit this file directly, it is generated dynamically from
2
+ // the source JSDOC comments using the npm run docs script.
3
+
4
+ import React from "react";
5
+ import {argTypes as vizArgTypes} from "./Viz.args.jsx";
6
+ import {assign} from "@d3plus/dom";
7
+
8
+ import {Sankey as D3plusSankey} from "@d3plus/react";
9
+ export const Sankey = ({ config }) => <D3plusSankey config={config} />;
10
+
11
+ export const argTypes = assign(
12
+
13
+ /**
14
+ * Filters out unused argTypes from the Viz primitive and
15
+ * overrides any defaults that have been changed in Sankey
16
+ */
17
+ Object.keys(vizArgTypes)
18
+ .filter(k => !k.match(/^(zoom.*)$/))
19
+ .reduce((obj, k) => (obj[k] = vizArgTypes[k], obj), {}),
20
+
21
+ /**
22
+ * Sankey-specific methods
23
+ */
24
+
25
+ {
26
+ hover: {
27
+ control: {},
28
+ table: {
29
+ defaultValue: {
30
+ summary: "undefined"
31
+ }
32
+ },
33
+ type: {
34
+ required: false,
35
+ summary: "function"
36
+ }
37
+ },
38
+ links: {
39
+ control: {
40
+ type: "array"
41
+ },
42
+ defaultValue: "d => d[\"links\"]",
43
+ description: "= []",
44
+ table: {
45
+ defaultValue: {
46
+ detail: "d => d[\"links\"]",
47
+ summary: "function"
48
+ }
49
+ },
50
+ type: {
51
+ required: true,
52
+ summary: "array"
53
+ }
54
+ },
55
+ linksSource: {
56
+ control: {
57
+ type: "text"
58
+ },
59
+ defaultValue: "source",
60
+ table: {
61
+ defaultValue: {
62
+ summary: "source"
63
+ }
64
+ },
65
+ type: {
66
+ required: false,
67
+ summary: "string"
68
+ }
69
+ },
70
+ linksTarget: {
71
+ control: {
72
+ type: "text"
73
+ },
74
+ defaultValue: "target",
75
+ table: {
76
+ defaultValue: {
77
+ summary: "target"
78
+ }
79
+ },
80
+ type: {
81
+ required: false,
82
+ summary: "string"
83
+ }
84
+ },
85
+ noDataMessage: {
86
+ control: {
87
+ type: "boolean"
88
+ },
89
+ defaultValue: false,
90
+ table: {
91
+ defaultValue: {
92
+ summary: false
93
+ }
94
+ },
95
+ type: {
96
+ required: false,
97
+ summary: "boolean"
98
+ }
99
+ },
100
+ nodeAlign: {
101
+ control: {
102
+ type: "text"
103
+ },
104
+ defaultValue: "sankeyAligns.justify",
105
+ table: {
106
+ defaultValue: {
107
+ summary: "sankeyAligns.justify"
108
+ }
109
+ },
110
+ type: {
111
+ required: false,
112
+ summary: "function | string"
113
+ }
114
+ },
115
+ nodeId: {
116
+ control: {
117
+ type: "text"
118
+ },
119
+ defaultValue: "d => d[\"id\"]",
120
+ table: {
121
+ defaultValue: {
122
+ detail: "d => d[\"id\"]",
123
+ summary: "function"
124
+ }
125
+ },
126
+ type: {
127
+ required: false,
128
+ summary: "string"
129
+ }
130
+ },
131
+ nodePadding: {
132
+ control: {
133
+ type: "number"
134
+ },
135
+ defaultValue: 8,
136
+ table: {
137
+ defaultValue: {
138
+ summary: 8
139
+ }
140
+ },
141
+ type: {
142
+ required: false,
143
+ summary: "number"
144
+ }
145
+ },
146
+ nodeWidth: {
147
+ control: {
148
+ type: "number"
149
+ },
150
+ defaultValue: 30,
151
+ table: {
152
+ defaultValue: {
153
+ summary: 30
154
+ }
155
+ },
156
+ type: {
157
+ required: false,
158
+ summary: "number"
159
+ }
160
+ },
161
+ nodes: {
162
+ control: {
163
+ type: "array"
164
+ },
165
+ defaultValue: "d => d[\"nodes\"]",
166
+ description: "= []",
167
+ table: {
168
+ defaultValue: {
169
+ detail: "d => d[\"nodes\"]",
170
+ summary: "function"
171
+ }
172
+ },
173
+ type: {
174
+ required: true,
175
+ summary: "array"
176
+ }
177
+ },
178
+ on: {
179
+ control: {
180
+ type: "text"
181
+ },
182
+ defaultValue: {
183
+ mouseenter: "() => {\n }",
184
+ "mouseleave.shape": "() => {\n this.hover(false);\n}",
185
+ "mousemove.shape": "(d, i, x, event) => {\n defaultMouseMove(d, i, x, event);\n if (this._focus && this._focus === d.id) {\n this.hover(false);\n this._on.mouseenter.bind(this)(d, i, x, event);\n this._focus = undefined;\n } else {\n const id = this._nodeId(d, i), node = this._nodeLookup[id], nodeLookup = Object.keys(this._nodeLookup).reduce((all, item)=>{\n all[this._nodeLookup[item]] = !isNaN(item) ? parseInt(item, 10) : item;\n return all;\n }, {});\n const links = this._linkLookup[node];\n const filterIds = [\n id\n ];\n links.forEach((l)=>{\n filterIds.push(nodeLookup[l]);\n });\n this.hover((h, x)=>{\n if (h.source && h.target) {\n return h.source.id === id || h.target.id === id;\n } else {\n return filterIds.includes(this._nodeId(h, x));\n }\n });\n }\n}"
186
+ },
187
+ table: {
188
+ defaultValue: {
189
+ summary: {
190
+ mouseenter: "() => {\n }",
191
+ "mouseleave.shape": "() => {\n this.hover(false);\n}",
192
+ "mousemove.shape": "(d, i, x, event) => {\n defaultMouseMove(d, i, x, event);\n if (this._focus && this._focus === d.id) {\n this.hover(false);\n this._on.mouseenter.bind(this)(d, i, x, event);\n this._focus = undefined;\n } else {\n const id = this._nodeId(d, i), node = this._nodeLookup[id], nodeLookup = Object.keys(this._nodeLookup).reduce((all, item)=>{\n all[this._nodeLookup[item]] = !isNaN(item) ? parseInt(item, 10) : item;\n return all;\n }, {});\n const links = this._linkLookup[node];\n const filterIds = [\n id\n ];\n links.forEach((l)=>{\n filterIds.push(nodeLookup[l]);\n });\n this.hover((h, x)=>{\n if (h.source && h.target) {\n return h.source.id === id || h.target.id === id;\n } else {\n return filterIds.includes(this._nodeId(h, x));\n }\n });\n }\n}"
193
+ }
194
+ }
195
+ },
196
+ type: {
197
+ required: false,
198
+ summary: "string"
199
+ }
200
+ },
201
+ shape: {
202
+ control: {
203
+ type: "text"
204
+ },
205
+ defaultValue: "Rect",
206
+ table: {
207
+ defaultValue: {
208
+ summary: "Rect"
209
+ }
210
+ },
211
+ type: {
212
+ required: false,
213
+ summary: "function | string"
214
+ }
215
+ },
216
+ shapeConfig: {
217
+ control: {
218
+ type: "object"
219
+ },
220
+ defaultValue: "assign(this._shapeConfig, {Path: {fill: none, hoverStyle: {stroke-width: (d) => Math.max(1, Math.abs(d.source.y1 - d.source.y0) * (d.value / d.source.value) - 2)}, label: false, stroke: #DBDBDB, strokeOpacity: 0.5, strokeWidth: (d) => Math.max(1, Math.abs(d.source.y1 - d.source.y0) * (d.value / d.source.value) - 2)}, Rect: {}})",
221
+ table: {
222
+ defaultValue: {
223
+ detail: "assign(this._shapeConfig, {Path: {fill: none, hoverStyle: {stroke-width: (d) => Math.max(1, Math.abs(d.source.y1 - d.source.y0) * (d.value / d.source.value) - 2)}, label: false, stroke: #DBDBDB, strokeOpacity: 0.5, strokeWidth: (d) => Math.max(1, Math.abs(d.source.y1 - d.source.y0) * (d.value / d.source.value) - 2)}, Rect: {}})",
224
+ summary: "function"
225
+ }
226
+ },
227
+ type: {
228
+ required: false,
229
+ summary: "object"
230
+ }
231
+ },
232
+ value: {
233
+ control: {
234
+ type: "number"
235
+ },
236
+ defaultValue: 1,
237
+ table: {
238
+ defaultValue: {
239
+ summary: 1
240
+ }
241
+ },
242
+ type: {
243
+ required: true,
244
+ summary: "function | number"
245
+ }
246
+ }
247
+ }
248
+ );
@@ -0,0 +1,26 @@
1
+ // WARNING: do not edit this file directly, it is generated dynamically from
2
+ // the source JSDOC comments using the npm run docs script.
3
+
4
+ import React from "react";
5
+ import {argTypes as areaArgTypes} from "../shapes/Area.args.jsx";
6
+ import {assign} from "@d3plus/dom";
7
+
8
+ import {StackedArea as D3plusStackedArea} from "@d3plus/react";
9
+ export const StackedArea = ({ config }) => <D3plusStackedArea config={config} />;
10
+
11
+ export const argTypes = assign(
12
+
13
+ /**
14
+ * Filters out unused argTypes from the Area primitive and
15
+ * overrides any defaults that have been changed in StackedArea
16
+ */
17
+ Object.keys(areaArgTypes)
18
+ .filter(k => !k.match(/^(shape|zoom.*)$/))
19
+ .reduce((obj, k) => (obj[k] = areaArgTypes[k], obj), {}),
20
+
21
+ /**
22
+ * StackedArea-specific methods
23
+ */
24
+
25
+ {}
26
+ );
@@ -0,0 +1,88 @@
1
+ // WARNING: do not edit this file directly, it is generated dynamically from
2
+ // the source JSDOC comments using the npm run docs script.
3
+
4
+ import React from "react";
5
+ import {argTypes as vizArgTypes} from "./Viz.args.jsx";
6
+ import {assign} from "@d3plus/dom";
7
+
8
+ import {Tree as D3plusTree} from "@d3plus/react";
9
+ export const Tree = ({ config }) => <D3plusTree config={config} />;
10
+
11
+ export const argTypes = assign(
12
+
13
+ /**
14
+ * Filters out unused argTypes from the Viz primitive and
15
+ * overrides any defaults that have been changed in Tree
16
+ */
17
+ Object.keys(vizArgTypes)
18
+ .filter(k => !k.match(/^(zoom.*)$/))
19
+ .reduce((obj, k) => (obj[k] = vizArgTypes[k], obj), {}),
20
+
21
+ /**
22
+ * Tree-specific methods
23
+ */
24
+
25
+ {
26
+ orient: {
27
+ control: {
28
+ type: "text"
29
+ },
30
+ defaultValue: "vertical",
31
+ description: "Accepts either \"vertical\" or \"horizontal\".",
32
+ table: {
33
+ defaultValue: {
34
+ summary: "vertical"
35
+ }
36
+ },
37
+ type: {
38
+ required: false,
39
+ summary: "string"
40
+ }
41
+ },
42
+ separation: {
43
+ control: {},
44
+ defaultValue: "(a, b) => a.parent === b.parent ? 1 : 2",
45
+ table: {
46
+ defaultValue: {
47
+ detail: "(a, b) => a.parent === b.parent ? 1 : 2",
48
+ summary: "function"
49
+ }
50
+ },
51
+ type: {
52
+ required: false,
53
+ summary: "function"
54
+ }
55
+ },
56
+ shape: {
57
+ control: {
58
+ type: "text"
59
+ },
60
+ defaultValue: "Circle",
61
+ table: {
62
+ defaultValue: {
63
+ summary: "Circle"
64
+ }
65
+ },
66
+ type: {
67
+ required: false,
68
+ summary: "function | string"
69
+ }
70
+ },
71
+ shapeConfig: {
72
+ control: {
73
+ type: "object"
74
+ },
75
+ defaultValue: "assign(this._shapeConfig, {ariaLabel: (d, i) => this._treeData ? `${this._treeData.i.depth}. ${this._drawLabel(d, i)}.` : , labelConfig: {fontColor: #444}, Path: {fill: none, stroke: #ccc, strokeWidth: 1}, r: 5, width: 10, height: 10})",
76
+ table: {
77
+ defaultValue: {
78
+ detail: "assign(this._shapeConfig, {ariaLabel: (d, i) => this._treeData ? `${this._treeData.i.depth}. ${this._drawLabel(d, i)}.` : , labelConfig: {fontColor: #444}, Path: {fill: none, stroke: #ccc, strokeWidth: 1}, r: 5, width: 10, height: 10})",
79
+ summary: "function"
80
+ }
81
+ },
82
+ type: {
83
+ required: false,
84
+ summary: "object"
85
+ }
86
+ }
87
+ }
88
+ );
@@ -0,0 +1,181 @@
1
+ // WARNING: do not edit this file directly, it is generated dynamically from
2
+ // the source JSDOC comments using the npm run docs script.
3
+
4
+ import React from "react";
5
+ import {argTypes as vizArgTypes} from "./Viz.args.jsx";
6
+ import {assign} from "@d3plus/dom";
7
+
8
+ import {Treemap as D3plusTreemap} from "@d3plus/react";
9
+ export const Treemap = ({ config }) => <D3plusTreemap config={config} />;
10
+
11
+ export const argTypes = assign(
12
+
13
+ /**
14
+ * Filters out unused argTypes from the Viz primitive and
15
+ * overrides any defaults that have been changed in Treemap
16
+ */
17
+ Object.keys(vizArgTypes)
18
+ .filter(k => !k.match(/^(shape|zoom.*)$/))
19
+ .reduce((obj, k) => (obj[k] = vizArgTypes[k], obj), {}),
20
+
21
+ /**
22
+ * Treemap-specific methods
23
+ */
24
+
25
+ {
26
+ layoutPadding: {
27
+ control: {
28
+ type: "number"
29
+ },
30
+ defaultValue: 1,
31
+ table: {
32
+ defaultValue: {
33
+ summary: 1
34
+ }
35
+ },
36
+ type: {
37
+ required: false,
38
+ summary: "function | number"
39
+ }
40
+ },
41
+ legend: {
42
+ control: {
43
+ type: "boolean"
44
+ },
45
+ defaultValue: "(config, arr) => {\n if (arr.length === this._filteredData.length) return false;\n return defaultLegend.bind(this)(config, arr);\n}",
46
+ table: {
47
+ defaultValue: {
48
+ detail: "(config, arr) => {\n if (arr.length === this._filteredData.length) return false;\n return defaultLegend.bind(this)(config, arr);\n}",
49
+ summary: "function"
50
+ }
51
+ },
52
+ type: {
53
+ required: false,
54
+ summary: "boolean | function"
55
+ }
56
+ },
57
+ legendSort: {
58
+ control: {},
59
+ defaultValue: "(a, b) => this._sum(b) - this._sum(a)",
60
+ table: {
61
+ defaultValue: {
62
+ detail: "(a, b) => this._sum(b) - this._sum(a)",
63
+ summary: "function"
64
+ }
65
+ },
66
+ type: {
67
+ required: true,
68
+ summary: "function"
69
+ }
70
+ },
71
+ legendTooltip: {
72
+ control: {
73
+ type: "object"
74
+ },
75
+ defaultValue: "assign({}, this._legendTooltip, {tbody: [\n\n]})",
76
+ table: {
77
+ defaultValue: {
78
+ summary: "assign({}, this._legendTooltip, {tbody: [\n\n]})"
79
+ }
80
+ },
81
+ type: {
82
+ required: false,
83
+ summary: "object"
84
+ }
85
+ },
86
+ shapeConfig: {
87
+ control: {
88
+ type: "object"
89
+ },
90
+ defaultValue: "assign({}, this._shapeConfig, {ariaLabel: (d, i) => {\n const rank = this._rankData ? `${this._rankData.indexOf(d) + 1}. ` : \"\";\n return `${rank}${this._drawLabel(d, i)}, ${this._sum(d, i)}.`;\n}, labelConfig: {fontMax: 32, fontMin: 8, fontResize: true, padding: 5}})",
91
+ table: {
92
+ defaultValue: {
93
+ detail: "assign({}, this._shapeConfig, {ariaLabel: (d, i) => {\n const rank = this._rankData ? `${this._rankData.indexOf(d) + 1}. ` : \"\";\n return `${rank}${this._drawLabel(d, i)}, ${this._sum(d, i)}.`;\n}, labelConfig: {fontMax: 32, fontMin: 8, fontResize: true, padding: 5}})",
94
+ summary: "function"
95
+ }
96
+ },
97
+ type: {
98
+ required: false,
99
+ summary: "object"
100
+ }
101
+ },
102
+ sort: {
103
+ control: {
104
+ type: "array"
105
+ },
106
+ defaultValue: "(a, b) => {\n const aggA = isAggregated(a);\n const aggB = isAggregated(b);\n return aggA && !aggB ? 1 : !aggA && aggB ? -1 : b.value - a.value;\n}",
107
+ table: {
108
+ defaultValue: {
109
+ detail: "(a, b) => {\n const aggA = isAggregated(a);\n const aggB = isAggregated(b);\n return aggA && !aggB ? 1 : !aggA && aggB ? -1 : b.value - a.value;\n}",
110
+ summary: "function"
111
+ }
112
+ },
113
+ type: {
114
+ required: false,
115
+ summary: "array"
116
+ }
117
+ },
118
+ sum: {
119
+ control: {
120
+ type: "number"
121
+ },
122
+ defaultValue: "d => d[\"value\"]",
123
+ table: {
124
+ defaultValue: {
125
+ detail: "d => d[\"value\"]",
126
+ summary: "function"
127
+ }
128
+ },
129
+ type: {
130
+ required: false,
131
+ summary: "function | number"
132
+ }
133
+ },
134
+ thresholdKey: {
135
+ control: {
136
+ type: "number"
137
+ },
138
+ defaultValue: "this._sum",
139
+ table: {
140
+ defaultValue: {
141
+ summary: "this._sum"
142
+ }
143
+ },
144
+ type: {
145
+ required: false,
146
+ summary: "function | number"
147
+ }
148
+ },
149
+ tile: {
150
+ control: {
151
+ type: "text"
152
+ },
153
+ defaultValue: "treemapSquarify",
154
+ table: {
155
+ defaultValue: {
156
+ summary: "treemapSquarify"
157
+ }
158
+ },
159
+ type: {
160
+ required: false,
161
+ summary: "string | function"
162
+ }
163
+ },
164
+ tooltipConfig: {
165
+ control: {
166
+ type: "object"
167
+ },
168
+ defaultValue: "assign({}, this._tooltipConfig, {tbody: [\n[\n() => this._translate(Share),\n(d, i, x) => `${formatAbbreviate(x.share * 100, this._locale)}%`\n]\n]})",
169
+ table: {
170
+ defaultValue: {
171
+ detail: "assign({}, this._tooltipConfig, {tbody: [\n[\n() => this._translate(Share),\n(d, i, x) => `${formatAbbreviate(x.share * 100, this._locale)}%`\n]\n]})",
172
+ summary: "function"
173
+ }
174
+ },
175
+ type: {
176
+ required: false,
177
+ summary: "object"
178
+ }
179
+ }
180
+ }
181
+ );