billboard.js 3.11.1 → 3.11.3
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/README.md +1 -1
- package/dist/billboard.css +1 -1
- package/dist/billboard.js +209 -124
- package/dist/billboard.min.css +1 -1
- package/dist/billboard.min.js +2 -2
- package/dist/billboard.pkgd.js +209 -124
- package/dist/billboard.pkgd.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-bubblecompare.js +2 -2
- package/dist/plugin/billboardjs-plugin-bubblecompare.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-sparkline.js +2 -2
- package/dist/plugin/billboardjs-plugin-sparkline.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-stanford.js +2 -2
- package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-tableview.js +2 -2
- package/dist/plugin/billboardjs-plugin-tableview.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-textoverlap.js +2 -2
- package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.min.js +2 -2
- package/dist/theme/dark.css +1 -1
- package/dist/theme/dark.min.css +1 -1
- package/dist/theme/datalab.css +1 -1
- package/dist/theme/datalab.min.css +1 -1
- package/dist/theme/graph.css +1 -1
- package/dist/theme/graph.min.css +1 -1
- package/dist/theme/insight.css +1 -1
- package/dist/theme/insight.min.css +1 -1
- package/dist/theme/modern.css +1 -1
- package/dist/theme/modern.min.css +1 -1
- package/dist-esm/billboard.js +182 -132
- package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-sparkline.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-stanford.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-tableview.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +2 -2
- package/package.json +17 -17
- package/src/ChartInternal/ChartInternal.ts +2 -2
- package/src/ChartInternal/data/IData.ts +2 -2
- package/src/ChartInternal/data/data.ts +1 -1
- package/src/ChartInternal/data/load.ts +7 -1
- package/src/ChartInternal/internals/clip.ts +1 -6
- package/src/ChartInternal/internals/legend.ts +6 -5
- package/src/ChartInternal/internals/redraw.ts +2 -1
- package/src/ChartInternal/internals/tooltip.ts +10 -6
- package/src/ChartInternal/shape/point.common.ts +134 -0
- package/src/ChartInternal/shape/point.ts +3 -95
- package/src/ChartInternal/shape/shape.ts +1 -1
- package/src/config/Options/common/legend.ts +1 -1
- package/src/config/Store/State.ts +1 -1
- package/src/config/resolver/axis.ts +4 -4
- package/src/config/resolver/shape.ts +22 -10
package/dist/billboard.pkgd.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 3.11.
|
|
8
|
+
* @version 3.11.3
|
|
9
9
|
*
|
|
10
10
|
* All-in-one packaged file for ease use of 'billboard.js' with dependant d3.js modules & polyfills.
|
|
11
11
|
* - @types/d3-selection ^3.0.0
|
|
@@ -26574,7 +26574,7 @@ var data_this = undefined;
|
|
|
26574
26574
|
* - rectangle
|
|
26575
26575
|
* @property {boolean} [legend.format] Set formatter function for legend text.
|
|
26576
26576
|
* The argument:<br>
|
|
26577
|
-
* - `id`: legend text
|
|
26577
|
+
* - `id`: legend text value. When `data.names` is specified, will pass from it, otherwise will pass data id.
|
|
26578
26578
|
* @property {boolean} [legend.tooltip=false] Show full legend text value using system tooltip(via `<title>` element).
|
|
26579
26579
|
* @property {boolean} [legend.usePoint=false] Whether to use custom points in legend.
|
|
26580
26580
|
* @see [Demo: format](https://naver.github.io/billboard.js/demo/#Legend.LegendFormat)
|
|
@@ -29149,7 +29149,8 @@ function callDone(fn, resizeAfter) {
|
|
|
29149
29149
|
const $$ = this,
|
|
29150
29150
|
state = $$.state,
|
|
29151
29151
|
$el = $$.$el,
|
|
29152
|
-
$T = $$.$T
|
|
29152
|
+
$T = $$.$T,
|
|
29153
|
+
hasLegendDefsPoint = !!($$.hasLegendDefsPoint != null && $$.hasLegendDefsPoint());
|
|
29153
29154
|
let done = customDoneCb,
|
|
29154
29155
|
targetIds = rawTargetIds;
|
|
29155
29156
|
// reset internally cached data
|
|
@@ -29177,14 +29178,17 @@ function callDone(fn, resizeAfter) {
|
|
|
29177
29178
|
}.bind(this)));
|
|
29178
29179
|
$T(targets).style("opacity", "0").remove().call(endall, done);
|
|
29179
29180
|
targetIds.forEach(function (id) {
|
|
29180
|
-
var _this4 = this
|
|
29181
|
+
var _this4 = this,
|
|
29182
|
+
_$el$defs;
|
|
29181
29183
|
_newArrowCheck(this, _this3);
|
|
29184
|
+
const suffixId = $$.getTargetSelectorSuffix(id);
|
|
29185
|
+
|
|
29182
29186
|
// Reset fadein for future load
|
|
29183
29187
|
state.withoutFadeIn[id] = !1;
|
|
29184
29188
|
|
|
29185
29189
|
// Remove target's elements
|
|
29186
29190
|
if ($el.legend) {
|
|
29187
|
-
$el.legend.selectAll("." + $LEGEND.legendItem +
|
|
29191
|
+
$el.legend.selectAll("." + $LEGEND.legendItem + suffixId).remove();
|
|
29188
29192
|
}
|
|
29189
29193
|
|
|
29190
29194
|
// Remove target
|
|
@@ -29192,6 +29196,9 @@ function callDone(fn, resizeAfter) {
|
|
|
29192
29196
|
_newArrowCheck(this, _this4);
|
|
29193
29197
|
return t.id !== id;
|
|
29194
29198
|
}.bind(this));
|
|
29199
|
+
|
|
29200
|
+
// Remove custom point def element
|
|
29201
|
+
hasLegendDefsPoint && ((_$el$defs = $el.defs) == null ? void 0 : _$el$defs.select("#" + $$.getDefsPointId(suffixId)).remove());
|
|
29195
29202
|
}.bind(this));
|
|
29196
29203
|
|
|
29197
29204
|
// since treemap uses different data types, it needs to be transformed
|
|
@@ -30950,13 +30957,17 @@ function getLegendColor(id) {
|
|
|
30950
30957
|
/**
|
|
30951
30958
|
* Get formatted text value
|
|
30952
30959
|
* @param {string} id Legend text id
|
|
30960
|
+
* @param {boolean} formatted Whether or not to format the text
|
|
30953
30961
|
* @returns {string} Formatted legend text
|
|
30954
30962
|
*/
|
|
30955
|
-
function getFormattedText(id) {
|
|
30963
|
+
function getFormattedText(id, formatted) {
|
|
30956
30964
|
var _config$data_names$id;
|
|
30965
|
+
if (formatted === void 0) {
|
|
30966
|
+
formatted = !0;
|
|
30967
|
+
}
|
|
30957
30968
|
const config = this.config;
|
|
30958
30969
|
let text = (_config$data_names$id = config.data_names[id]) != null ? _config$data_names$id : id;
|
|
30959
|
-
if (isFunction(config.legend_format)) {
|
|
30970
|
+
if (formatted && isFunction(config.legend_format)) {
|
|
30960
30971
|
text = config.legend_format(text);
|
|
30961
30972
|
}
|
|
30962
30973
|
return text;
|
|
@@ -31461,10 +31472,13 @@ function getFormattedText(id) {
|
|
|
31461
31472
|
if (config.legend_tooltip) {
|
|
31462
31473
|
legend.selectAll("title").data(targetIdz).text(function (id) {
|
|
31463
31474
|
_newArrowCheck(this, _this4);
|
|
31464
|
-
return id;
|
|
31475
|
+
return getFormattedText.bind($$)(id, !1);
|
|
31465
31476
|
}.bind(this));
|
|
31466
31477
|
}
|
|
31467
|
-
const texts = legend.selectAll("text").data(targetIdz).text(
|
|
31478
|
+
const texts = legend.selectAll("text").data(targetIdz).text(function (id) {
|
|
31479
|
+
_newArrowCheck(this, _this4);
|
|
31480
|
+
return getFormattedText.bind($$)(id);
|
|
31481
|
+
}.bind(this)) // MEMO: needed for update
|
|
31468
31482
|
.each(function (id, i) {
|
|
31469
31483
|
updatePositions(this, id, i);
|
|
31470
31484
|
});
|
|
@@ -31605,7 +31619,10 @@ function getFormattedText(id) {
|
|
|
31605
31619
|
return id;
|
|
31606
31620
|
}.bind(this));
|
|
31607
31621
|
}
|
|
31608
|
-
l.append("text").text(
|
|
31622
|
+
l.append("text").text(function (id) {
|
|
31623
|
+
_newArrowCheck(this, _this6);
|
|
31624
|
+
return getFormattedText.bind($$)(id);
|
|
31625
|
+
}.bind(this)).each(function (id, i) {
|
|
31609
31626
|
updatePositions(this, id, i);
|
|
31610
31627
|
}).style("pointer-events", $$.getStylePropValue("none")).attr("x", isLegendRightOrInset ? posFn.xText : -200).attr("y", isLegendRightOrInset ? -200 : posFn.yText);
|
|
31611
31628
|
l.append("rect").attr("class", $LEGEND.legendItemEvent).style("fill-opacity", $$.getStylePropValue("0")).attr("x", isLegendRightOrInset ? posFn.xRect : -200).attr("y", isLegendRightOrInset ? -200 : posFn.yRect);
|
|
@@ -31793,10 +31810,10 @@ function getFormattedText(id) {
|
|
|
31793
31810
|
// treemap
|
|
31794
31811
|
treemap && $$.updateTreemap(durationForExit);
|
|
31795
31812
|
}
|
|
31796
|
-
|
|
31797
|
-
// @TODO: Axis & Radar type
|
|
31798
31813
|
if (!state.resizing && !treemap && ($$.hasPointType() || state.hasRadar)) {
|
|
31799
31814
|
$$.updateCircle();
|
|
31815
|
+
} else if ($$.hasLegendDefsPoint != null && $$.hasLegendDefsPoint()) {
|
|
31816
|
+
$$.data.targets.forEach($$.point("create", this));
|
|
31800
31817
|
}
|
|
31801
31818
|
|
|
31802
31819
|
// text
|
|
@@ -34757,6 +34774,7 @@ function getGroupedDataPointsFn(d) {
|
|
|
34757
34774
|
},
|
|
34758
34775
|
getBarW: function getBarW(type, axis, targetsNum) {
|
|
34759
34776
|
var _config$data_groups,
|
|
34777
|
+
_$$$getZoomTransform,
|
|
34760
34778
|
_config$axis_x_min,
|
|
34761
34779
|
_config$axis_x_max,
|
|
34762
34780
|
_this11 = this;
|
|
@@ -34767,8 +34785,10 @@ function getGroupedDataPointsFn(d) {
|
|
|
34767
34785
|
maxDataCount = $$.getMaxDataCount(),
|
|
34768
34786
|
isGrouped = type === "bar" && ((_config$data_groups = config.data_groups) == null ? void 0 : _config$data_groups.length),
|
|
34769
34787
|
configName = type + "_width",
|
|
34770
|
-
_$$$getZoomTransform = $$.getZoomTransform()
|
|
34771
|
-
|
|
34788
|
+
_ref2 = (_$$$getZoomTransform = $$.getZoomTransform == null ? void 0 : $$.getZoomTransform()) != null ? _$$$getZoomTransform : {
|
|
34789
|
+
k: 1
|
|
34790
|
+
},
|
|
34791
|
+
k = _ref2.k,
|
|
34772
34792
|
xMinMax = [(_config$axis_x_min = config.axis_x_min) != null ? _config$axis_x_min : org.xDomain[0], (_config$axis_x_max = config.axis_x_max) != null ? _config$axis_x_max : org.xDomain[1]].map($$.axis.isTimeSeries() ? parseDate.bind($$) : Number);
|
|
34773
34793
|
let tickInterval = axis.tickInterval(maxDataCount);
|
|
34774
34794
|
if (scale.zoom && !$$.axis.isCategorized() && k > 1) {
|
|
@@ -36236,11 +36256,11 @@ function getTextXPos(pos, width) {
|
|
|
36236
36256
|
width = _state.width,
|
|
36237
36257
|
height = _state.height,
|
|
36238
36258
|
current = _state.current,
|
|
36259
|
+
hasRadar = _state.hasRadar,
|
|
36260
|
+
hasTreemap = _state.hasTreemap,
|
|
36239
36261
|
isLegendRight = _state.isLegendRight,
|
|
36240
36262
|
inputType = _state.inputType,
|
|
36241
36263
|
hasGauge = $$.hasType("gauge") && !config.gauge_fullCircle,
|
|
36242
|
-
hasTreemap = state.hasTreemap,
|
|
36243
|
-
hasRadar = state.hasRadar,
|
|
36244
36264
|
isRotated = config.axis_rotated,
|
|
36245
36265
|
hasArcType = $$.hasArcType(),
|
|
36246
36266
|
svgLeft = $$.getSvgLeft(!0);
|
|
@@ -36254,10 +36274,14 @@ function getTextXPos(pos, width) {
|
|
|
36254
36274
|
x += x >= width / 2 ? 15 : -(tWidth + 15);
|
|
36255
36275
|
y += 15;
|
|
36256
36276
|
} else if (hasArcType) {
|
|
36257
|
-
if (
|
|
36258
|
-
var _$$$getTitlePadding;
|
|
36277
|
+
if (inputType !== "touch") {
|
|
36278
|
+
var _$$$getTitlePadding, _config$arc_rangeText;
|
|
36279
|
+
let titlePadding = (_$$$getTitlePadding = $$.getTitlePadding == null ? void 0 : $$.getTitlePadding()) != null ? _$$$getTitlePadding : 0;
|
|
36280
|
+
if (titlePadding && hasGauge && (_config$arc_rangeText = config.arc_rangeText_values) != null && _config$arc_rangeText.length) {
|
|
36281
|
+
titlePadding += 10;
|
|
36282
|
+
}
|
|
36259
36283
|
x += (width - (isLegendRight ? $$.getLegendWidth() : 0)) / 2;
|
|
36260
|
-
y += (hasGauge ? height : height / 2 + tHeight) +
|
|
36284
|
+
y += (hasGauge ? height : height / 2 + tHeight) + titlePadding;
|
|
36261
36285
|
}
|
|
36262
36286
|
} else if (hasTreemap) {
|
|
36263
36287
|
y += tHeight;
|
|
@@ -37079,7 +37103,7 @@ let ChartInternal = /*#__PURE__*/function () {
|
|
|
37079
37103
|
config.axis_y2_show = !1;
|
|
37080
37104
|
config.subchart_show = !1;
|
|
37081
37105
|
}
|
|
37082
|
-
if ($$.hasPointType()) {
|
|
37106
|
+
if ($$.hasPointType() || $$.hasLegendDefsPoint != null && $$.hasLegendDefsPoint()) {
|
|
37083
37107
|
$$.point = $$.generatePoint();
|
|
37084
37108
|
}
|
|
37085
37109
|
if (state.hasAxis) {
|
|
@@ -37186,7 +37210,7 @@ let ChartInternal = /*#__PURE__*/function () {
|
|
|
37186
37210
|
|
|
37187
37211
|
// Define defs
|
|
37188
37212
|
const hasColorPatterns = isFunction(config.color_tiles) && $$.patterns;
|
|
37189
|
-
if (hasAxis || hasColorPatterns || hasPolar || hasTreemap || config.data_labels_backgroundColors) {
|
|
37213
|
+
if (hasAxis || hasColorPatterns || hasPolar || hasTreemap || config.data_labels_backgroundColors || $$.hasLegendDefsPoint != null && $$.hasLegendDefsPoint()) {
|
|
37190
37214
|
$el.defs = $el.svg.append("defs");
|
|
37191
37215
|
if (hasAxis) {
|
|
37192
37216
|
["id", "idXAxis", "idYAxis", "idGrid"].forEach(function (v) {
|
|
@@ -42628,8 +42652,7 @@ const src_linear_linear = function (t) {
|
|
|
42628
42652
|
if (!config.clipPath && /-clip$/.test(id) || !config.axis_x_clipPath && /-clip-xaxis$/.test(id) || !config.axis_y_clipPath && /-clip-yaxis$/.test(id)) {
|
|
42629
42653
|
return null;
|
|
42630
42654
|
}
|
|
42631
|
-
|
|
42632
|
-
return "url(" + (isIE9 ? "" : browser_doc.URL.split("#")[0]) + "#" + id + ")";
|
|
42655
|
+
return "url(#" + id + ")";
|
|
42633
42656
|
},
|
|
42634
42657
|
appendClip: function appendClip(parent, id) {
|
|
42635
42658
|
id && parent.append("clipPath").attr("id", id).append("rect");
|
|
@@ -45335,8 +45358,20 @@ function axis_objectSpread(e) { for (var r = 1, t; r < arguments.length; r++) {
|
|
|
45335
45358
|
|
|
45336
45359
|
|
|
45337
45360
|
const api = [api_axis, api_category, flow, api_grid, group, api_regions, x];
|
|
45338
|
-
const internal =
|
|
45339
|
-
|
|
45361
|
+
const internal = {
|
|
45362
|
+
axis: Axis,
|
|
45363
|
+
clip: clip,
|
|
45364
|
+
eventrect: eventrect,
|
|
45365
|
+
flow: interactions_flow,
|
|
45366
|
+
grid: internals_grid,
|
|
45367
|
+
region: region,
|
|
45368
|
+
sizeAxis: size_axis
|
|
45369
|
+
};
|
|
45370
|
+
const options = {
|
|
45371
|
+
optDataAxis: data_axis,
|
|
45372
|
+
optAxis: Options_axis_axis,
|
|
45373
|
+
optGrid: common_grid
|
|
45374
|
+
};
|
|
45340
45375
|
;// CONCATENATED MODULE: ./node_modules/d3-shape/src/array.js
|
|
45341
45376
|
var slice = Array.prototype.slice;
|
|
45342
45377
|
/* harmony default export */ function d3_shape_src_array(x) {
|
|
@@ -48175,6 +48210,130 @@ function candlestick_objectSpread(e) { for (var r = 1, t; r < arguments.length;
|
|
|
48175
48210
|
return linePoint === !0 || isArray(linePoint) && linePoint.indexOf(d.id) !== -1;
|
|
48176
48211
|
}
|
|
48177
48212
|
});
|
|
48213
|
+
;// CONCATENATED MODULE: ./src/ChartInternal/shape/point.common.ts
|
|
48214
|
+
|
|
48215
|
+
/**
|
|
48216
|
+
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
48217
|
+
* billboard.js project is licensed under the MIT license
|
|
48218
|
+
*/
|
|
48219
|
+
|
|
48220
|
+
|
|
48221
|
+
|
|
48222
|
+
|
|
48223
|
+
/**
|
|
48224
|
+
* Check if point draw methods are valid
|
|
48225
|
+
* @param {string} point point type
|
|
48226
|
+
* @returns {boolean}
|
|
48227
|
+
* @private
|
|
48228
|
+
*/
|
|
48229
|
+
function hasValidPointDrawMethods(point) {
|
|
48230
|
+
return isObjectType(point) && isFunction(point.create) && isFunction(point.update);
|
|
48231
|
+
}
|
|
48232
|
+
|
|
48233
|
+
/**
|
|
48234
|
+
* Insert point info defs element
|
|
48235
|
+
* @param {string} point Point element
|
|
48236
|
+
* @param {string} id Point id
|
|
48237
|
+
* @private
|
|
48238
|
+
*/
|
|
48239
|
+
function insertPointInfoDefs(point, id) {
|
|
48240
|
+
var _this = this,
|
|
48241
|
+
_node$childNodes;
|
|
48242
|
+
const $$ = this,
|
|
48243
|
+
copyAttr = function (from, target) {
|
|
48244
|
+
_newArrowCheck(this, _this);
|
|
48245
|
+
const attribs = from.attributes;
|
|
48246
|
+
for (let i = 0, name; name = attribs[i]; i++) {
|
|
48247
|
+
name = name.name;
|
|
48248
|
+
target.setAttribute(name, from.getAttribute(name));
|
|
48249
|
+
}
|
|
48250
|
+
}.bind(this),
|
|
48251
|
+
doc = new DOMParser().parseFromString(point, "image/svg+xml"),
|
|
48252
|
+
node = doc.documentElement,
|
|
48253
|
+
clone = browser_doc.createElementNS(namespaces.svg, node.nodeName.toLowerCase());
|
|
48254
|
+
clone.id = id;
|
|
48255
|
+
clone.style.fill = "inherit";
|
|
48256
|
+
clone.style.stroke = "inherit";
|
|
48257
|
+
copyAttr(node, clone);
|
|
48258
|
+
if ((_node$childNodes = node.childNodes) != null && _node$childNodes.length) {
|
|
48259
|
+
const parent = src_select(clone);
|
|
48260
|
+
if ("innerHTML" in clone) {
|
|
48261
|
+
parent.html(node.innerHTML);
|
|
48262
|
+
} else {
|
|
48263
|
+
toArray(node.childNodes).forEach(function (v) {
|
|
48264
|
+
_newArrowCheck(this, _this);
|
|
48265
|
+
copyAttr(v, parent.append(v.tagName).node());
|
|
48266
|
+
}.bind(this));
|
|
48267
|
+
}
|
|
48268
|
+
}
|
|
48269
|
+
$$.$el.defs.node().appendChild(clone);
|
|
48270
|
+
}
|
|
48271
|
+
/* harmony default export */ var point_common = ({
|
|
48272
|
+
/**
|
|
48273
|
+
* Check if point type option is valid
|
|
48274
|
+
* @param {string} type point type
|
|
48275
|
+
* @returns {boolean}
|
|
48276
|
+
* @private
|
|
48277
|
+
*/
|
|
48278
|
+
hasValidPointType: function hasValidPointType(type) {
|
|
48279
|
+
return /^(circle|rect(angle)?|polygon|ellipse|use)$/i.test(type || this.config.point_type);
|
|
48280
|
+
},
|
|
48281
|
+
/**
|
|
48282
|
+
* Check if pattern point is set to be used on legend
|
|
48283
|
+
* @returns {boolean}
|
|
48284
|
+
* @private
|
|
48285
|
+
*/
|
|
48286
|
+
hasLegendDefsPoint: function hasLegendDefsPoint() {
|
|
48287
|
+
var _config$point_pattern;
|
|
48288
|
+
const config = this.config;
|
|
48289
|
+
return config.legend_show && ((_config$point_pattern = config.point_pattern) == null ? void 0 : _config$point_pattern.length) && config.legend_usePoint;
|
|
48290
|
+
},
|
|
48291
|
+
getDefsPointId: function getDefsPointId(id) {
|
|
48292
|
+
const datetimeId = this.state.datetimeId;
|
|
48293
|
+
return datetimeId + "-point" + id;
|
|
48294
|
+
},
|
|
48295
|
+
/**
|
|
48296
|
+
* Get generate point function
|
|
48297
|
+
* @returns {Function}
|
|
48298
|
+
* @private
|
|
48299
|
+
*/
|
|
48300
|
+
generatePoint: function generatePoint() {
|
|
48301
|
+
const $$ = this,
|
|
48302
|
+
$el = $$.$el,
|
|
48303
|
+
config = $$.config,
|
|
48304
|
+
ids = [],
|
|
48305
|
+
pattern = notEmpty(config.point_pattern) ? config.point_pattern : [config.point_type];
|
|
48306
|
+
return function (method, context) {
|
|
48307
|
+
for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
48308
|
+
args[_key - 2] = arguments[_key];
|
|
48309
|
+
}
|
|
48310
|
+
return function (d) {
|
|
48311
|
+
var _d$data, _point$method;
|
|
48312
|
+
const id = $$.getTargetSelectorSuffix(d.id || ((_d$data = d.data) == null ? void 0 : _d$data.id) || d),
|
|
48313
|
+
element = src_select(this);
|
|
48314
|
+
ids.indexOf(id) < 0 && ids.push(id);
|
|
48315
|
+
let point = pattern[ids.indexOf(id) % pattern.length];
|
|
48316
|
+
if ($$.hasValidPointType(point)) {
|
|
48317
|
+
point = $$[point];
|
|
48318
|
+
} else if (!hasValidPointDrawMethods(point || config.point_type)) {
|
|
48319
|
+
const pointId = $$.getDefsPointId(id),
|
|
48320
|
+
defsPoint = $el.defs.select("#" + pointId);
|
|
48321
|
+
if (defsPoint.size() < 1) {
|
|
48322
|
+
insertPointInfoDefs.bind($$)(point, pointId);
|
|
48323
|
+
}
|
|
48324
|
+
if (method === "create") {
|
|
48325
|
+
var _$$$custom;
|
|
48326
|
+
return (_$$$custom = $$.custom) == null ? void 0 : _$$$custom.create.bind(context).apply(void 0, [element, pointId].concat(args));
|
|
48327
|
+
} else if (method === "update") {
|
|
48328
|
+
var _$$$custom2;
|
|
48329
|
+
return (_$$$custom2 = $$.custom) == null ? void 0 : _$$$custom2.update.bind(context).apply(void 0, [element].concat(args));
|
|
48330
|
+
}
|
|
48331
|
+
}
|
|
48332
|
+
return (_point$method = point[method]) == null ? void 0 : _point$method.bind(context).apply(void 0, [element].concat(args));
|
|
48333
|
+
};
|
|
48334
|
+
};
|
|
48335
|
+
}
|
|
48336
|
+
});
|
|
48178
48337
|
;// CONCATENATED MODULE: ./src/ChartInternal/shape/point.ts
|
|
48179
48338
|
|
|
48180
48339
|
var point_this = undefined;
|
|
@@ -48185,19 +48344,11 @@ var point_this = undefined;
|
|
|
48185
48344
|
|
|
48186
48345
|
|
|
48187
48346
|
|
|
48188
|
-
|
|
48189
48347
|
const getTransitionName = function () {
|
|
48190
48348
|
_newArrowCheck(this, point_this);
|
|
48191
48349
|
return getRandom();
|
|
48192
48350
|
}.bind(undefined);
|
|
48193
48351
|
/* harmony default export */ var point = ({
|
|
48194
|
-
hasValidPointType: function hasValidPointType(type) {
|
|
48195
|
-
return /^(circle|rect(angle)?|polygon|ellipse|use)$/i.test(type || this.config.point_type);
|
|
48196
|
-
},
|
|
48197
|
-
hasValidPointDrawMethods: function hasValidPointDrawMethods(type) {
|
|
48198
|
-
const pointType = type || this.config.point_type;
|
|
48199
|
-
return isObjectType(pointType) && isFunction(pointType.create) && isFunction(pointType.update);
|
|
48200
|
-
},
|
|
48201
48352
|
initialOpacityForCircle: function initialOpacityForCircle(d) {
|
|
48202
48353
|
const config = this.config,
|
|
48203
48354
|
withoutFadeIn = this.state.withoutFadeIn;
|
|
@@ -48511,41 +48662,6 @@ const getTransitionName = function () {
|
|
|
48511
48662
|
}
|
|
48512
48663
|
return sensitivity;
|
|
48513
48664
|
},
|
|
48514
|
-
insertPointInfoDefs: function insertPointInfoDefs(point, id) {
|
|
48515
|
-
var _this7 = this,
|
|
48516
|
-
_node$childNodes;
|
|
48517
|
-
const $$ = this,
|
|
48518
|
-
copyAttr = function (from, target) {
|
|
48519
|
-
_newArrowCheck(this, _this7);
|
|
48520
|
-
const attribs = from.attributes;
|
|
48521
|
-
for (let i = 0, name; name = attribs[i]; i++) {
|
|
48522
|
-
name = name.name;
|
|
48523
|
-
target.setAttribute(name, from.getAttribute(name));
|
|
48524
|
-
}
|
|
48525
|
-
}.bind(this),
|
|
48526
|
-
doc = new DOMParser().parseFromString(point, "image/svg+xml"),
|
|
48527
|
-
node = doc.documentElement,
|
|
48528
|
-
clone = browser_doc.createElementNS(namespaces.svg, node.nodeName.toLowerCase());
|
|
48529
|
-
clone.id = id;
|
|
48530
|
-
clone.style.fill = "inherit";
|
|
48531
|
-
clone.style.stroke = "inherit";
|
|
48532
|
-
copyAttr(node, clone);
|
|
48533
|
-
if ((_node$childNodes = node.childNodes) != null && _node$childNodes.length) {
|
|
48534
|
-
const parent = src_select(clone);
|
|
48535
|
-
if ("innerHTML" in clone) {
|
|
48536
|
-
parent.html(node.innerHTML);
|
|
48537
|
-
} else {
|
|
48538
|
-
toArray(node.childNodes).forEach(function (v) {
|
|
48539
|
-
_newArrowCheck(this, _this7);
|
|
48540
|
-
copyAttr(v, parent.append(v.tagName).node());
|
|
48541
|
-
}.bind(this));
|
|
48542
|
-
}
|
|
48543
|
-
}
|
|
48544
|
-
$$.$el.defs.node().appendChild(clone);
|
|
48545
|
-
},
|
|
48546
|
-
pointFromDefs: function pointFromDefs(id) {
|
|
48547
|
-
return this.$el.defs.select("#" + id);
|
|
48548
|
-
},
|
|
48549
48665
|
updatePointClass: function updatePointClass(d) {
|
|
48550
48666
|
const $$ = this,
|
|
48551
48667
|
circle = $$.$el.circle;
|
|
@@ -48562,7 +48678,7 @@ const getTransitionName = function () {
|
|
|
48562
48678
|
return pointClass;
|
|
48563
48679
|
},
|
|
48564
48680
|
generateGetLinePoints: function generateGetLinePoints(lineIndices, isSub) {
|
|
48565
|
-
var
|
|
48681
|
+
var _this7 = this;
|
|
48566
48682
|
// partial duplication of generateGetBarPoints
|
|
48567
48683
|
const $$ = this,
|
|
48568
48684
|
config = $$.config,
|
|
@@ -48571,7 +48687,7 @@ const getTransitionName = function () {
|
|
|
48571
48687
|
lineOffset = $$.getShapeOffset($$.isLineType, lineIndices, isSub),
|
|
48572
48688
|
yScale = $$.getYScaleById.bind($$);
|
|
48573
48689
|
return function (d, i) {
|
|
48574
|
-
_newArrowCheck(this,
|
|
48690
|
+
_newArrowCheck(this, _this7);
|
|
48575
48691
|
const y0 = yScale.call($$, d.id, isSub)($$.getShapeYMin(d.id)),
|
|
48576
48692
|
offset = lineOffset(d, i) || y0,
|
|
48577
48693
|
posX = x(d); // offset is for stacked area chart
|
|
@@ -48589,56 +48705,22 @@ const getTransitionName = function () {
|
|
|
48589
48705
|
point, point];
|
|
48590
48706
|
}.bind(this);
|
|
48591
48707
|
},
|
|
48592
|
-
generatePoint: function generatePoint() {
|
|
48593
|
-
const $$ = this,
|
|
48594
|
-
config = $$.config,
|
|
48595
|
-
datetimeId = $$.state.datetimeId,
|
|
48596
|
-
ids = [],
|
|
48597
|
-
pattern = notEmpty(config.point_pattern) ? config.point_pattern : [config.point_type];
|
|
48598
|
-
return function (method, context) {
|
|
48599
|
-
for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
48600
|
-
args[_key - 2] = arguments[_key];
|
|
48601
|
-
}
|
|
48602
|
-
return function (d) {
|
|
48603
|
-
var _d$data;
|
|
48604
|
-
const id = $$.getTargetSelectorSuffix(d.id || ((_d$data = d.data) == null ? void 0 : _d$data.id) || d),
|
|
48605
|
-
element = src_select(this);
|
|
48606
|
-
ids.indexOf(id) < 0 && ids.push(id);
|
|
48607
|
-
let point = pattern[ids.indexOf(id) % pattern.length];
|
|
48608
|
-
if ($$.hasValidPointType(point)) {
|
|
48609
|
-
point = $$[point];
|
|
48610
|
-
} else if (!$$.hasValidPointDrawMethods(point)) {
|
|
48611
|
-
const pointId = datetimeId + "-point" + id,
|
|
48612
|
-
pointFromDefs = $$.pointFromDefs(pointId);
|
|
48613
|
-
if (pointFromDefs.size() < 1) {
|
|
48614
|
-
$$.insertPointInfoDefs(point, pointId);
|
|
48615
|
-
}
|
|
48616
|
-
if (method === "create") {
|
|
48617
|
-
return $$.custom.create.bind(context).apply(void 0, [element, pointId].concat(args));
|
|
48618
|
-
} else if (method === "update") {
|
|
48619
|
-
return $$.custom.update.bind(context).apply(void 0, [element].concat(args));
|
|
48620
|
-
}
|
|
48621
|
-
}
|
|
48622
|
-
return point[method].bind(context).apply(void 0, [element].concat(args));
|
|
48623
|
-
};
|
|
48624
|
-
};
|
|
48625
|
-
},
|
|
48626
48708
|
custom: {
|
|
48627
48709
|
create: function create(element, id, fillStyleFn) {
|
|
48628
48710
|
return element.append("use").attr("xlink:href", "#" + id).attr("class", this.updatePointClass.bind(this)).style("fill", fillStyleFn).node();
|
|
48629
48711
|
},
|
|
48630
48712
|
update: function update(element, xPosFn, yPosFn, fillStyleFn, withTransition, flow, selectedCircles) {
|
|
48631
|
-
var
|
|
48713
|
+
var _this8 = this;
|
|
48632
48714
|
const $$ = this,
|
|
48633
48715
|
_element$node$getBBox = element.node().getBBox(),
|
|
48634
48716
|
width = _element$node$getBBox.width,
|
|
48635
48717
|
height = _element$node$getBBox.height,
|
|
48636
48718
|
xPosFn2 = function (d) {
|
|
48637
|
-
_newArrowCheck(this,
|
|
48719
|
+
_newArrowCheck(this, _this8);
|
|
48638
48720
|
return isValue(d.value) ? xPosFn(d) - width / 2 : 0;
|
|
48639
48721
|
}.bind(this),
|
|
48640
48722
|
yPosFn2 = function (d) {
|
|
48641
|
-
_newArrowCheck(this,
|
|
48723
|
+
_newArrowCheck(this, _this8);
|
|
48642
48724
|
return isValue(d.value) ? yPosFn(d) - height / 2 : 0;
|
|
48643
48725
|
}.bind(this);
|
|
48644
48726
|
let mainCircles = element;
|
|
@@ -48676,23 +48758,23 @@ const getTransitionName = function () {
|
|
|
48676
48758
|
// 'rectangle' data point
|
|
48677
48759
|
rectangle: {
|
|
48678
48760
|
create: function create(element, sizeFn, fillStyleFn) {
|
|
48679
|
-
var
|
|
48761
|
+
var _this9 = this;
|
|
48680
48762
|
const rectSizeFn = function (d) {
|
|
48681
|
-
_newArrowCheck(this,
|
|
48763
|
+
_newArrowCheck(this, _this9);
|
|
48682
48764
|
return sizeFn(d) * 2;
|
|
48683
48765
|
}.bind(this);
|
|
48684
48766
|
return element.append("rect").attr("class", this.updatePointClass.bind(this)).attr("width", rectSizeFn).attr("height", rectSizeFn).style("fill", fillStyleFn).node();
|
|
48685
48767
|
},
|
|
48686
48768
|
update: function update(element, xPosFn, yPosFn, fillStyleFn, withTransition, flow, selectedCircles) {
|
|
48687
|
-
var
|
|
48769
|
+
var _this10 = this;
|
|
48688
48770
|
const $$ = this,
|
|
48689
48771
|
r = $$.config.point_r,
|
|
48690
48772
|
rectXPosFn = function (d) {
|
|
48691
|
-
_newArrowCheck(this,
|
|
48773
|
+
_newArrowCheck(this, _this10);
|
|
48692
48774
|
return xPosFn(d) - r;
|
|
48693
48775
|
}.bind(this),
|
|
48694
48776
|
rectYPosFn = function (d) {
|
|
48695
|
-
_newArrowCheck(this,
|
|
48777
|
+
_newArrowCheck(this, _this10);
|
|
48696
48778
|
return yPosFn(d) - r;
|
|
48697
48779
|
}.bind(this);
|
|
48698
48780
|
let mainCircles = element;
|
|
@@ -51368,6 +51450,7 @@ var shape_this = undefined;
|
|
|
51368
51450
|
|
|
51369
51451
|
|
|
51370
51452
|
|
|
51453
|
+
|
|
51371
51454
|
// Options
|
|
51372
51455
|
|
|
51373
51456
|
|
|
@@ -51395,9 +51478,9 @@ var shape_this = undefined;
|
|
|
51395
51478
|
* @private
|
|
51396
51479
|
*/
|
|
51397
51480
|
function extendAxis(module, option) {
|
|
51398
|
-
util_extend(ChartInternal.prototype, internal.concat(module));
|
|
51481
|
+
util_extend(ChartInternal.prototype, Object.values(internal).concat(module));
|
|
51399
51482
|
util_extend(Chart.prototype, api);
|
|
51400
|
-
Options.setOptions(options.concat(option || []));
|
|
51483
|
+
Options.setOptions(Object.values(options).concat(option || []));
|
|
51401
51484
|
}
|
|
51402
51485
|
|
|
51403
51486
|
/**
|
|
@@ -51407,7 +51490,7 @@ function extendAxis(module, option) {
|
|
|
51407
51490
|
* @private
|
|
51408
51491
|
*/
|
|
51409
51492
|
function extendLine(module, option) {
|
|
51410
|
-
extendAxis([point, line].concat(module || []));
|
|
51493
|
+
extendAxis([point_common, point, line].concat(module || []));
|
|
51411
51494
|
Options.setOptions([common_point, shape_line].concat(option || []));
|
|
51412
51495
|
}
|
|
51413
51496
|
|
|
@@ -51418,8 +51501,8 @@ function extendLine(module, option) {
|
|
|
51418
51501
|
* @private
|
|
51419
51502
|
*/
|
|
51420
51503
|
function extendArc(module, option) {
|
|
51421
|
-
util_extend(ChartInternal.prototype, [arc].concat(module || []));
|
|
51422
|
-
Options.setOptions(option);
|
|
51504
|
+
util_extend(ChartInternal.prototype, [arc, point_common].concat(module || []));
|
|
51505
|
+
Options.setOptions([common_point].concat(option || []));
|
|
51423
51506
|
}
|
|
51424
51507
|
|
|
51425
51508
|
// Area types
|
|
@@ -51522,7 +51605,9 @@ let _area = function area() {
|
|
|
51522
51605
|
resolver_shape_radar = function () {
|
|
51523
51606
|
var _this14 = this;
|
|
51524
51607
|
_newArrowCheck(this, shape_this);
|
|
51525
|
-
return extendArc([point, radar], [common_point, shape_radar
|
|
51608
|
+
return extendArc([internal.eventrect, point, radar], [common_point, shape_radar, {
|
|
51609
|
+
axis_x_categories: options.optAxis.axis_x_categories
|
|
51610
|
+
}]), (resolver_shape_radar = function () {
|
|
51526
51611
|
_newArrowCheck(this, _this14);
|
|
51527
51612
|
return TYPE.RADAR;
|
|
51528
51613
|
}.bind(this))();
|
|
@@ -51530,7 +51615,7 @@ let _area = function area() {
|
|
|
51530
51615
|
resolver_shape_bar = function () {
|
|
51531
51616
|
var _this15 = this;
|
|
51532
51617
|
_newArrowCheck(this, shape_this);
|
|
51533
|
-
return extendAxis([bar], shape_bar), (resolver_shape_bar = function () {
|
|
51618
|
+
return extendAxis([bar, point_common], [shape_bar, common_point]), (resolver_shape_bar = function () {
|
|
51534
51619
|
_newArrowCheck(this, _this15);
|
|
51535
51620
|
return TYPE.BAR;
|
|
51536
51621
|
}.bind(this))();
|
|
@@ -51538,7 +51623,7 @@ let _area = function area() {
|
|
|
51538
51623
|
resolver_shape_bubble = function () {
|
|
51539
51624
|
var _this16 = this;
|
|
51540
51625
|
_newArrowCheck(this, shape_this);
|
|
51541
|
-
return extendAxis([point, bubble], [shape_bubble, common_point]), (resolver_shape_bubble = function () {
|
|
51626
|
+
return extendAxis([point_common, point, bubble], [shape_bubble, common_point]), (resolver_shape_bubble = function () {
|
|
51542
51627
|
_newArrowCheck(this, _this16);
|
|
51543
51628
|
return TYPE.BUBBLE;
|
|
51544
51629
|
}.bind(this))();
|
|
@@ -51546,7 +51631,7 @@ let _area = function area() {
|
|
|
51546
51631
|
resolver_shape_candlestick = function () {
|
|
51547
51632
|
var _this17 = this;
|
|
51548
51633
|
_newArrowCheck(this, shape_this);
|
|
51549
|
-
return extendAxis([candlestick], [shape_candlestick]), (resolver_shape_candlestick = function () {
|
|
51634
|
+
return extendAxis([candlestick, point_common], [shape_candlestick, common_point]), (resolver_shape_candlestick = function () {
|
|
51550
51635
|
_newArrowCheck(this, _this17);
|
|
51551
51636
|
return TYPE.CANDLESTICK;
|
|
51552
51637
|
}.bind(this))();
|
|
@@ -51554,7 +51639,7 @@ let _area = function area() {
|
|
|
51554
51639
|
shape_scatter = function () {
|
|
51555
51640
|
var _this18 = this;
|
|
51556
51641
|
_newArrowCheck(this, shape_this);
|
|
51557
|
-
return extendAxis([point], [common_point, scatter]), (shape_scatter = function () {
|
|
51642
|
+
return extendAxis([point_common, point], [common_point, scatter]), (shape_scatter = function () {
|
|
51558
51643
|
_newArrowCheck(this, _this18);
|
|
51559
51644
|
return TYPE.SCATTER;
|
|
51560
51645
|
}.bind(this))();
|
|
@@ -54029,7 +54114,7 @@ let _defaults = {};
|
|
|
54029
54114
|
|
|
54030
54115
|
/**
|
|
54031
54116
|
* @namespace bb
|
|
54032
|
-
* @version 3.11.
|
|
54117
|
+
* @version 3.11.3
|
|
54033
54118
|
*/
|
|
54034
54119
|
const bb = {
|
|
54035
54120
|
/**
|
|
@@ -54039,7 +54124,7 @@ const bb = {
|
|
|
54039
54124
|
* bb.version; // "1.0.0"
|
|
54040
54125
|
* @memberof bb
|
|
54041
54126
|
*/
|
|
54042
|
-
version: "3.11.
|
|
54127
|
+
version: "3.11.3",
|
|
54043
54128
|
/**
|
|
54044
54129
|
* Generate chart
|
|
54045
54130
|
* - **NOTE:** Bear in mind for the possiblity of ***throwing an error***, during the generation when:
|