@d3plus/docs 3.0.5 → 3.0.7

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 (72) hide show
  1. package/.storybook/preview-head.html +5 -0
  2. package/args/core/charts/AreaPlot.args.jsx +4 -1
  3. package/args/core/charts/BarChart.args.jsx +5 -1
  4. package/args/core/charts/BoxWhisker.args.jsx +4 -1
  5. package/args/core/charts/BumpChart.args.jsx +8 -1
  6. package/args/core/charts/Donut.args.jsx +4 -2
  7. package/args/core/charts/Geomap.args.jsx +29 -13
  8. package/args/core/charts/LinePlot.args.jsx +3 -1
  9. package/args/core/charts/Matrix.args.jsx +13 -2
  10. package/args/core/charts/Network.args.jsx +29 -16
  11. package/args/core/charts/Pack.args.jsx +11 -2
  12. package/args/core/charts/Pie.args.jsx +8 -1
  13. package/args/core/charts/Plot.args.jsx +54 -21
  14. package/args/core/charts/Priestley.args.jsx +6 -0
  15. package/args/core/charts/Radar.args.jsx +7 -1
  16. package/args/core/charts/RadialMatrix.args.jsx +15 -4
  17. package/args/core/charts/Rings.args.jsx +21 -10
  18. package/args/core/charts/Sankey.args.jsx +17 -5
  19. package/args/core/charts/Tree.args.jsx +46 -6
  20. package/args/core/charts/Treemap.args.jsx +15 -5
  21. package/args/core/charts/Viz.args.jsx +102 -24
  22. package/args/core/components/Axis.args.jsx +49 -12
  23. package/args/core/components/AxisBottom.args.jsx +1 -1
  24. package/args/core/components/AxisLeft.args.jsx +1 -1
  25. package/args/core/components/AxisRight.args.jsx +1 -1
  26. package/args/core/components/AxisTop.args.jsx +1 -1
  27. package/args/core/components/ColorScale.args.jsx +37 -10
  28. package/args/core/components/Legend.args.jsx +21 -5
  29. package/args/core/components/TextBox.args.jsx +40 -7
  30. package/args/core/components/Timeline.args.jsx +33 -9
  31. package/args/core/components/Tooltip.args.jsx +40 -12
  32. package/args/core/shapes/Area.args.jsx +11 -1
  33. package/args/core/shapes/Bar.args.jsx +10 -1
  34. package/args/core/shapes/Box.args.jsx +19 -5
  35. package/args/core/shapes/Circle.args.jsx +4 -1
  36. package/args/core/shapes/Image.args.jsx +13 -1
  37. package/args/core/shapes/Line.args.jsx +7 -1
  38. package/args/core/shapes/Path.args.jsx +4 -1
  39. package/args/core/shapes/Rect.args.jsx +4 -1
  40. package/args/core/shapes/Shape.args.jsx +49 -13
  41. package/args/core/shapes/Whisker.args.jsx +13 -2
  42. package/args/core/utils/BaseClass.args.jsx +4 -0
  43. package/args/core/utils/accessor.args.jsx +1 -3
  44. package/args/core/utils/constant.args.jsx +1 -1
  45. package/args/data/dataConcat.args.jsx +1 -1
  46. package/args/data/dataLoad.args.jsx +1 -1
  47. package/args/data/isData.args.jsx +1 -3
  48. package/args/data/merge.args.jsx +1 -1
  49. package/args/data/unique.args.jsx +1 -1
  50. package/args/dom/attrize.args.jsx +1 -3
  51. package/args/dom/elem.args.jsx +1 -3
  52. package/args/dom/fontExists.args.jsx +1 -1
  53. package/args/dom/isObject.args.jsx +1 -3
  54. package/args/dom/parseSides.args.jsx +1 -1
  55. package/args/dom/stylize.args.jsx +1 -3
  56. package/args/dom/textWidth.args.jsx +1 -1
  57. package/args/export/saveElement.args.jsx +1 -3
  58. package/args/format/formatDate.args.jsx +2 -4
  59. package/args/math/closest.args.jsx +1 -1
  60. package/args/math/largestRect.args.jsx +1 -1
  61. package/args/math/lineIntersection.args.jsx +4 -4
  62. package/args/math/pointDistance.args.jsx +2 -2
  63. package/args/math/pointDistanceSquared.args.jsx +2 -2
  64. package/args/math/pointRotate.args.jsx +2 -2
  65. package/args/math/polygonInside.args.jsx +2 -2
  66. package/args/math/polygonRayCast.args.jsx +2 -2
  67. package/args/math/polygonRotate.args.jsx +2 -2
  68. package/args/math/segmentBoxContains.args.jsx +3 -3
  69. package/args/math/segmentsIntersect.args.jsx +4 -4
  70. package/helpers/configify.js +2 -10
  71. package/package.json +6 -6
  72. package/packages/core/charts/Tree.stories.jsx +40 -0
@@ -27,7 +27,7 @@ export const argTypes = assign(
27
27
  type: "text"
28
28
  },
29
29
  defaultValue: "middle",
