@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.
- 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 +33 -9
- 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
|
@@ -27,6 +27,7 @@ export const argTypes = assign(
|
|
|
27
27
|
control: {
|
|
28
28
|
type: "text"
|
|
29
29
|
},
|
|
30
|
+
description: "Sets the center node to be the node with the given id.",
|
|
30
31
|
table: {
|
|
31
32
|
defaultValue: {
|
|
32
33
|
summary: "undefined"
|
|
@@ -39,6 +40,7 @@ export const argTypes = assign(
|
|
|
39
40
|
},
|
|
40
41
|
hover: {
|
|
41
42
|
control: {},
|
|
43
|
+
description: "If *value* is specified, sets the hover method to the specified function and returns the current class instance.",
|
|
42
44
|
table: {
|
|
43
45
|
defaultValue: {
|
|
44
46
|
summary: "undefined"
|
|
@@ -51,13 +53,13 @@ export const argTypes = assign(
|
|
|
51
53
|
},
|
|
52
54
|
links: {
|
|
53
55
|
control: {
|
|
54
|
-
type: "
|
|
56
|
+
type: "object"
|
|
55
57
|
},
|
|
56
|
-
defaultValue: "[
|
|
57
|
-
description: "
|
|
58
|
+
defaultValue: "[ ]",
|
|
59
|
+
description: "A predefined *Array* of edges that connect each object passed to the [node](#Rings.node) method. The `source` and `target` keys in each link need to map to the nodes in one of three ways:\n1. The index of the node in the nodes array (as in [this](http://d3plus.org/examples/d3plus-network/getting-started/) example).\n2. The actual node *Object* itself.\n3. A *String* value matching the `id` of the node.\n\nThe value passed should either be an *Array* of data or a *String* representing a filepath or URL to be loaded. An optional formatting function can be passed as a second argument to this method. This custom function will be passed the data that has been loaded, as long as there are no errors. This function should return the final links *Array*.",
|
|
58
60
|
table: {
|
|
59
61
|
defaultValue: {
|
|
60
|
-
summary: "[
|
|
62
|
+
summary: "[ ]"
|
|
61
63
|
}
|
|
62
64
|
},
|
|
63
65
|
type: {
|
|
@@ -70,6 +72,7 @@ export const argTypes = assign(
|
|
|
70
72
|
type: "boolean"
|
|
71
73
|
},
|
|
72
74
|
defaultValue: false,
|
|
75
|
+
description: "Toggles the visibility of the status message that is displayed when no data is supplied to the visualization.",
|
|
73
76
|
table: {
|
|
74
77
|
defaultValue: {
|
|
75
78
|
summary: false
|
|
@@ -82,8 +85,9 @@ export const argTypes = assign(
|
|
|
82
85
|
},
|
|
83
86
|
nodeGroupBy: {
|
|
84
87
|
control: {
|
|
85
|
-
type: "
|
|
88
|
+
type: "object"
|
|
86
89
|
},
|
|
90
|
+
description: "If *value* is specified, sets the node group accessor(s) to the specified string, function, or array of values and returns the current class instance. This method overrides the default .groupBy() function from being used with the data passed to .nodes(). If *value* is not specified, returns the current node group accessor.",
|
|
87
91
|
table: {
|
|
88
92
|
defaultValue: {
|
|
89
93
|
summary: "undefined"
|
|
@@ -96,13 +100,13 @@ export const argTypes = assign(
|
|
|
96
100
|
},
|
|
97
101
|
nodes: {
|
|
98
102
|
control: {
|
|
99
|
-
type: "
|
|
103
|
+
type: "object"
|
|
100
104
|
},
|
|
101
|
-
defaultValue: "[
|
|
102
|
-
description: "
|
|
105
|
+
defaultValue: "[ ]",
|
|
106
|
+
description: "The list of nodes to be used for drawing the rings network. The value passed should either be an *Array* of data or a *String* representing a filepath or URL to be loaded.\n\nAdditionally, a custom formatting function can be passed as a second argument to this method. This custom function will be passed the data that has been loaded, as long as there are no errors. This function should return the final node *Array*.",
|
|
103
107
|
table: {
|
|
104
108
|
defaultValue: {
|
|
105
|
-
summary: "[
|
|
109
|
+
summary: "[ ]"
|
|
106
110
|
}
|
|
107
111
|
},
|
|
108
112
|
type: {
|
|
@@ -120,6 +124,7 @@ export const argTypes = assign(
|
|
|
120
124
|
"mouseleave.shape": "() => {\n this.hover(false);\n}",
|
|
121
125
|
"mousemove.shape": "(d, i, x, event) => {\n defaultMouseMove(d, i, x, event);\n if (this._focus && this._focus === d.id) {\n this.hover(false);\n this._on.mouseenter.bind(this)(d, i, x, event);\n this._focus = undefined;\n } else {\n const id = this._nodeGroupBy && this._nodeGroupBy[this._drawDepth](d, i) ? this._nodeGroupBy[this._drawDepth](d, i) : this._id(d, i), links = this._linkLookup[id], node = this._nodeLookup[id];\n const filterIds = [\n node.id\n ];\n const xDomain = [\n node.x - node.r,\n node.x + node.r\n ], yDomain = [\n node.y - node.r,\n node.y + node.r\n ];\n links.forEach((l)=>{\n filterIds.push(l.id);\n if (l.x - l.r < xDomain[0]) xDomain[0] = l.x - l.r;\n if (l.x + l.r > xDomain[1]) xDomain[1] = l.x + l.r;\n if (l.y - l.r < yDomain[0]) yDomain[0] = l.y - l.r;\n if (l.y + l.r > yDomain[1]) yDomain[1] = l.y + l.r;\n });\n this.hover((h, x)=>{\n if (h.source && h.target) return h.source.id === node.id || h.target.id === node.id;\n else return filterIds.includes(this._ids(h, x)[this._drawDepth]);\n });\n }\n}"
|
|
122
126
|
},
|
|
127
|
+
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.",
|
|
123
128
|
table: {
|
|
124
129
|
defaultValue: {
|
|
125
130
|
summary: {
|
|
@@ -140,6 +145,7 @@ export const argTypes = assign(
|
|
|
140
145
|
type: "text"
|
|
141
146
|
},
|
|
142
147
|
defaultValue: "Circle",
|
|
148
|
+
description: "Changes the primary shape used to represent each data point in a visualization. Not all visualizations support changing shapes, this method can be provided the String name of a D3plus shape class (for example, \"Rect\" or \"Circle\"), or an accessor Function that returns the String class name to be used for each individual data point.",
|
|
143
149
|
table: {
|
|
144
150
|
defaultValue: {
|
|
145
151
|
summary: "Circle"
|
|
@@ -147,7 +153,7 @@ export const argTypes = assign(
|
|
|
147
153
|
},
|
|
148
154
|
type: {
|
|
149
155
|
required: false,
|
|
150
|
-
summary: "
|
|
156
|
+
summary: "string | function"
|
|
151
157
|
}
|
|
152
158
|
},
|
|
153
159
|
shapeConfig: {
|
|
@@ -155,6 +161,7 @@ export const argTypes = assign(
|
|
|
155
161
|
type: "object"
|
|
156
162
|
},
|
|
157
163
|
defaultValue: "assign(this._shapeConfig, {ariaLabel: (d, i) => {\n const validSize = this._size ? `, ${this._size(d, i)}` : \"\";\n return `${this._drawLabel(d, i)}${validSize}.`;\n}, labelConfig: {duration: 0, fontMin: 1, fontResize: true, labelPadding: 0, textAnchor: middle, verticalAlign: middle}, Path: {fill: none, label: false, stroke: #eee, strokeWidth: 1}})",
|
|
164
|
+
description: "If *value* is specified, sets the config method for each shape and returns the current class instance.",
|
|
158
165
|
table: {
|
|
159
166
|
defaultValue: {
|
|
160
167
|
detail: "assign(this._shapeConfig, {ariaLabel: (d, i) => {\n const validSize = this._size ? `, ${this._size(d, i)}` : \"\";\n return `${this._drawLabel(d, i)}${validSize}.`;\n}, labelConfig: {duration: 0, fontMin: 1, fontResize: true, labelPadding: 0, textAnchor: middle, verticalAlign: middle}, Path: {fill: none, label: false, stroke: #eee, strokeWidth: 1}})",
|
|
@@ -170,6 +177,7 @@ export const argTypes = assign(
|
|
|
170
177
|
control: {
|
|
171
178
|
type: "text"
|
|
172
179
|
},
|
|
180
|
+
description: "If *value* is specified, sets the size accessor to the specified function or data key and returns the current class instance. If *value* is not specified, returns the current size accessor.",
|
|
173
181
|
table: {
|
|
174
182
|
defaultValue: {
|
|
175
183
|
summary: "undefined"
|
|
@@ -184,6 +192,7 @@ export const argTypes = assign(
|
|
|
184
192
|
control: {
|
|
185
193
|
type: "number"
|
|
186
194
|
},
|
|
195
|
+
description: "If *value* is specified, sets the size scale maximum to the specified number and returns the current class instance. If *value* is not specified, returns the current size scale maximum. By default, the maximum size is determined by half the distance of the two closest nodes.",
|
|
187
196
|
table: {
|
|
188
197
|
defaultValue: {
|
|
189
198
|
summary: "undefined"
|
|
@@ -199,6 +208,7 @@ export const argTypes = assign(
|
|
|
199
208
|
type: "number"
|
|
200
209
|
},
|
|
201
210
|
defaultValue: 5,
|
|
211
|
+
description: "If *value* is specified, sets the size scale minimum to the specified number and returns the current class instance. If *value* is not specified, returns the current size scale minimum.",
|
|
202
212
|
table: {
|
|
203
213
|
defaultValue: {
|
|
204
214
|
summary: 5
|
|
@@ -214,6 +224,7 @@ export const argTypes = assign(
|
|
|
214
224
|
type: "text"
|
|
215
225
|
},
|
|
216
226
|
defaultValue: "sqrt",
|
|
227
|
+
description: "If *value* is specified, sets the size scale to the specified string and returns the current class instance. If *value* is not specified, returns the current size scale.",
|
|
217
228
|
table: {
|
|
218
229
|
defaultValue: {
|
|
219
230
|
summary: "sqrt"
|
|
@@ -25,6 +25,7 @@ export const argTypes = assign(
|
|
|
25
25
|
{
|
|
26
26
|
hover: {
|
|
27
27
|
control: {},
|
|
28
|
+
description: "If *value* is specified, sets the hover method to the specified function and returns the current class instance.",
|
|
28
29
|
table: {
|
|
29
30
|
defaultValue: {
|
|
30
31
|
summary: "undefined"
|
|
@@ -37,10 +38,10 @@ export const argTypes = assign(
|
|
|
37
38
|
},
|
|
38
39
|
links: {
|
|
39
40
|
control: {
|
|
40
|
-
type: "
|
|
41
|
+
type: "object"
|
|
41
42
|
},
|
|
42
43
|
defaultValue: "d => d[\"links\"]",
|
|
43
|
-
description: "
|
|
44
|
+
description: "A predefined *Array* of edges that connect each object passed to the [node](#Sankey.node) method. The `source` and `target` keys in each link need to map to the nodes in one of one way:\n1. A *String* value matching the `id` of the node.\n\nThe value passed should be an *Array* of data. An optional formatting function can be passed as a second argument to this method. This custom function will be passed the data that has been loaded, as long as there are no errors. This function should return the final links *Array*.",
|
|
44
45
|
table: {
|
|
45
46
|
defaultValue: {
|
|
46
47
|
detail: "d => d[\"links\"]",
|
|
@@ -57,6 +58,7 @@ export const argTypes = assign(
|
|
|
57
58
|
type: "text"
|
|
58
59
|
},
|
|
59
60
|
defaultValue: "source",
|
|
61
|
+
description: "The key inside of each link Object that references the source node.",
|
|
60
62
|
table: {
|
|
61
63
|
defaultValue: {
|
|
62
64
|
summary: "source"
|
|
@@ -72,6 +74,7 @@ export const argTypes = assign(
|
|
|
72
74
|
type: "text"
|
|
73
75
|
},
|
|
74
76
|
defaultValue: "target",
|
|
77
|
+
description: "The key inside of each link Object that references the target node.",
|
|
75
78
|
table: {
|
|
76
79
|
defaultValue: {
|
|
77
80
|
summary: "target"
|
|
@@ -87,6 +90,7 @@ export const argTypes = assign(
|
|
|
87
90
|
type: "boolean"
|
|
88
91
|
},
|
|
89
92
|
defaultValue: false,
|
|
93
|
+
description: "Toggles the visibility of the status message that is displayed when no data is supplied to the visualization.",
|
|
90
94
|
table: {
|
|
91
95
|
defaultValue: {
|
|
92
96
|
summary: false
|
|
@@ -102,6 +106,7 @@ export const argTypes = assign(
|
|
|
102
106
|
type: "text"
|
|
103
107
|
},
|
|
104
108
|
defaultValue: "sankeyAligns.justify",
|
|
109
|
+
description: "Sets the nodeAlign property of the sankey layout, which can either be \"left\", \"right\", \"center\", or \"justify\".",
|
|
105
110
|
table: {
|
|
106
111
|
defaultValue: {
|
|
107
112
|
summary: "sankeyAligns.justify"
|
|
@@ -117,6 +122,7 @@ export const argTypes = assign(
|
|
|
117
122
|
type: "text"
|
|
118
123
|
},
|
|
119
124
|
defaultValue: "d => d[\"id\"]",
|
|
125
|
+
description: "If *value* is specified, sets the node id accessor(s) to the specified array of values and returns the current class instance. If *value* is not specified, returns the current node group accessor.",
|
|
120
126
|
table: {
|
|
121
127
|
defaultValue: {
|
|
122
128
|
detail: "d => d[\"id\"]",
|
|
@@ -133,6 +139,7 @@ export const argTypes = assign(
|
|
|
133
139
|
type: "number"
|
|
134
140
|
},
|
|
135
141
|
defaultValue: 8,
|
|
142
|
+
description: "If *value* is specified, sets the padding of the node and returns the current class instance. If *value* is not specified, returns the current nodePadding. By default, the nodePadding size is 8.",
|
|
136
143
|
table: {
|
|
137
144
|
defaultValue: {
|
|
138
145
|
summary: 8
|
|
@@ -148,6 +155,7 @@ export const argTypes = assign(
|
|
|
148
155
|
type: "number"
|
|
149
156
|
},
|
|
150
157
|
defaultValue: 30,
|
|
158
|
+
description: "If *value* is specified, sets the width of the node and returns the current class instance. If *value* is not specified, returns the current nodeWidth. By default, the nodeWidth size is 30.",
|
|
151
159
|
table: {
|
|
152
160
|
defaultValue: {
|
|
153
161
|
summary: 30
|
|
@@ -160,10 +168,10 @@ export const argTypes = assign(
|
|
|
160
168
|
},
|
|
161
169
|
nodes: {
|
|
162
170
|
control: {
|
|
163
|
-
type: "
|
|
171
|
+
type: "object"
|
|
164
172
|
},
|
|
165
173
|
defaultValue: "d => d[\"nodes\"]",
|
|
166
|
-
description: "
|
|
174
|
+
description: "The list of nodes to be used for drawing the network. The value passed must be an *Array* of data.\n\nAdditionally, a custom formatting function can be passed as a second argument to this method. This custom function will be passed the data that has been loaded, as long as there are no errors. This function should return the final node *Array*.",
|
|
167
175
|
table: {
|
|
168
176
|
defaultValue: {
|
|
169
177
|
detail: "d => d[\"nodes\"]",
|
|
@@ -184,6 +192,7 @@ export const argTypes = assign(
|
|
|
184
192
|
"mouseleave.shape": "() => {\n this.hover(false);\n}",
|
|
185
193
|
"mousemove.shape": "(d, i, x, event) => {\n defaultMouseMove(d, i, x, event);\n if (this._focus && this._focus === d.id) {\n this.hover(false);\n this._on.mouseenter.bind(this)(d, i, x, event);\n this._focus = undefined;\n } else {\n const id = this._nodeId(d, i), node = this._nodeLookup[id], nodeLookup = Object.keys(this._nodeLookup).reduce((all, item)=>{\n all[this._nodeLookup[item]] = !isNaN(item) ? parseInt(item, 10) : item;\n return all;\n }, {});\n const links = this._linkLookup[node];\n const filterIds = [\n id\n ];\n links.forEach((l)=>{\n filterIds.push(nodeLookup[l]);\n });\n this.hover((h, x)=>{\n if (h.source && h.target) {\n return h.source.id === id || h.target.id === id;\n } else {\n return filterIds.includes(this._nodeId(h, x));\n }\n });\n }\n}"
|
|
186
194
|
},
|
|
195
|
+
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.",
|
|
187
196
|
table: {
|
|
188
197
|
defaultValue: {
|
|
189
198
|
summary: {
|
|
@@ -203,6 +212,7 @@ export const argTypes = assign(
|
|
|
203
212
|
type: "text"
|
|
204
213
|
},
|
|
205
214
|
defaultValue: "Rect",
|
|
215
|
+
description: "Changes the primary shape used to represent each data point in a visualization. Not all visualizations support changing shapes, this method can be provided the String name of a D3plus shape class (for example, \"Rect\" or \"Circle\"), or an accessor Function that returns the String class name to be used for each individual data point.",
|
|
206
216
|
table: {
|
|
207
217
|
defaultValue: {
|
|
208
218
|
summary: "Rect"
|
|
@@ -210,7 +220,7 @@ export const argTypes = assign(
|
|
|
210
220
|
},
|
|
211
221
|
type: {
|
|
212
222
|
required: false,
|
|
213
|
-
summary: "
|
|
223
|
+
summary: "string | function"
|
|
214
224
|
}
|
|
215
225
|
},
|
|
216
226
|
shapeConfig: {
|
|
@@ -218,6 +228,7 @@ export const argTypes = assign(
|
|
|
218
228
|
type: "object"
|
|
219
229
|
},
|
|
220
230
|
defaultValue: "assign(this._shapeConfig, {Path: {fill: none, hoverStyle: {stroke-width: (d) => Math.max(1, Math.abs(d.source.y1 - d.source.y0) * (d.value / d.source.value) - 2)}, label: false, stroke: #DBDBDB, strokeOpacity: 0.5, strokeWidth: (d) => Math.max(1, Math.abs(d.source.y1 - d.source.y0) * (d.value / d.source.value) - 2)}, Rect: {}})",
|
|
231
|
+
description: "If *value* is specified, sets the config method for each shape and returns the current class instance.",
|
|
221
232
|
table: {
|
|
222
233
|
defaultValue: {
|
|
223
234
|
detail: "assign(this._shapeConfig, {Path: {fill: none, hoverStyle: {stroke-width: (d) => Math.max(1, Math.abs(d.source.y1 - d.source.y0) * (d.value / d.source.value) - 2)}, label: false, stroke: #DBDBDB, strokeOpacity: 0.5, strokeWidth: (d) => Math.max(1, Math.abs(d.source.y1 - d.source.y0) * (d.value / d.source.value) - 2)}, Rect: {}})",
|
|
@@ -234,6 +245,7 @@ export const argTypes = assign(
|
|
|
234
245
|
type: "number"
|
|
235
246
|
},
|
|
236
247
|
defaultValue: 1,
|
|
248
|
+
description: "If *value* is specified, sets the width of the links and returns the current class instance. If *value* is not specified, returns the current value accessor.",
|
|
237
249
|
table: {
|
|
238
250
|
defaultValue: {
|
|
239
251
|
summary: 1
|
|
@@ -23,12 +23,32 @@ export const argTypes = assign(
|
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
25
|
{
|
|
26
|
+
legendTooltip: {
|
|
27
|
+
control: {
|
|
28
|
+
type: "object"
|
|
29
|
+
},
|
|
30
|
+
defaultValue: "assign(this._legendTooltip, {title: legendLabel.bind(this)})",
|
|
31
|
+
description: "If *value* is specified, sets the config method for the legend tooltip and returns the current class instance.",
|
|
32
|
+
table: {
|
|
33
|
+
defaultValue: {
|
|
34
|
+
summary: "assign(this._legendTooltip, {title: legendLabel.bind(this)})"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
type: {
|
|
38
|
+
required: false,
|
|
39
|
+
summary: "object"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
26
42
|
orient: {
|
|
27
43
|
control: {
|
|
28
|
-
type: "
|
|
44
|
+
type: "radio"
|
|
29
45
|
},
|
|
30
46
|
defaultValue: "vertical",
|
|
31
|
-
description: "
|
|
47
|
+
description: "Changes the orientation of the entire Tree, either \"vertical\" (top to bottom) or \"horizontal\" (left to right).",
|
|
48
|
+
options: [
|
|
49
|
+
"vertical",
|
|
50
|
+
"horizontal"
|
|
51
|
+
],
|
|
32
52
|
table: {
|
|
33
53
|
defaultValue: {
|
|
34
54
|
summary: "vertical"
|
|
@@ -36,12 +56,13 @@ export const argTypes = assign(
|
|
|
36
56
|
},
|
|
37
57
|
type: {
|
|
38
58
|
required: false,
|
|
39
|
-
summary: "
|
|
59
|
+
summary: "'vertical' | 'horizontal'"
|
|
40
60
|
}
|
|
41
61
|
},
|
|
42
62
|
separation: {
|
|
43
63
|
control: {},
|
|
44
64
|
defaultValue: "(a, b) => a.parent === b.parent ? 1 : 2",
|
|
65
|
+
description: "If *value* is specified, sets the separation accessor to the specified function. If *value* is not specified, returns the current separation accessor.\n\nFrom the [d3-hierarchy documentation](https://github.com/d3/d3-hierarchy#tree_separation):\n> The separation accessor is used to separate neighboring nodes. The separation function is passed two nodes a and b, and must return the desired separation. The nodes are typically siblings, though the nodes may be more distantly related if the layout decides to place such nodes adjacent.",
|
|
45
66
|
table: {
|
|
46
67
|
defaultValue: {
|
|
47
68
|
detail: "(a, b) => a.parent === b.parent ? 1 : 2",
|
|
@@ -58,6 +79,7 @@ export const argTypes = assign(
|
|
|
58
79
|
type: "text"
|
|
59
80
|
},
|
|
60
81
|
defaultValue: "Circle",
|
|
82
|
+
description: "Changes the primary shape used to represent each data point in a visualization. Not all visualizations support changing shapes, this method can be provided the String name of a D3plus shape class (for example, \"Rect\" or \"Circle\"), or an accessor Function that returns the String class name to be used for each individual data point.",
|
|
61
83
|
table: {
|
|
62
84
|
defaultValue: {
|
|
63
85
|
summary: "Circle"
|
|
@@ -65,17 +87,35 @@ export const argTypes = assign(
|
|
|
65
87
|
},
|
|
66
88
|
type: {
|
|
67
89
|
required: false,
|
|
68
|
-
summary: "
|
|
90
|
+
summary: "string | function"
|
|
69
91
|
}
|
|
70
92
|
},
|
|
71
93
|
shapeConfig: {
|
|
72
94
|
control: {
|
|
73
95
|
type: "object"
|
|
74
96
|
},
|
|
75
|
-
defaultValue: "assign(this._shapeConfig, {ariaLabel: (d, i) => this._treeData ? `${this._treeData.i.depth}. ${this._drawLabel(d, i)}.` : , labelConfig: {fontColor:
|
|
97
|
+
defaultValue: "assign(this._shapeConfig, {ariaLabel: (d, i) => this._treeData ? `${this._treeData.i.depth}. ${this._drawLabel(d, i)}.` : , labelConfig: {fontColor: colorDefaults.dark}, Path: {fill: none, stroke: colorDefaults.missing, strokeWidth: 2}, r: 7, width: 12, height: 12})",
|
|
98
|
+
description: "If *value* is specified, sets the config method for each shape and returns the current class instance.",
|
|
99
|
+
table: {
|
|
100
|
+
defaultValue: {
|
|
101
|
+
detail: "assign(this._shapeConfig, {ariaLabel: (d, i) => this._treeData ? `${this._treeData.i.depth}. ${this._drawLabel(d, i)}.` : , labelConfig: {fontColor: colorDefaults.dark}, Path: {fill: none, stroke: colorDefaults.missing, strokeWidth: 2}, r: 7, width: 12, height: 12})",
|
|
102
|
+
summary: "function"
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
type: {
|
|
106
|
+
required: false,
|
|
107
|
+
summary: "object"
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
tooltipConfig: {
|
|
111
|
+
control: {
|
|
112
|
+
type: "object"
|
|
113
|
+
},
|
|
114
|
+
defaultValue: "assign(this._tooltipConfig, {title: (d, i, x) => (this._drawLabel(d, i, x.depth - 1))})",
|
|
115
|
+
description: "If *value* is specified, sets the config method for the tooltip and returns the current class instance.",
|
|
76
116
|
table: {
|
|
77
117
|
defaultValue: {
|
|
78
|
-
detail: "assign(this.
|
|
118
|
+
detail: "assign(this._tooltipConfig, {title: (d, i, x) => (this._drawLabel(d, i, x.depth - 1))})",
|
|
79
119
|
summary: "function"
|
|
80
120
|
}
|
|
81
121
|
},
|
|
@@ -28,6 +28,7 @@ export const argTypes = assign(
|
|
|
28
28
|
type: "number"
|
|
29
29
|
},
|
|
30
30
|
defaultValue: 1,
|
|
31
|
+
description: "If *value* is specified, sets the inner and outer padding accessor to the specified function or number and returns the current class instance. If *value* is not specified, returns the current padding accessor.",
|
|
31
32
|
table: {
|
|
32
33
|
defaultValue: {
|
|
33
34
|
summary: 1
|
|
@@ -43,6 +44,7 @@ export const argTypes = assign(
|
|
|
43
44
|
type: "boolean"
|
|
44
45
|
},
|
|
45
46
|
defaultValue: "(config, arr) => {\n if (arr.length === this._filteredData.length) return false;\n return defaultLegend.bind(this)(config, arr);\n}",
|
|
47
|
+
description: "If *value* is specified, toggles the legend based on the specified boolean and returns the current class instance.",
|
|
46
48
|
table: {
|
|
47
49
|
defaultValue: {
|
|
48
50
|
detail: "(config, arr) => {\n if (arr.length === this._filteredData.length) return false;\n return defaultLegend.bind(this)(config, arr);\n}",
|
|
@@ -57,6 +59,7 @@ export const argTypes = assign(
|
|
|
57
59
|
legendSort: {
|
|
58
60
|
control: {},
|
|
59
61
|
defaultValue: "(a, b) => this._sum(b) - this._sum(a)",
|
|
62
|
+
description: "A JavaScript [sort comparator function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) used to sort the legend.",
|
|
60
63
|
table: {
|
|
61
64
|
defaultValue: {
|
|
62
65
|
detail: "(a, b) => this._sum(b) - this._sum(a)",
|
|
@@ -72,10 +75,11 @@ export const argTypes = assign(
|
|
|
72
75
|
control: {
|
|
73
76
|
type: "object"
|
|
74
77
|
},
|
|
75
|
-
defaultValue: "assign({}, this._legendTooltip, {tbody: [
|
|
78
|
+
defaultValue: "assign({}, this._legendTooltip, {tbody: [ ]})",
|
|
79
|
+
description: "If *value* is specified, sets the config method for the legend tooltip and returns the current class instance.",
|
|
76
80
|
table: {
|
|
77
81
|
defaultValue: {
|
|
78
|
-
summary: "assign({}, this._legendTooltip, {tbody: [
|
|
82
|
+
summary: "assign({}, this._legendTooltip, {tbody: [ ]})"
|
|
79
83
|
}
|
|
80
84
|
},
|
|
81
85
|
type: {
|
|
@@ -88,6 +92,7 @@ export const argTypes = assign(
|
|
|
88
92
|
type: "object"
|
|
89
93
|
},
|
|
90
94
|
defaultValue: "assign({}, this._shapeConfig, {ariaLabel: (d, i) => {\n const rank = this._rankData ? `${this._rankData.indexOf(d) + 1}. ` : \"\";\n return `${rank}${this._drawLabel(d, i)}, ${this._sum(d, i)}.`;\n}, labelConfig: {fontMax: 32, fontMin: 8, fontResize: true, padding: 5}})",
|
|
95
|
+
description: "If *value* is specified, sets the config method for each shape and returns the current class instance.",
|
|
91
96
|
table: {
|
|
92
97
|
defaultValue: {
|
|
93
98
|
detail: "assign({}, this._shapeConfig, {ariaLabel: (d, i) => {\n const rank = this._rankData ? `${this._rankData.indexOf(d) + 1}. ` : \"\";\n return `${rank}${this._drawLabel(d, i)}, ${this._sum(d, i)}.`;\n}, labelConfig: {fontMax: 32, fontMin: 8, fontResize: true, padding: 5}})",
|
|
@@ -101,9 +106,10 @@ export const argTypes = assign(
|
|
|
101
106
|
},
|
|
102
107
|
sort: {
|
|
103
108
|
control: {
|
|
104
|
-
type: "
|
|
109
|
+
type: "object"
|
|
105
110
|
},
|
|
106
111
|
defaultValue: "(a, b) => {\n const aggA = isAggregated(a);\n const aggB = isAggregated(b);\n return aggA && !aggB ? 1 : !aggA && aggB ? -1 : b.value - a.value;\n}",
|
|
112
|
+
description: "If *comparator* is specified, sets the sort order for the treemap using the specified comparator function. If *comparator* is not specified, returns the current group sort order, which defaults to descending order by the associated input data's numeric value attribute.",
|
|
107
113
|
table: {
|
|
108
114
|
defaultValue: {
|
|
109
115
|
detail: "(a, b) => {\n const aggA = isAggregated(a);\n const aggB = isAggregated(b);\n return aggA && !aggB ? 1 : !aggA && aggB ? -1 : b.value - a.value;\n}",
|
|
@@ -120,6 +126,7 @@ export const argTypes = assign(
|
|
|
120
126
|
type: "number"
|
|
121
127
|
},
|
|
122
128
|
defaultValue: "d => d[\"value\"]",
|
|
129
|
+
description: "If *value* is specified, sets the sum accessor to the specified function or number and returns the current class instance. If *value* is not specified, returns the current sum accessor.",
|
|
123
130
|
table: {
|
|
124
131
|
defaultValue: {
|
|
125
132
|
detail: "d => d[\"value\"]",
|
|
@@ -136,6 +143,7 @@ export const argTypes = assign(
|
|
|
136
143
|
type: "number"
|
|
137
144
|
},
|
|
138
145
|
defaultValue: "this._sum",
|
|
146
|
+
description: "If *value* is specified, sets the accesor for the value used in the threshold algorithm, and returns the current class instance.",
|
|
139
147
|
table: {
|
|
140
148
|
defaultValue: {
|
|
141
149
|
summary: "this._sum"
|
|
@@ -151,6 +159,7 @@ export const argTypes = assign(
|
|
|
151
159
|
type: "text"
|
|
152
160
|
},
|
|
153
161
|
defaultValue: "treemapSquarify",
|
|
162
|
+
description: "Sets the tiling method used when calcuating the size and position of the rectangles.\r\n\r\nCan either be a string referring to a d3-hierarchy [tiling method](https://github.com/d3/d3-hierarchy#treemap-tiling), or a custom function in the same format.",
|
|
154
163
|
table: {
|
|
155
164
|
defaultValue: {
|
|
156
165
|
summary: "treemapSquarify"
|
|
@@ -165,10 +174,11 @@ export const argTypes = assign(
|
|
|
165
174
|
control: {
|
|
166
175
|
type: "object"
|
|
167
176
|
},
|
|
168
|
-
defaultValue: "assign({}, this._tooltipConfig, {tbody: [
|
|
177
|
+
defaultValue: "assign({}, this._tooltipConfig, {tbody: [ [\n () => this._translate(Share),\n(d, i, x) => `${formatAbbreviate(x.share * 100, this._locale)}%`\n] ]})",
|
|
178
|
+
description: "If *value* is specified, sets the config method for the tooltip and returns the current class instance.",
|
|
169
179
|
table: {
|
|
170
180
|
defaultValue: {
|
|
171
|
-
detail: "assign({}, this._tooltipConfig, {tbody: [
|
|
181
|
+
detail: "assign({}, this._tooltipConfig, {tbody: [ [\n () => this._translate(Share),\n(d, i, x) => `${formatAbbreviate(x.share * 100, this._locale)}%`\n] ]})",
|
|
172
182
|
summary: "function"
|
|
173
183
|
}
|
|
174
184
|
},
|