@d3plus/docs 3.0.4 → 3.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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 +56 -23
  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 +29 -5
  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
@@ -11,6 +11,7 @@ export const argTypes = {
11
11
  control: {
12
12
  type: "object"
13
13
  },
14
+ description: "If *value* is specified, sets the methods that correspond to the key/value pairs and returns this class. If *value* is not specified, returns the current configuration.",
14
15
  table: {
15
16
  defaultValue: {
16
17
  summary: "undefined"
@@ -26,6 +27,7 @@ export const argTypes = {
26
27
  type: "object"
27
28
  },
28
29
  defaultValue: "\"en-US\"",
30
+ description: "Sets the locale used for all text and number formatting. This method supports the locales defined in [d3plus-format](https://github.com/d3plus/d3plus-format/blob/master/src/locale.js). The locale can be defined as a complex Object (like in d3plus-format), a locale code (like \"en-US\"), or a 2-digit language code (like \"en\"). If a 2-digit code is provided, the \"findLocale\" function is used to identify the most approximate locale from d3plus-format.",
29
31
  table: {
30
32
  defaultValue: {
31
33
  summary: "\"en-US\""
@@ -40,6 +42,7 @@ export const argTypes = {
40
42
  control: {
41
43
  type: "text"
42
44
  },
45
+ description: "Adds or removes a *listener* to each object for the specified event *typenames*. If a *listener* is not specified, returns the currently assigned listener for the specified event *typename*. Mirrors the core [d3-selection](https://github.com/d3/d3-selection#selection_on) behavior.",
43
46
  table: {
44
47
  defaultValue: {
45
48
  summary: "undefined"
@@ -52,6 +55,7 @@ export const argTypes = {
52
55
  },
53
56
  translate: {
54
57
  control: {},
58
+ description: "Defines how informational text strings should be displayed. By default, this function will try to find the string in question (which is the first argument provided to this function) inside of an internally managed translation Object. If you'd like to override to use custom text, simply pass this method your own custom formatting function.",
55
59
  table: {
56
60
  defaultValue: {
57
61
  summary: "undefined"
@@ -7,9 +7,7 @@ import React from "react";
7
7
 
8
8
  export const argTypes = {
9
9
  def: {
10
- control: {
11
- type: "*"
12
- },
10
+ control: {},
13
11
  description: "A default value to be returned if the key is not present.",
14
12
  table: {
15
13
  defaultValue: {
@@ -8,7 +8,7 @@ import React from "react";
8
8
  export const argTypes = {
9
9
  value: {
10
10
  control: {
11
- type: "array"
11
+ type: "object"
12
12
  },
13
13
  description: "The value to be returned from the function.",
14
14
  table: {
@@ -8,7 +8,7 @@ import React from "react";
8
8
  export const argTypes = {
9
9
  arrayOfArray: {
10
10
  control: {
11
- type: "array"
11
+ type: "object"
12
12
  },
13
13
  description: "Array of elements",
14
14
  table: {
@@ -49,7 +49,7 @@ export const argTypes = {
49
49
  },
50
50
  path: {
51
51
  control: {
52
- type: "array"
52
+ type: "object"
53
53
  },
54
54
  description: "The path to the file or url to be loaded. Also support array of paths strings. If an Array of objects is passed, the xhr request logic is skipped.",
55
55
  table: {
@@ -7,9 +7,7 @@ import React from "react";
7
7
 
8
8
  export const argTypes = {
9
9
  dataItem: {
10
- control: {
11
- type: "*"
12
- },
10
+ control: {},
13
11
  description: "The value to be tested",
14
12
  table: {
15
13
  defaultValue: {
@@ -23,7 +23,7 @@ export const argTypes = {
23
23
  },
24
24
  objects: {
25
25
  control: {
26
- type: "array"
26
+ type: "object"
27
27
  },
28
28
  description: "The Array of objects to be merged together.",
29
29
  table: {
@@ -21,7 +21,7 @@ export const argTypes = {
21
21
  },
22
22
  arr: {
23
23
  control: {
24
- type: "array"
24
+ type: "object"
25
25
  },
26
26
  description: "The Array of objects to be filtered.",
27
27
  table: {
@@ -22,9 +22,7 @@ export const argTypes = {
22
22
  }
23
23
  },
24
24
  elem: {
25
- control: {
26
- type: "d3selection"
27
- },
25
+ control: {},
28
26
  description: "The D3 element to apply the styles to.",
29
27
  table: {
30
28
  defaultValue: {
@@ -86,9 +86,7 @@ export const argTypes = {
86
86
  }
87
87
  },
88
88
  "params.parent": {
89
- control: {
90
- type: "d3selection"
91
- },
89
+ control: {},
92
90
  defaultValue: "d3.select(\"body\")",
93
91
  description: "The parent element for this new element to be appended to.",
94
92
  table: {
@@ -8,7 +8,7 @@ import React from "react";
8
8
  export const argTypes = {
9
9
  font: {
10
10
  control: {
11
- type: "text"
11
+ type: "object"
12
12
  },
13
13
  description: "Can be either a valid CSS font-family string (single or comma-separated names) or an Array of string names.",
14
14
  table: {
@@ -7,9 +7,7 @@ import React from "react";
7
7
 
8
8
  export const argTypes = {
9
9
  item: {
10
- control: {
11
- type: "*"
12
- },
10
+ control: {},
13
11
  table: {
14
12
  defaultValue: {
15
13
  summary: "undefined"
@@ -8,7 +8,7 @@ import React from "react";
8
8
  export const argTypes = {
9
9
  sides: {
10
10
  control: {
11
- type: "text"
11
+ type: "number"
12
12
  },
13
13
  description: "The CSS shorthand string to expand.",
14
14
  table: {
@@ -7,9 +7,7 @@ import React from "react";
7
7
 
8
8
  export const argTypes = {
9
9
  elem: {
10
- control: {
11
- type: "d3selection"
12
- },
10
+ control: {},
13
11
  description: "The D3 element to apply the styles to.",
14
12
  table: {
15
13
  defaultValue: {
@@ -23,7 +23,7 @@ export const argTypes = {
23
23
  },
24
24
  text: {
25
25
  control: {
26
- type: "text"
26
+ type: "object"
27
27
  },
28
28
  description: "Can be either a single string or an array of strings to analyze.",
29
29
  table: {
@@ -7,9 +7,7 @@ import React from "react";
7
7
 
8
8
  export const argTypes = {
9
9
  elem: {
10
- control: {
11
- type: "htmlelement"
12
- },
10
+ control: {},
13
11
  description: "A single element to be saved to one file.",
14
12
  table: {
15
13
  defaultValue: {
@@ -7,9 +7,7 @@ import React from "react";
7
7
 
8
8
  export const argTypes = {
9
9
  d: {
10
- control: {
11
- type: "date"
12
- },
10
+ control: {},
13
11
  description: "The date string to be formatted.",
14
12
  table: {
15
13
  defaultValue: {
@@ -23,7 +21,7 @@ export const argTypes = {
23
21
  },
24
22
  dataArray: {
25
23
  control: {
26
- type: "array"
24
+ type: "object"
27
25
  },
28
26
  description: "The full array of ordered Date Objects.",
29
27
  table: {
@@ -8,7 +8,7 @@ import React from "react";
8
8
  export const argTypes = {
9
9
  arr: {
10
10
  control: {
11
- type: "array"
11
+ type: "object"
12
12
  },
13
13
  description: "The array of values to test against.",
14
14
  table: {
@@ -24,7 +24,7 @@ export const argTypes = {
24
24
  },
25
25
  poly: {
26
26
  control: {
27
- type: "array"
27
+ type: "object"
28
28
  },
29
29
  description: "An Array of points that represent a polygon.",
30
30
  table: {
@@ -8,7 +8,7 @@ import React from "react";
8
8
  export const argTypes = {
9
9
  p1: {
10
10
  control: {
11
- type: "array"
11
+ type: "object"
12
12
  },
13
13
  description: "The first point of the first line segment, which should always be an `[x, y]` formatted Array.",
14
14
  table: {
@@ -23,7 +23,7 @@ export const argTypes = {
23
23
  },
24
24
  p2: {
25
25
  control: {
26
- type: "array"
26
+ type: "object"
27
27
  },
28
28
  description: "The first point of the second line segment, which should always be an `[x, y]` formatted Array.",
29
29
  table: {
@@ -38,7 +38,7 @@ export const argTypes = {
38
38
  },
39
39
  q1: {
40
40
  control: {
41
- type: "array"
41
+ type: "object"
42
42
  },
43
43
  description: "The second point of the first line segment, which should always be an `[x, y]` formatted Array.",
44
44
  table: {
@@ -53,7 +53,7 @@ export const argTypes = {
53
53
  },
54
54
  q2: {
55
55
  control: {
56
- type: "array"
56
+ type: "object"
57
57
  },
58
58
  description: "The second point of the second line segment, which should always be an `[x, y]` formatted Array.",
59
59
  table: {
@@ -8,7 +8,7 @@ import React from "react";
8
8
  export const argTypes = {
9
9
  p1: {
10
10
  control: {
11
- type: "array"
11
+ type: "object"
12
12
  },
13
13
  description: "The first point, which should always be an `[x, y]` formatted Array.",
14
14
  table: {
@@ -23,7 +23,7 @@ export const argTypes = {
23
23
  },
24
24
  p2: {
25
25
  control: {
26
- type: "array"
26
+ type: "object"
27
27
  },
28
28
  description: "The second point, which should always be an `[x, y]` formatted Array.",
29
29
  table: {
@@ -8,7 +8,7 @@ import React from "react";
8
8
  export const argTypes = {
9
9
  p1: {
10
10
  control: {
11
- type: "array"
11
+ type: "object"
12
12
  },
13
13
  description: "The first point, which should always be an `[x, y]` formatted Array.",
14
14
  table: {
@@ -23,7 +23,7 @@ export const argTypes = {
23
23
  },
24
24
  p2: {
25
25
  control: {
26
- type: "array"
26
+ type: "object"
27
27
  },
28
28
  description: "The second point, which should always be an `[x, y]` formatted Array.",
29
29
  table: {
@@ -23,7 +23,7 @@ export const argTypes = {
23
23
  },
24
24
  origin: {
25
25
  control: {
26
- type: "array"
26
+ type: "object"
27
27
  },
28
28
  defaultValue: "[0, 0]",
29
29
  description: "The origin point of the rotation, which should always be an `[x, y]` formatted Array.",
@@ -39,7 +39,7 @@ export const argTypes = {
39
39
  },
40
40
  p: {
41
41
  control: {
42
- type: "array"
42
+ type: "object"
43
43
  },
44
44
  description: "The point to be rotated, which should always be an `[x, y]` formatted Array.",
45
45
  table: {
@@ -8,7 +8,7 @@ import React from "react";
8
8
  export const argTypes = {
9
9
  polyA: {
10
10
  control: {
11
- type: "array"
11
+ type: "object"
12
12
  },
13
13
  description: "An Array of `[x, y]` points to be used as the inner polygon, checking if it is inside polyA.",
14
14
  table: {
@@ -23,7 +23,7 @@ export const argTypes = {
23
23
  },
24
24
  polyB: {
25
25
  control: {
26
- type: "array"
26
+ type: "object"
27
27
  },
28
28
  description: "An Array of `[x, y]` points to be used as the containing polygon.",
29
29
  table: {
@@ -24,7 +24,7 @@ export const argTypes = {
24
24
  },
25
25
  origin: {
26
26
  control: {
27
- type: "array"
27
+ type: "object"
28
28
  },
29
29
  description: "The origin point of the ray to be cast, which should be an `[x, y]` formatted Array.",
30
30
  table: {
@@ -39,7 +39,7 @@ export const argTypes = {
39
39
  },
40
40
  poly: {
41
41
  control: {
42
- type: "array"
42
+ type: "object"
43
43
  },
44
44
  description: "The polygon to test against, which should be an `[x, y]` formatted Array.",
45
45
  table: {
@@ -23,7 +23,7 @@ export const argTypes = {
23
23
  },
24
24
  origin: {
25
25
  control: {
26
- type: "array"
26
+ type: "object"
27
27
  },
28
28
  defaultValue: "[0, 0]",
29
29
  description: "The origin point of the rotation, which should be an `[x, y]` formatted Array.",
@@ -39,7 +39,7 @@ export const argTypes = {
39
39
  },
40
40
  poly: {
41
41
  control: {
42
- type: "array"
42
+ type: "object"
43
43
  },
44
44
  description: "The polygon to be rotated, which should be an Array of `[x, y]` values.",
45
45
  table: {
@@ -8,7 +8,7 @@ import React from "react";
8
8
  export const argTypes = {
9
9
  p: {
10
10
  control: {
11
- type: "array"
11
+ type: "object"
12
12
  },
13
13
  description: "The point to be checked, which should always be an `[x, y]` formatted Array.",
14
14
  table: {
@@ -23,7 +23,7 @@ export const argTypes = {
23
23
  },
24
24
  s1: {
25
25
  control: {
26
- type: "array"
26
+ type: "object"
27
27
  },
28
28
  description: "The first point of the line segment to be used for the bounding box, which should always be an `[x, y]` formatted Array.",
29
29
  table: {
@@ -38,7 +38,7 @@ export const argTypes = {
38
38
  },
39
39
  s2: {
40
40
  control: {
41
- type: "array"
41
+ type: "object"
42
42
  },
43
43
  description: "The second point of the line segment to be used for the bounding box, which should always be an `[x, y]` formatted Array.",
44
44
  table: {
@@ -8,7 +8,7 @@ import React from "react";
8
8
  export const argTypes = {
9
9
  p1: {
10
10
  control: {
11
- type: "array"
11
+ type: "object"
12
12
  },
13
13
  description: "The first point of the first line segment, which should always be an `[x, y]` formatted Array.",
14
14
  table: {
@@ -23,7 +23,7 @@ export const argTypes = {
23
23
  },
24
24
  p2: {
25
25
  control: {
26
- type: "array"
26
+ type: "object"
27
27
  },
28
28
  description: "The first point of the second line segment, which should always be an `[x, y]` formatted Array.",
29
29
  table: {
@@ -38,7 +38,7 @@ export const argTypes = {
38
38
  },
39
39
  q1: {
40
40
  control: {
41
- type: "array"
41
+ type: "object"
42
42
  },
43
43
  description: "The second point of the first line segment, which should always be an `[x, y]` formatted Array.",
44
44
  table: {
@@ -53,7 +53,7 @@ export const argTypes = {
53
53
  },
54
54
  q2: {
55
55
  control: {
56
- type: "array"
56
+ type: "object"
57
57
  },
58
58
  description: "The second point of the second line segment, which should always be an `[x, y]` formatted Array.",
59
59
  table: {
@@ -4,15 +4,7 @@
4
4
  */
5
5
  export default function(args, argTypes) {
6
6
  return Object.keys(args).reduce((acc, key) => {
7
- const _acc = acc;
8
- if (
9
- args[key] !== undefined && argTypes[key] !== undefined &&
10
- (argTypes[key].defaultValue === undefined ||
11
- typeof argTypes[key].defaultValue === "function"
12
- ? argTypes[key].defaultValue !== args[key]
13
- : JSON.stringify(argTypes[key].defaultValue) !== JSON.stringify(args[key])
14
- )
15
- ) _acc[key] = args[key];
16
- return _acc;
7
+ if (args[key] !== undefined && argTypes[key] !== undefined) acc[key] = args[key];
8
+ return acc;
17
9
  }, {});
18
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@d3plus/docs",
3
- "version": "3.0.4",
3
+ "version": "3.0.6",
4
4
  "description": "Documentation and examples for the d3plus visualization library.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://d3plus.org",
@@ -16,11 +16,11 @@
16
16
  "dev:local": "storybook dev --docs --ci --no-version-updates --port=4000"
17
17
  },
18
18
  "dependencies": {
19
- "@d3plus/core": "3.0.4",
20
- "@d3plus/dom": "3.0.4",
21
- "@d3plus/format": "3.0.4",
22
- "@d3plus/locales": "3.0.4",
23
- "@d3plus/react": "3.0.4",
19
+ "@d3plus/core": "3.0.6",
20
+ "@d3plus/dom": "3.0.6",
21
+ "@d3plus/format": "3.0.6",
22
+ "@d3plus/locales": "3.0.6",
23
+ "@d3plus/react": "3.0.6",
24
24
  "@types/react": "^19.1.0",
25
25
  "next": "^15.2.4",
26
26
  "react": "^18.2.0",
@@ -25,3 +25,43 @@ const Template = (args) => <Tree config={configify(args, argTypes)} />;
25
25
  // WARNING: do not edit above this line of code directly, it is generated
26
26
  // from the source code. Stories below this line can be modified.
27
27
 
28
+ export const BasicExample = Template.bind({});
29
+ BasicExample.args = {
30
+ data: [
31
+ {parent: "Group 1", id: "alpha"},
32
+ {parent: "Group 1", id: "beta"},
33
+ {parent: "Group 1", id: "gamma"},
34
+ {parent: "Group 2", id: "delta"},
35
+ {parent: "Group 2", id: "eta"}
36
+ ],
37
+ groupBy: ["parent", "id"]
38
+ };
39
+ BasicExample.parameters = {controls: {include: ["groupBy"]}};
40
+
41
+ export const HorizontalOrientation = Template.bind({});
42
+ HorizontalOrientation.args = {
43
+ data: [
44
+ {parent: "Group 1", id: "alpha"},
45
+ {parent: "Group 1", id: "beta"},
46
+ {parent: "Group 1", id: "gamma"},
47
+ {parent: "Group 2", id: "delta"},
48
+ {parent: "Group 2", id: "eta"}
49
+ ],
50
+ groupBy: ["parent", "id"],
51
+ orient: "horizontal"
52
+ };
53
+ HorizontalOrientation.parameters = {controls: {include: ["orient"]}};
54
+
55
+ export const ChangingShapes = Template.bind({});
56
+ ChangingShapes.args = {
57
+ data: [
58
+ {parent: "Group 1", id: "alpha"},
59
+ {parent: "Group 1", id: "beta"},
60
+ {parent: "Group 1", id: "gamma"},
61
+ {parent: "Group 2", id: "delta"},
62
+ {parent: "Group 2", id: "eta"}
63
+ ],
64
+ groupBy: ["parent", "id"],
65
+ shape: funcify(d => d.parent === "Group 1" ? "Rect" : "Circle", 'd => d.parent === "Group 1" ? "Rect" : "Circle"')
66
+ };
67
+ ChangingShapes.parameters = {controls: {include: ["shape"]}};