@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,74 @@
1
+ // WARNING: do not edit the top part of this file directly, it is generated
2
+ // from the source code. Scroll down to the next WARNING and places stories below it.
3
+
4
+ import React from "react";
5
+
6
+ import {argTypes, AreaPlot} from "../../../args/core/charts/AreaPlot.args";
7
+ import configify from "../../../helpers/configify";
8
+ import funcify from "../../../helpers/funcify";
9
+
10
+ export default {
11
+ title: "Core/Charts/AreaPlot",
12
+ component: AreaPlot,
13
+ argTypes,
14
+ parameters: {
15
+ docs: {
16
+ description: {
17
+ component: "Creates an area plot based on an array of data.",
18
+ },
19
+ },
20
+ }
21
+ };
22
+
23
+ const Template = (args) => <AreaPlot config={configify(args, argTypes)} />;
24
+
25
+ // WARNING: do not edit above this line of code directly, it is generated
26
+ // from the source code. Stories below this line can be modified.
27
+
28
+ export const BasicExample = {
29
+ args: {
30
+ data: [
31
+ {id: "alpha", x: 1, y: 7},
32
+ {id: "alpha", x: 2, y: 2},
33
+ {id: "alpha", x: 3, y: 13},
34
+ {id: "alpha", x: 4, y: 4},
35
+ {id: "alpha", x: 5, y: 22},
36
+ {id: "alpha", x: 6, y: 13}
37
+ ],
38
+ groupBy: "id",
39
+ x: "x",
40
+ y: "y"
41
+ },
42
+ parameters: {
43
+ nextjs: {
44
+ router: {
45
+ pathname: "/core/charts/AreaPlot"
46
+ }
47
+ }
48
+ },
49
+ render: Template
50
+ }
51
+
52
+ export const ChangingAreaOpacity = Template.bind({});
53
+ ChangingAreaOpacity.args = {
54
+ data: [
55
+ {id: "alpha", x: 1, y: 7},
56
+ {id: "alpha", x: 2, y: 2},
57
+ {id: "alpha", x: 3, y: 13},
58
+ {id: "alpha", x: 4, y: 4},
59
+ {id: "alpha", x: 5, y: 22},
60
+ {id: "beta", x: 1, y: 10},
61
+ {id: "beta", x: 2, y: 6},
62
+ {id: "beta", x: 3, y: 3},
63
+ {id: "beta", x: 4, y: 12},
64
+ {id: "beta", x: 5, y: 11}
65
+ ],
66
+ groupBy: "id",
67
+ shapeConfig: {
68
+ fill: "red",
69
+ Area: {
70
+ fillOpacity: 0.5
71
+ }
72
+ }
73
+ };
74
+ ChangingAreaOpacity.parameters = {controls: {include: ["shapeConfig"]}};
@@ -0,0 +1,307 @@
1
+ // WARNING: do not edit the top part of this file directly, it is generated
2
+ // from the source code. Scroll down to the next WARNING and places stories below it.
3
+
4
+ import React from "react";
5
+
6
+ import {argTypes, BarChart} from "../../../args/core/charts/BarChart.args";
7
+ import configify from "../../../helpers/configify";
8
+ import funcify from "../../../helpers/funcify";
9
+
10
+ export default {
11
+ title: "Core/Charts/BarChart",
12
+ component: BarChart,
13
+ argTypes,
14
+ parameters: {
15
+ docs: {
16
+ description: {
17
+ component: "Creates a bar chart based on an array of data.",
18
+ },
19
+ },
20
+ }
21
+ };
22
+
23
+ const Template = (args) => <BarChart config={configify(args, argTypes)} />;
24
+
25
+ // WARNING: do not edit above this line of code directly, it is generated
26
+ // from the source code. Stories below this line can be modified.
27
+
28
+ export const BasicExample = Template.bind({});
29
+ BasicExample.args = {
30
+ data: [
31
+ {id: "alpha", x: 4, y: 7},
32
+ {id: "alpha", x: 5, y: 25},
33
+ {id: "alpha", x: 6, y: 13},
34
+ {id: "beta", x: 4, y: 17},
35
+ {id: "beta", x: 5, y: 8},
36
+ {id: "beta", x: 6, y: 13}
37
+ ],
38
+ groupBy: "id",
39
+ x: "x",
40
+ y: "y"
41
+ };
42
+ BasicExample.parameters = {controls: {include: ["x", "y"]}};
43
+
44
+ export const SortingBars = Template.bind({});
45
+ SortingBars.args = {
46
+ data: [
47
+ {"Travel Time": "< 5 Minutes", "ID Travel Time": "0", "Population Percentage": 2},
48
+ {"Travel Time": "15 - 24 Minutes", "ID Travel Time": "2", "Population Percentage": 30},
49
+ {"Travel Time": "35 - 44 Minutes", "ID Travel Time": "4", "Population Percentage": 7},
50
+ {"Travel Time": "45 - 89 Minutes", "ID Travel Time": "5", "Population Percentage": 11},
51
+ {"Travel Time": "5 - 14 Minutes", "ID Travel Time": "1", "Population Percentage": 20},
52
+ {"Travel Time": "90+ Minutes", "ID Travel Time": "6", "Population Percentage": 5},
53
+ {"Travel Time": "25 - 34 Minutes", "ID Travel Time": "3", "Population Percentage": 25}
54
+ ],
55
+ groupBy: "Travel Time",
56
+ x: "Travel Time",
57
+ y: "Population Percentage",
58
+ xSort: funcify(
59
+ (a, b) => a["ID Travel Time"] - b["ID Travel Time"],
60
+ `(a, b) => a["ID Travel Time"] - b["ID Travel Time"]`
61
+ )
62
+ };
63
+ SortingBars.parameters = {controls: {include: ["xSort"]}};
64
+
65
+ export const CustomBarPadding = Template.bind({});
66
+ CustomBarPadding.args = {
67
+ data: [
68
+ {id: "alpha", x: 4, y: 7},
69
+ {id: "alpha", x: 5, y: 25},
70
+ {id: "alpha", x: 6, y: 13},
71
+ {id: "beta", x: 4, y: 17},
72
+ {id: "beta", x: 5, y: 8},
73
+ {id: "beta", x: 6, y: 13}
74
+ ],
75
+ barPadding: 5,
76
+ groupBy: "id",
77
+ groupPadding: 40,
78
+ x: "x",
79
+ y: "y"
80
+ }
81
+ CustomBarPadding.parameters = {controls: {include: ["barPadding", "groupPadding"]}};
82
+
83
+ export const StackedBars = Template.bind({});
84
+ StackedBars.args = {
85
+ data: [
86
+ {id: "alpha", x: 4, y: 7},
87
+ {id: "alpha", x: 5, y: 25},
88
+ {id: "alpha", x: 6, y: 13},
89
+ {id: "beta", x: 4, y: 17},
90
+ {id: "beta", x: 5, y: 8},
91
+ {id: "beta", x: 6, y: 13}
92
+ ],
93
+ groupBy: "id",
94
+ stacked: true,
95
+ x: "x",
96
+ y: "y"
97
+ };
98
+ StackedBars.parameters = {controls: {include: ["stacked"]}};
99
+
100
+ export const HorizontalBars = Template.bind({});
101
+ HorizontalBars.args = {
102
+ data: [
103
+ {id: "alpha", x: 4, y: 7},
104
+ {id: "alpha", x: 5, y: 25},
105
+ {id: "alpha", x: 6, y: 13},
106
+ {id: "beta", x: 4, y: 17},
107
+ {id: "beta", x: 5, y: 8},
108
+ {id: "beta", x: 6, y: 13}
109
+
110
+ ],
111
+ groupBy: "id",
112
+ discrete: "y",
113
+ x: "y",
114
+ y: "x"
115
+ };
116
+ HorizontalBars.parameters = {controls: {include: ["discrete", "x", "y"]}};
117
+
118
+ export const PopulationPyramid = Template.bind({});
119
+ PopulationPyramid.args = {
120
+ data: [
121
+ {
122
+ "Age range": "0 to 4",
123
+ "Sex": "Male",
124
+ "Population": 1445122
125
+ },
126
+ {
127
+ "Age range": "0 to 4",
128
+ "Sex": "Female",
129
+ "Population": -1385933
130
+ },
131
+ {
132
+ "Age range": "5 to 9",
133
+ "Sex": "Male",
134
+ "Population": 1473968
135
+ },
136
+ {
137
+ "Age range": "5 to 9",
138
+ "Sex": "Female",
139
+ "Population": -1417319
140
+ },
141
+ {
142
+ "Age range": "10 to 15",
143
+ "Sex": "Male",
144
+ "Population": 1483727
145
+ },
146
+ {
147
+ "Age range": "10 to 15",
148
+ "Sex": "Female",
149
+ "Population": -1430083
150
+ },
151
+ {
152
+ "Age range": "15 to 19",
153
+ "Sex": "Male",
154
+ "Population": 1466289
155
+ },
156
+ {
157
+ "Age range": "15 to 19",
158
+ "Sex": "Female",
159
+ "Population": -1420257
160
+ },
161
+ {
162
+ "Age range": "20 to 24",
163
+ "Sex": "Male",
164
+ "Population": 1438000
165
+ },
166
+ {
167
+ "Age range": "20 to 24",
168
+ "Sex": "Female",
169
+ "Population": -1401017
170
+ },
171
+ {
172
+ "Age range": "25 to 29",
173
+ "Sex": "Male",
174
+ "Population": 1371191
175
+ },
176
+ {
177
+ "Age range": "25 to 29",
178
+ "Sex": "Female",
179
+ "Population": -1344048
180
+ },
181
+ {
182
+ "Age range": "30 to 34",
183
+ "Sex": "Male",
184
+ "Population": 1251238
185
+ },
186
+ {
187
+ "Age range": "30 to 34",
188
+ "Sex": "Female",
189
+ "Population": -1233884
190
+ },
191
+ {
192
+ "Age range": "35 to 39",
193
+ "Sex": "Male",
194
+ "Population": 1156915
195
+ },
196
+ {
197
+ "Age range": "35 to 39",
198
+ "Sex": "Female",
199
+ "Population": -1145477
200
+ },
201
+ {
202
+ "Age range": "40 to 44",
203
+ "Sex": "Male",
204
+ "Population": 1038422
205
+ },
206
+ {
207
+ "Age range": "40 to 44",
208
+ "Sex": "Female",
209
+ "Population": -1034343
210
+ },
211
+ {
212
+ "Age range": "45 to 49",
213
+ "Sex": "Male",
214
+ "Population": 899326
215
+ },
216
+ {
217
+ "Age range": "45 to 49",
218
+ "Sex": "Female",
219
+ "Population": -903752
220
+ },
221
+ {
222
+ "Age range": "50 to 54",
223
+ "Sex": "Male",
224
+ "Population": 774590
225
+ },
226
+ {
227
+ "Age range": "50 to 54",
228
+ "Sex": "Female",
229
+ "Population": -788241
230
+ },
231
+ {
232
+ "Age range": "55 to 59",
233
+ "Sex": "Male",
234
+ "Population": 634510
235
+ },
236
+ {
237
+ "Age range": "55 to 59",
238
+ "Sex": "Female",
239
+ "Population": -658490
240
+ },
241
+ {
242
+ "Age range": "60 to 64",
243
+ "Sex": "Male",
244
+ "Population": 501128
245
+ },
246
+ {
247
+ "Age range": "60 to 64",
248
+ "Sex": "Female",
249
+ "Population": -532940
250
+ },
251
+ {
252
+ "Age range": "65 to 69",
253
+ "Sex": "Male",
254
+ "Population": 379352
255
+ },
256
+ {
257
+ "Age range": "65 to 69",
258
+ "Sex": "Female",
259
+ "Population": -415647
260
+ },
261
+ {
262
+ "Age range": "70 to 74",
263
+ "Sex": "Male",
264
+ "Population": 271687
265
+ },
266
+ {
267
+ "Age range": "70 to 74",
268
+ "Sex": "Female",
269
+ "Population": -311231
270
+ },
271
+ {
272
+ "Age range": "75 to 79",
273
+ "Sex": "Male",
274
+ "Population": 186805
275
+ },
276
+ {
277
+ "Age range": "75 to 79",
278
+ "Sex": "Female",
279
+ "Population": -229221
280
+ },
281
+ {
282
+ "Age range": "80+",
283
+ "Sex": "Male",
284
+ "Population": 166789
285
+ },
286
+ {
287
+ "Age range": "80+",
288
+ "Sex": "Female",
289
+ "Population": -235076
290
+ }
291
+ ],
292
+ discrete: "y",
293
+ groupBy: "Sex",
294
+ shapeConfig: {
295
+ label: false
296
+ },
297
+ stacked: true,
298
+ x: "Population",
299
+ xConfig: {
300
+ tickFormat: funcify(
301
+ d => formatAbbreviate(Math.abs(d)),
302
+ "d => formatAbbreviate(Math.abs(d))"
303
+ )
304
+ },
305
+ y: "Age range"
306
+ };
307
+ PopulationPyramid.parameters = {controls: {include: ["stacked", "xConfig"]}};
@@ -0,0 +1,204 @@
1
+ // WARNING: do not edit the top part of this file directly, it is generated
2
+ // from the source code. Scroll down to the next WARNING and places stories below it.
3
+
4
+ import React from "react";
5
+
6
+ import {argTypes, BoxWhisker} from "../../../args/core/charts/BoxWhisker.args";
7
+ import configify from "../../../helpers/configify";
8
+ import funcify from "../../../helpers/funcify";
9
+
10
+ export default {
11
+ title: "Core/Charts/BoxWhisker",
12
+ component: BoxWhisker,
13
+ argTypes,
14
+ parameters: {
15
+ docs: {
16
+ description: {
17
+ component: "Creates a simple box and whisker based on an array of data.",
18
+ },
19
+ },
20
+ }
21
+ };
22
+
23
+ const Template = (args) => <BoxWhisker config={configify(args, argTypes)} />;
24
+
25
+ // WARNING: do not edit above this line of code directly, it is generated
26
+ // from the source code. Stories below this line can be modified.
27
+
28
+ export const BasicExample = Template.bind({});
29
+ BasicExample.args = {
30
+ data: [
31
+ {id: "alpha", value: 300},
32
+ {id: "alpha", value: 20},
33
+ {id: "alpha", value: 180},
34
+ {id: "alpha", value: 40},
35
+ {id: "alpha", value: 170},
36
+ {id: "alpha", value: 125},
37
+ {id: "alpha", value: 74},
38
+ {id: "alpha", value: 80},
39
+ {id: "beta", value: 180},
40
+ {id: "beta", value: 30},
41
+ {id: "beta", value: 120},
42
+ {id: "beta", value: 50},
43
+ {id: "beta", value: 140},
44
+ {id: "beta", value: 115},
45
+ {id: "beta", value: 14},
46
+ {id: "beta", value: 30}
47
+ ],
48
+ groupBy: ["id", "value"],
49
+ legend: false,
50
+ x: "id",
51
+ y: "value"
52
+ };
53
+
54
+ export const ShowingOutliers = Template.bind({});
55
+ ShowingOutliers.args = {
56
+ data: [
57
+ {id: "alpha", value: 840},
58
+ {id: "alpha", value: 940},
59
+ {id: "alpha", value: 780},
60
+ {id: "alpha", value: 650},
61
+ {id: "alpha", value: 720},
62
+ {id: "alpha", value: 430},
63
+ {id: "alpha", value: 1850},
64
+ {id: "alpha", value: 300},
65
+ {id: "alpha", value: 360},
66
+ {id: "alpha", value: 1690},
67
+ {id: "alpha", value: 690},
68
+ {id: "alpha", value: -950},
69
+ {id: "alpha", value: -600},
70
+ {id: "alpha", value: -850},
71
+ {id: "beta", value: 980},
72
+ {id: "beta", value: 300},
73
+ {id: "beta", value: 120},
74
+ {id: "beta", value: 500},
75
+ {id: "beta", value: 140},
76
+ {id: "beta", value: 115},
77
+ {id: "beta", value: 14},
78
+ {id: "beta", value: -30},
79
+ {id: "beta", value: -1050},
80
+ {id: "beta", value: -100},
81
+ {id: "beta", value: -800},
82
+ {id: "beta", value: -1100}
83
+ ],
84
+ groupBy: ["id", "value"],
85
+ legend: false,
86
+ x: "id",
87
+ y: "value"
88
+ };
89
+
90
+ export const ChangingEndpointShapes = Template.bind({});
91
+ ChangingEndpointShapes.args = {
92
+ data: [
93
+ {id: "alpha", value: 300},
94
+ {id: "alpha", value: 20},
95
+ {id: "alpha", value: 180},
96
+ {id: "alpha", value: 40},
97
+ {id: "alpha", value: 170},
98
+ {id: "alpha", value: 125},
99
+ {id: "alpha", value: 74},
100
+ {id: "alpha", value: 80},
101
+ {id: "beta", value: 180},
102
+ {id: "beta", value: 30},
103
+ {id: "beta", value: 120},
104
+ {id: "beta", value: 50},
105
+ {id: "beta", value: 140},
106
+ {id: "beta", value: 115},
107
+ {id: "beta", value: 14},
108
+ {id: "beta", value: 30},
109
+ ],
110
+ groupBy: ["id", "value"],
111
+ shapeConfig: {
112
+ whiskerConfig: {
113
+ endpoint: funcify(
114
+ d => d.id === "alpha" ? "Rect" : "Circle",
115
+ "d => d.id === 'alpha' ? 'Rect' : 'Circle'"
116
+ )
117
+ }
118
+ },
119
+ x: "id",
120
+ y: "value"
121
+ };
122
+ ChangingEndpointShapes.parameters = {controls: {include: ["shapeConfig"]}};
123
+
124
+ export const ChangingOutlierStyles = Template.bind({});
125
+ ChangingOutlierStyles.args = {
126
+ data: [
127
+ {id: "alpha", value: 840},
128
+ {id: "alpha", value: 940},
129
+ {id: "alpha", value: 780},
130
+ {id: "alpha", value: 650},
131
+ {id: "alpha", value: 720},
132
+ {id: "alpha", value: 430},
133
+ {id: "alpha", value: 1850},
134
+ {id: "alpha", value: 300},
135
+ {id: "alpha", value: 360},
136
+ {id: "alpha", value: 1690},
137
+ {id: "alpha", value: 690},
138
+ {id: "alpha", value: -950},
139
+ {id: "alpha", value: -600},
140
+ {id: "alpha", value: -850},
141
+ {id: "beta", value: 980},
142
+ {id: "beta", value: 300},
143
+ {id: "beta", value: 120},
144
+ {id: "beta", value: 500},
145
+ {id: "beta", value: 140},
146
+ {id: "beta", value: 115},
147
+ {id: "beta", value: 14},
148
+ {id: "beta", value: -30},
149
+ {id: "beta", value: -1050},
150
+ {id: "beta", value: -100},
151
+ {id: "beta", value: -800},
152
+ {id: "beta", value: -1100}
153
+ ],
154
+ groupBy: ["id", "value"],
155
+ shapeConfig: {
156
+ outlier: funcify(
157
+ d => d.id === "alpha" ? "Circle" : "Rect",
158
+ "d => d.id === 'alpha' ? 'Circle' : 'Rect'"
159
+ ),
160
+ outlierConfig: {
161
+ Rect: {
162
+ fill: "green"
163
+ },
164
+ Circle: {
165
+ fill: "red"
166
+ }
167
+ }
168
+ },
169
+ x: "id",
170
+ y: "value"
171
+ };
172
+ ChangingOutlierStyles.parameters = {controls: {include: ["shapeConfig"]}};
173
+
174
+ export const HorizontalChart = Template.bind({});
175
+ HorizontalChart.args = {
176
+ data: [
177
+ {id: "alpha", value: 300},
178
+ {id: "alpha", value: 20},
179
+ {id: "alpha", value: 180},
180
+ {id: "alpha", value: 40},
181
+ {id: "alpha", value: 170},
182
+ {id: "alpha", value: 125},
183
+ {id: "alpha", value: 74},
184
+ {id: "alpha", value: 80},
185
+ {id: "beta", value: 180},
186
+ {id: "beta", value: 30},
187
+ {id: "beta", value: 120},
188
+ {id: "beta", value: 50},
189
+ {id: "beta", value: 140},
190
+ {id: "beta", value: 115},
191
+ {id: "beta", value: 14},
192
+ {id: "beta", value: 30}
193
+ ],
194
+ groupBy: ["id", "value"],
195
+ discrete: "y",
196
+ shapeConfig: {
197
+ Box: {
198
+ orient: "horizontal"
199
+ }
200
+ },
201
+ x: "value",
202
+ y: "id"
203
+ };
204
+ HorizontalChart.parameters = {controls: {include: ["discrete", "shapeConfig"]}};
@@ -0,0 +1,52 @@
1
+ // WARNING: do not edit the top part of this file directly, it is generated
2
+ // from the source code. Scroll down to the next WARNING and places stories below it.
3
+
4
+ import React from "react";
5
+
6
+ import {argTypes, BumpChart} from "../../../args/core/charts/BumpChart.args";
7
+ import configify from "../../../helpers/configify";
8
+ import funcify from "../../../helpers/funcify";
9
+
10
+ export default {
11
+ title: "Core/Charts/BumpChart",
12
+ component: BumpChart,
13
+ argTypes,
14
+ parameters: {
15
+ docs: {
16
+ description: {
17
+ component: "Creates a bump chart based on an array of data.",
18
+ },
19
+ },
20
+ }
21
+ };
22
+
23
+ const Template = (args) => <BumpChart config={configify(args, argTypes)} />;
24
+
25
+ // WARNING: do not edit above this line of code directly, it is generated
26
+ // from the source code. Stories below this line can be modified.
27
+
28
+ export const BasicExample = Template.bind({});
29
+ BasicExample.args = {
30
+ data: [
31
+ {fruit: "apple", label: "Apple", year: 1, rank: 1},
32
+ {fruit: "apple", label: "Apple", year: 2, rank: 2},
33
+ {fruit: "apple", label: "Apple", year: 3, rank: 1},
34
+ {fruit: "banana", label: "Banana", year: 1, rank: 2},
35
+ {fruit: "banana", label: "Banana", year: 2, rank: 4},
36
+ {fruit: "banana", label: "Banana", year: 3, rank: 3},
37
+ {fruit: "cherry", label: "Cherry", year: 1, rank: 4},
38
+ {fruit: "cherry", label: "Cherry", year: 2, rank: 3},
39
+ {fruit: "cherry", label: "Cherry", year: 3, rank: 2},
40
+ {fruit: "orange", label: "Orange", year: 1, rank: 3},
41
+ {fruit: "orange", label: "Orange", year: 2, rank: 1},
42
+ {fruit: "orange", label: "Orange", year: 3, rank: 4}
43
+ ],
44
+ groupBy: "fruit",
45
+ discrete: "x",
46
+ label: funcify(
47
+ d => d.label,
48
+ "d => d.label"
49
+ ),
50
+ x: "year",
51
+ y: "rank"
52
+ };
@@ -0,0 +1,41 @@
1
+ // WARNING: do not edit the top part of this file directly, it is generated
2
+ // from the source code. Scroll down to the next WARNING and places stories below it.
3
+
4
+ import React from "react";
5
+
6
+ import {argTypes, Donut} from "../../../args/core/charts/Donut.args";
7
+ import configify from "../../../helpers/configify";
8
+ import funcify from "../../../helpers/funcify";
9
+
10
+ export default {
11
+ title: "Core/Charts/Donut",
12
+ component: Donut,
13
+ argTypes,
14
+ parameters: {
15
+ docs: {
16
+ description: {
17
+ component: "Extends the Pie visualization to create a donut chart.",
18
+ },
19
+ },
20
+ }
21
+ };
22
+
23
+ const Template = (args) => <Donut config={configify(args, argTypes)} />;
24
+
25
+ // WARNING: do not edit above this line of code directly, it is generated
26
+ // from the source code. Stories below this line can be modified.
27
+
28
+ export const BasicExample = Template.bind({});
29
+ BasicExample.args = {
30
+ data: [
31
+ {Topping: "Powdered sugar", Sold: 40},
32
+ {Topping: "Cinnamon", Sold: 20},
33
+ {Topping: "Sprinkles", Sold: 25},
34
+ {Topping: "Fruits", Sold: 30},
35
+ {Topping: "Cream", Sold: 15}
36
+ ],
37
+ groupBy: "Topping",
38
+ value: "Sold"
39
+ };
40
+ BasicExample.parameters = {controls: {include: ["value"]}};
41
+