@d3plus/core 3.0.15 → 3.1.0
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/LICENSE +21 -0
- package/README.md +88482 -2998
- package/es/index.js +1 -1
- package/es/src/charts/AreaPlot.js +1 -3
- package/es/src/charts/BarChart.js +1 -3
- package/es/src/charts/BoxWhisker.js +2 -4
- package/es/src/charts/BumpChart.js +4 -5
- package/es/src/charts/Donut.js +1 -3
- package/es/src/charts/Geomap.js +47 -88
- package/es/src/charts/LinePlot.js +1 -3
- package/es/src/charts/Matrix.js +27 -46
- package/es/src/charts/Network.js +87 -81
- package/es/src/charts/Pack.js +21 -34
- package/es/src/charts/Pie.js +12 -24
- package/es/src/charts/Plot.js +226 -321
- package/es/src/charts/Priestley.js +18 -36
- package/es/src/charts/Radar.js +100 -47
- package/es/src/charts/RadialMatrix.js +35 -47
- package/es/src/charts/Rings.js +99 -90
- package/es/src/charts/Sankey.js +85 -75
- package/es/src/charts/StackedArea.js +1 -3
- package/es/src/charts/Tree.js +27 -28
- package/es/src/charts/Treemap.js +117 -71
- package/es/src/charts/Viz.js +297 -493
- package/es/src/charts/drawSteps/drawAttribution.js +1 -1
- package/es/src/charts/drawSteps/drawBack.js +1 -2
- package/es/src/charts/drawSteps/drawColorScale.js +1 -2
- package/es/src/charts/drawSteps/drawLegend.js +8 -10
- package/es/src/charts/drawSteps/drawSubtitle.js +1 -3
- package/es/src/charts/drawSteps/drawTimeline.js +12 -9
- package/es/src/charts/drawSteps/drawTitle.js +1 -3
- package/es/src/charts/drawSteps/drawTotal.js +1 -3
- package/es/src/charts/drawSteps/zoomControls.js +19 -21
- package/es/src/charts/events/click.legend.js +2 -3
- package/es/src/charts/events/click.shape.js +2 -4
- package/es/src/charts/events/mouseenter.js +7 -8
- package/es/src/charts/events/mouseleave.js +1 -3
- package/es/src/charts/events/mousemove.legend.js +3 -4
- package/es/src/charts/events/mousemove.shape.js +2 -4
- package/es/src/charts/events/touchstart.body.js +1 -1
- package/es/src/charts/helpers/matrixData.js +11 -4
- package/es/src/charts/helpers/tileAttributions.js +2 -1
- package/es/src/charts/plotBuffers/Bar.js +55 -12
- package/es/src/charts/plotBuffers/Box.js +55 -12
- package/es/src/charts/plotBuffers/Circle.js +9 -11
- package/es/src/charts/plotBuffers/Line.js +4 -6
- package/es/src/charts/plotBuffers/Rect.js +10 -12
- package/es/src/charts/plotBuffers/discreteBuffer.js +4 -2
- package/es/src/charts/plotBuffers/numericBuffer.js +7 -6
- package/es/src/components/Axis.js +298 -426
- package/es/src/components/AxisBottom.js +1 -3
- package/es/src/components/AxisLeft.js +1 -3
- package/es/src/components/AxisRight.js +1 -3
- package/es/src/components/AxisTop.js +1 -3
- package/es/src/components/ColorScale.js +80 -197
- package/es/src/components/Legend.js +82 -135
- package/es/src/components/Message.js +27 -19
- package/es/src/components/TextBox.js +106 -262
- package/es/src/components/Timeline.js +88 -155
- package/es/src/components/Tooltip.js +301 -330
- package/es/src/shapes/Area.js +95 -74
- package/es/src/shapes/Bar.js +46 -86
- package/es/src/shapes/Box.js +104 -118
- package/es/src/shapes/Circle.js +29 -30
- package/es/src/shapes/Image.js +44 -102
- package/es/src/shapes/Line.js +74 -40
- package/es/src/shapes/Path.js +23 -25
- package/es/src/shapes/Rect.js +29 -41
- package/es/src/shapes/Shape.js +152 -369
- package/es/src/shapes/Whisker.js +89 -90
- package/es/src/utils/AccessorFn.js +4 -0
- package/es/src/utils/BaseClass.js +53 -82
- package/es/src/utils/D3plusConfig.js +1 -0
- package/es/src/utils/RESET.js +2 -4
- package/es/src/utils/accessor.js +4 -5
- package/es/src/utils/configPrep.js +13 -12
- package/es/src/utils/constant.js +2 -3
- package/es/src/utils/getProp.js +4 -4
- package/es/src/utils/index.js +0 -1
- package/package.json +29 -22
- package/types/index.d.ts +5 -0
- package/types/src/charts/AreaPlot.d.ts +16 -0
- package/types/src/charts/BarChart.d.ts +16 -0
- package/types/src/charts/BoxWhisker.d.ts +11 -0
- package/types/src/charts/BumpChart.d.ts +36 -0
- package/types/src/charts/Donut.d.ts +11 -0
- package/types/src/charts/Geomap.d.ts +120 -0
- package/types/src/charts/LinePlot.d.ts +15 -0
- package/types/src/charts/Matrix.d.ts +74 -0
- package/types/src/charts/Network.d.ts +78 -0
- package/types/src/charts/Pack.d.ts +47 -0
- package/types/src/charts/Pie.d.ts +44 -0
- package/types/src/charts/Plot.d.ts +199 -0
- package/types/src/charts/Priestley.d.ts +37 -0
- package/types/src/charts/Radar.d.ts +38 -0
- package/types/src/charts/RadialMatrix.d.ts +78 -0
- package/types/src/charts/Rings.d.ts +74 -0
- package/types/src/charts/Sankey.d.ts +81 -0
- package/types/src/charts/StackedArea.d.ts +14 -0
- package/types/src/charts/Tree.d.ts +33 -0
- package/types/src/charts/Treemap.d.ts +51 -0
- package/types/src/charts/Viz.d.ts +402 -0
- package/types/src/charts/drawSteps/drawAttribution.d.ts +7 -0
- package/types/src/charts/drawSteps/drawBack.d.ts +6 -0
- package/types/src/charts/drawSteps/drawColorScale.d.ts +6 -0
- package/types/src/charts/drawSteps/drawLegend.d.ts +12 -0
- package/types/src/charts/drawSteps/drawSubtitle.d.ts +7 -0
- package/types/src/charts/drawSteps/drawTimeline.d.ts +7 -0
- package/types/src/charts/drawSteps/drawTitle.d.ts +7 -0
- package/types/src/charts/drawSteps/drawTotal.d.ts +7 -0
- package/types/src/charts/drawSteps/zoomControls.d.ts +7 -0
- package/types/src/charts/events/click.legend.d.ts +8 -0
- package/types/src/charts/events/click.shape.d.ts +8 -0
- package/types/src/charts/events/mouseenter.d.ts +8 -0
- package/types/src/charts/events/mouseleave.d.ts +8 -0
- package/types/src/charts/events/mousemove.legend.d.ts +9 -0
- package/types/src/charts/events/mousemove.shape.d.ts +9 -0
- package/types/src/charts/events/touchstart.body.d.ts +7 -0
- package/types/src/charts/helpers/matrixData.d.ts +11 -0
- package/types/src/charts/helpers/tileAttributions.d.ts +6 -0
- package/types/src/charts/index.d.ts +21 -0
- package/types/src/charts/plotBuffers/Bar.d.ts +16 -0
- package/types/src/charts/plotBuffers/Box.d.ts +16 -0
- package/types/src/charts/plotBuffers/Circle.d.ts +20 -0
- package/types/src/charts/plotBuffers/Line.d.ts +16 -0
- package/types/src/charts/plotBuffers/Rect.d.ts +19 -0
- package/types/src/charts/plotBuffers/discreteBuffer.d.ts +7 -0
- package/types/src/charts/plotBuffers/numericBuffer.d.ts +5 -0
- package/types/src/components/Axis.d.ts +309 -0
- package/types/src/components/AxisBottom.d.ts +11 -0
- package/types/src/components/AxisLeft.d.ts +11 -0
- package/types/src/components/AxisRight.d.ts +11 -0
- package/types/src/components/AxisTop.d.ts +11 -0
- package/types/src/components/ColorScale.d.ts +208 -0
- package/types/src/components/Legend.d.ts +157 -0
- package/types/src/components/Message.d.ts +40 -0
- package/types/src/components/TextBox.d.ts +278 -0
- package/types/src/components/Timeline.d.ts +157 -0
- package/types/src/components/Tooltip.d.ts +297 -0
- package/types/src/components/index.d.ts +11 -0
- package/types/src/shapes/Area.d.ts +81 -0
- package/types/src/shapes/Bar.d.ts +104 -0
- package/types/src/shapes/Box.d.ts +121 -0
- package/types/src/shapes/Circle.d.ts +44 -0
- package/types/src/shapes/Image.d.ts +124 -0
- package/types/src/shapes/Line.d.ts +48 -0
- package/types/src/shapes/Path.d.ts +38 -0
- package/types/src/shapes/Rect.d.ts +54 -0
- package/types/src/shapes/Shape.d.ts +378 -0
- package/types/src/shapes/Whisker.d.ts +96 -0
- package/types/src/shapes/index.d.ts +10 -0
- package/types/src/utils/AccessorFn.d.ts +6 -0
- package/types/src/utils/BaseClass.d.ts +76 -0
- package/types/src/utils/D3plusConfig.d.ts +164 -0
- package/types/src/utils/RESET.d.ts +3 -0
- package/types/src/utils/accessor.d.ts +13 -0
- package/types/src/utils/configPrep.d.ts +28 -0
- package/types/src/utils/constant.d.ts +11 -0
- package/types/src/utils/getProp.d.ts +9 -0
- package/types/src/utils/index.d.ts +8 -0
- package/umd/d3plus-core.full.js +20134 -18708
- package/umd/d3plus-core.full.js.map +1 -1
- package/umd/d3plus-core.full.min.js +2922 -5396
- package/umd/d3plus-core.js +1927 -4081
- package/umd/d3plus-core.js.map +1 -1
- package/umd/d3plus-core.min.js +1607 -3939
- package/es/src/utils/uuid.js +0 -13
|
@@ -27,6 +27,19 @@ function _create_class(Constructor, protoProps, staticProps) {
|
|
|
27
27
|
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
28
28
|
return Constructor;
|
|
29
29
|
}
|
|
30
|
+
function _define_property(obj, key, value) {
|
|
31
|
+
if (key in obj) {
|
|
32
|
+
Object.defineProperty(obj, key, {
|
|
33
|
+
value: value,
|
|
34
|
+
enumerable: true,
|
|
35
|
+
configurable: true,
|
|
36
|
+
writable: true
|
|
37
|
+
});
|
|
38
|
+
} else {
|
|
39
|
+
obj[key] = value;
|
|
40
|
+
}
|
|
41
|
+
return obj;
|
|
42
|
+
}
|
|
30
43
|
function _get_prototype_of(o) {
|
|
31
44
|
_get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
|
|
32
45
|
return o.__proto__ || Object.getPrototypeOf(o);
|
|
@@ -73,10 +86,10 @@ function _is_native_reflect_construct() {
|
|
|
73
86
|
}
|
|
74
87
|
import { max, min, sum } from "d3-array";
|
|
75
88
|
import { select } from "d3-selection";
|
|
76
|
-
//
|
|
77
|
-
import
|
|
89
|
+
// side-effect import: registers .transition() on d3 selections
|
|
90
|
+
import "d3-transition";
|
|
78
91
|
import { fontExists, parseSides, rtl as detectRTL, textWidth } from "@d3plus/dom";
|
|
79
|
-
import { fontFamily, strip, textSplit, textWrap
|
|
92
|
+
import { fontFamily, strip, textSplit, textWrap } from "@d3plus/text";
|
|
80
93
|
import { accessor, BaseClass, constant } from "../utils/index.js";
|
|
81
94
|
var defaultHtmlLookup = {
|
|
82
95
|
i: "font-style: italic;",
|
|
@@ -90,23 +103,34 @@ var TextBox = /*#__PURE__*/ function(BaseClass) {
|
|
|
90
103
|
function TextBox() {
|
|
91
104
|
_class_call_check(this, TextBox);
|
|
92
105
|
var _this;
|
|
93
|
-
_this = _call_super(this, TextBox);
|
|
106
|
+
_this = _call_super(this, TextBox), _define_property(_this, "_select", void 0), _define_property(_this, "_data", void 0), _define_property(_this, "_ariaHidden", void 0), _define_property(_this, "_delay", void 0), _define_property(_this, "_duration", void 0), _define_property(_this, "_ellipsis", void 0), _define_property(_this, "_fontColor", void 0), _define_property(_this, "_fontFamily", void 0), _define_property(_this, "_fontMax", void 0), _define_property(_this, "_fontMin", void 0), _define_property(_this, "_fontOpacity", void 0), _define_property(_this, "_fontResize", void 0), _define_property(_this, "_fontSize", void 0), _define_property(_this, "_fontStroke", void 0), _define_property(_this, "_fontStrokeWidth", void 0), _define_property(_this, "_fontWeight", void 0), _define_property(_this, "_height", void 0), _define_property(_this, "_html", void 0), _define_property(_this, "_id", void 0), _define_property(_this, "_lineHeight", void 0), _define_property(_this, "_maxLines", void 0), _define_property(_this, "_on", void 0), _define_property(_this, "_overflow", void 0), _define_property(_this, "_padding", void 0), _define_property(_this, "_pointerEvents", void 0), _define_property(_this, "_rotate", void 0), _define_property(_this, "_rotateAnchor", void 0), _define_property(_this, "_split", void 0), _define_property(_this, "_text", void 0), _define_property(_this, "_textAnchor", void 0), _define_property(_this, "_verticalAlign", void 0), _define_property(_this, "_width", void 0), _define_property(_this, "_x", void 0), _define_property(_this, "_y", void 0);
|
|
94
107
|
_this._ariaHidden = constant("false");
|
|
95
108
|
_this._delay = 0;
|
|
96
109
|
_this._duration = 0;
|
|
97
110
|
_this._ellipsis = function(text, line) {
|
|
98
111
|
return line ? "".concat(text.replace(/\.|,$/g, ""), "...") : "";
|
|
99
112
|
};
|
|
113
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
100
114
|
_this._fontColor = constant("black");
|
|
115
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
101
116
|
_this._fontFamily = constant(fontFamily);
|
|
117
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
102
118
|
_this._fontMax = constant(50);
|
|
119
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
103
120
|
_this._fontMin = constant(8);
|
|
121
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
104
122
|
_this._fontOpacity = constant(1);
|
|
123
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
105
124
|
_this._fontResize = constant(false);
|
|
125
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
106
126
|
_this._fontSize = constant(10);
|
|
127
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
107
128
|
_this._fontStroke = constant("transparent");
|
|
129
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
108
130
|
_this._fontStrokeWidth = constant(0);
|
|
131
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
109
132
|
_this._fontWeight = constant(400);
|
|
133
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
110
134
|
_this._height = accessor("height", 200);
|
|
111
135
|
_this._html = defaultHtmlLookup;
|
|
112
136
|
_this._id = function(d, i) {
|
|
@@ -128,21 +152,26 @@ var TextBox = /*#__PURE__*/ function(BaseClass) {
|
|
|
128
152
|
];
|
|
129
153
|
};
|
|
130
154
|
_this._split = textSplit;
|
|
155
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
131
156
|
_this._text = accessor("text");
|
|
157
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
132
158
|
_this._textAnchor = constant("start");
|
|
159
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
133
160
|
_this._verticalAlign = constant("top");
|
|
161
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
134
162
|
_this._width = accessor("width", 200);
|
|
163
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
135
164
|
_this._x = accessor("x", 0);
|
|
165
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
136
166
|
_this._y = accessor("y", 0);
|
|
137
167
|
return _this;
|
|
138
168
|
}
|
|
139
169
|
_create_class(TextBox, [
|
|
140
170
|
{
|
|
141
171
|
/**
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
*/ key: "render",
|
|
172
|
+
Renders the text boxes. If a *callback* is specified, it will be called once the shapes are done drawing.
|
|
173
|
+
@param callback Optional callback invoked after rendering completes.
|
|
174
|
+
*/ key: "render",
|
|
146
175
|
value: function render(callback) {
|
|
147
176
|
var _this = this;
|
|
148
177
|
if (this._select === void 0) this.select(select("body").append("svg").style("width", "".concat(window.innerWidth, "px")).style("height", "".concat(window.innerHeight, "px")).node());
|
|
@@ -150,10 +179,15 @@ var TextBox = /*#__PURE__*/ function(BaseClass) {
|
|
|
150
179
|
var boxes = this._select.selectAll(".d3plus-textBox").data(this._data.reduce(function(arr, d, i) {
|
|
151
180
|
var t = _this._text(d, i);
|
|
152
181
|
if (t === void 0) return arr;
|
|
153
|
-
t =
|
|
182
|
+
t = "".concat(t).trim();
|
|
154
183
|
var resize = _this._fontResize(d, i);
|
|
155
184
|
var lHRatio = _this._lineHeight(d, i) / _this._fontSize(d, i);
|
|
156
|
-
var fS = resize ? _this._fontMax(d, i) : _this._fontSize(d, i), lH = resize ? fS * lHRatio : _this._lineHeight(d, i), line = 1, lineData = [], sizes, wrapResults
|
|
185
|
+
var fS = resize ? _this._fontMax(d, i) : _this._fontSize(d, i), lH = resize ? fS * lHRatio : _this._lineHeight(d, i), line = 1, lineData = [], sizes, wrapResults = {
|
|
186
|
+
lines: [],
|
|
187
|
+
truncated: false,
|
|
188
|
+
widths: []
|
|
189
|
+
};
|
|
190
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
157
191
|
var style = {
|
|
158
192
|
"font-family": fontExists(_this._fontFamily(d, i)),
|
|
159
193
|
"font-size": fS,
|
|
@@ -167,8 +201,8 @@ var TextBox = /*#__PURE__*/ function(BaseClass) {
|
|
|
167
201
|
/**
|
|
168
202
|
Figures out the lineData to be used for wrapping.
|
|
169
203
|
@private
|
|
170
|
-
|
|
171
|
-
var truncate = function() {
|
|
204
|
+
*/ function checkSize() {
|
|
205
|
+
var truncate = function truncate() {
|
|
172
206
|
if (line < 1) lineData = [
|
|
173
207
|
that._ellipsis("", line)
|
|
174
208
|
];
|
|
@@ -254,7 +288,8 @@ var TextBox = /*#__PURE__*/ function(BaseClass) {
|
|
|
254
288
|
});
|
|
255
289
|
}
|
|
256
290
|
return arr;
|
|
257
|
-
}, []),
|
|
291
|
+
}, []), // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
292
|
+
function(d) {
|
|
258
293
|
return _this._id(d.data, d.i);
|
|
259
294
|
});
|
|
260
295
|
var t = this._select.transition().duration(this._duration);
|
|
@@ -268,7 +303,8 @@ var TextBox = /*#__PURE__*/ function(BaseClass) {
|
|
|
268
303
|
* Applies translate and rotate to a text element.
|
|
269
304
|
* @param {D3Selection} text
|
|
270
305
|
* @private
|
|
271
|
-
|
|
306
|
+
*/ // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
307
|
+
function rotate(text) {
|
|
272
308
|
text.attr("transform", function(d, i) {
|
|
273
309
|
var rotateAnchor = that._rotateAnchor(d, i);
|
|
274
310
|
return "translate(".concat(d.x, ", ").concat(d.y, ") rotate(").concat(d.r, ", ").concat(rotateAnchor[0], ", ").concat(rotateAnchor[1], ")");
|
|
@@ -284,34 +320,37 @@ var TextBox = /*#__PURE__*/ function(BaseClass) {
|
|
|
284
320
|
/**
|
|
285
321
|
Sets the inner text content of each <text> element.
|
|
286
322
|
@private
|
|
287
|
-
|
|
323
|
+
*/ // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
324
|
+
function textContent(text) {
|
|
288
325
|
var tag = false;
|
|
289
326
|
text[that._html ? "html" : "text"](function(t) {
|
|
290
|
-
var cleaned =
|
|
327
|
+
var cleaned = t.trimEnd().replace(/&([^;&]*)/g, function(str, a) {
|
|
291
328
|
return a === "amp" ? str : "&".concat(a);
|
|
292
329
|
}) // replaces all non-HTML ampersands with escaped entity
|
|
293
|
-
.replace(/<([^A-z^/]+)/g, function(
|
|
330
|
+
.replace(/<([^A-z^/]+)/g, function(_str, a) {
|
|
294
331
|
return "<".concat(a);
|
|
295
332
|
}).replace(/<$/g, "<") // replaces all non-HTML left angle brackets with escaped entity
|
|
296
|
-
.replace(/(<[^>^/]+>)([^<^>]+)$/g, function(
|
|
333
|
+
.replace(/(<[^>^/]+>)([^<^>]+)$/g, function(_str, a, b) {
|
|
297
334
|
return "".concat(a).concat(b).concat(a.replace("<", "</"));
|
|
298
335
|
}) // ands end tag to lines before mid-HTML break
|
|
299
|
-
.replace(/^([^<^>]+)(<\/[^>]+>)/g, function(
|
|
336
|
+
.replace(/^([^<^>]+)(<\/[^>]+>)/g, function(_str, a, b) {
|
|
300
337
|
return "".concat(b.replace("</", "<")).concat(a).concat(b);
|
|
301
338
|
}); // ands start tag to lines after mid-HTML break
|
|
302
339
|
var tagRegex = new RegExp(/<([A-z]+)[^>]*>([^<^>]+)<\/[^>]+>/g);
|
|
303
340
|
if (cleaned.match(tagRegex)) {
|
|
304
|
-
|
|
305
|
-
|
|
341
|
+
var htmlLookup = that._html;
|
|
342
|
+
cleaned = cleaned.replace(tagRegex, function(_str, a, b) {
|
|
343
|
+
tag = htmlLookup[a] ? a : false;
|
|
306
344
|
if (tag) {
|
|
307
|
-
var style =
|
|
345
|
+
var style = htmlLookup[tag];
|
|
308
346
|
if (t.includes("</".concat(tag, ">"))) tag = false;
|
|
309
347
|
return '<tspan style="'.concat(style, '">').concat(b, "</tspan>");
|
|
310
348
|
}
|
|
311
349
|
return b;
|
|
312
350
|
});
|
|
313
|
-
} else if (tag.length) {
|
|
314
|
-
|
|
351
|
+
} else if (tag && tag.length) {
|
|
352
|
+
var htmlLookup1 = that._html;
|
|
353
|
+
cleaned = '<tspan style="'.concat(htmlLookup1[tag], '">').concat(cleaned, "</tspan>");
|
|
315
354
|
}
|
|
316
355
|
return cleaned;
|
|
317
356
|
});
|
|
@@ -319,8 +358,9 @@ var TextBox = /*#__PURE__*/ function(BaseClass) {
|
|
|
319
358
|
/**
|
|
320
359
|
Styles to apply to each <text> element.
|
|
321
360
|
@private
|
|
322
|
-
|
|
323
|
-
|
|
361
|
+
*/ // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
362
|
+
function textStyle(text) {
|
|
363
|
+
text.attr("aria-hidden", d.aH).attr("dir", rtl ? "rtl" : "ltr").attr("fill", d.fC).attr("stroke", d.fStroke).attr("stroke-width", d.fSW).attr("text-anchor", d.tA).attr("font-family", d.fF).style("font-family", d.fF).attr("font-size", "".concat(d.fS, "px")).style("font-size", "".concat(d.fS, "px")).attr("font-weight", d.fW).style("font-weight", d.fW).attr("x", "".concat(d.tA === "middle" ? d.w / 2 : rtl ? d.tA === "start" ? d.w : 0 : d.tA === "end" ? d.w : 2 * Math.sin(Math.PI * d.r / 180), "px")).attr("y", function(_t, i) {
|
|
324
364
|
return d.r === 0 || d.vA === "top" ? "".concat((i + 1) * d.lH - (d.lH - d.fS), "px") : d.vA === "middle" ? "".concat((d.h + d.fS) / 2 - (d.lH - d.fS) + (i - d.lines.length / 2 + 0.5) * d.lH, "px") : "".concat(d.h - 2 * (d.lH - d.fS) - (d.lines.length - (i + 1)) * d.lH + 2 * Math.cos(Math.PI * d.r / 180), "px");
|
|
325
365
|
});
|
|
326
366
|
}
|
|
@@ -336,8 +376,12 @@ var TextBox = /*#__PURE__*/ function(BaseClass) {
|
|
|
336
376
|
}
|
|
337
377
|
}).transition(t).call(rotate);
|
|
338
378
|
var events = Object.keys(this._on), on = events.reduce(function(obj, e) {
|
|
339
|
-
|
|
340
|
-
|
|
379
|
+
var _this1 = _this;
|
|
380
|
+
obj[e] = function() {
|
|
381
|
+
for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
|
|
382
|
+
args[_key] = arguments[_key];
|
|
383
|
+
}
|
|
384
|
+
return _this1._on[e](args[0].data, args[1]);
|
|
341
385
|
};
|
|
342
386
|
return obj;
|
|
343
387
|
}, {});
|
|
@@ -347,397 +391,199 @@ var TextBox = /*#__PURE__*/ function(BaseClass) {
|
|
|
347
391
|
}
|
|
348
392
|
},
|
|
349
393
|
{
|
|
350
|
-
|
|
351
|
-
@memberof TextBox
|
|
352
|
-
@desc If *value* is specified, sets the aria-hidden attribute to the specified function or string and returns the current class instance.
|
|
353
|
-
@param {Function|String} *value*
|
|
354
|
-
@chainable
|
|
355
|
-
*/ key: "ariaHidden",
|
|
394
|
+
key: "ariaHidden",
|
|
356
395
|
value: function ariaHidden(_) {
|
|
357
396
|
return _ !== undefined ? (this._ariaHidden = typeof _ === "function" ? _ : constant(_), this) : this._ariaHidden;
|
|
358
397
|
}
|
|
359
398
|
},
|
|
360
399
|
{
|
|
361
|
-
|
|
362
|
-
@memberof TextBox
|
|
363
|
-
@desc Sets the data array to the specified array. A text box will be drawn for each object in the array.
|
|
364
|
-
@param {Array} [*data* = []]
|
|
365
|
-
@chainable
|
|
366
|
-
*/ key: "data",
|
|
400
|
+
key: "data",
|
|
367
401
|
value: function data(_) {
|
|
368
402
|
return arguments.length ? (this._data = _, this) : this._data;
|
|
369
403
|
}
|
|
370
404
|
},
|
|
371
405
|
{
|
|
372
|
-
|
|
373
|
-
@memberof TextBox
|
|
374
|
-
@desc Sets the animation delay to the specified number in milliseconds.
|
|
375
|
-
@param {Number} [*value* = 0]
|
|
376
|
-
@chainable
|
|
377
|
-
*/ key: "delay",
|
|
406
|
+
key: "delay",
|
|
378
407
|
value: function delay(_) {
|
|
379
408
|
return arguments.length ? (this._delay = _, this) : this._delay;
|
|
380
409
|
}
|
|
381
410
|
},
|
|
382
411
|
{
|
|
383
|
-
|
|
384
|
-
@memberof TextBox
|
|
385
|
-
@desc Sets the animation duration to the specified number in milliseconds.
|
|
386
|
-
@param {Number} [*value* = 0]
|
|
387
|
-
@chainable
|
|
388
|
-
*/ key: "duration",
|
|
412
|
+
key: "duration",
|
|
389
413
|
value: function duration(_) {
|
|
390
414
|
return arguments.length ? (this._duration = _, this) : this._duration;
|
|
391
415
|
}
|
|
392
416
|
},
|
|
393
417
|
{
|
|
394
|
-
|
|
395
|
-
@memberof TextBox
|
|
396
|
-
@desc Sets the function that handles what to do when a line is truncated. It should return the new value for the line, and is passed 2 arguments: the String of text for the line in question, and the number of the line. By default, an ellipsis is added to the end of any line except if it is the first word that cannot fit (in that case, an empty string is returned).
|
|
397
|
-
@param {Function|String} [*value*]
|
|
398
|
-
@chainable
|
|
399
|
-
@example <caption>default accessor</caption>
|
|
400
|
-
function(text, line) {
|
|
401
|
-
return line ? text.replace(/\.|,$/g, "") + "..." : "";
|
|
402
|
-
}
|
|
403
|
-
*/ key: "ellipsis",
|
|
418
|
+
key: "ellipsis",
|
|
404
419
|
value: function ellipsis(_) {
|
|
405
420
|
return arguments.length ? (this._ellipsis = typeof _ === "function" ? _ : constant(_), this) : this._ellipsis;
|
|
406
421
|
}
|
|
407
422
|
},
|
|
408
423
|
{
|
|
409
|
-
|
|
410
|
-
@memberof TextBox
|
|
411
|
-
@desc Sets the font color to the specified accessor function or static string, which is inferred from the [DOM selection](#textBox.select) by default.
|
|
412
|
-
@param {Function|String} [*value* = "black"]
|
|
413
|
-
@chainable
|
|
414
|
-
*/ key: "fontColor",
|
|
424
|
+
key: "fontColor",
|
|
415
425
|
value: function fontColor(_) {
|
|
416
426
|
return arguments.length ? (this._fontColor = typeof _ === "function" ? _ : constant(_), this) : this._fontColor;
|
|
417
427
|
}
|
|
418
428
|
},
|
|
419
429
|
{
|
|
420
|
-
|
|
421
|
-
@memberof TextBox
|
|
422
|
-
@desc Defines the font-family to be used. The value passed can be either a *String* name of a font, a comma-separated list of font-family fallbacks, an *Array* of fallbacks, or a *Function* that returns either a *String* or an *Array*. If supplying multiple fallback fonts, the [fontExists](#fontExists) function will be used to determine the first available font on the client's machine.
|
|
423
|
-
@param {Array|Function|String} [*value* = ["Inter", "Helvetica Neue", "HelveticaNeue", "Helvetica", "Arial", "sans-serif"]]
|
|
424
|
-
@chainable
|
|
425
|
-
*/ key: "fontFamily",
|
|
430
|
+
key: "fontFamily",
|
|
426
431
|
value: function fontFamily(_) {
|
|
427
432
|
return arguments.length ? (this._fontFamily = typeof _ === "function" ? _ : constant(_), this) : this._fontFamily;
|
|
428
433
|
}
|
|
429
434
|
},
|
|
430
435
|
{
|
|
431
|
-
|
|
432
|
-
@memberof TextBox
|
|
433
|
-
@desc Sets the maximum font size to the specified accessor function or static number (which corresponds to pixel units), which is used when [dynamically resizing fonts](#textBox.fontResize).
|
|
434
|
-
@param {Function|Number} [*value* = 50]
|
|
435
|
-
@chainable
|
|
436
|
-
*/ key: "fontMax",
|
|
436
|
+
key: "fontMax",
|
|
437
437
|
value: function fontMax(_) {
|
|
438
438
|
return arguments.length ? (this._fontMax = typeof _ === "function" ? _ : constant(_), this) : this._fontMax;
|
|
439
439
|
}
|
|
440
440
|
},
|
|
441
441
|
{
|
|
442
|
-
|
|
443
|
-
@memberof TextBox
|
|
444
|
-
@desc Sets the minimum font size to the specified accessor function or static number (which corresponds to pixel units), which is used when [dynamically resizing fonts](#textBox.fontResize).
|
|
445
|
-
@param {Function|Number} [*value* = 8]
|
|
446
|
-
@chainable
|
|
447
|
-
*/ key: "fontMin",
|
|
442
|
+
key: "fontMin",
|
|
448
443
|
value: function fontMin(_) {
|
|
449
444
|
return arguments.length ? (this._fontMin = typeof _ === "function" ? _ : constant(_), this) : this._fontMin;
|
|
450
445
|
}
|
|
451
446
|
},
|
|
452
447
|
{
|
|
453
|
-
|
|
454
|
-
@memberof TextBox
|
|
455
|
-
@desc Sets the font opacity to the specified accessor function or static number between 0 and 1.
|
|
456
|
-
@param {Function|Number} [*value* = 1]
|
|
457
|
-
@chainable
|
|
458
|
-
*/ key: "fontOpacity",
|
|
448
|
+
key: "fontOpacity",
|
|
459
449
|
value: function fontOpacity(_) {
|
|
460
450
|
return arguments.length ? (this._fontOpacity = typeof _ === "function" ? _ : constant(_), this) : this._fontOpacity;
|
|
461
451
|
}
|
|
462
452
|
},
|
|
463
453
|
{
|
|
464
|
-
|
|
465
|
-
@memberof TextBox
|
|
466
|
-
@desc Toggles font resizing, which can either be defined as a static boolean for all data points, or an accessor function that returns a boolean. See [this example](http://d3plus.org/examples/d3plus-text/resizing-text/) for a side-by-side comparison.
|
|
467
|
-
@param {Function|Boolean} [*value* = false]
|
|
468
|
-
@chainable
|
|
469
|
-
*/ key: "fontResize",
|
|
454
|
+
key: "fontResize",
|
|
470
455
|
value: function fontResize(_) {
|
|
471
456
|
return arguments.length ? (this._fontResize = typeof _ === "function" ? _ : constant(_), this) : this._fontResize;
|
|
472
457
|
}
|
|
473
458
|
},
|
|
474
459
|
{
|
|
475
|
-
|
|
476
|
-
@memberof TextBox
|
|
477
|
-
@desc Sets the font size to the specified accessor function or static number (which corresponds to pixel units), which is inferred from the [DOM selection](#textBox.select) by default.
|
|
478
|
-
@param {Function|Number} [*value* = 10]
|
|
479
|
-
@chainable
|
|
480
|
-
*/ key: "fontSize",
|
|
460
|
+
key: "fontSize",
|
|
481
461
|
value: function fontSize(_) {
|
|
482
462
|
return arguments.length ? (this._fontSize = typeof _ === "function" ? _ : constant(_), this) : this._fontSize;
|
|
483
463
|
}
|
|
484
464
|
},
|
|
485
465
|
{
|
|
486
|
-
|
|
487
|
-
@memberof TextBox
|
|
488
|
-
@desc Sets the font stroke color for the rendered text.
|
|
489
|
-
@param {Function|String} [*value* = "transparent"]
|
|
490
|
-
@chainable
|
|
491
|
-
*/ key: "fontStroke",
|
|
466
|
+
key: "fontStroke",
|
|
492
467
|
value: function fontStroke(_) {
|
|
493
468
|
return arguments.length ? (this._fontStroke = typeof _ === "function" ? _ : constant(_), this) : this._fontStroke;
|
|
494
469
|
}
|
|
495
470
|
},
|
|
496
471
|
{
|
|
497
|
-
|
|
498
|
-
@memberof TextBox
|
|
499
|
-
@desc Sets the font stroke width for the rendered text.
|
|
500
|
-
@param {Function|Number} [*value* = 0]
|
|
501
|
-
@chainable
|
|
502
|
-
*/ key: "fontStrokeWidth",
|
|
472
|
+
key: "fontStrokeWidth",
|
|
503
473
|
value: function fontStrokeWidth(_) {
|
|
504
474
|
return arguments.length ? (this._fontStrokeWidth = typeof _ === "function" ? _ : constant(_), this) : this._fontStrokeWidth;
|
|
505
475
|
}
|
|
506
476
|
},
|
|
507
477
|
{
|
|
508
|
-
|
|
509
|
-
@memberof TextBox
|
|
510
|
-
@desc Sets the font weight to the specified accessor function or static number, which is inferred from the [DOM selection](#textBox.select) by default.
|
|
511
|
-
@param {Function|Number|String} [*value* = 400]
|
|
512
|
-
@chainable
|
|
513
|
-
*/ key: "fontWeight",
|
|
478
|
+
key: "fontWeight",
|
|
514
479
|
value: function fontWeight(_) {
|
|
515
480
|
return arguments.length ? (this._fontWeight = typeof _ === "function" ? _ : constant(_), this) : this._fontWeight;
|
|
516
481
|
}
|
|
517
482
|
},
|
|
518
483
|
{
|
|
519
|
-
|
|
520
|
-
@memberof TextBox
|
|
521
|
-
@desc Sets the height for each box to the specified accessor function or static number.
|
|
522
|
-
@param {Function|Number} [*value*]
|
|
523
|
-
@chainable
|
|
524
|
-
@example <caption>default accessor</caption>
|
|
525
|
-
function(d) {
|
|
526
|
-
return d.height || 200;
|
|
527
|
-
}
|
|
528
|
-
*/ key: "height",
|
|
484
|
+
key: "height",
|
|
529
485
|
value: function height(_) {
|
|
530
486
|
return arguments.length ? (this._height = typeof _ === "function" ? _ : constant(_), this) : this._height;
|
|
531
487
|
}
|
|
532
488
|
},
|
|
533
489
|
{
|
|
534
|
-
|
|
535
|
-
@memberof TextBox
|
|
536
|
-
@desc Configures the ability to render simple HTML tags. Defaults to supporting `<b>`, `<strong>`, `<i>`, and `<em>`, set to false to disable or provide a mapping of tags to svg styles
|
|
537
|
-
@param {Object|Boolean} [*value* = {
|
|
538
|
-
i: 'font-style: italic;',
|
|
539
|
-
em: 'font-style: italic;',
|
|
540
|
-
b: 'font-weight: bold;',
|
|
541
|
-
strong: 'font-weight: bold;'
|
|
542
|
-
}]
|
|
543
|
-
@chainable
|
|
544
|
-
*/ key: "html",
|
|
490
|
+
key: "html",
|
|
545
491
|
value: function html(_) {
|
|
546
492
|
return arguments.length ? (this._html = typeof _ === "boolean" ? _ ? defaultHtmlLookup : false : _, this) : this._html;
|
|
547
493
|
}
|
|
548
494
|
},
|
|
549
495
|
{
|
|
550
|
-
|
|
551
|
-
@memberof TextBox
|
|
552
|
-
@desc Defines the unique id for each box to the specified accessor function or static number.
|
|
553
|
-
@param {Function|Number} [*value*]
|
|
554
|
-
@chainable
|
|
555
|
-
@example <caption>default accessor</caption>
|
|
556
|
-
function(d, i) {
|
|
557
|
-
return d.id || i + "";
|
|
558
|
-
}
|
|
559
|
-
*/ key: "id",
|
|
496
|
+
key: "id",
|
|
560
497
|
value: function id(_) {
|
|
561
498
|
return arguments.length ? (this._id = typeof _ === "function" ? _ : constant(_), this) : this._id;
|
|
562
499
|
}
|
|
563
500
|
},
|
|
564
501
|
{
|
|
565
|
-
|
|
566
|
-
@memberof TextBox
|
|
567
|
-
@desc Sets the line height to the specified accessor function or static number, which is 1.2 times the [font size](#textBox.fontSize) by default.
|
|
568
|
-
@param {Function|Number} [*value*]
|
|
569
|
-
@chainable
|
|
570
|
-
*/ key: "lineHeight",
|
|
502
|
+
key: "lineHeight",
|
|
571
503
|
value: function lineHeight(_) {
|
|
572
504
|
return arguments.length ? (this._lineHeight = typeof _ === "function" ? _ : constant(_), this) : this._lineHeight;
|
|
573
505
|
}
|
|
574
506
|
},
|
|
575
507
|
{
|
|
576
|
-
|
|
577
|
-
@memberof TextBox
|
|
578
|
-
@desc Restricts the maximum number of lines to wrap onto, which is null (unlimited) by default.
|
|
579
|
-
@param {Function|Number} [*value*]
|
|
580
|
-
@chainable
|
|
581
|
-
*/ key: "maxLines",
|
|
508
|
+
key: "maxLines",
|
|
582
509
|
value: function maxLines(_) {
|
|
583
510
|
return arguments.length ? (this._maxLines = typeof _ === "function" ? _ : constant(_), this) : this._maxLines;
|
|
584
511
|
}
|
|
585
512
|
},
|
|
586
513
|
{
|
|
587
|
-
|
|
588
|
-
@memberof TextBox
|
|
589
|
-
@desc Sets the text overflow to the specified accessor function or static boolean.
|
|
590
|
-
@param {Function|Boolean} [*value* = false]
|
|
591
|
-
@chainable
|
|
592
|
-
*/ key: "overflow",
|
|
514
|
+
key: "overflow",
|
|
593
515
|
value: function overflow(_) {
|
|
594
516
|
return arguments.length ? (this._overflow = typeof _ === "function" ? _ : constant(_), this) : this._overflow;
|
|
595
517
|
}
|
|
596
518
|
},
|
|
597
519
|
{
|
|
598
|
-
|
|
599
|
-
@memberof TextBox
|
|
600
|
-
@desc Sets the padding to the specified accessor function, CSS shorthand string, or static number, which is 0 by default.
|
|
601
|
-
@param {Function|Number|String} [*value*]
|
|
602
|
-
@chainable
|
|
603
|
-
*/ key: "padding",
|
|
520
|
+
key: "padding",
|
|
604
521
|
value: function padding(_) {
|
|
605
522
|
return arguments.length ? (this._padding = typeof _ === "function" ? _ : constant(_), this) : this._padding;
|
|
606
523
|
}
|
|
607
524
|
},
|
|
608
525
|
{
|
|
609
|
-
|
|
610
|
-
@memberof TextBox
|
|
611
|
-
@desc Sets the pointer-events to the specified accessor function or static string.
|
|
612
|
-
@param {Function|String} [*value* = "auto"]
|
|
613
|
-
@chainable
|
|
614
|
-
*/ key: "pointerEvents",
|
|
526
|
+
key: "pointerEvents",
|
|
615
527
|
value: function pointerEvents(_) {
|
|
616
528
|
return arguments.length ? (this._pointerEvents = typeof _ === "function" ? _ : constant(_), this) : this._pointerEvents;
|
|
617
529
|
}
|
|
618
530
|
},
|
|
619
531
|
{
|
|
620
|
-
|
|
621
|
-
@memberof TextBox
|
|
622
|
-
@desc Sets the rotate percentage for each box to the specified accessor function or static string.
|
|
623
|
-
@param {Function|Number} [*value* = 0]
|
|
624
|
-
@chainable
|
|
625
|
-
*/ key: "rotate",
|
|
532
|
+
key: "rotate",
|
|
626
533
|
value: function rotate(_) {
|
|
627
534
|
return arguments.length ? (this._rotate = typeof _ === "function" ? _ : constant(_), this) : this._rotate;
|
|
628
535
|
}
|
|
629
536
|
},
|
|
630
537
|
{
|
|
631
|
-
|
|
632
|
-
@memberof TextBox
|
|
633
|
-
@desc Sets the anchor point around which to rotate the text box.
|
|
634
|
-
@param {Function|Number[]}
|
|
635
|
-
@chainable
|
|
636
|
-
*/ key: "rotateAnchor",
|
|
538
|
+
key: "rotateAnchor",
|
|
637
539
|
value: function rotateAnchor(_) {
|
|
638
540
|
return arguments.length ? (this._rotateAnchor = typeof _ === "function" ? _ : constant(_), this) : this._rotateAnchor;
|
|
639
541
|
}
|
|
640
542
|
},
|
|
641
543
|
{
|
|
642
|
-
|
|
643
|
-
@memberof TextBox
|
|
644
|
-
@desc Sets the SVG container element to the specified d3 selector or DOM element. If not explicitly specified, an SVG element will be added to the page for use.
|
|
645
|
-
@param {String|HTMLElement} [*selector*]
|
|
646
|
-
@chainable
|
|
647
|
-
*/ key: "select",
|
|
544
|
+
key: "select",
|
|
648
545
|
value: function select1(_) {
|
|
649
546
|
return arguments.length ? (this._select = select(_), this) : this._select;
|
|
650
547
|
}
|
|
651
548
|
},
|
|
652
549
|
{
|
|
653
|
-
|
|
654
|
-
@memberof TextBox
|
|
655
|
-
@desc Sets the word split behavior to the specified function, which when passed a string is expected to return that string split into an array of words.
|
|
656
|
-
@param {Function} [*value*]
|
|
657
|
-
@chainable
|
|
658
|
-
*/ key: "split",
|
|
550
|
+
key: "split",
|
|
659
551
|
value: function split(_) {
|
|
660
552
|
return arguments.length ? (this._split = _, this) : this._split;
|
|
661
553
|
}
|
|
662
554
|
},
|
|
663
555
|
{
|
|
664
|
-
|
|
665
|
-
@memberof TextBox
|
|
666
|
-
@desc Sets the text for each box to the specified accessor function or static string.
|
|
667
|
-
@param {Function|String} [*value*]
|
|
668
|
-
@chainable
|
|
669
|
-
@example <caption>default accessor</caption>
|
|
670
|
-
function(d) {
|
|
671
|
-
return d.text;
|
|
672
|
-
}
|
|
673
|
-
*/ key: "text",
|
|
556
|
+
key: "text",
|
|
674
557
|
value: function text(_) {
|
|
675
558
|
return arguments.length ? (this._text = typeof _ === "function" ? _ : constant(_), this) : this._text;
|
|
676
559
|
}
|
|
677
560
|
},
|
|
678
561
|
{
|
|
679
|
-
|
|
680
|
-
@memberof TextBox
|
|
681
|
-
@desc Sets the horizontal text anchor to the specified accessor function or static string, whose values are analagous to the SVG [text-anchor](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/text-anchor) property.
|
|
682
|
-
@param {Function|String} [*value* = "start"]
|
|
683
|
-
@chainable
|
|
684
|
-
*/ key: "textAnchor",
|
|
562
|
+
key: "textAnchor",
|
|
685
563
|
value: function textAnchor(_) {
|
|
686
564
|
return arguments.length ? (this._textAnchor = typeof _ === "function" ? _ : constant(_), this) : this._textAnchor;
|
|
687
565
|
}
|
|
688
566
|
},
|
|
689
567
|
{
|
|
690
|
-
|
|
691
|
-
@memberof TextBox
|
|
692
|
-
@desc Sets the vertical alignment to the specified accessor function or static string. Accepts `"top"`, `"middle"`, and `"bottom"`.
|
|
693
|
-
@param {Function|String} [*value* = "top"]
|
|
694
|
-
@chainable
|
|
695
|
-
*/ key: "verticalAlign",
|
|
568
|
+
key: "verticalAlign",
|
|
696
569
|
value: function verticalAlign(_) {
|
|
697
570
|
return arguments.length ? (this._verticalAlign = typeof _ === "function" ? _ : constant(_), this) : this._verticalAlign;
|
|
698
571
|
}
|
|
699
572
|
},
|
|
700
573
|
{
|
|
701
|
-
|
|
702
|
-
@memberof TextBox
|
|
703
|
-
@desc Sets the width for each box to the specified accessor function or static number.
|
|
704
|
-
@param {Function|Number} [*value*]
|
|
705
|
-
@chainable
|
|
706
|
-
@example <caption>default accessor</caption>
|
|
707
|
-
function(d) {
|
|
708
|
-
return d.width || 200;
|
|
709
|
-
}
|
|
710
|
-
*/ key: "width",
|
|
574
|
+
key: "width",
|
|
711
575
|
value: function width(_) {
|
|
712
576
|
return arguments.length ? (this._width = typeof _ === "function" ? _ : constant(_), this) : this._width;
|
|
713
577
|
}
|
|
714
578
|
},
|
|
715
579
|
{
|
|
716
|
-
|
|
717
|
-
@memberof TextBox
|
|
718
|
-
@desc Sets the x position for each box to the specified accessor function or static number. The number given should correspond to the left side of the textBox.
|
|
719
|
-
@param {Function|Number} [*value*]
|
|
720
|
-
@chainable
|
|
721
|
-
@example <caption>default accessor</caption>
|
|
722
|
-
function(d) {
|
|
723
|
-
return d.x || 0;
|
|
724
|
-
}
|
|
725
|
-
*/ key: "x",
|
|
580
|
+
key: "x",
|
|
726
581
|
value: function x(_) {
|
|
727
582
|
return arguments.length ? (this._x = typeof _ === "function" ? _ : constant(_), this) : this._x;
|
|
728
583
|
}
|
|
729
584
|
},
|
|
730
585
|
{
|
|
731
|
-
|
|
732
|
-
@memberof TextBox
|
|
733
|
-
@desc Sets the y position for each box to the specified accessor function or static number. The number given should correspond to the top side of the textBox.
|
|
734
|
-
@param {Function|Number} [*value*]
|
|
735
|
-
@chainable
|
|
736
|
-
@example <caption>default accessor</caption>
|
|
737
|
-
function(d) {
|
|
738
|
-
return d.y || 0;
|
|
739
|
-
}
|
|
740
|
-
*/ key: "y",
|
|
586
|
+
key: "y",
|
|
741
587
|
value: function y(_) {
|
|
742
588
|
return arguments.length ? (this._y = typeof _ === "function" ? _ : constant(_), this) : this._y;
|
|
743
589
|
}
|
|
@@ -746,7 +592,5 @@ function(d) {
|
|
|
746
592
|
return TextBox;
|
|
747
593
|
}(BaseClass);
|
|
748
594
|
/**
|
|
749
|
-
|
|
750
|
-
@extends BaseClass
|
|
751
|
-
@desc Creates a wrapped text box for each point in an array of data. See [this example](https://d3plus.org/examples/d3plus-text/getting-started/) for help getting started using the TextBox class.
|
|
595
|
+
Creates a wrapped text box for each point in an array of data. See [this example](https://d3plus.org/examples/d3plus-text/getting-started/) for help getting started using the TextBox class.
|
|
752
596
|
*/ export { TextBox as default };
|