@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
package/es/src/charts/Viz.js
CHANGED
|
@@ -71,6 +71,7 @@ function _inherits(subClass, superClass) {
|
|
|
71
71
|
if (superClass) _set_prototype_of(subClass, superClass);
|
|
72
72
|
}
|
|
73
73
|
function _instanceof(left, right) {
|
|
74
|
+
"@swc/helpers - instanceof";
|
|
74
75
|
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
75
76
|
return !!right[Symbol.hasInstance](left);
|
|
76
77
|
} else {
|
|
@@ -191,18 +192,16 @@ function _is_native_reflect_construct() {
|
|
|
191
192
|
import { group, max, merge as arrayMerge, min, range, rollup } from "d3-array";
|
|
192
193
|
import { brush } from "d3-brush";
|
|
193
194
|
import { color } from "d3-color";
|
|
194
|
-
import { queue } from "d3-queue";
|
|
195
195
|
import { select } from "d3-selection";
|
|
196
196
|
import { scaleOrdinal } from "d3-scale";
|
|
197
197
|
import { zoom } from "d3-zoom";
|
|
198
|
-
import lrucache from "lrucache";
|
|
199
198
|
import { colorAssign, colorContrast, colorDefaults } from "@d3plus/color";
|
|
200
199
|
import { addToQueue, merge, unique } from "@d3plus/data";
|
|
201
200
|
import { assign, date, getSize, inViewport } from "@d3plus/dom";
|
|
202
201
|
import { formatAbbreviate } from "@d3plus/format";
|
|
203
202
|
import { fontFamily, fontFamilyStringify } from "@d3plus/text";
|
|
204
203
|
import { ColorScale, Legend, TextBox, Timeline, Tooltip } from "../components/index.js";
|
|
205
|
-
import { accessor, BaseClass,
|
|
204
|
+
import { accessor, BaseClass, constant } from "../utils/index.js";
|
|
206
205
|
// import {Rect} from "../shape/index.js";
|
|
207
206
|
import Message from "../components/Message.js";
|
|
208
207
|
import drawBack from "./drawSteps/drawBack.js";
|
|
@@ -221,7 +220,8 @@ import mouseleave from "./events/mouseleave.js";
|
|
|
221
220
|
import mousemoveLegend from "./events/mousemove.legend.js";
|
|
222
221
|
import mousemoveShape from "./events/mousemove.shape.js";
|
|
223
222
|
import touchstartBody from "./events/touchstart.body.js";
|
|
224
|
-
function debounce(
|
|
223
|
+
function debounce(// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
224
|
+
func, delay) {
|
|
225
225
|
var timeout;
|
|
226
226
|
return function() {
|
|
227
227
|
for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
|
|
@@ -266,6 +266,41 @@ function debounce(func, delay) {
|
|
|
266
266
|
}
|
|
267
267
|
return acc(d, i);
|
|
268
268
|
}
|
|
269
|
+
/**
|
|
270
|
+
Minimal LRU cache backed by a Map (insertion-order iteration enables O(1) eviction).
|
|
271
|
+
Only .get() and .set() are used by Viz.
|
|
272
|
+
@private
|
|
273
|
+
*/ var LRU = /*#__PURE__*/ function() {
|
|
274
|
+
"use strict";
|
|
275
|
+
function LRU(capacity) {
|
|
276
|
+
_class_call_check(this, LRU);
|
|
277
|
+
_define_property(this, "_cap", void 0);
|
|
278
|
+
_define_property(this, "_map", void 0);
|
|
279
|
+
this._cap = capacity;
|
|
280
|
+
this._map = new Map();
|
|
281
|
+
}
|
|
282
|
+
_create_class(LRU, [
|
|
283
|
+
{
|
|
284
|
+
key: "get",
|
|
285
|
+
value: function get(key) {
|
|
286
|
+
if (!this._map.has(key)) return undefined;
|
|
287
|
+
var val = this._map.get(key);
|
|
288
|
+
this._map.delete(key);
|
|
289
|
+
this._map.set(key, val);
|
|
290
|
+
return val;
|
|
291
|
+
}
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
key: "set",
|
|
295
|
+
value: function set(key, val) {
|
|
296
|
+
this._map.delete(key);
|
|
297
|
+
if (this._map.size >= this._cap) this._map.delete(this._map.keys().next().value);
|
|
298
|
+
this._map.set(key, val);
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
]);
|
|
302
|
+
return LRU;
|
|
303
|
+
}();
|
|
269
304
|
var Viz = /*#__PURE__*/ function(BaseClass) {
|
|
270
305
|
"use strict";
|
|
271
306
|
_inherits(Viz, BaseClass);
|
|
@@ -276,10 +311,11 @@ var Viz = /*#__PURE__*/ function(BaseClass) {
|
|
|
276
311
|
_this._aggs = {};
|
|
277
312
|
_this._ariaHidden = true;
|
|
278
313
|
_this._attribution = false;
|
|
314
|
+
var attributionBg = "rgba(255, 255, 255, 0.75)";
|
|
279
315
|
_this._attributionStyle = {
|
|
280
|
-
background:
|
|
316
|
+
background: attributionBg,
|
|
281
317
|
border: "1px solid rgba(0, 0, 0, 0.25)",
|
|
282
|
-
color:
|
|
318
|
+
color: colorContrast(attributionBg),
|
|
283
319
|
display: "block",
|
|
284
320
|
font: "400 11px/11px ".concat(fontFamilyStringify(fontFamily)),
|
|
285
321
|
margin: "5px",
|
|
@@ -288,7 +324,8 @@ var Viz = /*#__PURE__*/ function(BaseClass) {
|
|
|
288
324
|
};
|
|
289
325
|
_this._backClass = new TextBox().on("click", function() {
|
|
290
326
|
if (_this._history.length) _this.config(_this._history.pop()).render();
|
|
291
|
-
else _this.depth(_this._drawDepth - 1).filter(false)
|
|
327
|
+
else _this.depth(_this._drawDepth - 1).filter(false);
|
|
328
|
+
_this.render();
|
|
292
329
|
}).on("mousemove", function() {
|
|
293
330
|
return _this._backClass.select().style("cursor", "pointer");
|
|
294
331
|
});
|
|
@@ -341,7 +378,7 @@ var Viz = /*#__PURE__*/ function(BaseClass) {
|
|
|
341
378
|
var id = _this._groupBy[_this._legendDepth].bind(_this)(d, i);
|
|
342
379
|
return _instanceof(id, Array) ? id.length : 1;
|
|
343
380
|
});
|
|
344
|
-
return arr.length > 1 && maxGrouped <= 2;
|
|
381
|
+
return arr.length > 1 && (maxGrouped !== null && maxGrouped !== void 0 ? maxGrouped : 0) <= 2;
|
|
345
382
|
};
|
|
346
383
|
_this._legendClass = new Legend();
|
|
347
384
|
_this._legendConfig = {
|
|
@@ -368,7 +405,7 @@ var Viz = /*#__PURE__*/ function(BaseClass) {
|
|
|
368
405
|
return '\n <div style="left: 50%; top: 50%; position: absolute; transform: translate(-50%, -50%);">\n <strong>'.concat(_this._translate("Loading Visualization"), '</strong>\n <sub style="bottom: 0; display: block; line-height: 1; margin-top: 5px;"><a href="https://d3plus.org" target="_blank">').concat(_this._translate("Powered by D3plus"), "</a></sub>\n </div>");
|
|
369
406
|
};
|
|
370
407
|
_this._loadingMessage = true;
|
|
371
|
-
_this._lrucache =
|
|
408
|
+
_this._lrucache = new LRU(10);
|
|
372
409
|
_this._messageClass = new Message();
|
|
373
410
|
_this._messageMask = "rgba(0, 0, 0, 0.05)";
|
|
374
411
|
_this._messageStyle = {
|
|
@@ -392,18 +429,21 @@ var Viz = /*#__PURE__*/ function(BaseClass) {
|
|
|
392
429
|
"mousemove.legend": mousemoveLegend.bind(_this)
|
|
393
430
|
};
|
|
394
431
|
_this._queue = [];
|
|
395
|
-
_this._resizeObserver = new ResizeObserver(debounce(function() {
|
|
396
|
-
|
|
397
|
-
_this.
|
|
432
|
+
_this._resizeObserver = new ResizeObserver(debounce(function(entries) {
|
|
433
|
+
var _entries__contentRect = entries[0].contentRect, width = _entries__contentRect.width, height = _entries__contentRect.height;
|
|
434
|
+
if ((width !== _this._width && _this._autoWidth || height !== _this._height && _this._autoHeight) && width && height) {
|
|
435
|
+
_this._setSVGSize(width, height);
|
|
436
|
+
if (!_this._callback) _this.render();
|
|
437
|
+
}
|
|
398
438
|
}, _this._detectResizeDelay));
|
|
399
439
|
_this._scrollContainer = typeof window === "undefined" ? "" : window;
|
|
400
440
|
_this._shape = constant("Rect");
|
|
401
441
|
_this._shapes = [];
|
|
402
442
|
_this._shapeConfig = {
|
|
403
|
-
ariaLabel: function(d, i) {
|
|
443
|
+
ariaLabel: function ariaLabel(d, i) {
|
|
404
444
|
return _this._drawLabel(d, i);
|
|
405
445
|
},
|
|
406
|
-
fill: function(d, i) {
|
|
446
|
+
fill: function fill(d, i) {
|
|
407
447
|
while(d.__d3plus__ && d.data){
|
|
408
448
|
d = d.data;
|
|
409
449
|
i = d.i;
|
|
@@ -423,13 +463,13 @@ var Viz = /*#__PURE__*/ function(BaseClass) {
|
|
|
423
463
|
return colorAssign(typeof c1 === "string" ? c1 : JSON.stringify(c1), _this._colorDefaults);
|
|
424
464
|
},
|
|
425
465
|
labelConfig: {
|
|
426
|
-
fontColor: function(d, i) {
|
|
466
|
+
fontColor: function fontColor(d, i) {
|
|
427
467
|
var c = typeof _this._shapeConfig.fill === "function" ? _this._shapeConfig.fill(d, i) : _this._shapeConfig.fill;
|
|
428
468
|
return colorContrast(c);
|
|
429
469
|
}
|
|
430
470
|
},
|
|
431
471
|
opacity: constant(1),
|
|
432
|
-
stroke: function(d, i) {
|
|
472
|
+
stroke: function stroke(d, i) {
|
|
433
473
|
var c = typeof _this._shapeConfig.fill === "function" ? _this._shapeConfig.fill(d, i) : _this._shapeConfig.fill;
|
|
434
474
|
return color(c).darker(0.25);
|
|
435
475
|
},
|
|
@@ -498,10 +538,11 @@ var Viz = /*#__PURE__*/ function(BaseClass) {
|
|
|
498
538
|
fill: "#777",
|
|
499
539
|
"stroke-width": 0
|
|
500
540
|
};
|
|
541
|
+
var zoomBg = "rgba(255, 255, 255, 0.75)";
|
|
501
542
|
_this._zoomControlStyle = {
|
|
502
|
-
background:
|
|
543
|
+
background: zoomBg,
|
|
503
544
|
border: "1px solid rgba(0, 0, 0, 0.75)",
|
|
504
|
-
color:
|
|
545
|
+
color: colorContrast(zoomBg),
|
|
505
546
|
display: "block",
|
|
506
547
|
font: "900 15px/21px ".concat(fontFamilyStringify(fontFamily)),
|
|
507
548
|
height: "20px",
|
|
@@ -511,9 +552,10 @@ var Viz = /*#__PURE__*/ function(BaseClass) {
|
|
|
511
552
|
"text-align": "center",
|
|
512
553
|
width: "20px"
|
|
513
554
|
};
|
|
555
|
+
var zoomActiveBg = "rgba(0, 0, 0, 0.75)";
|
|
514
556
|
_this._zoomControlStyleActive = {
|
|
515
|
-
background:
|
|
516
|
-
color:
|
|
557
|
+
background: zoomActiveBg,
|
|
558
|
+
color: colorContrast(zoomActiveBg),
|
|
517
559
|
opacity: 1
|
|
518
560
|
};
|
|
519
561
|
_this._zoomControlStyleHover = {
|
|
@@ -530,8 +572,7 @@ var Viz = /*#__PURE__*/ function(BaseClass) {
|
|
|
530
572
|
_create_class(Viz, [
|
|
531
573
|
{
|
|
532
574
|
/**
|
|
533
|
-
|
|
534
|
-
@desc Called by draw before anything is drawn. Formats the data and performs preparations for draw.
|
|
575
|
+
Called by draw before anything is drawn. Formats the data and performs preparations for draw.
|
|
535
576
|
@private
|
|
536
577
|
*/ key: "_preDraw",
|
|
537
578
|
value: function _preDraw() {
|
|
@@ -636,8 +677,7 @@ var Viz = /*#__PURE__*/ function(BaseClass) {
|
|
|
636
677
|
},
|
|
637
678
|
{
|
|
638
679
|
/**
|
|
639
|
-
|
|
640
|
-
@desc Called by render once all checks are passed.
|
|
680
|
+
Called by render once all checks are passed.
|
|
641
681
|
@private
|
|
642
682
|
*/ key: "_draw",
|
|
643
683
|
value: function _draw() {
|
|
@@ -660,7 +700,7 @@ var Viz = /*#__PURE__*/ function(BaseClass) {
|
|
|
660
700
|
].includes(colorScalePosition)) colorScalePosition = "bottom";
|
|
661
701
|
// Draws legend and colorScale if they are positioned "left" or "right"
|
|
662
702
|
if (legendPosition === "left" || legendPosition === "right") drawLegend.bind(this)(this._legendData);
|
|
663
|
-
if (colorScalePosition === "left" || colorScalePosition === "right" || colorScalePosition === false) drawColorScale.bind(this)(
|
|
703
|
+
if (colorScalePosition === "left" || colorScalePosition === "right" || colorScalePosition === false) drawColorScale.bind(this)();
|
|
664
704
|
// Draws all of the top/bottom UI elements
|
|
665
705
|
drawBack.bind(this)();
|
|
666
706
|
drawTitle.bind(this)(this._filteredData);
|
|
@@ -669,7 +709,7 @@ var Viz = /*#__PURE__*/ function(BaseClass) {
|
|
|
669
709
|
drawTimeline.bind(this)(this._filteredData);
|
|
670
710
|
// Draws legend and colorScale if they are positioned "top" or "bottom"
|
|
671
711
|
if (legendPosition === "top" || legendPosition === "bottom") drawLegend.bind(this)(this._legendData);
|
|
672
|
-
if (colorScalePosition === "top" || colorScalePosition === "bottom") drawColorScale.bind(this)(
|
|
712
|
+
if (colorScalePosition === "top" || colorScalePosition === "bottom") drawColorScale.bind(this)();
|
|
673
713
|
this._shapes = [];
|
|
674
714
|
// Draws a container and zoomGroup to test functionality.
|
|
675
715
|
// this._testGroup = this._select.selectAll("g.d3plus-viz-testGroup").data([0]);
|
|
@@ -726,7 +766,7 @@ var Viz = /*#__PURE__*/ function(BaseClass) {
|
|
|
726
766
|
* @param {Array} data The data to process.
|
|
727
767
|
* @private
|
|
728
768
|
*/ key: "_thresholdFunction",
|
|
729
|
-
value: function _thresholdFunction(data) {
|
|
769
|
+
value: function _thresholdFunction(data, _tree) {
|
|
730
770
|
return data;
|
|
731
771
|
}
|
|
732
772
|
},
|
|
@@ -735,20 +775,20 @@ var Viz = /*#__PURE__*/ function(BaseClass) {
|
|
|
735
775
|
* Detects width and height and sets SVG properties
|
|
736
776
|
* @private
|
|
737
777
|
*/ key: "_setSVGSize",
|
|
738
|
-
value: function _setSVGSize() {
|
|
739
|
-
var
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
w -= parseFloat(this._select.style("border-
|
|
744
|
-
|
|
745
|
-
h -= parseFloat(this._select.style("border-
|
|
746
|
-
this._select.style("
|
|
747
|
-
if (this._autoWidth) {
|
|
778
|
+
value: function _setSVGSize(width, height) {
|
|
779
|
+
var _ref = _sliced_to_array(width && height ? [
|
|
780
|
+
width,
|
|
781
|
+
height
|
|
782
|
+
] : getSize(this._select.node().parentNode), 2), w = _ref[0], h = _ref[1];
|
|
783
|
+
w -= parseFloat(this._select.style("border-left-width"));
|
|
784
|
+
w -= parseFloat(this._select.style("border-right-width"));
|
|
785
|
+
h -= parseFloat(this._select.style("border-top-width"));
|
|
786
|
+
h -= parseFloat(this._select.style("border-bottom-width"));
|
|
787
|
+
if (this._autoWidth && this._width !== w) {
|
|
748
788
|
this.width(w);
|
|
749
789
|
this._select.style("width", "".concat(this._width, "px")).attr("width", "".concat(this._width, "px"));
|
|
750
790
|
}
|
|
751
|
-
if (this._autoHeight) {
|
|
791
|
+
if (this._autoHeight && this._height !== h) {
|
|
752
792
|
this.height(h);
|
|
753
793
|
this._select.style("height", "".concat(this._height, "px")).attr("height", "".concat(this._height, "px"));
|
|
754
794
|
}
|
|
@@ -756,10 +796,8 @@ var Viz = /*#__PURE__*/ function(BaseClass) {
|
|
|
756
796
|
},
|
|
757
797
|
{
|
|
758
798
|
/**
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
@param {Function} [*callback*] An optional callback function that, if passed, will be called after animation is complete.
|
|
762
|
-
@chainable
|
|
799
|
+
Draws the visualization given the specified configuration.
|
|
800
|
+
@param callback Optional callback invoked after rendering completes.
|
|
763
801
|
*/ key: "render",
|
|
764
802
|
value: function render(callback) {
|
|
765
803
|
var _this = this;
|
|
@@ -779,7 +817,7 @@ var Viz = /*#__PURE__*/ function(BaseClass) {
|
|
|
779
817
|
};
|
|
780
818
|
// Appends a fullscreen SVG to the BODY if a container has not been provided through .select().
|
|
781
819
|
if (this._select === void 0 || this._select.node().tagName.toLowerCase() !== "svg") {
|
|
782
|
-
var parent = this._select === void 0 ? select("body").
|
|
820
|
+
var parent = this._select === void 0 ? select("body").insert("div", "#d3plus-portal").style("height", "100dvh").style("width", "100%").style("min-height", "150px") : this._select;
|
|
783
821
|
var svg = parent.select(".d3plus-viz").size() ? parent.select(".d3plus-viz") : parent.append("svg");
|
|
784
822
|
this.select(svg.node());
|
|
785
823
|
}
|
|
@@ -789,9 +827,9 @@ var Viz = /*#__PURE__*/ function(BaseClass) {
|
|
|
789
827
|
this._autoHeight = this._height === undefined;
|
|
790
828
|
this._setSVGSize();
|
|
791
829
|
}
|
|
792
|
-
this._select.attr("class", "d3plus-viz").attr("aria-hidden", this._ariaHidden).attr("aria-labelledby", "".concat(this._uuid, "-title ").concat(this._uuid, "-desc")).attr("role", "img").attr("xmlns", "http://www.w3.org/2000/svg").attr("xmlns:xlink", "http://www.w3.org/1999/xlink").transition().duration(this._duration).style("width", this._width !== undefined ? "".concat(this._width, "px") : undefined).style("height", this._height !== undefined ? "".concat(this._height, "px") : undefined).attr("width", this._width !== undefined ? "".concat(this._width, "px") : undefined).attr("height", this._height !== undefined ? "".concat(this._height, "px") : undefined);
|
|
793
|
-
// sets "position: relative" on the SVG parent if currently undefined
|
|
794
830
|
var parent1 = select(this._select.node().parentNode);
|
|
831
|
+
this._select.attr("class", "d3plus-viz").attr("aria-hidden", this._ariaHidden).attr("aria-labelledby", "".concat(this._uuid, "-title ").concat(this._uuid, "-desc")).attr("role", "img").attr("xmlns", "http://www.w3.org/2000/svg").attr("xmlns:xlink", "http://www.w3.org/1999/xlink").style("position", "absolute").style("top", parent1.style("padding-top")).style("left", parent1.style("padding-left")).transition().duration(this._duration).style("width", this._width !== undefined ? "".concat(this._width, "px") : undefined).style("height", this._height !== undefined ? "".concat(this._height, "px") : undefined).attr("width", this._width !== undefined ? "".concat(this._width, "px") : undefined).attr("height", this._height !== undefined ? "".concat(this._height, "px") : undefined);
|
|
832
|
+
// sets "position: relative" on the SVG parent if currently undefined
|
|
795
833
|
var position = parent1.style("position");
|
|
796
834
|
if (position === "static") parent1.style("position", "relative");
|
|
797
835
|
parent1.style("font-family", fontFamilyStringify(this._fontFamily));
|
|
@@ -840,15 +878,20 @@ var Viz = /*#__PURE__*/ function(BaseClass) {
|
|
|
840
878
|
}
|
|
841
879
|
});
|
|
842
880
|
} else {
|
|
843
|
-
var
|
|
881
|
+
var promises = [];
|
|
844
882
|
this._queue.forEach(function(p) {
|
|
845
|
-
var _q;
|
|
846
883
|
var cache = _this._cache ? _this._lrucache.get("".concat(p[3], "_").concat(p[1])) : undefined;
|
|
847
|
-
if (!cache)
|
|
848
|
-
|
|
884
|
+
if (!cache) {
|
|
885
|
+
promises.push(new Promise(function(resolve) {
|
|
886
|
+
p[0](p[1], p[2], p[3], function(err) {
|
|
887
|
+
if (err) console.error(err);
|
|
888
|
+
resolve();
|
|
889
|
+
});
|
|
890
|
+
}));
|
|
891
|
+
} else _this["_".concat(p[3])] = p[2] ? p[2](cache) : cache;
|
|
849
892
|
});
|
|
850
893
|
this._queue = [];
|
|
851
|
-
if (this._loadingMessage &&
|
|
894
|
+
if (this._loadingMessage && promises.length) {
|
|
852
895
|
this._messageClass.render({
|
|
853
896
|
container: this._select.node().parentNode,
|
|
854
897
|
html: this._loadingHTML(this),
|
|
@@ -856,7 +899,7 @@ var Viz = /*#__PURE__*/ function(BaseClass) {
|
|
|
856
899
|
style: this._messageStyle
|
|
857
900
|
});
|
|
858
901
|
}
|
|
859
|
-
|
|
902
|
+
Promise.all(promises).then(function() {
|
|
860
903
|
// creates a data table as DOM elements inside of the SVG for accessibility
|
|
861
904
|
// only if this._ariaHidden is set to true
|
|
862
905
|
var columns = _instanceof(_this._data, Array) && _this._data.length > 0 ? Object.keys(_this._data[0]) : [];
|
|
@@ -883,7 +926,7 @@ var Viz = /*#__PURE__*/ function(BaseClass) {
|
|
|
883
926
|
});
|
|
884
927
|
// finishes the draw cycle
|
|
885
928
|
_this._preDraw();
|
|
886
|
-
_this._draw(
|
|
929
|
+
_this._draw();
|
|
887
930
|
zoomControls.bind(_this)();
|
|
888
931
|
drawAttribution.bind(_this)();
|
|
889
932
|
if (_this._messageClass._isVisible && (!_this._noDataMessage || _this._filteredData.length)) {
|
|
@@ -895,7 +938,10 @@ var Viz = /*#__PURE__*/ function(BaseClass) {
|
|
|
895
938
|
} else {
|
|
896
939
|
_this._resizeObserver.unobserve(_this._select.node().parentNode);
|
|
897
940
|
}
|
|
898
|
-
if (callback) setTimeout(
|
|
941
|
+
if (callback) setTimeout(function() {
|
|
942
|
+
callback();
|
|
943
|
+
_this._callback = undefined;
|
|
944
|
+
}, _this._duration + 100);
|
|
899
945
|
});
|
|
900
946
|
}
|
|
901
947
|
// Attaches touchstart event listener to the BODY to hide the tooltip when the user touches any element without data
|
|
@@ -905,11 +951,19 @@ var Viz = /*#__PURE__*/ function(BaseClass) {
|
|
|
905
951
|
},
|
|
906
952
|
{
|
|
907
953
|
/**
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
954
|
+
Tears down the visualization: disconnects the ResizeObserver and removes DOM event listeners. Call this when unmounting to avoid memory leaks.
|
|
955
|
+
*/ key: "destroy",
|
|
956
|
+
value: function destroy() {
|
|
957
|
+
this._resizeObserver.disconnect();
|
|
958
|
+
this._tooltipClass.data([]).render();
|
|
959
|
+
select("body").on("touchstart.".concat(this._uuid), null);
|
|
960
|
+
return this;
|
|
961
|
+
}
|
|
962
|
+
},
|
|
963
|
+
{
|
|
964
|
+
/**
|
|
965
|
+
The active callback function for highlighting shapes.
|
|
966
|
+
*/ key: "active",
|
|
913
967
|
value: function active(_) {
|
|
914
968
|
this._active = _;
|
|
915
969
|
if (this._shapeConfig.activeOpacity !== 1) {
|
|
@@ -923,140 +977,103 @@ var Viz = /*#__PURE__*/ function(BaseClass) {
|
|
|
923
977
|
},
|
|
924
978
|
{
|
|
925
979
|
/**
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
@param {Object} [*value*]
|
|
929
|
-
@chainable
|
|
930
|
-
*/ key: "aggs",
|
|
980
|
+
Custom aggregation methods for each data key.
|
|
981
|
+
*/ key: "aggs",
|
|
931
982
|
value: function aggs(_) {
|
|
932
983
|
return arguments.length ? (this._aggs = assign(this._aggs, _), this) : this._aggs;
|
|
933
984
|
}
|
|
934
985
|
},
|
|
935
986
|
{
|
|
936
987
|
/**
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
@param {Boolean} [*value* = true]
|
|
940
|
-
@chainable
|
|
941
|
-
*/ key: "ariaHidden",
|
|
988
|
+
The "aria-hidden" attribute of the containing SVG element. The default value is "false", but if you need to hide the SVG from screen readers set this property to "true".
|
|
989
|
+
*/ key: "ariaHidden",
|
|
942
990
|
value: function ariaHidden(_) {
|
|
943
991
|
return arguments.length ? (this._ariaHidden = _, this) : this._ariaHidden;
|
|
944
992
|
}
|
|
945
993
|
},
|
|
946
994
|
{
|
|
947
995
|
/**
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
@param {HTMLString|Boolean} *value* = false
|
|
951
|
-
@chainable
|
|
952
|
-
*/ key: "attribution",
|
|
996
|
+
Sets text to be shown positioned absolute on top of the visualization in the bottom-right corner. This is most often used in Geomaps to display the copyright of map tiles. The text is rendered as HTML, so any valid HTML string will render as expected (eg. anchor links work).
|
|
997
|
+
*/ key: "attribution",
|
|
953
998
|
value: function attribution(_) {
|
|
954
999
|
return arguments.length ? (this._attribution = _, this) : this._attribution;
|
|
955
1000
|
}
|
|
956
1001
|
},
|
|
957
1002
|
{
|
|
958
1003
|
/**
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
@param {Object} [*value*]
|
|
962
|
-
@chainable
|
|
963
|
-
*/ key: "attributionStyle",
|
|
1004
|
+
Configuration object for the attribution style.
|
|
1005
|
+
*/ key: "attributionStyle",
|
|
964
1006
|
value: function attributionStyle(_) {
|
|
965
1007
|
return arguments.length ? (this._attributionStyle = assign(this._attributionStyle, _), this) : this._attributionStyle;
|
|
966
1008
|
}
|
|
967
1009
|
},
|
|
968
1010
|
{
|
|
969
1011
|
/**
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
@param {Object} [*value*]
|
|
973
|
-
@chainable
|
|
974
|
-
*/ key: "backConfig",
|
|
1012
|
+
Configuration object for the back button.
|
|
1013
|
+
*/ key: "backConfig",
|
|
975
1014
|
value: function backConfig(_) {
|
|
976
1015
|
return arguments.length ? (this._backConfig = assign(this._backConfig, _), this) : this._backConfig;
|
|
977
1016
|
}
|
|
978
1017
|
},
|
|
979
1018
|
{
|
|
980
1019
|
/**
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
@param {Boolean} [*value* = false]
|
|
984
|
-
@chainable
|
|
985
|
-
*/ key: "cache",
|
|
1020
|
+
Enables a lru cache that stores up to 5 previously loaded files/URLs. Helpful when constantly writing over the data array with a URL in the render function of a react component.
|
|
1021
|
+
*/ key: "cache",
|
|
986
1022
|
value: function cache(_) {
|
|
987
1023
|
return arguments.length ? (this._cache = _, this) : this._cache;
|
|
988
1024
|
}
|
|
989
1025
|
},
|
|
990
1026
|
{
|
|
991
1027
|
/**
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
@param {Function|String|False} [*value*]
|
|
995
|
-
@chainable
|
|
996
|
-
*/ key: "color",
|
|
1028
|
+
Defines the main color to be used for each data point in a visualization. Can be either an accessor function or a string key to reference in each data point. If a color value is returned, it will be used as is. If a string is returned, a unique color will be assigned based on the string.
|
|
1029
|
+
*/ key: "color",
|
|
997
1030
|
value: function color(_) {
|
|
998
1031
|
return arguments.length ? (this._color = !_ || typeof _ === "function" ? _ : accessor(_), this) : this._color;
|
|
999
1032
|
}
|
|
1000
1033
|
},
|
|
1001
1034
|
{
|
|
1002
1035
|
/**
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
@param {Function|String|False} [*value*]
|
|
1006
|
-
@chainable
|
|
1007
|
-
*/ key: "colorScale",
|
|
1036
|
+
Defines the value to be used for a color scale. Can be either an accessor function or a string key to reference in each data point.
|
|
1037
|
+
*/ key: "colorScale",
|
|
1008
1038
|
value: function colorScale(_) {
|
|
1009
1039
|
return arguments.length ? (this._colorScale = !_ || typeof _ === "function" ? _ : accessor(_), this) : this._colorScale;
|
|
1010
1040
|
}
|
|
1011
1041
|
},
|
|
1012
1042
|
{
|
|
1013
1043
|
/**
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
@param {Object} [*value*]
|
|
1017
|
-
@chainable
|
|
1018
|
-
*/ key: "colorScaleConfig",
|
|
1044
|
+
A pass-through to the config method of ColorScale.
|
|
1045
|
+
*/ key: "colorScaleConfig",
|
|
1019
1046
|
value: function colorScaleConfig(_) {
|
|
1020
1047
|
return arguments.length ? (this._colorScaleConfig = assign(this._colorScaleConfig, _), this) : this._colorScaleConfig;
|
|
1021
1048
|
}
|
|
1022
1049
|
},
|
|
1023
1050
|
{
|
|
1024
1051
|
/**
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
@param {Boolean|Function} [*value*]
|
|
1028
|
-
@chainable
|
|
1029
|
-
*/ key: "colorScalePadding",
|
|
1052
|
+
Tells the colorScale whether or not to use the internal padding defined by the visualization in it's positioning. For example, d3plus-plot will add padding on the left so that the colorScale appears centered above the x-axis. By default, this padding is only applied on screens larger than 600 pixels wide.
|
|
1053
|
+
*/ key: "colorScalePadding",
|
|
1030
1054
|
value: function colorScalePadding(_) {
|
|
1031
1055
|
return arguments.length ? (this._colorScalePadding = typeof _ === "function" ? _ : constant(_), this) : this._colorScalePadding;
|
|
1032
1056
|
}
|
|
1033
1057
|
},
|
|
1034
1058
|
{
|
|
1035
1059
|
/**
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
@param {Function|String|Boolean} [*value* = "bottom"]
|
|
1039
|
-
@chainable
|
|
1040
|
-
*/ key: "colorScalePosition",
|
|
1060
|
+
Defines which side of the visualization to anchor the color scale. Acceptable values are `"top"`, `"bottom"`, `"left"`, `"right"`, and `false`. A `false` value will cause the color scale to not be displayed, but will still color shapes based on the scale.
|
|
1061
|
+
*/ key: "colorScalePosition",
|
|
1041
1062
|
value: function colorScalePosition(_) {
|
|
1042
1063
|
return arguments.length ? (this._colorScalePosition = typeof _ === "function" ? _ : constant(_), this) : this._colorScalePosition;
|
|
1043
1064
|
}
|
|
1044
1065
|
},
|
|
1045
1066
|
{
|
|
1046
1067
|
/**
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
@param {Number} [*value* = 600]
|
|
1050
|
-
@chainable
|
|
1051
|
-
*/ key: "colorScaleMaxSize",
|
|
1068
|
+
The maximum pixel size for drawing the color scale: width for horizontal scales and height for vertical scales.
|
|
1069
|
+
*/ key: "colorScaleMaxSize",
|
|
1052
1070
|
value: function colorScaleMaxSize(_) {
|
|
1053
1071
|
return arguments.length ? (this._colorScaleMaxSize = _, this) : this._colorScaleMaxSize;
|
|
1054
1072
|
}
|
|
1055
1073
|
},
|
|
1056
1074
|
{
|
|
1057
1075
|
/**
|
|
1058
|
-
|
|
1059
|
-
@desc Sets the primary data array to be used when drawing the visualization. The value passed should be an *Array* of objects or a *String* representing a filepath or URL to be loaded. The following filetypes are supported: `csv`, `tsv`, `txt`, and `json`.
|
|
1076
|
+
The primary data array used to draw the visualization. The value passed should be an *Array* of objects or a *String* representing a filepath or URL to be loaded. The following filetypes are supported: `csv`, `tsv`, `txt`, and `json`.
|
|
1060
1077
|
|
|
1061
1078
|
If your data URL needs specific headers to be set, an Object with "url" and "headers" keys may also be passed.
|
|
1062
1079
|
|
|
@@ -1064,13 +1081,12 @@ Additionally, a custom formatting function can be passed as a second argument to
|
|
|
1064
1081
|
|
|
1065
1082
|
If you would like to specify certain configuration options based on the yet-to-be-loaded data, you can also return a full `config` object from the data formatter (including the new `data` array as a key in the object).
|
|
1066
1083
|
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
@param {Function} [*formatter*]
|
|
1070
|
-
@chainable
|
|
1084
|
+
Defaults to an empty array (`[]`).
|
|
1085
|
+
@param f The data array or a URL string to load data from.
|
|
1071
1086
|
*/ key: "data",
|
|
1072
1087
|
value: function data(_, f) {
|
|
1073
1088
|
if (arguments.length) {
|
|
1089
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1074
1090
|
addToQueue.bind(this)(_, f, "data");
|
|
1075
1091
|
this._hidden = [];
|
|
1076
1092
|
this._solo = [];
|
|
@@ -1086,143 +1102,104 @@ If *data* is not specified, this method returns the current primary data array,
|
|
|
1086
1102
|
},
|
|
1087
1103
|
{
|
|
1088
1104
|
/**
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
@param {Number} [*value* = 100]
|
|
1092
|
-
@chainable
|
|
1093
|
-
*/ key: "dataCutoff",
|
|
1105
|
+
If the number of visible data points exceeds this number, the default hover behavior will be disabled (helpful for very large visualizations bogging down the DOM with opacity updates).
|
|
1106
|
+
*/ key: "dataCutoff",
|
|
1094
1107
|
value: function dataCutoff(_) {
|
|
1095
1108
|
return arguments.length ? (this._dataCutoff = _, this) : this._dataCutoff;
|
|
1096
1109
|
}
|
|
1097
1110
|
},
|
|
1098
1111
|
{
|
|
1099
1112
|
/**
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
@param {Number} [*value*]
|
|
1103
|
-
@chainable
|
|
1104
|
-
*/ key: "depth",
|
|
1113
|
+
The current depth of the visualization. The value should correspond with an index in the [groupBy](#groupBy) array.
|
|
1114
|
+
*/ key: "depth",
|
|
1105
1115
|
value: function depth(_) {
|
|
1106
1116
|
return arguments.length ? (this._depth = _, this) : this._depth;
|
|
1107
1117
|
}
|
|
1108
1118
|
},
|
|
1109
1119
|
{
|
|
1110
1120
|
/**
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
@param {Boolean} *value* = true
|
|
1114
|
-
@chainable
|
|
1115
|
-
*/ key: "detectResize",
|
|
1121
|
+
If the width and/or height of a Viz is not user-defined, it is determined by the size of it's parent element. When this method is set to `true`, the Viz will listen for the `window.onresize` event and adjust it's dimensions accordingly.
|
|
1122
|
+
*/ key: "detectResize",
|
|
1116
1123
|
value: function detectResize(_) {
|
|
1117
1124
|
return arguments.length ? (this._detectResize = _, this) : this._detectResize;
|
|
1118
1125
|
}
|
|
1119
1126
|
},
|
|
1120
1127
|
{
|
|
1121
1128
|
/**
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
@param {Number} *value* = 400
|
|
1125
|
-
@chainable
|
|
1126
|
-
*/ key: "detectResizeDelay",
|
|
1129
|
+
When resizing the browser window, this is the millisecond delay to trigger the resize event.
|
|
1130
|
+
*/ key: "detectResizeDelay",
|
|
1127
1131
|
value: function detectResizeDelay(_) {
|
|
1128
1132
|
return arguments.length ? (this._detectResizeDelay = _, this) : this._detectResizeDelay;
|
|
1129
1133
|
}
|
|
1130
1134
|
},
|
|
1131
1135
|
{
|
|
1132
1136
|
/**
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
@param {Boolean} *value* = true
|
|
1136
|
-
@chainable
|
|
1137
|
-
*/ key: "detectVisible",
|
|
1137
|
+
Toggles whether or not the Viz should try to detect if it visible in the current viewport. When this method is set to `true`, the Viz will only be rendered when it has entered the viewport either through scrolling or if it's display or visibility is changed.
|
|
1138
|
+
*/ key: "detectVisible",
|
|
1138
1139
|
value: function detectVisible(_) {
|
|
1139
1140
|
return arguments.length ? (this._detectVisible = _, this) : this._detectVisible;
|
|
1140
1141
|
}
|
|
1141
1142
|
},
|
|
1142
1143
|
{
|
|
1143
1144
|
/**
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
@param {Number} *value* = 1000
|
|
1147
|
-
@chainable
|
|
1148
|
-
*/ key: "detectVisibleInterval",
|
|
1145
|
+
The interval, in milliseconds, for checking if the visualization is visible on the page.
|
|
1146
|
+
*/ key: "detectVisibleInterval",
|
|
1149
1147
|
value: function detectVisibleInterval(_) {
|
|
1150
1148
|
return arguments.length ? (this._detectVisibleInterval = _, this) : this._detectVisibleInterval;
|
|
1151
1149
|
}
|
|
1152
1150
|
},
|
|
1153
1151
|
{
|
|
1154
1152
|
/**
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
@param {String} [*value*]
|
|
1158
|
-
@chainable
|
|
1159
|
-
*/ key: "discrete",
|
|
1153
|
+
If *value* is specified, sets the discrete accessor to the specified method name (usually an axis) and returns the current class instance.
|
|
1154
|
+
*/ key: "discrete",
|
|
1160
1155
|
value: function discrete(_) {
|
|
1161
1156
|
return arguments.length ? (this._discrete = _, this) : this._discrete;
|
|
1162
1157
|
}
|
|
1163
1158
|
},
|
|
1164
1159
|
{
|
|
1165
1160
|
/**
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
@param {Boolean} [*value* = false]
|
|
1169
|
-
@chainable
|
|
1170
|
-
*/ key: "downloadButton",
|
|
1161
|
+
Shows a button that allows for downloading the current visualization.
|
|
1162
|
+
*/ key: "downloadButton",
|
|
1171
1163
|
value: function downloadButton(_) {
|
|
1172
1164
|
return arguments.length ? (this._downloadButton = _, this) : this._downloadButton;
|
|
1173
1165
|
}
|
|
1174
1166
|
},
|
|
1175
1167
|
{
|
|
1176
1168
|
/**
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
@param {Object} [*value* = {type: "png"}]
|
|
1180
|
-
@chainable
|
|
1181
|
-
*/ key: "downloadConfig",
|
|
1169
|
+
Sets specific options of the saveElement function used when downloading the visualization.
|
|
1170
|
+
*/ key: "downloadConfig",
|
|
1182
1171
|
value: function downloadConfig(_) {
|
|
1183
1172
|
return arguments.length ? (this._downloadConfig = assign(this._downloadConfig, _), this) : this._downloadConfig;
|
|
1184
1173
|
}
|
|
1185
1174
|
},
|
|
1186
1175
|
{
|
|
1187
1176
|
/**
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
@param {String} [*value* = "top"]
|
|
1191
|
-
@chainable
|
|
1192
|
-
*/ key: "downloadPosition",
|
|
1177
|
+
Defines which control group to add the download button into.
|
|
1178
|
+
*/ key: "downloadPosition",
|
|
1193
1179
|
value: function downloadPosition(_) {
|
|
1194
1180
|
return arguments.length ? (this._downloadPosition = _, this) : this._downloadPosition;
|
|
1195
1181
|
}
|
|
1196
1182
|
},
|
|
1197
1183
|
{
|
|
1198
1184
|
/**
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
@param {Number} [*ms* = 600]
|
|
1202
|
-
@chainable
|
|
1203
|
-
*/ key: "duration",
|
|
1185
|
+
The animation duration in milliseconds.
|
|
1186
|
+
*/ key: "duration",
|
|
1204
1187
|
value: function duration(_) {
|
|
1205
1188
|
return arguments.length ? (this._duration = _, this) : this._duration;
|
|
1206
1189
|
}
|
|
1207
1190
|
},
|
|
1208
1191
|
{
|
|
1209
1192
|
/**
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
@param {Function} [*value*]
|
|
1213
|
-
@chainable
|
|
1214
|
-
*/ key: "filter",
|
|
1193
|
+
A filter function applied to the data before drawing.
|
|
1194
|
+
*/ key: "filter",
|
|
1215
1195
|
value: function filter(_) {
|
|
1216
1196
|
return arguments.length ? (this._filter = _, this) : this._filter;
|
|
1217
1197
|
}
|
|
1218
1198
|
},
|
|
1219
1199
|
{
|
|
1220
1200
|
/**
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
@param {Function} [*value*]
|
|
1224
|
-
@chainable
|
|
1225
|
-
*/ key: "fontFamily",
|
|
1201
|
+
The font family used throughout the visualization.
|
|
1202
|
+
*/ key: "fontFamily",
|
|
1226
1203
|
value: function fontFamily(_) {
|
|
1227
1204
|
var _this = this;
|
|
1228
1205
|
if (arguments.length) {
|
|
@@ -1276,19 +1253,16 @@ If *data* is not specified, this method returns the current primary data array,
|
|
|
1276
1253
|
},
|
|
1277
1254
|
{
|
|
1278
1255
|
/**
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
@param {String|Function|Array} [*value*]
|
|
1282
|
-
@chainable
|
|
1283
|
-
*/ key: "groupBy",
|
|
1256
|
+
Defines the mapping between data and shape. The value can be a String matching a key in each data point (default is "id"), or an accessor Function that returns a unique value for each data point. Additionally, an Array of these values may be provided if the visualization supports nested hierarchies.
|
|
1257
|
+
*/ key: "groupBy",
|
|
1284
1258
|
value: function groupBy(_) {
|
|
1285
1259
|
var _this = this;
|
|
1286
1260
|
if (!arguments.length) return this._groupBy;
|
|
1287
1261
|
this._groupByRaw = _;
|
|
1288
|
-
|
|
1262
|
+
var arr = _instanceof(_, Array) ? _ : [
|
|
1289
1263
|
_
|
|
1290
1264
|
];
|
|
1291
|
-
return this._groupBy =
|
|
1265
|
+
return this._groupBy = arr.map(function(k) {
|
|
1292
1266
|
if (typeof k === "function") return k;
|
|
1293
1267
|
else {
|
|
1294
1268
|
if (!_this._aggs[k]) {
|
|
@@ -1304,48 +1278,36 @@ If *data* is not specified, this method returns the current primary data array,
|
|
|
1304
1278
|
},
|
|
1305
1279
|
{
|
|
1306
1280
|
/**
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
@param {Number} [*value* = window.innerHeight]
|
|
1310
|
-
@chainable
|
|
1311
|
-
*/ key: "height",
|
|
1281
|
+
The overall height of the visualization in pixels.
|
|
1282
|
+
*/ key: "height",
|
|
1312
1283
|
value: function height(_) {
|
|
1313
1284
|
return arguments.length ? (this._height = _, this) : this._height;
|
|
1314
1285
|
}
|
|
1315
1286
|
},
|
|
1316
1287
|
{
|
|
1317
1288
|
/**
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
@param {Function|String} [*value* = "#aaa"]
|
|
1321
|
-
@chainable
|
|
1322
|
-
*/ key: "hiddenColor",
|
|
1289
|
+
Defines the color used for legend shapes when the corresponding grouping is hidden from display (by clicking on the legend).
|
|
1290
|
+
*/ key: "hiddenColor",
|
|
1323
1291
|
value: function hiddenColor(_) {
|
|
1324
1292
|
return arguments.length ? (this._hiddenColor = typeof _ === "function" ? _ : constant(_), this) : this._hiddenColor;
|
|
1325
1293
|
}
|
|
1326
1294
|
},
|
|
1327
1295
|
{
|
|
1328
1296
|
/**
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
@param {Function|Number} [*value* = 0.5]
|
|
1332
|
-
@chainable
|
|
1333
|
-
*/ key: "hiddenOpacity",
|
|
1297
|
+
Defines the opacity used for legend labels when the corresponding grouping is hidden from display (by clicking on the legend).
|
|
1298
|
+
*/ key: "hiddenOpacity",
|
|
1334
1299
|
value: function hiddenOpacity(_) {
|
|
1335
1300
|
return arguments.length ? (this._hiddenOpacity = typeof _ === "function" ? _ : constant(_), this) : this._hiddenOpacity;
|
|
1336
1301
|
}
|
|
1337
1302
|
},
|
|
1338
1303
|
{
|
|
1339
1304
|
/**
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
@param {Function} [*value*]
|
|
1343
|
-
@chainable
|
|
1344
|
-
*/ key: "hover",
|
|
1305
|
+
The hover callback function for highlighting shapes on mouseover.
|
|
1306
|
+
*/ key: "hover",
|
|
1345
1307
|
value: function hover(_) {
|
|
1346
1308
|
var _this = this;
|
|
1347
1309
|
var hoverFunction = this._hover = _;
|
|
1348
|
-
if (this._shapeConfig.hoverOpacity !== 1) {
|
|
1310
|
+
if (this._shapeConfig.hoverOpacity !== 1 && _ !== undefined) {
|
|
1349
1311
|
if (typeof _ === "function") {
|
|
1350
1312
|
var shapeData = arrayMerge(this._shapes.map(function(s) {
|
|
1351
1313
|
return s.data();
|
|
@@ -1361,7 +1323,7 @@ If *data* is not specified, this method returns the current primary data array,
|
|
|
1361
1323
|
activeIds = activeIds.filter(function(id, i) {
|
|
1362
1324
|
return activeIds.indexOf(id) === i;
|
|
1363
1325
|
});
|
|
1364
|
-
if (activeIds.length) hoverFunction = function(d, i) {
|
|
1326
|
+
if (activeIds.length) hoverFunction = function hoverFunction(d, i) {
|
|
1365
1327
|
return activeIds.includes(JSON.stringify(_this._ids(d, i)));
|
|
1366
1328
|
};
|
|
1367
1329
|
}
|
|
@@ -1375,264 +1337,192 @@ If *data* is not specified, this method returns the current primary data array,
|
|
|
1375
1337
|
},
|
|
1376
1338
|
{
|
|
1377
1339
|
/**
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
@param {Function|String} [*value*]
|
|
1381
|
-
@chainable
|
|
1382
|
-
*/ key: "label",
|
|
1340
|
+
Accessor function or string key for the label of each data point.
|
|
1341
|
+
*/ key: "label",
|
|
1383
1342
|
value: function label(_) {
|
|
1384
1343
|
return arguments.length ? (this._label = typeof _ === "function" ? _ : constant(_), this) : this._label;
|
|
1385
1344
|
}
|
|
1386
1345
|
},
|
|
1387
1346
|
{
|
|
1388
1347
|
/**
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
@param {Boolean|Function} [*value* = true]
|
|
1392
|
-
@chainable
|
|
1393
|
-
*/ key: "legend",
|
|
1348
|
+
Whether to display the legend.
|
|
1349
|
+
*/ key: "legend",
|
|
1394
1350
|
value: function legend(_) {
|
|
1395
1351
|
return arguments.length ? (this._legend = typeof _ === "function" ? _ : constant(_), this) : this._legend;
|
|
1396
1352
|
}
|
|
1397
1353
|
},
|
|
1398
1354
|
{
|
|
1399
1355
|
/**
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
@param {Object} [*value*]
|
|
1403
|
-
@chainable
|
|
1404
|
-
*/ key: "legendConfig",
|
|
1356
|
+
Configuration object passed to the legend's config method.
|
|
1357
|
+
*/ key: "legendConfig",
|
|
1405
1358
|
value: function legendConfig(_) {
|
|
1406
1359
|
return arguments.length ? (this._legendConfig = assign(this._legendConfig, _), this) : this._legendConfig;
|
|
1407
1360
|
}
|
|
1408
1361
|
},
|
|
1409
1362
|
{
|
|
1410
1363
|
/**
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
@param {Boolean|Function} [*value* = false]
|
|
1414
|
-
@chainable
|
|
1415
|
-
*/ key: "legendFilterInvert",
|
|
1364
|
+
Defines the click functionality of categorical legend squares. When set to false, clicking will hide that category and shift+clicking will solo that category. When set to true, clicking with solo that category and shift+clicking will hide that category.
|
|
1365
|
+
*/ key: "legendFilterInvert",
|
|
1416
1366
|
value: function legendFilterInvert(_) {
|
|
1417
1367
|
return arguments.length ? (this._legendFilterInvert = typeof _ === "function" ? _ : constant(_), this) : this._legendFilterInvert;
|
|
1418
1368
|
}
|
|
1419
1369
|
},
|
|
1420
1370
|
{
|
|
1421
1371
|
/**
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
@param {Boolean|Function} [*value*]
|
|
1425
|
-
@chainable
|
|
1426
|
-
*/ key: "legendPadding",
|
|
1372
|
+
Tells the legend whether or not to use the internal padding defined by the visualization in it's positioning. For example, d3plus-plot will add padding on the left so that the legend appears centered underneath the x-axis. By default, this padding is only applied on screens larger than 600 pixels wide.
|
|
1373
|
+
*/ key: "legendPadding",
|
|
1427
1374
|
value: function legendPadding(_) {
|
|
1428
1375
|
return arguments.length ? (this._legendPadding = typeof _ === "function" ? _ : constant(_), this) : this._legendPadding;
|
|
1429
1376
|
}
|
|
1430
1377
|
},
|
|
1431
1378
|
{
|
|
1432
1379
|
/**
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
@param {Function|String} [*value* = "bottom"]
|
|
1436
|
-
@chainable
|
|
1437
|
-
*/ key: "legendPosition",
|
|
1380
|
+
Defines which side of the visualization to anchor the legend. Expected values are `"top"`, `"bottom"`, `"left"`, and `"right"`.
|
|
1381
|
+
*/ key: "legendPosition",
|
|
1438
1382
|
value: function legendPosition(_) {
|
|
1439
1383
|
return arguments.length ? (this._legendPosition = typeof _ === "function" ? _ : constant(_), this) : this._legendPosition;
|
|
1440
1384
|
}
|
|
1441
1385
|
},
|
|
1442
1386
|
{
|
|
1443
1387
|
/**
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
@param {Function} *value*
|
|
1447
|
-
@chainable
|
|
1448
|
-
*/ key: "legendSort",
|
|
1388
|
+
A JavaScript [sort comparator function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) used to sort the legend.
|
|
1389
|
+
*/ key: "legendSort",
|
|
1449
1390
|
value: function legendSort(_) {
|
|
1450
1391
|
return arguments.length ? (this._legendSort = _, this) : this._legendSort;
|
|
1451
1392
|
}
|
|
1452
1393
|
},
|
|
1453
1394
|
{
|
|
1454
1395
|
/**
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
@param {Object} [*value* = {}]
|
|
1458
|
-
@chainable
|
|
1459
|
-
*/ key: "legendTooltip",
|
|
1396
|
+
Configuration object for the legend tooltip.
|
|
1397
|
+
*/ key: "legendTooltip",
|
|
1460
1398
|
value: function legendTooltip(_) {
|
|
1461
1399
|
return arguments.length ? (this._legendTooltip = assign(this._legendTooltip, _), this) : this._legendTooltip;
|
|
1462
1400
|
}
|
|
1463
1401
|
},
|
|
1464
1402
|
{
|
|
1465
1403
|
/**
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
@param {Function|String} [*value*]
|
|
1469
|
-
@chainable
|
|
1470
|
-
*/ key: "loadingHTML",
|
|
1404
|
+
The inner HTML of the status message displayed when loading AJAX requests and displaying errors. Must be a valid HTML string or a function that, when passed this Viz instance, returns a valid HTML string.
|
|
1405
|
+
*/ key: "loadingHTML",
|
|
1471
1406
|
value: function loadingHTML(_) {
|
|
1472
1407
|
return arguments.length ? (this._loadingHTML = typeof _ === "function" ? _ : constant(_), this) : this._loadingHTML;
|
|
1473
1408
|
}
|
|
1474
1409
|
},
|
|
1475
1410
|
{
|
|
1476
1411
|
/**
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
@param {Boolean} [*value* = true]
|
|
1480
|
-
@chainable
|
|
1481
|
-
*/ key: "loadingMessage",
|
|
1412
|
+
Toggles the visibility of the status message that is displayed when loading AJAX requests and displaying errors.
|
|
1413
|
+
*/ key: "loadingMessage",
|
|
1482
1414
|
value: function loadingMessage(_) {
|
|
1483
1415
|
return arguments.length ? (this._loadingMessage = _, this) : this._loadingMessage;
|
|
1484
1416
|
}
|
|
1485
1417
|
},
|
|
1486
1418
|
{
|
|
1487
1419
|
/**
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
@param {Boolean|String} [*value* = "rgba(0, 0, 0, 0.1)"]
|
|
1491
|
-
@chainable
|
|
1492
|
-
*/ key: "messageMask",
|
|
1420
|
+
The color of the mask displayed underneath the status message when loading AJAX requests and displaying errors. Set to `false` to turn off the mask completely.
|
|
1421
|
+
*/ key: "messageMask",
|
|
1493
1422
|
value: function messageMask(_) {
|
|
1494
1423
|
return arguments.length ? (this._messageMask = _, this) : this._messageMask;
|
|
1495
1424
|
}
|
|
1496
1425
|
},
|
|
1497
1426
|
{
|
|
1498
1427
|
/**
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
@param {Object} [*value*]
|
|
1502
|
-
@chainable
|
|
1503
|
-
*/ key: "messageStyle",
|
|
1428
|
+
Defines the CSS style properties for the status message that is displayed when loading AJAX requests and displaying errors.
|
|
1429
|
+
*/ key: "messageStyle",
|
|
1504
1430
|
value: function messageStyle(_) {
|
|
1505
1431
|
return arguments.length ? (this._messageStyle = assign(this._messageStyle, _), this) : this._messageStyle;
|
|
1506
1432
|
}
|
|
1507
1433
|
},
|
|
1508
1434
|
{
|
|
1509
1435
|
/**
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
@param {Function|String} [*value*]
|
|
1513
|
-
@chainable
|
|
1514
|
-
*/ key: "noDataHTML",
|
|
1436
|
+
The inner HTML of the status message displayed when no data is supplied to the visualization. Must be a valid HTML string or a function that, when passed this Viz instance, returns a valid HTML string.
|
|
1437
|
+
*/ key: "noDataHTML",
|
|
1515
1438
|
value: function noDataHTML(_) {
|
|
1516
1439
|
return arguments.length ? (this._noDataHTML = typeof _ === "function" ? _ : constant(_), this) : this._noDataHTML;
|
|
1517
1440
|
}
|
|
1518
1441
|
},
|
|
1519
1442
|
{
|
|
1520
1443
|
/**
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
@param {Boolean} [*value* = true]
|
|
1524
|
-
@chainable
|
|
1525
|
-
*/ key: "noDataMessage",
|
|
1444
|
+
Toggles the visibility of the status message that is displayed when no data is supplied to the visualization.
|
|
1445
|
+
*/ key: "noDataMessage",
|
|
1526
1446
|
value: function noDataMessage(_) {
|
|
1527
1447
|
return arguments.length ? (this._noDataMessage = _, this) : this._noDataMessage;
|
|
1528
1448
|
}
|
|
1529
1449
|
},
|
|
1530
1450
|
{
|
|
1531
1451
|
/**
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
@param {String|HTMLElement} *selector*
|
|
1535
|
-
@chainable
|
|
1536
|
-
*/ key: "scrollContainer",
|
|
1452
|
+
If using scroll or visibility detection, this method allow a custom override of the element to which the scroll detection function gets attached.
|
|
1453
|
+
*/ key: "scrollContainer",
|
|
1537
1454
|
value: function scrollContainer(_) {
|
|
1538
1455
|
return arguments.length ? (this._scrollContainer = _, this) : this._scrollContainer;
|
|
1539
1456
|
}
|
|
1540
1457
|
},
|
|
1541
1458
|
{
|
|
1542
1459
|
/**
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
@param {String|HTMLElement} [*selector*]
|
|
1546
|
-
@chainable
|
|
1547
|
-
*/ key: "select",
|
|
1460
|
+
The SVG container element as a d3 selector or DOM element. Defaults to `undefined`.
|
|
1461
|
+
*/ key: "select",
|
|
1548
1462
|
value: function select1(_) {
|
|
1549
1463
|
return arguments.length ? (this._select = select(_), this) : this._select;
|
|
1550
1464
|
}
|
|
1551
1465
|
},
|
|
1552
1466
|
{
|
|
1553
1467
|
/**
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
@param {String|Function} [*value*]
|
|
1557
|
-
@chainable
|
|
1558
|
-
*/ key: "shape",
|
|
1468
|
+
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.
|
|
1469
|
+
*/ key: "shape",
|
|
1559
1470
|
value: function shape(_) {
|
|
1560
1471
|
return arguments.length ? (this._shape = typeof _ === "function" ? _ : constant(_), this) : this._shape;
|
|
1561
1472
|
}
|
|
1562
1473
|
},
|
|
1563
1474
|
{
|
|
1564
1475
|
/**
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
@param {Object} [*value*]
|
|
1568
|
-
@chainable
|
|
1569
|
-
*/ key: "shapeConfig",
|
|
1476
|
+
Configuration object with key/value pairs applied as method calls on each shape.
|
|
1477
|
+
*/ key: "shapeConfig",
|
|
1570
1478
|
value: function shapeConfig(_) {
|
|
1571
1479
|
return arguments.length ? (this._shapeConfig = assign(this._shapeConfig, _), this) : this._shapeConfig;
|
|
1572
1480
|
}
|
|
1573
1481
|
},
|
|
1574
1482
|
{
|
|
1575
1483
|
/**
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
@param {Function|String} [*value*]
|
|
1579
|
-
@chainable
|
|
1580
|
-
*/ key: "subtitle",
|
|
1484
|
+
Accessor function or string for the visualization's subtitle.
|
|
1485
|
+
*/ key: "subtitle",
|
|
1581
1486
|
value: function subtitle(_) {
|
|
1582
1487
|
return arguments.length ? (this._subtitle = typeof _ === "function" ? _ : constant(_), this) : this._subtitle;
|
|
1583
1488
|
}
|
|
1584
1489
|
},
|
|
1585
1490
|
{
|
|
1586
1491
|
/**
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
@param {Object} [*value*]
|
|
1590
|
-
@chainable
|
|
1591
|
-
*/ key: "subtitleConfig",
|
|
1492
|
+
Configuration object for the subtitle.
|
|
1493
|
+
*/ key: "subtitleConfig",
|
|
1592
1494
|
value: function subtitleConfig(_) {
|
|
1593
1495
|
return arguments.length ? (this._subtitleConfig = assign(this._subtitleConfig, _), this) : this._subtitleConfig;
|
|
1594
1496
|
}
|
|
1595
1497
|
},
|
|
1596
1498
|
{
|
|
1597
1499
|
/**
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
@param {Boolean|Function} [*value*]
|
|
1601
|
-
@chainable
|
|
1602
|
-
*/ key: "subtitlePadding",
|
|
1500
|
+
Tells the subtitle whether or not to use the internal padding defined by the visualization in it's positioning. For example, d3plus-plot will add padding on the left so that the subtitle appears centered above the x-axis. By default, this padding is only applied on screens larger than 600 pixels wide.
|
|
1501
|
+
*/ key: "subtitlePadding",
|
|
1603
1502
|
value: function subtitlePadding(_) {
|
|
1604
1503
|
return arguments.length ? (this._subtitlePadding = typeof _ === "function" ? _ : constant(_), this) : this._subtitlePadding;
|
|
1605
1504
|
}
|
|
1606
1505
|
},
|
|
1607
1506
|
{
|
|
1608
1507
|
/**
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
@param {String} [*value*]
|
|
1612
|
-
@chainable
|
|
1613
|
-
*/ key: "svgDesc",
|
|
1508
|
+
The description text for the SVG `<desc>` element, used for accessibility.
|
|
1509
|
+
*/ key: "svgDesc",
|
|
1614
1510
|
value: function svgDesc(_) {
|
|
1615
1511
|
return arguments.length ? (this._svgDesc = _, this) : this._svgDesc;
|
|
1616
1512
|
}
|
|
1617
1513
|
},
|
|
1618
1514
|
{
|
|
1619
1515
|
/**
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
@param {String} [*value*]
|
|
1623
|
-
@chainable
|
|
1624
|
-
*/ key: "svgTitle",
|
|
1516
|
+
The title text for the SVG `<title>` element, used for accessibility.
|
|
1517
|
+
*/ key: "svgTitle",
|
|
1625
1518
|
value: function svgTitle(_) {
|
|
1626
1519
|
return arguments.length ? (this._svgTitle = _, this) : this._svgTitle;
|
|
1627
1520
|
}
|
|
1628
1521
|
},
|
|
1629
1522
|
{
|
|
1630
1523
|
/**
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
@param {Function|Number} [value]
|
|
1634
|
-
@chainable
|
|
1635
|
-
*/ key: "threshold",
|
|
1524
|
+
The threshold value for bucketing small data points together.
|
|
1525
|
+
*/ key: "threshold",
|
|
1636
1526
|
value: function threshold(_) {
|
|
1637
1527
|
if (arguments.length) {
|
|
1638
1528
|
if (typeof _ === "function") {
|
|
@@ -1646,11 +1536,9 @@ If *data* is not specified, this method returns the current primary data array,
|
|
|
1646
1536
|
},
|
|
1647
1537
|
{
|
|
1648
1538
|
/**
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
@chainable
|
|
1653
|
-
*/ key: "thresholdKey",
|
|
1539
|
+
Accessor for the value used in the threshold algorithm.
|
|
1540
|
+
@param key The data key used to group values for thresholding.
|
|
1541
|
+
*/ key: "thresholdKey",
|
|
1654
1542
|
value: function thresholdKey(key) {
|
|
1655
1543
|
if (arguments.length) {
|
|
1656
1544
|
if (typeof key === "function") {
|
|
@@ -1664,22 +1552,16 @@ If *data* is not specified, this method returns the current primary data array,
|
|
|
1664
1552
|
},
|
|
1665
1553
|
{
|
|
1666
1554
|
/**
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
@param {Function|String} [value]
|
|
1670
|
-
@chainable
|
|
1671
|
-
*/ key: "thresholdName",
|
|
1555
|
+
The label displayed for bucketed threshold items.
|
|
1556
|
+
*/ key: "thresholdName",
|
|
1672
1557
|
value: function thresholdName(_) {
|
|
1673
1558
|
return arguments.length ? (this._thresholdName = typeof _ === "function" ? _ : constant(_), this) : this._thresholdName;
|
|
1674
1559
|
}
|
|
1675
1560
|
},
|
|
1676
1561
|
{
|
|
1677
1562
|
/**
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
@param {Function|String} [*value*]
|
|
1681
|
-
@chainable
|
|
1682
|
-
*/ key: "time",
|
|
1563
|
+
Accessor function or string key for the time dimension of each data point.
|
|
1564
|
+
*/ key: "time",
|
|
1683
1565
|
value: function time(_) {
|
|
1684
1566
|
if (arguments.length) {
|
|
1685
1567
|
if (typeof _ === "function") {
|
|
@@ -1709,128 +1591,99 @@ If *data* is not specified, this method returns the current primary data array,
|
|
|
1709
1591
|
},
|
|
1710
1592
|
{
|
|
1711
1593
|
/**
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
@param {Function} [*value*]
|
|
1715
|
-
@chainable
|
|
1716
|
-
*/ key: "timeFilter",
|
|
1594
|
+
A filter function that limits which time periods are shown.
|
|
1595
|
+
*/ key: "timeFilter",
|
|
1717
1596
|
value: function timeFilter(_) {
|
|
1718
1597
|
return arguments.length ? (this._timeFilter = _, this) : this._timeFilter;
|
|
1719
1598
|
}
|
|
1720
1599
|
},
|
|
1721
1600
|
{
|
|
1722
1601
|
/**
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
@param {Boolean} [*value* = true]
|
|
1726
|
-
@chainable
|
|
1727
|
-
*/ key: "timeline",
|
|
1602
|
+
Whether to display the timeline.
|
|
1603
|
+
*/ key: "timeline",
|
|
1728
1604
|
value: function timeline(_) {
|
|
1729
1605
|
return arguments.length ? (this._timeline = _, this) : this._timeline;
|
|
1730
1606
|
}
|
|
1731
1607
|
},
|
|
1732
1608
|
{
|
|
1733
1609
|
/**
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
@param {Object} [*value*]
|
|
1737
|
-
@chainable
|
|
1738
|
-
*/ key: "timelineConfig",
|
|
1610
|
+
Configuration object for the timeline.
|
|
1611
|
+
*/ key: "timelineConfig",
|
|
1739
1612
|
value: function timelineConfig(_) {
|
|
1740
1613
|
return arguments.length ? (this._timelineConfig = assign(this._timelineConfig, _), this) : this._timelineConfig;
|
|
1741
1614
|
}
|
|
1742
1615
|
},
|
|
1743
1616
|
{
|
|
1744
1617
|
/**
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
@param {Date|String|Array} [*value*]
|
|
1748
|
-
@chainable
|
|
1749
|
-
*/ key: "timelineDefault",
|
|
1618
|
+
The starting time or range for the timeline. Can be a single Date/String, or an Array of 2 values representing the min and max.
|
|
1619
|
+
*/ key: "timelineDefault",
|
|
1750
1620
|
value: function timelineDefault(_) {
|
|
1751
1621
|
if (arguments.length) {
|
|
1752
1622
|
if (!_instanceof(_, Array)) _ = [
|
|
1753
1623
|
_,
|
|
1754
1624
|
_
|
|
1755
1625
|
];
|
|
1756
|
-
this._timelineDefault = _.map(
|
|
1626
|
+
this._timelineDefault = _.map(function(d) {
|
|
1627
|
+
return date(d);
|
|
1628
|
+
}).filter(function(d) {
|
|
1629
|
+
return d !== false;
|
|
1630
|
+
});
|
|
1757
1631
|
return this;
|
|
1758
1632
|
} else return this._timelineDefault;
|
|
1759
1633
|
}
|
|
1760
1634
|
},
|
|
1761
1635
|
{
|
|
1762
1636
|
/**
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
@param {Boolean|Function} [*value*]
|
|
1766
|
-
@chainable
|
|
1767
|
-
*/ key: "timelinePadding",
|
|
1637
|
+
Tells the timeline whether or not to use the internal padding defined by the visualization in it's positioning. For example, d3plus-plot will add padding on the left so that the timeline appears centered underneath the x-axis. By default, this padding is only applied on screens larger than 600 pixels wide.
|
|
1638
|
+
*/ key: "timelinePadding",
|
|
1768
1639
|
value: function timelinePadding(_) {
|
|
1769
1640
|
return arguments.length ? (this._timelinePadding = typeof _ === "function" ? _ : constant(_), this) : this._timelinePadding;
|
|
1770
1641
|
}
|
|
1771
1642
|
},
|
|
1772
1643
|
{
|
|
1773
1644
|
/**
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
@param {Function|String} [*value*]
|
|
1777
|
-
@chainable
|
|
1778
|
-
*/ key: "title",
|
|
1645
|
+
Accessor function or string for the visualization's title.
|
|
1646
|
+
*/ key: "title",
|
|
1779
1647
|
value: function title(_) {
|
|
1780
1648
|
return arguments.length ? (this._title = typeof _ === "function" ? _ : constant(_), this) : this._title;
|
|
1781
1649
|
}
|
|
1782
1650
|
},
|
|
1783
1651
|
{
|
|
1784
1652
|
/**
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
@param {Object} [*value*]
|
|
1788
|
-
@chainable
|
|
1789
|
-
*/ key: "titleConfig",
|
|
1653
|
+
Configuration object for the title.
|
|
1654
|
+
*/ key: "titleConfig",
|
|
1790
1655
|
value: function titleConfig(_) {
|
|
1791
1656
|
return arguments.length ? (this._titleConfig = assign(this._titleConfig, _), this) : this._titleConfig;
|
|
1792
1657
|
}
|
|
1793
1658
|
},
|
|
1794
1659
|
{
|
|
1795
1660
|
/**
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
@param {Boolean|Function} [*value*]
|
|
1799
|
-
@chainable
|
|
1800
|
-
*/ key: "titlePadding",
|
|
1661
|
+
Tells the title whether or not to use the internal padding defined by the visualization in it's positioning. For example, d3plus-plot will add padding on the left so that the title appears centered above the x-axis. By default, this padding is only applied on screens larger than 600 pixels wide.
|
|
1662
|
+
*/ key: "titlePadding",
|
|
1801
1663
|
value: function titlePadding(_) {
|
|
1802
1664
|
return arguments.length ? (this._titlePadding = typeof _ === "function" ? _ : constant(_), this) : this._titlePadding;
|
|
1803
1665
|
}
|
|
1804
1666
|
},
|
|
1805
1667
|
{
|
|
1806
1668
|
/**
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
@param {Boolean|Function} [*value* = true]
|
|
1810
|
-
@chainable
|
|
1811
|
-
*/ key: "tooltip",
|
|
1669
|
+
Whether to display tooltips on hover.
|
|
1670
|
+
*/ key: "tooltip",
|
|
1812
1671
|
value: function tooltip(_) {
|
|
1813
1672
|
return arguments.length ? (this._tooltip = typeof _ === "function" ? _ : constant(_), this) : this._tooltip;
|
|
1814
1673
|
}
|
|
1815
1674
|
},
|
|
1816
1675
|
{
|
|
1817
1676
|
/**
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
@param {Object} [*value*]
|
|
1821
|
-
@chainable
|
|
1822
|
-
*/ key: "tooltipConfig",
|
|
1677
|
+
Configuration object for the tooltip.
|
|
1678
|
+
*/ key: "tooltipConfig",
|
|
1823
1679
|
value: function tooltipConfig(_) {
|
|
1824
1680
|
return arguments.length ? (this._tooltipConfig = assign(this._tooltipConfig, _), this) : this._tooltipConfig;
|
|
1825
1681
|
}
|
|
1826
1682
|
},
|
|
1827
1683
|
{
|
|
1828
1684
|
/**
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
@param {Boolean|Function|String} [*value*]
|
|
1832
|
-
@chainable
|
|
1833
|
-
*/ key: "total",
|
|
1685
|
+
Accessor function or string key for the total value displayed in the visualization.
|
|
1686
|
+
*/ key: "total",
|
|
1834
1687
|
value: function total(_) {
|
|
1835
1688
|
if (arguments.length) {
|
|
1836
1689
|
if (typeof _ === "function") this._total = _;
|
|
@@ -1842,176 +1695,128 @@ If *data* is not specified, this method returns the current primary data array,
|
|
|
1842
1695
|
},
|
|
1843
1696
|
{
|
|
1844
1697
|
/**
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
@param {Object} [*value*]
|
|
1848
|
-
@chainable
|
|
1849
|
-
*/ key: "totalConfig",
|
|
1698
|
+
Configuration object for the total bar.
|
|
1699
|
+
*/ key: "totalConfig",
|
|
1850
1700
|
value: function totalConfig(_) {
|
|
1851
1701
|
return arguments.length ? (this._totalConfig = assign(this._totalConfig, _), this) : this._totalConfig;
|
|
1852
1702
|
}
|
|
1853
1703
|
},
|
|
1854
1704
|
{
|
|
1855
1705
|
/**
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
@param {Function} *value*
|
|
1859
|
-
@chainable
|
|
1860
|
-
*/ key: "totalFormat",
|
|
1706
|
+
Formatter function for the value in the total bar.
|
|
1707
|
+
*/ key: "totalFormat",
|
|
1861
1708
|
value: function totalFormat(_) {
|
|
1862
1709
|
return arguments.length ? (this._totalFormat = _, this) : this._totalFormat;
|
|
1863
1710
|
}
|
|
1864
1711
|
},
|
|
1865
1712
|
{
|
|
1866
1713
|
/**
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
@param {Boolean|Function} [*value*]
|
|
1870
|
-
@chainable
|
|
1871
|
-
*/ key: "totalPadding",
|
|
1714
|
+
Tells the total whether or not to use the internal padding defined by the visualization in it's positioning. For example, d3plus-plot will add padding on the left so that the total appears centered above the x-axis. By default, this padding is only applied on screens larger than 600 pixels wide.
|
|
1715
|
+
*/ key: "totalPadding",
|
|
1872
1716
|
value: function totalPadding(_) {
|
|
1873
1717
|
return arguments.length ? (this._totalPadding = typeof _ === "function" ? _ : constant(_), this) : this._totalPadding;
|
|
1874
1718
|
}
|
|
1875
1719
|
},
|
|
1876
1720
|
{
|
|
1877
1721
|
/**
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
@param {Number} [*value* = window.innerWidth]
|
|
1881
|
-
@chainable
|
|
1882
|
-
*/ key: "width",
|
|
1722
|
+
The overall width of the visualization in pixels.
|
|
1723
|
+
*/ key: "width",
|
|
1883
1724
|
value: function width(_) {
|
|
1884
1725
|
return arguments.length ? (this._width = _, this) : this._width;
|
|
1885
1726
|
}
|
|
1886
1727
|
},
|
|
1887
1728
|
{
|
|
1888
1729
|
/**
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
@param {Boolean} *value* = false
|
|
1892
|
-
@chainable
|
|
1893
|
-
*/ key: "zoom",
|
|
1730
|
+
Toggles the ability to zoom/pan the visualization. Certain parameters for zooming are required to be hooked up on a visualization by visualization basis.
|
|
1731
|
+
*/ key: "zoom",
|
|
1894
1732
|
value: function zoom(_) {
|
|
1895
1733
|
return arguments.length ? (this._zoom = _, this) : this._zoom;
|
|
1896
1734
|
}
|
|
1897
1735
|
},
|
|
1898
1736
|
{
|
|
1899
1737
|
/**
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
@param {Number} *value* = 1
|
|
1903
|
-
@chainable
|
|
1904
|
-
*/ key: "zoomBrushHandleSize",
|
|
1738
|
+
The pixel stroke-width of the zoom brush area.
|
|
1739
|
+
*/ key: "zoomBrushHandleSize",
|
|
1905
1740
|
value: function zoomBrushHandleSize(_) {
|
|
1906
1741
|
return arguments.length ? (this._zoomBrushHandleSize = _, this) : this._zoomBrushHandleSize;
|
|
1907
1742
|
}
|
|
1908
1743
|
},
|
|
1909
1744
|
{
|
|
1910
1745
|
/**
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
@param {Object|Boolean} *value*
|
|
1914
|
-
@chainable
|
|
1915
|
-
*/ key: "zoomBrushHandleStyle",
|
|
1746
|
+
An object containing CSS key/value pairs that is used to style the outer handle area of the zoom brush. Passing `false` will remove all default styling.
|
|
1747
|
+
*/ key: "zoomBrushHandleStyle",
|
|
1916
1748
|
value: function zoomBrushHandleStyle(_) {
|
|
1917
1749
|
return arguments.length ? (this._zoomBrushHandleStyle = _, this) : this._zoomBrushHandleStyle;
|
|
1918
1750
|
}
|
|
1919
1751
|
},
|
|
1920
1752
|
{
|
|
1921
1753
|
/**
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
@param {Object|Boolean} *value*
|
|
1925
|
-
@chainable
|
|
1926
|
-
*/ key: "zoomBrushSelectionStyle",
|
|
1754
|
+
An object containing CSS key/value pairs that is used to style the inner selection area of the zoom brush. Passing `false` will remove all default styling.
|
|
1755
|
+
*/ key: "zoomBrushSelectionStyle",
|
|
1927
1756
|
value: function zoomBrushSelectionStyle(_) {
|
|
1928
1757
|
return arguments.length ? (this._zoomBrushSelectionStyle = _, this) : this._zoomBrushSelectionStyle;
|
|
1929
1758
|
}
|
|
1930
1759
|
},
|
|
1931
1760
|
{
|
|
1932
1761
|
/**
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
@param {Object|Boolean} *value*
|
|
1936
|
-
@chainable
|
|
1937
|
-
*/ key: "zoomControlStyle",
|
|
1762
|
+
An object containing CSS key/value pairs that is used to style each zoom control button (`.zoom-in`, `.zoom-out`, `.zoom-reset`, and `.zoom-brush`). Passing `false` will remove all default styling.
|
|
1763
|
+
*/ key: "zoomControlStyle",
|
|
1938
1764
|
value: function zoomControlStyle(_) {
|
|
1939
1765
|
return arguments.length ? (this._zoomControlStyle = _, this) : this._zoomControlStyle;
|
|
1940
1766
|
}
|
|
1941
1767
|
},
|
|
1942
1768
|
{
|
|
1943
1769
|
/**
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
@param {Object|Boolean} *value*
|
|
1947
|
-
@chainable
|
|
1948
|
-
*/ key: "zoomControlStyleActive",
|
|
1770
|
+
An object containing CSS key/value pairs that is used to style each zoom control button when active (`.zoom-in`, `.zoom-out`, `.zoom-reset`, and `.zoom-brush`). Passing `false` will remove all default styling.
|
|
1771
|
+
*/ key: "zoomControlStyleActive",
|
|
1949
1772
|
value: function zoomControlStyleActive(_) {
|
|
1950
1773
|
return arguments.length ? (this._zoomControlStyleActive = _, this) : this._zoomControlStyleActive;
|
|
1951
1774
|
}
|
|
1952
1775
|
},
|
|
1953
1776
|
{
|
|
1954
1777
|
/**
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
@param {Object|Boolean} *value*
|
|
1958
|
-
@chainable
|
|
1959
|
-
*/ key: "zoomControlStyleHover",
|
|
1778
|
+
An object containing CSS key/value pairs that is used to style each zoom control button on hover (`.zoom-in`, `.zoom-out`, `.zoom-reset`, and `.zoom-brush`). Passing `false` will remove all default styling.
|
|
1779
|
+
*/ key: "zoomControlStyleHover",
|
|
1960
1780
|
value: function zoomControlStyleHover(_) {
|
|
1961
1781
|
return arguments.length ? (this._zoomControlStyleHover = _, this) : this._zoomControlStyleHover;
|
|
1962
1782
|
}
|
|
1963
1783
|
},
|
|
1964
1784
|
{
|
|
1965
1785
|
/**
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
@param {Number} *value* = 2
|
|
1969
|
-
@chainable
|
|
1970
|
-
*/ key: "zoomFactor",
|
|
1786
|
+
The multiplier that is used in with the control buttons when zooming in and out.
|
|
1787
|
+
*/ key: "zoomFactor",
|
|
1971
1788
|
value: function zoomFactor(_) {
|
|
1972
1789
|
return arguments.length ? (this._zoomFactor = _, this) : this._zoomFactor;
|
|
1973
1790
|
}
|
|
1974
1791
|
},
|
|
1975
1792
|
{
|
|
1976
1793
|
/**
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
@param {Number} *value* = 16
|
|
1980
|
-
@chainable
|
|
1981
|
-
*/ key: "zoomMax",
|
|
1794
|
+
The max zoom scale.
|
|
1795
|
+
*/ key: "zoomMax",
|
|
1982
1796
|
value: function zoomMax(_) {
|
|
1983
1797
|
return arguments.length ? (this._zoomMax = _, this) : this._zoomMax;
|
|
1984
1798
|
}
|
|
1985
1799
|
},
|
|
1986
1800
|
{
|
|
1987
1801
|
/**
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
@param {Boolean} *value* = true
|
|
1991
|
-
@chainable
|
|
1992
|
-
*/ key: "zoomPan",
|
|
1802
|
+
Toggles panning.
|
|
1803
|
+
*/ key: "zoomPan",
|
|
1993
1804
|
value: function zoomPan(_) {
|
|
1994
1805
|
return arguments.length ? (this._zoomPan = _, this) : this._zoomPan;
|
|
1995
1806
|
}
|
|
1996
1807
|
},
|
|
1997
1808
|
{
|
|
1998
1809
|
/**
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
@param {Number} *value* = 20
|
|
2002
|
-
@chainable
|
|
2003
|
-
*/ key: "zoomPadding",
|
|
1810
|
+
A pixel value to be used to pad all sides of a zoomed area.
|
|
1811
|
+
*/ key: "zoomPadding",
|
|
2004
1812
|
value: function zoomPadding(_) {
|
|
2005
1813
|
return arguments.length ? (this._zoomPadding = _, this) : this._zoomPadding;
|
|
2006
1814
|
}
|
|
2007
1815
|
},
|
|
2008
1816
|
{
|
|
2009
1817
|
/**
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
@param {Boolean} [*value* = true]
|
|
2013
|
-
@chainable
|
|
2014
|
-
*/ key: "zoomScroll",
|
|
1818
|
+
Toggles scroll zooming.
|
|
1819
|
+
*/ key: "zoomScroll",
|
|
2015
1820
|
value: function zoomScroll(_) {
|
|
2016
1821
|
return arguments.length ? (this._zoomScroll = _, this) : this._zoomScroll;
|
|
2017
1822
|
}
|
|
@@ -2020,7 +1825,6 @@ If *data* is not specified, this method returns the current primary data array,
|
|
|
2020
1825
|
return Viz;
|
|
2021
1826
|
}(BaseClass);
|
|
2022
1827
|
/**
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
*/ export { Viz as default };
|
|
1828
|
+
Creates an x/y plot based on an array of data. See [this example](https://d3plus.org/examples/d3plus-treemap/getting-started/) for help getting started using the treemap generator.
|
|
1829
|
+
*/ // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1830
|
+
export { Viz as default };
|