@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
|
@@ -21,6 +21,11 @@
|
|
|
21
21
|
margin: 0 !important;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
/* hide default type showing in description */
|
|
25
|
+
.docblock-argstable-body tr td:nth-child(2) div:last-child {
|
|
26
|
+
display: none;
|
|
27
|
+
}
|
|
28
|
+
|
|
24
29
|
/* kill paddings */
|
|
25
30
|
.docs-story > div:first-child { /* viz container */
|
|
26
31
|
padding: 10px !important;
|
|
@@ -28,6 +28,7 @@ export const argTypes = assign(
|
|
|
28
28
|
type: "number"
|
|
29
29
|
},
|
|
30
30
|
defaultValue: 0,
|
|
31
|
+
description: "Sets the baseline for the x/y plot. If *value* is not specified, returns the current baseline.",
|
|
31
32
|
table: {
|
|
32
33
|
defaultValue: {
|
|
33
34
|
summary: 0
|
|
@@ -43,6 +44,7 @@ export const argTypes = assign(
|
|
|
43
44
|
type: "text"
|
|
44
45
|
},
|
|
45
46
|
defaultValue: "x",
|
|
47
|
+
description: "If *value* is specified, sets the discrete accessor to the specified method name (usually an axis) and returns the current class instance.",
|
|
46
48
|
table: {
|
|
47
49
|
defaultValue: {
|
|
48
50
|
summary: "x"
|
|
@@ -58,6 +60,7 @@ export const argTypes = assign(
|
|
|
58
60
|
type: "text"
|
|
59
61
|
},
|
|
60
62
|
defaultValue: "Area",
|
|
63
|
+
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
64
|
table: {
|
|
62
65
|
defaultValue: {
|
|
63
66
|
summary: "Area"
|
|
@@ -65,7 +68,7 @@ export const argTypes = assign(
|
|
|
65
68
|
},
|
|
66
69
|
type: {
|
|
67
70
|
required: false,
|
|
68
|
-
summary: "
|
|
71
|
+
summary: "string | function"
|
|
69
72
|
}
|
|
70
73
|
}
|
|
71
74
|
}
|
|
@@ -28,6 +28,7 @@ export const argTypes = assign(
|
|
|
28
28
|
type: "number"
|
|
29
29
|
},
|
|
30
30
|
defaultValue: 0,
|
|
31
|
+
description: "Sets the baseline for the x/y plot. If *value* is not specified, returns the current baseline.",
|
|
31
32
|
table: {
|
|
32
33
|
defaultValue: {
|
|
33
34
|
summary: 0
|
|
@@ -43,6 +44,7 @@ export const argTypes = assign(
|
|
|
43
44
|
type: "text"
|
|
44
45
|
},
|
|
45
46
|
defaultValue: "x",
|
|
47
|
+
description: "If *value* is specified, sets the discrete accessor to the specified method name (usually an axis) and returns the current class instance.",
|
|
46
48
|
table: {
|
|
47
49
|
defaultValue: {
|
|
48
50
|
summary: "x"
|
|
@@ -58,6 +60,7 @@ export const argTypes = assign(
|
|
|
58
60
|
type: "boolean"
|
|
59
61
|
},
|
|
60
62
|
defaultValue: "(config, arr) => {\n const legendIds = arr.map(this._groupBy[this._legendDepth].bind(this)).sort().join();\n const barIds = this._filteredData.map(this._groupBy[this._legendDepth].bind(this)).sort().join();\n if (legendIds === barIds) return false;\n return defaultLegend.bind(this)(config, arr);\n}",
|
|
63
|
+
description: "If *value* is specified, toggles the legend based on the specified boolean and returns the current class instance.",
|
|
61
64
|
table: {
|
|
62
65
|
defaultValue: {
|
|
63
66
|
detail: "(config, arr) => {\n const legendIds = arr.map(this._groupBy[this._legendDepth].bind(this)).sort().join();\n const barIds = this._filteredData.map(this._groupBy[this._legendDepth].bind(this)).sort().join();\n if (legendIds === barIds) return false;\n return defaultLegend.bind(this)(config, arr);\n}",
|
|
@@ -74,6 +77,7 @@ export const argTypes = assign(
|
|
|
74
77
|
type: "text"
|
|
75
78
|
},
|
|
76
79
|
defaultValue: "Bar",
|
|
80
|
+
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.",
|
|
77
81
|
table: {
|
|
78
82
|
defaultValue: {
|
|
79
83
|
summary: "Bar"
|
|
@@ -81,7 +85,7 @@ export const argTypes = assign(
|
|
|
81
85
|
},
|
|
82
86
|
type: {
|
|
83
87
|
required: false,
|
|
84
|
-
summary: "
|
|
88
|
+
summary: "string | function"
|
|
85
89
|
}
|
|
86
90
|
}
|
|
87
91
|
}
|
|
@@ -28,6 +28,7 @@ export const argTypes = assign(
|
|
|
28
28
|
type: "text"
|
|
29
29
|
},
|
|
30
30
|
defaultValue: "x",
|
|
31
|
+
description: "If *value* is specified, sets the discrete accessor to the specified method name (usually an axis) and returns the current class instance.",
|
|
31
32
|
table: {
|
|
32
33
|
defaultValue: {
|
|
33
34
|
summary: "x"
|
|
@@ -43,6 +44,7 @@ export const argTypes = assign(
|
|
|
43
44
|
type: "text"
|
|
44
45
|
},
|
|
45
46
|
defaultValue: "Box",
|
|
47
|
+
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.",
|
|
46
48
|
table: {
|
|
47
49
|
defaultValue: {
|
|
48
50
|
summary: "Box"
|
|
@@ -50,7 +52,7 @@ export const argTypes = assign(
|
|
|
50
52
|
},
|
|
51
53
|
type: {
|
|
52
54
|
required: false,
|
|
53
|
-
summary: "
|
|
55
|
+
summary: "string | function"
|
|
54
56
|
}
|
|
55
57
|
},
|
|
56
58
|
tooltipConfig: {
|
|
@@ -58,6 +60,7 @@ export const argTypes = assign(
|
|
|
58
60
|
type: "object"
|
|
59
61
|
},
|
|
60
62
|
defaultValue: "assign(this._tooltipConfig, {title: (d, i) => {\n if (!d) return \"\";\n while(d.__d3plus__ && d.data){\n d = d.data;\n i = d.i;\n }\n if (this._label) return this._label(d, i);\n const l = this._ids(d, i).slice(0, this._drawDepth);\n return l[l.length - 1];\n}})",
|
|
63
|
+
description: "If *value* is specified, sets the config method for the tooltip and returns the current class instance.",
|
|
61
64
|
table: {
|
|
62
65
|
defaultValue: {
|
|
63
66
|
detail: "assign(this._tooltipConfig, {title: (d, i) => {\n if (!d) return \"\";\n while(d.__d3plus__ && d.data){\n d = d.data;\n i = d.i;\n }\n if (this._label) return this._label(d, i);\n const l = this._ids(d, i).slice(0, this._drawDepth);\n return l[l.length - 1];\n}})",
|
|
@@ -28,6 +28,7 @@ export const argTypes = assign(
|
|
|
28
28
|
type: "text"
|
|
29
29
|
},
|
|
30
30
|
defaultValue: "x",
|
|
31
|
+
description: "If *value* is specified, sets the discrete accessor to the specified method name (usually an axis) and returns the current class instance.",
|
|
31
32
|
table: {
|
|
32
33
|
defaultValue: {
|
|
33
34
|
summary: "x"
|
|
@@ -43,6 +44,7 @@ export const argTypes = assign(
|
|
|
43
44
|
type: "text"
|
|
44
45
|
},
|
|
45
46
|
defaultValue: "Line",
|
|
47
|
+
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.",
|
|
46
48
|
table: {
|
|
47
49
|
defaultValue: {
|
|
48
50
|
summary: "Line"
|
|
@@ -50,7 +52,7 @@ export const argTypes = assign(
|
|
|
50
52
|
},
|
|
51
53
|
type: {
|
|
52
54
|
required: false,
|
|
53
|
-
summary: "
|
|
55
|
+
summary: "string | function"
|
|
54
56
|
}
|
|
55
57
|
},
|
|
56
58
|
y2: {
|
|
@@ -58,6 +60,7 @@ export const argTypes = assign(
|
|
|
58
60
|
type: "text"
|
|
59
61
|
},
|
|
60
62
|
defaultValue: "(d) => this._y(d)",
|
|
63
|
+
description: "Sets the y2 accessor to the specified accessor Function or String representing which key in the data to reference. If *value* is not specified, returns the current y2 accessor.",
|
|
61
64
|
table: {
|
|
62
65
|
defaultValue: {
|
|
63
66
|
detail: "(d) => this._y(d)",
|
|
@@ -74,6 +77,7 @@ export const argTypes = assign(
|
|
|
74
77
|
type: "object"
|
|
75
78
|
},
|
|
76
79
|
defaultValue: "{tickFormat: (val) => {\n const data = this._formattedData;\n const xMax = data[data.length - 1].x instanceof Date ? data[data.length - 1].x.getTime() : data[data.length - 1].x;\n const endData = data.filter((d)=>(d.x instanceof Date ? d.x.getTime() : d.x) === xMax);\n const d = endData.find((d)=>d.y === val);\n return d ? this._drawLabel(d, d.i) : \"\";\n}}",
|
|
80
|
+
description: "A pass-through to the underlying [Axis](http://d3plus.org/docs/#Axis) config used for the secondary y-axis. Includes additional functionality where passing \"auto\" as the value for the [scale](http://d3plus.org/docs/#Axis.scale) method will determine if the scale should be \"linear\" or \"log\" based on the provided data.",
|
|
77
81
|
table: {
|
|
78
82
|
defaultValue: {
|
|
79
83
|
detail: "{tickFormat: (val) => {\n const data = this._formattedData;\n const xMax = data[data.length - 1].x instanceof Date ? data[data.length - 1].x.getTime() : data[data.length - 1].x;\n const endData = data.filter((d)=>(d.x instanceof Date ? d.x.getTime() : d.x) === xMax);\n const d = endData.find((d)=>d.y === val);\n return d ? this._drawLabel(d, d.i) : \"\";\n}}",
|
|
@@ -88,6 +92,7 @@ export const argTypes = assign(
|
|
|
88
92
|
y2Sort: {
|
|
89
93
|
control: {},
|
|
90
94
|
defaultValue: "(a, b) => this._y(b) - this._y(a)",
|
|
95
|
+
description: "Defines a custom sorting comparitor function to be used for discrete y2 axes.",
|
|
91
96
|
table: {
|
|
92
97
|
defaultValue: {
|
|
93
98
|
detail: "(a, b) => this._y(b) - this._y(a)",
|
|
@@ -104,6 +109,7 @@ export const argTypes = assign(
|
|
|
104
109
|
type: "object"
|
|
105
110
|
},
|
|
106
111
|
defaultValue: "{tickFormat: (val) => {\n const data = this._formattedData;\n const xMin = data[0].x instanceof Date ? data[0].x.getTime() : data[0].x;\n const startData = data.filter((d)=>(d.x instanceof Date ? d.x.getTime() : d.x) === xMin);\n const d = startData.find((d)=>d.y === val);\n return d ? this._drawLabel(d, d.i) : \"\";\n}}",
|
|
112
|
+
description: "A pass-through to the underlying [Axis](http://d3plus.org/docs/#Axis) config used for the y-axis. Includes additional functionality where passing \"auto\" as the value for the [scale](http://d3plus.org/docs/#Axis.scale) method will determine if the scale should be \"linear\" or \"log\" based on the provided data.\nNote:* If a \"domain\" array is passed to the y-axis config, it will be reversed.",
|
|
107
113
|
table: {
|
|
108
114
|
defaultValue: {
|
|
109
115
|
detail: "{tickFormat: (val) => {\n const data = this._formattedData;\n const xMin = data[0].x instanceof Date ? data[0].x.getTime() : data[0].x;\n const startData = data.filter((d)=>(d.x instanceof Date ? d.x.getTime() : d.x) === xMin);\n const d = startData.find((d)=>d.y === val);\n return d ? this._drawLabel(d, d.i) : \"\";\n}}",
|
|
@@ -118,6 +124,7 @@ export const argTypes = assign(
|
|
|
118
124
|
ySort: {
|
|
119
125
|
control: {},
|
|
120
126
|
defaultValue: "(a, b) => this._y(b) - this._y(a)",
|
|
127
|
+
description: "Defines a custom sorting comparitor function to be used for discrete y axes.",
|
|
121
128
|
table: {
|
|
122
129
|
defaultValue: {
|
|
123
130
|
detail: "(a, b) => this._y(b) - this._y(a)",
|
|
@@ -27,10 +27,11 @@ export const argTypes = assign(
|
|
|
27
27
|
control: {
|
|
28
28
|
type: "number"
|
|
29
29
|
},
|
|
30
|
-
defaultValue: "() => min([\
|
|
30
|
+
defaultValue: "() => min([\n this._width - this._margin.left - this._margin.right,\nthis._height - this._margin.top - this._margin.bottom\n]) / 4",
|
|
31
|
+
description: "The pixel value, or function that returns a pixel value, that is used as the inner radius of the Pie (creating a Donut).",
|
|
31
32
|
table: {
|
|
32
33
|
defaultValue: {
|
|
33
|
-
detail: "() => min([\
|
|
34
|
+
detail: "() => min([\n this._width - this._margin.left - this._margin.right,\nthis._height - this._margin.top - this._margin.bottom\n]) / 4",
|
|
34
35
|
summary: "function"
|
|
35
36
|
}
|
|
36
37
|
},
|
|
@@ -44,6 +45,7 @@ export const argTypes = assign(
|
|
|
44
45
|
type: "number"
|
|
45
46
|
},
|
|
46
47
|
defaultValue: 2,
|
|
48
|
+
description: "The padding between each arc, set as a pixel number value.\n\nBy default the value is \\`0\\`, which shows no padding between each arc.\n\nIf \\`padAngle\\` is defined, the \\`padPixel\\` value will not be considered.",
|
|
47
49
|
table: {
|
|
48
50
|
defaultValue: {
|
|
49
51
|
summary: 2
|
|
@@ -24,8 +24,9 @@ export const argTypes = assign(
|
|
|
24
24
|
{
|
|
25
25
|
fitFilter: {
|
|
26
26
|
control: {
|
|
27
|
-
type: "
|
|
27
|
+
type: "object"
|
|
28
28
|
},
|
|
29
|
+
description: "Topojson files sometimes include small geographies that negatively impact how the library determines the default zoom level (for example, a small island or territory far off the coast that is barely visible to the eye). The fitFilter method can be used to remove specific geographies from the logic used to determine the zooming.\n\nThe *value* passed can be a single id to remove, an array of ids, or a filter function. Take a look at the [Choropleth Example](http://d3plus.org/examples/d3plus-geomap/getting-started/) to see it in action.",
|
|
29
30
|
table: {
|
|
30
31
|
defaultValue: {
|
|
31
32
|
summary: "undefined"
|
|
@@ -40,6 +41,7 @@ export const argTypes = assign(
|
|
|
40
41
|
control: {
|
|
41
42
|
type: "text"
|
|
42
43
|
},
|
|
44
|
+
description: "If the topojson being used to determine the zoom fit (either the main [topojson](#Geomap.topojson) object or the [fitObject](#Geomap.fitObject)) contains multiple geographical sets (for example, a file containing state and county boundaries), use this method to indentify which set to use for the zoom fit.\n\nIf not specified, the first key in the *Array* returned from using `Object.keys` on the topojson will be used.",
|
|
43
45
|
table: {
|
|
44
46
|
defaultValue: {
|
|
45
47
|
summary: "undefined"
|
|
@@ -55,7 +57,7 @@ export const argTypes = assign(
|
|
|
55
57
|
type: "object"
|
|
56
58
|
},
|
|
57
59
|
defaultValue: false,
|
|
58
|
-
description: "
|
|
60
|
+
description: "The topojson to be used for the initial projection [fit extent](https://github.com/d3/d3-geo#projection_fitExtent). The value passed should either be a valid Topojson *Object* 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 needs to return the final Topojson *Object*.",
|
|
59
61
|
table: {
|
|
60
62
|
defaultValue: {
|
|
61
63
|
summary: false
|
|
@@ -71,6 +73,7 @@ export const argTypes = assign(
|
|
|
71
73
|
type: "boolean"
|
|
72
74
|
},
|
|
73
75
|
defaultValue: false,
|
|
76
|
+
description: "Toggles the visibility of the status message that is displayed when no data is supplied to the visualization.",
|
|
74
77
|
table: {
|
|
75
78
|
defaultValue: {
|
|
76
79
|
summary: false
|
|
@@ -86,6 +89,7 @@ export const argTypes = assign(
|
|
|
86
89
|
type: "text"
|
|
87
90
|
},
|
|
88
91
|
defaultValue: "#d4dadc",
|
|
92
|
+
description: "The color visible behind any shapes drawn on the map projection. By default, a color value matching the color used in the map tiles is used to help mask the loading time needed to render the tiles. Any value CSS color value may be used, including hexidecimal, rgb, rgba, and color strings like `\"blue\"` and `\"transparent\"`.",
|
|
89
93
|
table: {
|
|
90
94
|
defaultValue: {
|
|
91
95
|
summary: "#d4dadc"
|
|
@@ -98,9 +102,10 @@ export const argTypes = assign(
|
|
|
98
102
|
},
|
|
99
103
|
point: {
|
|
100
104
|
control: {
|
|
101
|
-
type: "
|
|
105
|
+
type: "object"
|
|
102
106
|
},
|
|
103
107
|
defaultValue: "d => d[\"point\"]",
|
|
108
|
+
description: "The accessor to be used when detecting coordinate points in the objects passed to the [data](https://d3plus.org/docs/#Viz.data) method. Values are expected to be in the format `[longitude, latitude]`, which is in-line with d3's expected coordinate mapping.",
|
|
104
109
|
table: {
|
|
105
110
|
defaultValue: {
|
|
106
111
|
detail: "d => d[\"point\"]",
|
|
@@ -117,6 +122,7 @@ export const argTypes = assign(
|
|
|
117
122
|
type: "number"
|
|
118
123
|
},
|
|
119
124
|
defaultValue: 1,
|
|
125
|
+
description: "The accessor or static value to be used for sizing coordinate points.",
|
|
120
126
|
table: {
|
|
121
127
|
defaultValue: {
|
|
122
128
|
summary: 1
|
|
@@ -132,6 +138,7 @@ export const argTypes = assign(
|
|
|
132
138
|
type: "number"
|
|
133
139
|
},
|
|
134
140
|
defaultValue: 10,
|
|
141
|
+
description: "The maximum pixel radius used in the scale for sizing coordinate points.",
|
|
135
142
|
table: {
|
|
136
143
|
defaultValue: {
|
|
137
144
|
summary: 10
|
|
@@ -147,6 +154,7 @@ export const argTypes = assign(
|
|
|
147
154
|
type: "number"
|
|
148
155
|
},
|
|
149
156
|
defaultValue: 5,
|
|
157
|
+
description: "The minimum pixel radius used in the scale for sizing coordinate points.",
|
|
150
158
|
table: {
|
|
151
159
|
defaultValue: {
|
|
152
160
|
summary: 5
|
|
@@ -162,7 +170,7 @@ export const argTypes = assign(
|
|
|
162
170
|
type: "text"
|
|
163
171
|
},
|
|
164
172
|
defaultValue: "d3Geo.geoMercator()",
|
|
165
|
-
description: "
|
|
173
|
+
description: "Sets the map projection used when displaying topojson and coordinate points. All of the projections exported from [d3-geo](https://github.com/d3/d3-geo#projections), [d3-geo-projection](https://github.com/d3/d3-geo-projection#api-reference), and [d3-composite-projections](http://geoexamples.com/d3-composite-projections/) are accepted, whether as the string name (ie. \"geoMercator\") or the generator function itself. Map tiles are only usable when the projection is set to Mercator (which is also the default value).",
|
|
166
174
|
table: {
|
|
167
175
|
defaultValue: {
|
|
168
176
|
summary: "d3Geo.geoMercator()"
|
|
@@ -178,6 +186,7 @@ export const argTypes = assign(
|
|
|
178
186
|
type: "number"
|
|
179
187
|
},
|
|
180
188
|
defaultValue: "parseSides(20)",
|
|
189
|
+
description: "The outer padding between the edge of the visualization and the shapes drawn. The value passed can be either a single number to be used on all sides, or a CSS string pattern (ie. `\"20px 0 10px\"`).",
|
|
181
190
|
table: {
|
|
182
191
|
defaultValue: {
|
|
183
192
|
summary: "parseSides(20)"
|
|
@@ -190,9 +199,10 @@ export const argTypes = assign(
|
|
|
190
199
|
},
|
|
191
200
|
projectionRotate: {
|
|
192
201
|
control: {
|
|
193
|
-
type: "
|
|
202
|
+
type: "object"
|
|
194
203
|
},
|
|
195
204
|
defaultValue: "[0, 0]",
|
|
205
|
+
description: "An array that corresponds to the value passed to the projection's [rotate](https://github.com/d3/d3-geo#projection_rotate) function. Use this method to shift the centerpoint of a map.",
|
|
196
206
|
table: {
|
|
197
207
|
defaultValue: {
|
|
198
208
|
summary: "[0, 0]"
|
|
@@ -208,6 +218,7 @@ export const argTypes = assign(
|
|
|
208
218
|
type: "text"
|
|
209
219
|
},
|
|
210
220
|
defaultValue: "Circle",
|
|
221
|
+
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.",
|
|
211
222
|
table: {
|
|
212
223
|
defaultValue: {
|
|
213
224
|
summary: "Circle"
|
|
@@ -215,7 +226,7 @@ export const argTypes = assign(
|
|
|
215
226
|
},
|
|
216
227
|
type: {
|
|
217
228
|
required: false,
|
|
218
|
-
summary: "
|
|
229
|
+
summary: "string | function"
|
|
219
230
|
}
|
|
220
231
|
},
|
|
221
232
|
shapeConfig: {
|
|
@@ -223,6 +234,7 @@ export const argTypes = assign(
|
|
|
223
234
|
type: "object"
|
|
224
235
|
},
|
|
225
236
|
defaultValue: "assign(this._shapeConfig, {ariaLabel: (d, i) => `${this._drawLabel(d, i)}, ${this._pointSize(d, i)}`, hoverOpacity: 1, Path: {ariaLabel: (d, i) => {\n const validColorScale = this._colorScale ? `, ${this._colorScale(d, i)}` : \"\";\n return `${this._drawLabel(d, i)}${validColorScale}.`;\n}, fill: (d, i) => {\n if (this._colorScale && !this._coordData.features.includes(d)) {\n const c = this._colorScale(d);\n if (c !== undefined && c !== null) {\n if (this._colorScaleClass._colorScale) {\n return this._colorScaleClass._colorScale(c);\n } else {\n let color = this._colorScaleClass.color();\n if (color instanceof Array) color = color[color.length - 1];\n return color;\n }\n }\n }\n return this._topojsonFill(d, i);\n}, on: {mouseenter: (d, i, x, event) => !this._coordData.features.includes(d) ? this._on.mouseenter.bind(this)(d, i, x, event) : null, mousemove.shape: (d, i, x, event) => !this._coordData.features.includes(d) ? this._on.mousemove.shape.bind(this)(d, i, x, event) : null, mouseleave: (d, i, x, event) => !this._coordData.features.includes(d) ? this._on.mouseleave.bind(this)(d, i, x, event) : null}, stroke: (d, i) => {\n const c = typeof this._shapeConfig.Path.fill === \"function\" ? this._shapeConfig.Path.fill(d, i) : this._shapeConfig.Path.fill;\n return color(c).darker();\n}, strokeWidth: 1}})",
|
|
237
|
+
description: "If *value* is specified, sets the config method for each shape and returns the current class instance.",
|
|
226
238
|
table: {
|
|
227
239
|
defaultValue: {
|
|
228
240
|
detail: "assign(this._shapeConfig, {ariaLabel: (d, i) => `${this._drawLabel(d, i)}, ${this._pointSize(d, i)}`, hoverOpacity: 1, Path: {ariaLabel: (d, i) => {\n const validColorScale = this._colorScale ? `, ${this._colorScale(d, i)}` : \"\";\n return `${this._drawLabel(d, i)}${validColorScale}.`;\n}, fill: (d, i) => {\n if (this._colorScale && !this._coordData.features.includes(d)) {\n const c = this._colorScale(d);\n if (c !== undefined && c !== null) {\n if (this._colorScaleClass._colorScale) {\n return this._colorScaleClass._colorScale(c);\n } else {\n let color = this._colorScaleClass.color();\n if (color instanceof Array) color = color[color.length - 1];\n return color;\n }\n }\n }\n return this._topojsonFill(d, i);\n}, on: {mouseenter: (d, i, x, event) => !this._coordData.features.includes(d) ? this._on.mouseenter.bind(this)(d, i, x, event) : null, mousemove.shape: (d, i, x, event) => !this._coordData.features.includes(d) ? this._on.mousemove.shape.bind(this)(d, i, x, event) : null, mouseleave: (d, i, x, event) => !this._coordData.features.includes(d) ? this._on.mouseleave.bind(this)(d, i, x, event) : null}, stroke: (d, i) => {\n const c = typeof this._shapeConfig.Path.fill === \"function\" ? this._shapeConfig.Path.fill(d, i) : this._shapeConfig.Path.fill;\n return color(c).darker();\n}, strokeWidth: 1}})",
|
|
@@ -239,6 +251,7 @@ export const argTypes = assign(
|
|
|
239
251
|
type: "text"
|
|
240
252
|
},
|
|
241
253
|
defaultValue: "https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}@2x.png",
|
|
254
|
+
description: "By default, d3plus uses the `light_all` style provided by [CARTO](https://carto.com/location-data-services/basemaps/) for it's map tiles. The [tileUrl](https://d3plus.org/docs/#Geomap.tileUrl) method changes the base URL used for fetching the tiles, as long as the string passed contains `{x}`, `{y}`, and `{z}` variables enclosed in curly brackets for the zoom logic to load the correct tiles.",
|
|
242
255
|
table: {
|
|
243
256
|
defaultValue: {
|
|
244
257
|
summary: "https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}@2x.png"
|
|
@@ -254,6 +267,7 @@ export const argTypes = assign(
|
|
|
254
267
|
type: "boolean"
|
|
255
268
|
},
|
|
256
269
|
defaultValue: true,
|
|
270
|
+
description: "Toggles the visibility of the map tiles.",
|
|
257
271
|
table: {
|
|
258
272
|
defaultValue: {
|
|
259
273
|
summary: true
|
|
@@ -269,7 +283,7 @@ export const argTypes = assign(
|
|
|
269
283
|
type: "object"
|
|
270
284
|
},
|
|
271
285
|
defaultValue: false,
|
|
272
|
-
description: "
|
|
286
|
+
description: "The topojson to be used for drawing geographical paths. The value passed should either be a valid Topojson *Object* 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 Topojson *Obejct*.",
|
|
273
287
|
table: {
|
|
274
288
|
defaultValue: {
|
|
275
289
|
summary: false
|
|
@@ -285,7 +299,7 @@ export const argTypes = assign(
|
|
|
285
299
|
type: "text"
|
|
286
300
|
},
|
|
287
301
|
defaultValue: "#f5f5f3",
|
|
288
|
-
description: "
|
|
302
|
+
description: "The function is used to set default color of the map.",
|
|
289
303
|
table: {
|
|
290
304
|
defaultValue: {
|
|
291
305
|
summary: "#f5f5f3"
|
|
@@ -298,12 +312,13 @@ export const argTypes = assign(
|
|
|
298
312
|
},
|
|
299
313
|
topojsonFilter: {
|
|
300
314
|
control: {
|
|
301
|
-
type: "
|
|
315
|
+
type: "object"
|
|
302
316
|
},
|
|
303
|
-
defaultValue: "(d) => ![
|
|
317
|
+
defaultValue: "(d) => ![ 010 ].includes(d.id)",
|
|
318
|
+
description: "If the [topojson](#Geomap.topojson) being used contains boundaries that should not be shown, this method can be used to filter them out of the final output. The *value* passed can be a single id to remove, an array of ids, or a filter function.",
|
|
304
319
|
table: {
|
|
305
320
|
defaultValue: {
|
|
306
|
-
detail: "(d) => ![
|
|
321
|
+
detail: "(d) => ![ 010 ].includes(d.id)",
|
|
307
322
|
summary: "function"
|
|
308
323
|
}
|
|
309
324
|
},
|
|
@@ -317,7 +332,7 @@ export const argTypes = assign(
|
|
|
317
332
|
type: "text"
|
|
318
333
|
},
|
|
319
334
|
defaultValue: "d => d[\"id\"]",
|
|
320
|
-
description: "
|
|
335
|
+
description: "The accessor used to map each topojson geometry to it's corresponding [data](https://d3plus.org/docs/#Viz.data) point.",
|
|
321
336
|
table: {
|
|
322
337
|
defaultValue: {
|
|
323
338
|
detail: "d => d[\"id\"]",
|
|
@@ -333,6 +348,7 @@ export const argTypes = assign(
|
|
|
333
348
|
control: {
|
|
334
349
|
type: "text"
|
|
335
350
|
},
|
|
351
|
+
description: "If the [topojson](#Geomap.topojson) contains multiple geographical sets (for example, a file containing state and county boundaries), use this method to indentify which set to use.\n\nIf not specified, the first key in the *Array* returned from using `Object.keys` on the topojson will be used.",
|
|
336
352
|
table: {
|
|
337
353
|
defaultValue: {
|
|
338
354
|
summary: "undefined"
|
|
@@ -348,7 +364,7 @@ export const argTypes = assign(
|
|
|
348
364
|
type: "boolean"
|
|
349
365
|
},
|
|
350
366
|
defaultValue: true,
|
|
351
|
-
description: "
|
|
367
|
+
description: "Toggles the ability to zoom/pan the visualization. Certain parameters for zooming are required to be hooked up on a visualization by visualization basis.",
|
|
352
368
|
table: {
|
|
353
369
|
defaultValue: {
|
|
354
370
|
summary: true
|
|
@@ -28,6 +28,7 @@ export const argTypes = assign(
|
|
|
28
28
|
type: "text"
|
|
29
29
|
},
|
|
30
30
|
defaultValue: "x",
|
|
31
|
+
description: "If *value* is specified, sets the discrete accessor to the specified method name (usually an axis) and returns the current class instance.",
|
|
31
32
|
table: {
|
|
32
33
|
defaultValue: {
|
|
33
34
|
summary: "x"
|
|
@@ -43,6 +44,7 @@ export const argTypes = assign(
|
|
|
43
44
|
type: "text"
|
|
44
45
|
},
|
|
45
46
|
defaultValue: "Line",
|
|
47
|
+
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.",
|
|
46
48
|
table: {
|
|
47
49
|
defaultValue: {
|
|
48
50
|
summary: "Line"
|
|
@@ -50,7 +52,7 @@ export const argTypes = assign(
|
|
|
50
52
|
},
|
|
51
53
|
type: {
|
|
52
54
|
required: false,
|
|
53
|
-
summary: "
|
|
55
|
+
summary: "string | function"
|
|
54
56
|
}
|
|
55
57
|
}
|
|
56
58
|
}
|
|
@@ -27,6 +27,7 @@ export const argTypes = assign(
|
|
|
27
27
|
type: "number"
|
|
28
28
|
},
|
|
29
29
|
defaultValue: 2,
|
|
30
|
+
description: "The pixel padding in between each cell.",
|
|
30
31
|
table: {
|
|
31
32
|
defaultValue: {
|
|
32
33
|
summary: 2
|
|
@@ -42,6 +43,7 @@ export const argTypes = assign(
|
|
|
42
43
|
type: "text"
|
|
43
44
|
},
|
|
44
45
|
defaultValue: "d => d[\"column\"]",
|
|
46
|
+
description: "Determines which key in your data should be used for each column in the matrix. Can be either a String that matches a key used in every data point, or an accessor function that receives a data point and it's index in the data array, and is expected to return it's column value.",
|
|
45
47
|
table: {
|
|
46
48
|
defaultValue: {
|
|
47
49
|
detail: "d => d[\"column\"]",
|
|
@@ -58,6 +60,7 @@ export const argTypes = assign(
|
|
|
58
60
|
type: "object"
|
|
59
61
|
},
|
|
60
62
|
defaultValue: "assign({orient: top}, defaultAxisConfig)",
|
|
63
|
+
description: "A pass-through to the underlying [Axis](http://d3plus.org/docs/#Axis) config used for the column labels.",
|
|
61
64
|
table: {
|
|
62
65
|
defaultValue: {
|
|
63
66
|
summary: "assign({orient: top}, defaultAxisConfig)"
|
|
@@ -70,8 +73,9 @@ export const argTypes = assign(
|
|
|
70
73
|
},
|
|
71
74
|
columnList: {
|
|
72
75
|
control: {
|
|
73
|
-
type: "
|
|
76
|
+
type: "object"
|
|
74
77
|
},
|
|
78
|
+
description: "A manual list of IDs to be used for columns.",
|
|
75
79
|
table: {
|
|
76
80
|
defaultValue: {
|
|
77
81
|
summary: "undefined"
|
|
@@ -85,6 +89,7 @@ export const argTypes = assign(
|
|
|
85
89
|
columnSort: {
|
|
86
90
|
control: {},
|
|
87
91
|
defaultValue: "(a, b) => `${a}`.localeCompare(`${b}`)",
|
|
92
|
+
description: "A sort comparator function that is run on the unique set of column values.",
|
|
88
93
|
table: {
|
|
89
94
|
defaultValue: {
|
|
90
95
|
detail: "(a, b) => `${a}`.localeCompare(`${b}`)",
|
|
@@ -101,6 +106,7 @@ export const argTypes = assign(
|
|
|
101
106
|
type: "text"
|
|
102
107
|
},
|
|
103
108
|
defaultValue: "(d, i) => `${getProp.bind(this)(row, d, i)} / ${getProp.bind(this)(column, d, i)}`",
|
|
109
|
+
description: "If *value* is specified, sets the label accessor to the specified function or string and returns the current class instance.",
|
|
104
110
|
table: {
|
|
105
111
|
defaultValue: {
|
|
106
112
|
detail: "(d, i) => `${getProp.bind(this)(row, d, i)} / ${getProp.bind(this)(column, d, i)}`",
|
|
@@ -119,6 +125,7 @@ export const argTypes = assign(
|
|
|
119
125
|
defaultValue: {
|
|
120
126
|
"mousemove.shape": "(d, i, x, event) => {\n defaultMouseMoveShape(d, i, x, event);\n const row = getProp.bind(this)(\"row\", d, i);\n const column = getProp.bind(this)(\"column\", d, i);\n this.hover((h, ii)=>getProp.bind(this)(\"row\", h, ii) === row || getProp.bind(this)(\"column\", h, ii) === column);\n}"
|
|
121
127
|
},
|
|
128
|
+
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.",
|
|
122
129
|
table: {
|
|
123
130
|
defaultValue: {
|
|
124
131
|
summary: {
|
|
@@ -136,6 +143,7 @@ export const argTypes = assign(
|
|
|
136
143
|
type: "text"
|
|
137
144
|
},
|
|
138
145
|
defaultValue: "d => d[\"row\"]",
|
|
146
|
+
description: "Determines which key in your data should be used for each row in the matrix. Can be either a String that matches a key used in every data point, or an accessor function that receives a data point and it's index in the data array, and is expected to return it's row value.",
|
|
139
147
|
table: {
|
|
140
148
|
defaultValue: {
|
|
141
149
|
detail: "d => d[\"row\"]",
|
|
@@ -152,6 +160,7 @@ export const argTypes = assign(
|
|
|
152
160
|
type: "object"
|
|
153
161
|
},
|
|
154
162
|
defaultValue: "assign({orient: left}, defaultAxisConfig)",
|
|
163
|
+
description: "A pass-through to the underlying [Axis](http://d3plus.org/docs/#Axis) config used for the row labels.",
|
|
155
164
|
table: {
|
|
156
165
|
defaultValue: {
|
|
157
166
|
summary: "assign({orient: left}, defaultAxisConfig)"
|
|
@@ -164,8 +173,9 @@ export const argTypes = assign(
|
|
|
164
173
|
},
|
|
165
174
|
rowList: {
|
|
166
175
|
control: {
|
|
167
|
-
type: "
|
|
176
|
+
type: "object"
|
|
168
177
|
},
|
|
178
|
+
description: "A manual list of IDs to be used for rows.",
|
|
169
179
|
table: {
|
|
170
180
|
defaultValue: {
|
|
171
181
|
summary: "undefined"
|
|
@@ -179,6 +189,7 @@ export const argTypes = assign(
|
|
|
179
189
|
rowSort: {
|
|
180
190
|
control: {},
|
|
181
191
|
defaultValue: "(a, b) => `${a}`.localeCompare(`${b}`)",
|
|
192
|
+
description: "A sort comparator function that is run on the unique set of row values.",
|
|
182
193
|
table: {
|
|
183
194
|
defaultValue: {
|
|
184
195
|
detail: "(a, b) => `${a}`.localeCompare(`${b}`)",
|