30
- description: "Supports `\"left\"` and `\"center\"` and `\"right\"`.",
30
+ description: "If *value* is specified, sets the horizontal alignment to the specified value and returns the current class instance.",
31
31
  table: {
32
32
  defaultValue: {
33
33
  summary: "middle"
@@ -43,6 +43,7 @@ export const argTypes = assign(
43
43
  type: "object"
44
44
  },
45
45
  defaultValue: "{stroke: openColor.colors.gray.600, stroke-width: 1}",
46
+ description: "If *value* is specified, sets the axis line style and returns the current class instance.",
46
47
  table: {
47
48
  defaultValue: {
48
49
  summary: "{stroke: openColor.colors.gray.600, stroke-width: 1}"
@@ -55,12 +56,13 @@ export const argTypes = assign(
55
56
  },
56
57
  data: {
57
58
  control: {
58
- type: "array"
59
+ type: "object"
59
60
  },
60
- defaultValue: "[\n\n]",
61
+ defaultValue: "[ ]",
62
+ description: "An array of data points, which helps determine which ticks should be shown and which time resolution should be displayed.",
61
63
  table: {
62
64
  defaultValue: {
63
- summary: "[\n\n]"
65
+ summary: "[ ]"
64
66
  }
65
67
  },
66
68
  type: {
@@ -70,12 +72,13 @@ export const argTypes = assign(
70
72
  },
71
73
  domain: {
72
74
  control: {
73
- type: "array"
75
+ type: "object"
74
76
  },
75
- defaultValue: "[\n0,\n10\n]",
77
+ defaultValue: "[\n 0,\n10\n]",
78
+ description: "If *value* is specified, sets the scale domain of the axis and returns the current class instance.",
76
79
  table: {
77
80
  defaultValue: {
78
- summary: "[\n0,\n10\n]"
81
+ summary: "[\n 0,\n10\n]"
79
82
  }
80
83
  },
81
84
  type: {
@@ -88,6 +91,7 @@ export const argTypes = assign(
88
91
  type: "number"
89
92
  },
90
93
  defaultValue: 600,
94
+ description: "If *value* is specified, sets the transition duration of the axis and returns the current class instance.",
91
95
  table: {
92
96
  defaultValue: {
93
97
  summary: 600
@@ -100,8 +104,9 @@ export const argTypes = assign(
100
104
  },
101
105
  grid: {
102
106
  control: {
103
- type: "array"
107
+ type: "object"
104
108
  },
109
+ description: "If *value* is specified, sets the grid values of the axis and returns the current class instance.",
105
110
  table: {
106
111
  defaultValue: {
107
112
  summary: "undefined"
@@ -117,6 +122,7 @@ export const argTypes = assign(
117
122
  type: "object"
118
123
  },
119
124
  defaultValue: "{stroke: colorDefaults.light, stroke-width: 1}",
125
+ description: "If *value* is specified, sets the grid config of the axis and returns the current class instance.",
120
126
  table: {
121
127
  defaultValue: {
122
128
  summary: "{stroke: colorDefaults.light, stroke-width: 1}"
@@ -132,6 +138,7 @@ export const argTypes = assign(
132
138
  type: "boolean"
133
139
  },
134
140
  defaultValue: false,
141
+ description: "If *value* is specified, sets the grid behavior of the axis when scale is logarithmic and returns the current class instance.",
135
142
  table: {
136
143
  defaultValue: {
137
144
  summary: false
@@ -146,6 +153,7 @@ export const argTypes = assign(
146
153
  control: {
147
154
  type: "number"
148
155
  },
156
+ description: "If *value* is specified, sets the grid size of the axis and returns the current class instance.",
149
157
  table: {
150
158
  defaultValue: {
151
159
  summary: "undefined"
@@ -161,6 +169,7 @@ export const argTypes = assign(
161
169
  type: "number"
162
170
  },
163
171
  defaultValue: 400,
172
+ description: "If *value* is specified, sets the overall height of the axis and returns the current class instance.",
164
173
  table: {
165
174
  defaultValue: {
166
175
  summary: 400
@@ -176,6 +185,7 @@ export const argTypes = assign(
176
185
  type: "boolean"
177
186
  },
178
187
  defaultValue: false,
188
+ description: "If *value* is specified, sets whether offsets will be used to position some labels further away from the axis in order to allow space for the text.",
179
189
  table: {
180
190
  defaultValue: {
181
191
  summary: false
@@ -191,6 +201,7 @@ export const argTypes = assign(
191
201
  type: "boolean"
192
202
  },
193
203
  defaultValue: false,
204
+ description: "If *value* is specified, sets whether whether horizontal axis labels are rotated -90 degrees.",
194
205
  table: {
195
206
  defaultValue: {
196
207
  summary: false
@@ -203,8 +214,9 @@ export const argTypes = assign(
203
214
  },
204
215
  labels: {
205
216
  control: {
206
- type: "array"
217
+ type: "object"
207
218
  },
219
+ description: "If *value* is specified, sets the visible tick labels of the axis and returns the current class instance.",
208
220
  table: {
209
221
  defaultValue: {
210
222
  summary: "undefined"
@@ -219,6 +231,7 @@ export const argTypes = assign(
219
231
  control: {
220
232
  type: "number"
221
233
  },
234
+ description: "If *value* is specified, sets the maximum size allowed for the space that contains the axis tick labels and title.",
222
235
  table: {
223
236
  defaultValue: {
224
237
  summary: "undefined"
@@ -233,6 +246,7 @@ export const argTypes = assign(
233
246
  control: {
234
247
  type: "number"
235
248
  },
249
+ description: "If *value* is specified, sets the minimum size alloted for the space that contains the axis tick labels and title.",
236
250
  table: {
237
251
  defaultValue: {
238
252
  summary: "undefined"
@@ -248,7 +262,7 @@ export const argTypes = assign(
248
262
  type: "text"
249
263
  },
250
264
  defaultValue: "bottom",
251
- description: "Supports `\"top\"`, `\"right\"`, `\"bottom\"`, and `\"left\"` orientations.",
265
+ description: "If *orient* is specified, sets the orientation of the shape and returns the current class instance. If *orient* is not specified, returns the current orientation.",
252
266
  table: {
253
267
  defaultValue: {
254
268
  summary: "bottom"
@@ -264,6 +278,7 @@ export const argTypes = assign(
264
278
  type: "number"
265
279
  },
266
280
  defaultValue: 5,
281
+ description: "If *value* is specified, sets the padding between each tick label to the specified number and returns the current class instance.",
267
282
  table: {
268
283
  defaultValue: {
269
284
  summary: 5
@@ -279,6 +294,7 @@ export const argTypes = assign(
279
294
  type: "number"
280
295
  },
281
296
  defaultValue: 0.1,
297
+ description: "If *value* is specified, sets the inner padding of band scale to the specified number and returns the current class instance.",
282
298
  table: {
283
299
  defaultValue: {
284
300
  summary: 0.1
@@ -294,6 +310,7 @@ export const argTypes = assign(
294
310
  type: "number"
295
311
  },
296
312
  defaultValue: 0.1,
313
+ description: "If *value* is specified, sets the outer padding of band scales to the specified number and returns the current class instance.",
297
314
  table: {
298
315
  defaultValue: {
299
316
  summary: 0.1
@@ -306,8 +323,9 @@ export const argTypes = assign(
306
323
  },
307
324
  range: {
308
325
  control: {
309
- type: "array"
326
+ type: "object"
310
327
  },
328
+ description: "If *value* is specified, sets the scale range (in pixels) of the axis and returns the current class instance. The given array must have 2 values, but one may be `undefined` to allow the default behavior for that value.",
311
329
  table: {
312
330
  defaultValue: {
313
331
  summary: "undefined"
@@ -320,6 +338,7 @@ export const argTypes = assign(
320
338
  },
321
339
  render: {
322
340
  control: {},
341
+ description: "Renders the current Axis to the page. If a *callback* is specified, it will be called once the legend is done drawing.",
323
342
  table: {
324
343
  defaultValue: {
325
344
  summary: "undefined"
@@ -335,6 +354,7 @@ export const argTypes = assign(
335
354
  type: "text"
336
355
  },
337
356
  defaultValue: "none",
357
+ description: "Sets the rounding method, so that more evenly spaced ticks appear at the extents of the scale. Can be set to \"none\" (default), \"outside\", or \"inside\".",
338
358
  table: {
339
359
  defaultValue: {
340
360
  summary: "none"
@@ -350,6 +370,7 @@ export const argTypes = assign(
350
370
  type: "text"
351
371
  },
352
372
  defaultValue: "",
373
+ description: "Sets the prefix used for the maximum value of \"inside\" rounding scales.",
353
374
  table: {
354
375
  defaultValue: {
355
376
  summary: ""
@@ -365,6 +386,7 @@ export const argTypes = assign(
365
386
  type: "text"
366
387
  },
367
388
  defaultValue: "+",
389
+ description: "Sets the suffix used for the maximum value of \"inside\" rounding scales.",
368
390
  table: {
369
391
  defaultValue: {
370
392
  summary: "+"
@@ -380,6 +402,7 @@ export const argTypes = assign(
380
402
  type: "text"
381
403
  },
382
404
  defaultValue: "< ",
405
+ description: "Sets the prefix used for the minimum value of \"inside\" rounding scales.",
383
406
  table: {
384
407
  defaultValue: {
385
408
  summary: "< "
@@ -395,6 +418,7 @@ export const argTypes = assign(
395
418
  type: "text"
396
419
  },
397
420
  defaultValue: "",
421
+ description: "Sets the suffix used for the minimum value of \"inside\" rounding scales.",
398
422
  table: {
399
423
  defaultValue: {
400
424
  summary: ""
@@ -410,6 +434,7 @@ export const argTypes = assign(
410
434
  type: "text"
411
435
  },
412
436
  defaultValue: "linear",
437
+ description: "If *value* is specified, sets the scale of the axis and returns the current class instance.",
413
438
  table: {
414
439
  defaultValue: {
415
440
  summary: "linear"
@@ -425,6 +450,7 @@ export const argTypes = assign(
425
450
  type: "number"
426
451
  },
427
452
  defaultValue: 0.5,
453
+ description: "Sets the \"padding\" property of the scale, often used in point scales.",
428
454
  table: {
429
455
  defaultValue: {
430
456
  summary: 0.5
@@ -440,6 +466,7 @@ export const argTypes = assign(
440
466
  type: "text"
441
467
  },
442
468
  defaultValue: "d3.select(\"body\").append(\"svg\")",
469
+ description: "If *selector* is specified, sets the SVG container element to the specified d3 selector or DOM element and returns the current class instance. If *selector* is not specified, returns the current SVG container element.",
443
470
  table: {
444
471
  defaultValue: {
445
472
  summary: "d3.select(\"body\").append(\"svg\")"
@@ -455,6 +482,7 @@ export const argTypes = assign(
455
482
  type: "text"
456
483
  },
457
484
  defaultValue: "Line",
485
+ description: "If *value* is specified, sets the tick shape constructor and returns the current class instance.",
458
486
  table: {
459
487
  defaultValue: {
460
488
  summary: "Line"
@@ -470,6 +498,7 @@ export const argTypes = assign(
470
498
  type: "object"
471
499
  },
472
500
  defaultValue: "{fill: openColor.colors.gray.600, height: (d) => d.tick ? 8 : 0, label: (d) => d.text, labelBounds: (d) => d.labelBounds, labelConfig: {fontColor: openColor.colors.gray.600, fontResize: false, fontSize: 12, padding: 5, textAnchor: () => {\n const rtl = detectRTL(this._select.node());\n return this._orient === \"left\" ? rtl ? \"start\" : \"end\" : this._orient === \"right\" ? rtl ? \"end\" : \"start\" : this._labelRotation ? this._orient === \"bottom\" ? \"end\" : \"start\" : \"middle\";\n}, verticalAlign: () => this._orient === bottom ? top : this._orient === top ? bottom : middle}, r: (d) => d.tick ? 4 : 0, stroke: openColor.colors.gray.600, strokeWidth: 1, width: (d) => d.tick ? 8 : 0}",
501
+ description: "If *value* is specified, sets the tick style of the axis and returns the current class instance.",
473
502
  table: {
474
503
  defaultValue: {
475
504
  detail: "{fill: openColor.colors.gray.600, height: (d) => d.tick ? 8 : 0, label: (d) => d.text, labelBounds: (d) => d.labelBounds, labelConfig: {fontColor: openColor.colors.gray.600, fontResize: false, fontSize: 12, padding: 5, textAnchor: () => {\n const rtl = detectRTL(this._select.node());\n return this._orient === \"left\" ? rtl ? \"start\" : \"end\" : this._orient === \"right\" ? rtl ? \"end\" : \"start\" : this._labelRotation ? this._orient === \"bottom\" ? \"end\" : \"start\" : \"middle\";\n}, verticalAlign: () => this._orient === bottom ? top : this._orient === top ? bottom : middle}, r: (d) => d.tick ? 4 : 0, stroke: openColor.colors.gray.600, strokeWidth: 1, width: (d) => d.tick ? 8 : 0}",
@@ -483,6 +512,7 @@ export const argTypes = assign(
483
512
  },
484
513
  tickFormat: {
485
514
  control: {},
515
+ description: "If *value* is specified, sets the tick formatter and returns the current class instance.",
486
516
  table: {
487
517
  defaultValue: {
488
518
  summary: "undefined"
@@ -498,6 +528,7 @@ export const argTypes = assign(
498
528
  type: "number"
499
529
  },
500
530
  defaultValue: 8,
531
+ description: "If *value* is specified, sets the tick size of the axis and returns the current class instance.",
501
532
  table: {
502
533
  defaultValue: {
503
534
  summary: 8
@@ -513,6 +544,7 @@ export const argTypes = assign(
513
544
  type: "text"
514
545
  },
515
546
  defaultValue: "normal",
547
+ description: "Sets the behavior of the abbreviations when you are using linear scale. This method accepts two options: \"normal\" (uses formatAbbreviate to determinate the abbreviation) and \"smallest\" (uses suffix from the smallest tick as reference in every tick).",
516
548
  table: {
517
549
  defaultValue: {
518
550
  summary: "normal"
@@ -525,8 +557,9 @@ export const argTypes = assign(
525
557
  },
526
558
  ticks: {
527
559
  control: {
528
- type: "array"
560
+ type: "object"
529
561
  },
562
+ description: "If *value* is specified, sets the tick values of the axis and returns the current class instance.",
530
563
  table: {
531
564
  defaultValue: {
532
565
  summary: "undefined"
@@ -542,6 +575,7 @@ export const argTypes = assign(
542
575
  type: "object"
543
576
  },
544
577
  defaultValue: "undefined",
578
+ description: "Defines a custom locale object to be used in time scale. This object must include the following properties: dateTime, date, time, periods, days, shortDays, months, shortMonths. For more information, you can revise [d3p.d3-time-format](https://github.com/d3/d3-time-format/blob/master/README.md#timeFormatLocale).",
545
579
  table: {
546
580
  defaultValue: {
547
581
  summary: "undefined"
@@ -556,6 +590,7 @@ export const argTypes = assign(
556
590
  control: {
557
591
  type: "text"
558
592
  },
593
+ description: "If *value* is specified, sets the title of the axis and returns the current class instance.",
559
594
  table: {
560
595
  defaultValue: {
561
596
  summary: "undefined"
@@ -571,6 +606,7 @@ export const argTypes = assign(
571
606
  type: "object"
572
607
  },
573
608
  defaultValue: "{fontColor: colorDefaults.dark, fontSize: 12, textAnchor: middle}",
609
+ description: "If *value* is specified, sets the title configuration of the axis and returns the current class instance.",
574
610
  table: {
575
611
  defaultValue: {
576
612
  summary: "{fontColor: colorDefaults.dark, fontSize: 12, textAnchor: middle}"
@@ -586,6 +622,7 @@ export const argTypes = assign(
586
622
  type: "number"
587
623
  },
588
624
  defaultValue: 400,
625
+ description: "If *value* is specified, sets the overall width of the axis and returns the current class instance.",
589
626
  table: {
590
627
  defaultValue: {
591
628
  summary: 400
@@ -27,7 +27,7 @@ export const argTypes = assign(
27
27
  type: "text"
28
28
  },
29
29
  defaultValue: "bottom",
30
- description: "Supports `\"top\"`, `\"right\"`, `\"bottom\"`, and `\"left\"` orientations.",
30
+ description: "If *orient* is specified, sets the orientation of the shape and returns the current class instance. If *orient* is not specified, returns the current orientation.",
31
31
  table: {
32
32
  defaultValue: {
33
33
  summary: "bottom"
@@ -27,7 +27,7 @@ export const argTypes = assign(
27
27
  type: "text"
28
28
  },
29
29
  defaultValue: "left",
30
- description: "Supports `\"top\"`, `\"right\"`, `\"bottom\"`, and `\"left\"` orientations.",
30
+ description: "If *orient* is specified, sets the orientation of the shape and returns the current class instance. If *orient* is not specified, returns the current orientation.",
31
31
  table: {
32
32
  defaultValue: {
33
33
  summary: "left"
@@ -27,7 +27,7 @@ export const argTypes = assign(
27
27
  type: "text"
28
28
  },
29
29
  defaultValue: "right",
30
- description: "Supports `\"top\"`, `\"right\"`, `\"bottom\"`, and `\"left\"` orientations.",
30
+ description: "If *orient* is specified, sets the orientation of the shape and returns the current class instance. If *orient* is not specified, returns the current orientation.",
31
31
  table: {
32
32
  defaultValue: {
33
33
  summary: "right"
@@ -27,7 +27,7 @@ export const argTypes = assign(
27
27
  type: "text"
28
28
  },
29
29
  defaultValue: "top",
30
- description: "Supports `\"top\"`, `\"right\"`, `\"bottom\"`, and `\"left\"` orientations.",
30
+ description: "If *orient* is specified, sets the orientation of the shape and returns the current class instance. If *orient* is not specified, returns the current orientation.",
31
31
  table: {
32
32
  defaultValue: {
33
33
  summary: "top"
@@ -27,7 +27,7 @@ export const argTypes = assign(
27
27
  type: "text"
28
28
  },
29
29
  defaultValue: "middle",
30
- description: "Supports `\"left\"` and `\"center\"` and `\"right\"`.",
30
+ description: "If *value* is specified, sets the horizontal alignment to the specified value and returns the current class instance. If *value* is not specified, returns the current horizontal alignment.",
31
31
  table: {
32
32
  defaultValue: {
33
33
  summary: "middle"
@@ -43,6 +43,7 @@ export const argTypes = assign(
43
43
  type: "object"
44
44
  },
45
45
  defaultValue: "{gridSize: 0}",
46
+ description: "The [ColorScale](http://d3plus.org/docs/#ColorScale) is constructed by combining an [Axis](http://d3plus.org/docs/#Axis) for the ticks/labels and a [Rect](http://d3plus.org/docs/#Rect) for the actual color box (or multiple boxes, as in a jenks scale). Because of this, there are separate configs for the [Axis](http://d3plus.org/docs/#Axis) class used to display the text ([axisConfig](http://d3plus.org/docs/#ColorScale.axisConfig)) and the [Rect](http://d3plus.org/docs/#Rect) class used to draw the color breaks ([rectConfig](http://d3plus.org/docs/#ColorScale.rectConfig)). This method acts as a pass-through to the config method of the [Axis](http://d3plus.org/docs/#Axis). An example usage of this method can be seen [here](http://d3plus.org/examples/d3plus-legend/colorScale-dark/).",
46
47
  table: {
47
48
  defaultValue: {
48
49
  summary: "{gridSize: 0}"
@@ -58,6 +59,7 @@ export const argTypes = assign(
58
59
  type: "boolean"
59
60
  },
60
61
  defaultValue: false,
62
+ description: "Determines whether or not to use an Axis to display bucket scales (both \"buckets\" and \"jenks\"). When set to `false`, bucketed scales will use the `Legend` class to display squares for each range of data. When set to `true`, bucketed scales will be displayed on an `Axis`, similar to \"linear\" scales.",
61
63
  table: {
62
64
  defaultValue: {
63
65
  summary: false
@@ -71,6 +73,7 @@ export const argTypes = assign(
71
73
  bucketFormat: {
72
74
  control: {},
73
75
  defaultValue: "(tick, i, ticks, allValues) => {\n const format = this._axisConfig.tickFormat ? this._axisConfig.tickFormat : formatAbbreviate;\n const next = ticks[i + 1];\n const prev = i ? ticks[i - 1] : false;\n const last = i === ticks.length - 1;\n if (tick === next || last) {\n const suffix = last && tick < max(allValues) ? \"+\" : \"\";\n return `${format(tick)}${suffix}`;\n } else {\n const mod = next ? next / 100 : tick / 100;\n const pow = mod >= 1 || mod <= -1 ? Math.round(mod).toString().length - 1 : mod.toString().split(\".\")[1].replace(/([1-9])[1-9].*$/, \"$1\").length * -1;\n const ten = Math.pow(10, pow);\n const prevValue = prev === tick && i === 1 ? format(min([\n tick + ten,\n allValues.find((d)=>d > tick && d < next)\n ])) : format(tick);\n const nextValue = tick && i === 1 ? format(next) : format(max([\n next - ten,\n allValues.reverse().find((d)=>d > tick && d < next)\n ]));\n return this._bucketJoiner(prevValue, nextValue);\n }\n}",
76
+ description: "A function for formatting the labels associated to each bucket in a bucket-type scale (\"jenks\", \"quantile\", etc). The function is passed four arguments: the start value of the current bucket, it's index in the full Array of buckets, the full Array of buckets, and an Array of every value present in the data used to construct the buckets. Keep in mind that the end value for the bucket is not actually the next bucket in the list, but includes every value up until that next bucket value (less than, but not equal to). By default, d3plus will make the end value slightly less than it's current value, so that it does not overlap with the start label for the next bucket.",
74
77
  table: {
75
78
  defaultValue: {
76
79
  detail: "(tick, i, ticks, allValues) => {\n const format = this._axisConfig.tickFormat ? this._axisConfig.tickFormat : formatAbbreviate;\n const next = ticks[i + 1];\n const prev = i ? ticks[i - 1] : false;\n const last = i === ticks.length - 1;\n if (tick === next || last) {\n const suffix = last && tick < max(allValues) ? \"+\" : \"\";\n return `${format(tick)}${suffix}`;\n } else {\n const mod = next ? next / 100 : tick / 100;\n const pow = mod >= 1 || mod <= -1 ? Math.round(mod).toString().length - 1 : mod.toString().split(\".\")[1].replace(/([1-9])[1-9].*$/, \"$1\").length * -1;\n const ten = Math.pow(10, pow);\n const prevValue = prev === tick && i === 1 ? format(min([\n tick + ten,\n allValues.find((d)=>d > tick && d < next)\n ])) : format(tick);\n const nextValue = tick && i === 1 ? format(next) : format(max([\n next - ten,\n allValues.reverse().find((d)=>d > tick && d < next)\n ]));\n return this._bucketJoiner(prevValue, nextValue);\n }\n}",
@@ -85,6 +88,7 @@ export const argTypes = assign(
85
88
  bucketJoiner: {
86
89
  control: {},
87
90
  defaultValue: "(a, b) => a !== b ? `${a} - ${b}` : `${a}`",
91
+ description: "A function that receives the minimum and maximum values of a bucket, and is expected to return the full label.",
88
92
  table: {
89
93
  defaultValue: {
90
94
  detail: "(a, b) => a !== b ? `${a} - ${b}` : `${a}`",
@@ -98,9 +102,10 @@ export const argTypes = assign(
98
102
  },
99
103
  buckets: {
100
104
  control: {
101
- type: "number"
105
+ type: "object"
102
106
  },
103
107
  defaultValue: 5,
108
+ description: "The number of discrete buckets to create in a bucketed color scale. Will be overridden by any custom Array of colors passed to the `color` method. Optionally, users can supply an Array of values used to separate buckets, such as `[0, 10, 25, 50, 90]` for a percentage scale. This value would create 4 buckets, with each value representing the break point between each bucket (so 5 values makes 4 buckets).",
104
109
  table: {
105
110
  defaultValue: {
106
111
  summary: 5
@@ -116,6 +121,7 @@ export const argTypes = assign(
116
121
  type: "boolean"
117
122
  },
118
123
  defaultValue: true,
124
+ description: "Determines whether or not to display a midpoint centered Axis. Does not apply to quantile scales.",
119
125
  table: {
120
126
  defaultValue: {
121
127
  summary: true
@@ -128,12 +134,13 @@ export const argTypes = assign(
128
134
  },
129
135
  color: {
130
136
  control: {
131
- type: "text"
137
+ type: "object"
132
138
  },
133
- defaultValue: "[\n#54478C,\n#2C699A,\n#0DB39E,\n#83E377,\n#EFEA5A\n]",
139
+ defaultValue: "[\n #54478C,\n#2C699A,\n#0DB39E,\n#83E377,\n#EFEA5A\n]",
140
+ description: "Overrides the default internal logic of `colorMin`, `colorMid`, and `colorMax` to only use just this specified color. If a single color is given as a String, then the scale is interpolated by lightening that color. Otherwise, the function expects an Array of color values to be used in order for the scale.",
134
141
  table: {
135
142
  defaultValue: {
136
- summary: "[\n#54478C,\n#2C699A,\n#0DB39E,\n#83E377,\n#EFEA5A\n]"
143
+ summary: "[\n #54478C,\n#2C699A,\n#0DB39E,\n#83E377,\n#EFEA5A\n]"
137
144
  }
138
145
  },
139
146
  type: {
@@ -146,6 +153,7 @@ export const argTypes = assign(
146
153
  type: "text"
147
154
  },
148
155
  defaultValue: "colorDefaults.on",
156
+ description: "Defines the color to be used for numbers greater than the value of the `midpoint` on the scale (defaults to `0`). Colors in between this value and the value of `colorMid` will be interpolated, unless a custom Array of colors has been specified using the `color` method.",
149
157
  table: {
150
158
  defaultValue: {
151
159
  summary: "colorDefaults.on"
@@ -161,6 +169,7 @@ export const argTypes = assign(
161
169
  type: "text"
162
170
  },
163
171
  defaultValue: "colorDefaults.light",
172
+ description: "Defines the color to be used for the midpoint of a diverging scale, based on the current value of the `midpoint` method (defaults to `0`). Colors in between this value and the values of `colorMin` and `colorMax` will be interpolated, unless a custom Array of colors has been specified using the `color` method.",
164
173
  table: {
165
174
  defaultValue: {
166
175
  summary: "colorDefaults.light"
@@ -176,6 +185,7 @@ export const argTypes = assign(
176
185
  type: "text"
177
186
  },
178
187
  defaultValue: "colorDefaults.off",
188
+ description: "Defines the color to be used for numbers less than the value of the `midpoint` on the scale (defaults to `0`). Colors in between this value and the value of `colorMid` will be interpolated, unless a custom Array of colors has been specified using the `color` method.",
179
189
  table: {
180
190
  defaultValue: {
181
191
  summary: "colorDefaults.off"
@@ -188,12 +198,13 @@ export const argTypes = assign(
188
198
  },
189
199
  data: {
190
200
  control: {
191
- type: "array"
201
+ type: "object"
192
202
  },
193
- defaultValue: "[\n\n]",
203
+ defaultValue: "[ ]",
204
+ description: "If *data* is specified, sets the data array to the specified array and returns the current class instance. If *data* is not specified, returns the current data array. A shape key will be drawn for each object in the array.",
194
205
  table: {
195
206
  defaultValue: {
196
- summary: "[\n\n]"
207
+ summary: "[ ]"
197
208
  }
198
209
  },
199
210
  type: {
@@ -203,8 +214,9 @@ export const argTypes = assign(
203
214
  },
204
215
  domain: {
205
216
  control: {
206
- type: "array"
217
+ type: "object"
207
218
  },
219
+ description: "In a linear scale, this Array of 2 values defines the min and max values used in the color scale. Any values outside of this range will be mapped to the nearest color value.",
208
220
  table: {
209
221
  defaultValue: {
210
222
  summary: "undefined"
@@ -220,6 +232,7 @@ export const argTypes = assign(
220
232
  type: "number"
221
233
  },
222
234
  defaultValue: 600,
235
+ description: "If *value* is specified, sets the transition duration of the ColorScale and returns the current class instance. If *value* is not specified, returns the current duration.",
223
236
  table: {
224
237
  defaultValue: {
225
238
  summary: 600
@@ -235,6 +248,7 @@ export const argTypes = assign(
235
248
  type: "number"
236
249
  },
237
250
  defaultValue: 200,
251
+ description: "If *value* is specified, sets the overall height of the ColorScale and returns the current class instance. If *value* is not specified, returns the current height value.",
238
252
  table: {
239
253
  defaultValue: {
240
254
  summary: 200
@@ -250,6 +264,7 @@ export const argTypes = assign(
250
264
  type: "object"
251
265
  },
252
266
  defaultValue: "{fontColor: colorDefaults.dark, fontSize: 12}",
267
+ description: "A pass-through for the [TextBox](http://d3plus.org/docs/#TextBox) class used to style the labelMin and labelMax text.",
253
268
  table: {
254
269
  defaultValue: {
255
270
  summary: "{fontColor: colorDefaults.dark, fontSize: 12}"
@@ -264,6 +279,7 @@ export const argTypes = assign(
264
279
  control: {
265
280
  type: "text"
266
281
  },
282
+ description: "Defines a text label to be displayed off of the end of the maximum point in the scale (currently only available in horizontal orientation).",
267
283
  table: {
268
284
  defaultValue: {
269
285
  summary: "undefined"
@@ -278,6 +294,7 @@ export const argTypes = assign(
278
294
  control: {
279
295
  type: "text"
280
296
  },
297
+ description: "Defines a text label to be displayed off of the end of the minimum point in the scale (currently only available in horizontal orientation).",
281
298
  table: {
282
299
  defaultValue: {
283
300
  summary: "undefined"
@@ -293,6 +310,7 @@ export const argTypes = assign(
293
310
  type: "object"
294
311
  },
295
312
  defaultValue: "{shapeConfig: {stroke: colorDefaults.dark, strokeWidth: 1}}",
313
+ description: "The [ColorScale](http://d3plus.org/docs/#ColorScale) is constructed by combining an [Axis](http://d3plus.org/docs/#Axis) for the ticks/labels and a [Rect](http://d3plus.org/docs/#Rect) for the actual color box (or multiple boxes, as in a jenks scale). Because of this, there are separate configs for the [Axis](http://d3plus.org/docs/#Axis) class used to display the text ([axisConfig](http://d3plus.org/docs/#ColorScale.axisConfig)) and the [Rect](http://d3plus.org/docs/#Rect) class used to draw the color breaks ([rectConfig](http://d3plus.org/docs/#ColorScale.rectConfig)). This method acts as a pass-through to the config method of the [Axis](http://d3plus.org/docs/#Axis). An example usage of this method can be seen [here](http://d3plus.org/examples/d3plus-legend/colorScale-dark/).",
296
314
  table: {
297
315
  defaultValue: {
298
316
  summary: "{shapeConfig: {stroke: colorDefaults.dark, strokeWidth: 1}}"
@@ -308,6 +326,7 @@ export const argTypes = assign(
308
326
  type: "number"
309
327
  },
310
328
  defaultValue: 0,
329
+ description: "The number value to be used as the anchor for `colorMid`, and defines the center point of the diverging color scale.",
311
330
  table: {
312
331
  defaultValue: {
313
332
  summary: 0
@@ -323,6 +342,7 @@ export const argTypes = assign(
323
342
  type: "text"
324
343
  },
325
344
  defaultValue: "bottom",
345
+ description: "Sets the flow of the items inside the ColorScale. If no value is passed, the current flow will be returned.",
326
346
  table: {
327
347
  defaultValue: {
328
348
  summary: "bottom"
@@ -338,6 +358,7 @@ export const argTypes = assign(
338
358
  type: "number"
339
359
  },
340
360
  defaultValue: 5,
361
+ description: "If *value* is specified, sets the padding between each key to the specified number and returns the current class instance. If *value* is not specified, returns the current padding value.",
341
362
  table: {
342
363
  defaultValue: {
343
364
  summary: 5
@@ -353,6 +374,7 @@ export const argTypes = assign(
353
374
  type: "object"
354
375
  },
355
376
  defaultValue: "{stroke: #999, strokeWidth: 1}",
377
+ description: "The [ColorScale](http://d3plus.org/docs/#ColorScale) is constructed by combining an [Axis](http://d3plus.org/docs/#Axis) for the ticks/labels and a [Rect](http://d3plus.org/docs/#Rect) for the actual color box (or multiple boxes, as in a jenks scale). Because of this, there are separate configs for the [Axis](http://d3plus.org/docs/#Axis) class used to display the text ([axisConfig](http://d3plus.org/docs/#ColorScale.axisConfig)) and the [Rect](http://d3plus.org/docs/#Rect) class used to draw the color breaks ([rectConfig](http://d3plus.org/docs/#ColorScale.rectConfig)). This method acts as a pass-through to the config method of the [Rect](http://d3plus.org/docs/#Rect). An example usage of this method can be seen [here](http://d3plus.org/examples/d3plus-legend/colorScale-dark/).",
356
378
  table: {
357
379
  defaultValue: {
358
380
  summary: "{stroke: #999, strokeWidth: 1}"
@@ -365,6 +387,7 @@ export const argTypes = assign(
365
387
  },
366
388
  render: {
367
389
  control: {},
390
+ description: "Renders the current ColorScale to the page. If a *callback* is specified, it will be called once the ColorScale is done drawing.",
368
391
  table: {
369
392
  defaultValue: {
370
393
  summary: "undefined"
@@ -380,7 +403,7 @@ export const argTypes = assign(
380
403
  type: "text"
381
404
  },
382
405
  defaultValue: "linear",
383
- description: "Can either be \"linear\", \"jenks\", or \"buckets\".",
406
+ description: "If *value* is specified, sets the scale of the ColorScale and returns the current class instance. If *value* is not specified, returns the current scale value.",
384
407
  table: {
385
408
  defaultValue: {
386
409
  summary: "linear"
@@ -396,6 +419,7 @@ export const argTypes = assign(
396
419
  type: "text"
397
420
  },
398
421
  defaultValue: "d3.select(\"body\").append(\"svg\")",
422
+ description: "If *selector* is specified, sets the SVG container element to the specified d3 selector or DOM element and returns the current class instance. If *selector* is not specified, returns the current SVG container element.",
399
423
  table: {
400
424
  defaultValue: {
401
425
  summary: "d3.select(\"body\").append(\"svg\")"
@@ -411,6 +435,7 @@ export const argTypes = assign(
411
435
  type: "number"
412
436
  },
413
437
  defaultValue: 10,
438
+ description: "The height of horizontal color scales, and width when positioned vertical.",
414
439
  table: {
415
440
  defaultValue: {
416
441
  summary: 10
@@ -426,6 +451,7 @@ export const argTypes = assign(
426
451
  type: "text"
427
452
  },
428
453
  defaultValue: "d => d[\"value\"]",
454
+ description: "If *value* is specified, sets the value accessor to the specified function or string and returns the current class instance. If *value* is not specified, returns the current value accessor.",
429
455
  table: {
430
456
  defaultValue: {
431
457
  detail: "d => d[\"value\"]",
@@ -442,6 +468,7 @@ export const argTypes = assign(
442
468
  type: "number"
443
469
  },
444
470
  defaultValue: 400,
471
+ description: "If *value* is specified, sets the overall width of the ColorScale and returns the current class instance. If *value* is not specified, returns the current width value.",
445
472
  table: {
446
473
  defaultValue: {
447
474
  summary: 400