@d3plus/docs 3.0.5 → 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.
- package/.storybook/preview-head.html +5 -0
- package/args/core/charts/AreaPlot.args.jsx +4 -1
- package/args/core/charts/BarChart.args.jsx +5 -1
- package/args/core/charts/BoxWhisker.args.jsx +4 -1
- package/args/core/charts/BumpChart.args.jsx +8 -1
- package/args/core/charts/Donut.args.jsx +4 -2
- package/args/core/charts/Geomap.args.jsx +29 -13
- package/args/core/charts/LinePlot.args.jsx +3 -1
- package/args/core/charts/Matrix.args.jsx +13 -2
- package/args/core/charts/Network.args.jsx +29 -16
- package/args/core/charts/Pack.args.jsx +11 -2
- package/args/core/charts/Pie.args.jsx +8 -1
- package/args/core/charts/Plot.args.jsx +54 -21
- package/args/core/charts/Priestley.args.jsx +6 -0
- package/args/core/charts/Radar.args.jsx +7 -1
- package/args/core/charts/RadialMatrix.args.jsx +15 -4
- package/args/core/charts/Rings.args.jsx +21 -10
- package/args/core/charts/Sankey.args.jsx +17 -5
- package/args/core/charts/Tree.args.jsx +46 -6
- package/args/core/charts/Treemap.args.jsx +15 -5
- package/args/core/charts/Viz.args.jsx +102 -24
- package/args/core/components/Axis.args.jsx +49 -12
- package/args/core/components/AxisBottom.args.jsx +1 -1
- package/args/core/components/AxisLeft.args.jsx +1 -1
- package/args/core/components/AxisRight.args.jsx +1 -1
- package/args/core/components/AxisTop.args.jsx +1 -1
- package/args/core/components/ColorScale.args.jsx +37 -10
- package/args/core/components/Legend.args.jsx +21 -5
- package/args/core/components/TextBox.args.jsx +40 -7
- package/args/core/components/Timeline.args.jsx +29 -5
- package/args/core/components/Tooltip.args.jsx +40 -12
- package/args/core/shapes/Area.args.jsx +11 -1
- package/args/core/shapes/Bar.args.jsx +10 -1
- package/args/core/shapes/Box.args.jsx +19 -5
- package/args/core/shapes/Circle.args.jsx +4 -1
- package/args/core/shapes/Image.args.jsx +13 -1
- package/args/core/shapes/Line.args.jsx +7 -1
- package/args/core/shapes/Path.args.jsx +4 -1
- package/args/core/shapes/Rect.args.jsx +4 -1
- package/args/core/shapes/Shape.args.jsx +49 -13
- package/args/core/shapes/Whisker.args.jsx +13 -2
- package/args/core/utils/BaseClass.args.jsx +4 -0
- package/args/core/utils/accessor.args.jsx +1 -3
- package/args/core/utils/constant.args.jsx +1 -1
- package/args/data/dataConcat.args.jsx +1 -1
- package/args/data/dataLoad.args.jsx +1 -1
- package/args/data/isData.args.jsx +1 -3
- package/args/data/merge.args.jsx +1 -1
- package/args/data/unique.args.jsx +1 -1
- package/args/dom/attrize.args.jsx +1 -3
- package/args/dom/elem.args.jsx +1 -3
- package/args/dom/fontExists.args.jsx +1 -1
- package/args/dom/isObject.args.jsx +1 -3
- package/args/dom/parseSides.args.jsx +1 -1
- package/args/dom/stylize.args.jsx +1 -3
- package/args/dom/textWidth.args.jsx +1 -1
- package/args/export/saveElement.args.jsx +1 -3
- package/args/format/formatDate.args.jsx +2 -4
- package/args/math/closest.args.jsx +1 -1
- package/args/math/largestRect.args.jsx +1 -1
- package/args/math/lineIntersection.args.jsx +4 -4
- package/args/math/pointDistance.args.jsx +2 -2
- package/args/math/pointDistanceSquared.args.jsx +2 -2
- package/args/math/pointRotate.args.jsx +2 -2
- package/args/math/polygonInside.args.jsx +2 -2
- package/args/math/polygonRayCast.args.jsx +2 -2
- package/args/math/polygonRotate.args.jsx +2 -2
- package/args/math/segmentBoxContains.args.jsx +3 -3
- package/args/math/segmentsIntersect.args.jsx +4 -4
- package/helpers/configify.js +2 -10
- package/package.json +6 -6
- 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"
|
|
@@ -49,7 +49,7 @@ export const argTypes = {
|
|
|
49
49
|
},
|
|
50
50
|
path: {
|
|
51
51
|
control: {
|
|
52
|
-
type: "
|
|
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: {
|
package/args/data/merge.args.jsx
CHANGED
package/args/dom/elem.args.jsx
CHANGED
|
@@ -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: "
|
|
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
|
p1: {
|
|
10
10
|
control: {
|
|
11
|
-
type: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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: {
|
package/helpers/configify.js
CHANGED
|
@@ -4,15 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export default function(args, argTypes) {
|
|
6
6
|
return Object.keys(args).reduce((acc, key) => {
|
|
7
|
-
|
|
8
|
-
|
|
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.
|
|
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.
|
|
20
|
-
"@d3plus/dom": "3.0.
|
|
21
|
-
"@d3plus/format": "3.0.
|
|
22
|
-
"@d3plus/locales": "3.0.
|
|
23
|
-
"@d3plus/react": "3.0.
|
|
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"]}};
|