billboard.js 3.11.0 → 3.11.2
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/dist/billboard.css +1 -1
- package/dist/billboard.js +230 -134
- package/dist/billboard.min.css +1 -1
- package/dist/billboard.min.js +2 -2
- package/dist/billboard.pkgd.js +226 -128
- package/dist/billboard.pkgd.min.js +4 -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 +189 -122
- 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 +16 -14
- package/src/ChartInternal/Axis/AxisRenderer.ts +2 -1
- package/src/ChartInternal/ChartInternal.ts +2 -2
- package/src/ChartInternal/data/data.ts +1 -1
- package/src/ChartInternal/data/load.ts +7 -1
- package/src/ChartInternal/interactions/zoom.ts +9 -3
- package/src/ChartInternal/internals/redraw.ts +2 -1
- package/src/ChartInternal/internals/title.ts +2 -2
- package/src/ChartInternal/internals/tooltip.ts +1 -1
- package/src/ChartInternal/shape/point.common.ts +134 -0
- package/src/ChartInternal/shape/point.ts +3 -95
- package/src/ChartInternal/shape/shape.ts +18 -6
- 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-esm/billboard.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.2
|
|
9
9
|
*/
|
|
10
10
|
import { timeParse, utcParse, timeFormat, utcFormat } from 'd3-time-format';
|
|
11
11
|
import { pointer, select, namespaces, selectAll } from 'd3-selection';
|
|
@@ -4837,8 +4837,10 @@ var dataLoad = {
|
|
|
4837
4837
|
});
|
|
4838
4838
|
},
|
|
4839
4839
|
unload: function (rawTargetIds, customDoneCb) {
|
|
4840
|
+
var _a;
|
|
4840
4841
|
var $$ = this;
|
|
4841
4842
|
var state = $$.state, $el = $$.$el, $T = $$.$T;
|
|
4843
|
+
var hasLegendDefsPoint = !!((_a = $$.hasLegendDefsPoint) === null || _a === void 0 ? void 0 : _a.call($$));
|
|
4842
4844
|
var done = customDoneCb;
|
|
4843
4845
|
var targetIds = rawTargetIds;
|
|
4844
4846
|
// reset internally cached data
|
|
@@ -4859,14 +4861,18 @@ var dataLoad = {
|
|
|
4859
4861
|
.remove()
|
|
4860
4862
|
.call(endall, done);
|
|
4861
4863
|
targetIds.forEach(function (id) {
|
|
4864
|
+
var _a;
|
|
4865
|
+
var suffixId = $$.getTargetSelectorSuffix(id);
|
|
4862
4866
|
// Reset fadein for future load
|
|
4863
4867
|
state.withoutFadeIn[id] = false;
|
|
4864
4868
|
// Remove target's elements
|
|
4865
4869
|
if ($el.legend) {
|
|
4866
|
-
$el.legend.selectAll(".".concat($LEGEND.legendItem).concat(
|
|
4870
|
+
$el.legend.selectAll(".".concat($LEGEND.legendItem).concat(suffixId)).remove();
|
|
4867
4871
|
}
|
|
4868
4872
|
// Remove target
|
|
4869
4873
|
$$.data.targets = $$.data.targets.filter(function (t) { return t.id !== id; });
|
|
4874
|
+
// Remove custom point def element
|
|
4875
|
+
hasLegendDefsPoint && ((_a = $el.defs) === null || _a === void 0 ? void 0 : _a.select("#".concat($$.getDefsPointId(suffixId))).remove());
|
|
4870
4876
|
});
|
|
4871
4877
|
// since treemap uses different data types, it needs to be transformed
|
|
4872
4878
|
state.hasTreemap && $$.updateTargetsForTreemap($$.data.targets);
|
|
@@ -6675,7 +6681,7 @@ var legend$1 = {
|
|
|
6675
6681
|
*/
|
|
6676
6682
|
var redraw = {
|
|
6677
6683
|
redraw: function (options) {
|
|
6678
|
-
var _a, _b, _c;
|
|
6684
|
+
var _a, _b, _c, _d;
|
|
6679
6685
|
if (options === void 0) { options = {}; }
|
|
6680
6686
|
var $$ = this;
|
|
6681
6687
|
var config = $$.config, state = $$.state, $el = $$.$el;
|
|
@@ -6740,14 +6746,16 @@ var redraw = {
|
|
|
6740
6746
|
// treemap
|
|
6741
6747
|
treemap && $$.updateTreemap(durationForExit);
|
|
6742
6748
|
}
|
|
6743
|
-
// @TODO: Axis & Radar type
|
|
6744
6749
|
if (!state.resizing && !treemap && ($$.hasPointType() || state.hasRadar)) {
|
|
6745
6750
|
$$.updateCircle();
|
|
6746
6751
|
}
|
|
6752
|
+
else if ((_c = $$.hasLegendDefsPoint) === null || _c === void 0 ? void 0 : _c.call($$)) {
|
|
6753
|
+
$$.data.targets.forEach($$.point("create", this));
|
|
6754
|
+
}
|
|
6747
6755
|
// text
|
|
6748
6756
|
$$.hasDataLabel() && !$$.hasArcType(null, ["radar"]) && $$.updateText();
|
|
6749
6757
|
// title
|
|
6750
|
-
(
|
|
6758
|
+
(_d = $$.redrawTitle) === null || _d === void 0 ? void 0 : _d.call($$);
|
|
6751
6759
|
initializing && $$.updateTypesElements();
|
|
6752
6760
|
$$.generateRedrawList(targetsToShow, flow, duration, wth.Subchart);
|
|
6753
6761
|
$$.updateTooltipOnRedraw();
|
|
@@ -7404,14 +7412,25 @@ var shape = {
|
|
|
7404
7412
|
$$.getYScaleById(id)($$.getBaseValue(d));
|
|
7405
7413
|
},
|
|
7406
7414
|
getBarW: function (type, axis, targetsNum) {
|
|
7415
|
+
var _a, _b, _c, _d, _e;
|
|
7407
7416
|
var $$ = this;
|
|
7408
7417
|
var config = $$.config, org = $$.org, scale = $$.scale;
|
|
7409
7418
|
var maxDataCount = $$.getMaxDataCount();
|
|
7410
|
-
var isGrouped = type === "bar" && config.data_groups.length;
|
|
7419
|
+
var isGrouped = type === "bar" && ((_a = config.data_groups) === null || _a === void 0 ? void 0 : _a.length);
|
|
7411
7420
|
var configName = "".concat(type, "_width");
|
|
7412
|
-
var
|
|
7413
|
-
|
|
7414
|
-
|
|
7421
|
+
var k = ((_c = (_b = $$.getZoomTransform) === null || _b === void 0 ? void 0 : _b.call($$)) !== null && _c !== void 0 ? _c : { k: 1 }).k;
|
|
7422
|
+
var xMinMax = [
|
|
7423
|
+
(_d = config.axis_x_min) !== null && _d !== void 0 ? _d : org.xDomain[0],
|
|
7424
|
+
(_e = config.axis_x_max) !== null && _e !== void 0 ? _e : org.xDomain[1]
|
|
7425
|
+
].map($$.axis.isTimeSeries() ? parseDate.bind($$) : Number);
|
|
7426
|
+
var tickInterval = axis.tickInterval(maxDataCount);
|
|
7427
|
+
if (scale.zoom && !$$.axis.isCategorized() && k > 1) {
|
|
7428
|
+
var isSameMinMax_1 = xMinMax.every(function (v, i) { return v === org.xDomain[i]; });
|
|
7429
|
+
tickInterval = org.xDomain.map(function (v, i) {
|
|
7430
|
+
var value = isSameMinMax_1 ? v : v - Math.abs(xMinMax[i]);
|
|
7431
|
+
return scale.zoom(value);
|
|
7432
|
+
}).reduce(function (a, c) { return Math.abs(a) + c; }) / maxDataCount;
|
|
7433
|
+
}
|
|
7415
7434
|
var getWidth = function (id) {
|
|
7416
7435
|
var width = id ? config[configName][id] : config[configName];
|
|
7417
7436
|
var ratio = id ? width.ratio : config["".concat(configName, "_ratio")];
|
|
@@ -8514,9 +8533,9 @@ var title = {
|
|
|
8514
8533
|
*/
|
|
8515
8534
|
getTitlePadding: function () {
|
|
8516
8535
|
var $$ = this;
|
|
8517
|
-
var
|
|
8536
|
+
var title = $$.$el.title, config = $$.config;
|
|
8518
8537
|
return (config.title_padding.top || 0) +
|
|
8519
|
-
$$.getTextRect(
|
|
8538
|
+
(title ? $$.getTextRect(title, $TEXT.title).height : 0) +
|
|
8520
8539
|
(config.title_padding.bottom || 0);
|
|
8521
8540
|
},
|
|
8522
8541
|
};
|
|
@@ -8796,6 +8815,7 @@ var tooltip$1 = {
|
|
|
8796
8815
|
* @private
|
|
8797
8816
|
*/
|
|
8798
8817
|
getTooltipPosition: function (tWidth, tHeight, currPos) {
|
|
8818
|
+
var _a, _b;
|
|
8799
8819
|
var $$ = this;
|
|
8800
8820
|
var config = $$.config, scale = $$.scale, state = $$.state;
|
|
8801
8821
|
var width = state.width, height = state.height, current = state.current, isLegendRight = state.isLegendRight, inputType = state.inputType;
|
|
@@ -8817,7 +8837,7 @@ var tooltip$1 = {
|
|
|
8817
8837
|
var raw = inputType === "touch";
|
|
8818
8838
|
if (!raw) {
|
|
8819
8839
|
x += (width - (isLegendRight ? $$.getLegendWidth() : 0)) / 2;
|
|
8820
|
-
y += hasGauge ? height : (height / 2) + tHeight;
|
|
8840
|
+
y += (hasGauge ? height : (height / 2) + tHeight) + ((_b = (_a = $$.getTitlePadding) === null || _a === void 0 ? void 0 : _a.call($$)) !== null && _b !== void 0 ? _b : 0);
|
|
8821
8841
|
}
|
|
8822
8842
|
}
|
|
8823
8843
|
else if (hasTreemap) {
|
|
@@ -9528,6 +9548,7 @@ var ChartInternal = /** @class */ (function () {
|
|
|
9528
9548
|
}
|
|
9529
9549
|
};
|
|
9530
9550
|
ChartInternal.prototype.initParams = function () {
|
|
9551
|
+
var _a;
|
|
9531
9552
|
var $$ = this;
|
|
9532
9553
|
var config = $$.config, format = $$.format, state = $$.state;
|
|
9533
9554
|
var isRotated = config.axis_rotated;
|
|
@@ -9541,7 +9562,7 @@ var ChartInternal = /** @class */ (function () {
|
|
|
9541
9562
|
config.axis_y2_show = false;
|
|
9542
9563
|
config.subchart_show = false;
|
|
9543
9564
|
}
|
|
9544
|
-
if ($$.hasPointType()) {
|
|
9565
|
+
if ($$.hasPointType() || ((_a = $$.hasLegendDefsPoint) === null || _a === void 0 ? void 0 : _a.call($$))) {
|
|
9545
9566
|
$$.point = $$.generatePoint();
|
|
9546
9567
|
}
|
|
9547
9568
|
if (state.hasAxis) {
|
|
@@ -9575,7 +9596,7 @@ var ChartInternal = /** @class */ (function () {
|
|
|
9575
9596
|
state.inputType = convertInputType(config.interaction_inputType_mouse, config.interaction_inputType_touch);
|
|
9576
9597
|
};
|
|
9577
9598
|
ChartInternal.prototype.initWithData = function (data) {
|
|
9578
|
-
var _a, _b;
|
|
9599
|
+
var _a, _b, _c;
|
|
9579
9600
|
var $$ = this;
|
|
9580
9601
|
var config = $$.config, scale = $$.scale, state = $$.state, $el = $$.$el, org = $$.org;
|
|
9581
9602
|
var hasAxis = state.hasAxis, hasTreemap = state.hasTreemap;
|
|
@@ -9640,7 +9661,7 @@ var ChartInternal = /** @class */ (function () {
|
|
|
9640
9661
|
// Define defs
|
|
9641
9662
|
var hasColorPatterns = (isFunction(config.color_tiles) && $$.patterns);
|
|
9642
9663
|
if (hasAxis || hasColorPatterns || hasPolar || hasTreemap ||
|
|
9643
|
-
config.data_labels_backgroundColors) {
|
|
9664
|
+
config.data_labels_backgroundColors || ((_a = $$.hasLegendDefsPoint) === null || _a === void 0 ? void 0 : _a.call($$))) {
|
|
9644
9665
|
$el.defs = $el.svg.append("defs");
|
|
9645
9666
|
if (hasAxis) {
|
|
9646
9667
|
["id", "idXAxis", "idYAxis", "idGrid"].forEach(function (v) {
|
|
@@ -9689,11 +9710,11 @@ var ChartInternal = /** @class */ (function () {
|
|
|
9689
9710
|
$$.initChartElements();
|
|
9690
9711
|
if (hasAxis) {
|
|
9691
9712
|
// Cover whole with rects for events
|
|
9692
|
-
hasInteraction && ((
|
|
9713
|
+
hasInteraction && ((_b = $$.initEventRect) === null || _b === void 0 ? void 0 : _b.call($$));
|
|
9693
9714
|
// Grids
|
|
9694
9715
|
$$.initGrid();
|
|
9695
9716
|
// Add Axis here, when clipPath is 'true'
|
|
9696
|
-
config.clipPath && ((
|
|
9717
|
+
config.clipPath && ((_c = $$.axis) === null || _c === void 0 ? void 0 : _c.init());
|
|
9697
9718
|
}
|
|
9698
9719
|
// Set targets
|
|
9699
9720
|
$$.updateTargets($$.data.targets);
|
|
@@ -12829,13 +12850,14 @@ var AxisRenderer = /** @class */ (function () {
|
|
|
12829
12850
|
* @returns {number}
|
|
12830
12851
|
*/
|
|
12831
12852
|
AxisRenderer.prototype.tickInterval = function (size) {
|
|
12832
|
-
var
|
|
12833
|
-
var
|
|
12853
|
+
var _a;
|
|
12854
|
+
var _b = this.config, outerTickSize = _b.outerTickSize, tickOffset = _b.tickOffset, tickValues = _b.tickValues;
|
|
12834
12855
|
var interval;
|
|
12835
12856
|
if (this.params.isCategory) {
|
|
12836
12857
|
interval = tickOffset * 2;
|
|
12837
12858
|
}
|
|
12838
12859
|
else {
|
|
12860
|
+
var scale_1 = (_a = this.params.owner.scale.zoom) !== null && _a !== void 0 ? _a : this.helper.scale;
|
|
12839
12861
|
var length_1 = this.g.select("path.domain")
|
|
12840
12862
|
.node()
|
|
12841
12863
|
.getTotalLength() - outerTickSize * 2;
|
|
@@ -12845,7 +12867,7 @@ var AxisRenderer = /** @class */ (function () {
|
|
|
12845
12867
|
.map(function (v, i, arr) {
|
|
12846
12868
|
var next = i + 1;
|
|
12847
12869
|
return next < arr.length ?
|
|
12848
|
-
|
|
12870
|
+
scale_1(arr[next]) - scale_1(v) : null;
|
|
12849
12871
|
}).filter(Boolean) : [];
|
|
12850
12872
|
interval = Math.min.apply(Math, __spreadArray(__spreadArray([], intervalByValue, false), [interval], false));
|
|
12851
12873
|
}
|
|
@@ -17097,20 +17119,20 @@ var api = [
|
|
|
17097
17119
|
apiRegion,
|
|
17098
17120
|
apiX
|
|
17099
17121
|
];
|
|
17100
|
-
var internal =
|
|
17101
|
-
axis,
|
|
17102
|
-
clip,
|
|
17103
|
-
eventrect,
|
|
17104
|
-
flow,
|
|
17105
|
-
grid,
|
|
17106
|
-
region,
|
|
17107
|
-
sizeAxis,
|
|
17108
|
-
|
|
17109
|
-
var options =
|
|
17110
|
-
optDataAxis,
|
|
17111
|
-
optAxis,
|
|
17112
|
-
optGrid,
|
|
17113
|
-
|
|
17122
|
+
var internal = {
|
|
17123
|
+
axis: axis,
|
|
17124
|
+
clip: clip,
|
|
17125
|
+
eventrect: eventrect,
|
|
17126
|
+
flow: flow,
|
|
17127
|
+
grid: grid,
|
|
17128
|
+
region: region,
|
|
17129
|
+
sizeAxis: sizeAxis,
|
|
17130
|
+
};
|
|
17131
|
+
var options = {
|
|
17132
|
+
optDataAxis: optDataAxis,
|
|
17133
|
+
optAxis: optAxis,
|
|
17134
|
+
optGrid: optGrid,
|
|
17135
|
+
};
|
|
17114
17136
|
|
|
17115
17137
|
/**
|
|
17116
17138
|
* Get radius functions
|
|
@@ -19118,16 +19140,125 @@ var shapeLine = {
|
|
|
19118
19140
|
},
|
|
19119
19141
|
};
|
|
19120
19142
|
|
|
19121
|
-
|
|
19122
|
-
|
|
19143
|
+
/**
|
|
19144
|
+
* Check if point draw methods are valid
|
|
19145
|
+
* @param {string} point point type
|
|
19146
|
+
* @returns {boolean}
|
|
19147
|
+
* @private
|
|
19148
|
+
*/
|
|
19149
|
+
function hasValidPointDrawMethods(point) {
|
|
19150
|
+
return isObjectType(point) &&
|
|
19151
|
+
isFunction(point.create) && isFunction(point.update);
|
|
19152
|
+
}
|
|
19153
|
+
/**
|
|
19154
|
+
* Insert point info defs element
|
|
19155
|
+
* @param {string} point Point element
|
|
19156
|
+
* @param {string} id Point id
|
|
19157
|
+
* @private
|
|
19158
|
+
*/
|
|
19159
|
+
function insertPointInfoDefs(point, id) {
|
|
19160
|
+
var _a;
|
|
19161
|
+
var $$ = this;
|
|
19162
|
+
var copyAttr = function (from, target) {
|
|
19163
|
+
var attribs = from.attributes;
|
|
19164
|
+
for (var i = 0, name_1; (name_1 = attribs[i]); i++) {
|
|
19165
|
+
name_1 = name_1.name;
|
|
19166
|
+
target.setAttribute(name_1, from.getAttribute(name_1));
|
|
19167
|
+
}
|
|
19168
|
+
};
|
|
19169
|
+
var doc$1 = new DOMParser().parseFromString(point, "image/svg+xml");
|
|
19170
|
+
var node = doc$1.documentElement;
|
|
19171
|
+
var clone = doc.createElementNS(namespaces.svg, node.nodeName.toLowerCase());
|
|
19172
|
+
clone.id = id;
|
|
19173
|
+
clone.style.fill = "inherit";
|
|
19174
|
+
clone.style.stroke = "inherit";
|
|
19175
|
+
copyAttr(node, clone);
|
|
19176
|
+
if ((_a = node.childNodes) === null || _a === void 0 ? void 0 : _a.length) {
|
|
19177
|
+
var parent_1 = select(clone);
|
|
19178
|
+
if ("innerHTML" in clone) {
|
|
19179
|
+
parent_1.html(node.innerHTML);
|
|
19180
|
+
}
|
|
19181
|
+
else {
|
|
19182
|
+
toArray(node.childNodes).forEach(function (v) {
|
|
19183
|
+
copyAttr(v, parent_1.append(v.tagName).node());
|
|
19184
|
+
});
|
|
19185
|
+
}
|
|
19186
|
+
}
|
|
19187
|
+
$$.$el.defs.node().appendChild(clone);
|
|
19188
|
+
}
|
|
19189
|
+
var shapePointCommon = {
|
|
19190
|
+
/**
|
|
19191
|
+
* Check if point type option is valid
|
|
19192
|
+
* @param {string} type point type
|
|
19193
|
+
* @returns {boolean}
|
|
19194
|
+
* @private
|
|
19195
|
+
*/
|
|
19123
19196
|
hasValidPointType: function (type) {
|
|
19124
19197
|
return /^(circle|rect(angle)?|polygon|ellipse|use)$/i.test(type || this.config.point_type);
|
|
19125
19198
|
},
|
|
19126
|
-
|
|
19127
|
-
|
|
19128
|
-
|
|
19129
|
-
|
|
19199
|
+
/**
|
|
19200
|
+
* Check if pattern point is set to be used on legend
|
|
19201
|
+
* @returns {boolean}
|
|
19202
|
+
* @private
|
|
19203
|
+
*/
|
|
19204
|
+
hasLegendDefsPoint: function () {
|
|
19205
|
+
var _a;
|
|
19206
|
+
var config = this.config;
|
|
19207
|
+
return config.legend_show && ((_a = config.point_pattern) === null || _a === void 0 ? void 0 : _a.length) && config.legend_usePoint;
|
|
19130
19208
|
},
|
|
19209
|
+
getDefsPointId: function (id) {
|
|
19210
|
+
var datetimeId = this.state.datetimeId;
|
|
19211
|
+
return "".concat(datetimeId, "-point").concat(id);
|
|
19212
|
+
},
|
|
19213
|
+
/**
|
|
19214
|
+
* Get generate point function
|
|
19215
|
+
* @returns {Function}
|
|
19216
|
+
* @private
|
|
19217
|
+
*/
|
|
19218
|
+
generatePoint: function () {
|
|
19219
|
+
var $$ = this;
|
|
19220
|
+
var $el = $$.$el, config = $$.config;
|
|
19221
|
+
var ids = [];
|
|
19222
|
+
var pattern = notEmpty(config.point_pattern) ? config.point_pattern : [config.point_type];
|
|
19223
|
+
return function (method, context) {
|
|
19224
|
+
var args = [];
|
|
19225
|
+
for (var _i = 2; _i < arguments.length; _i++) {
|
|
19226
|
+
args[_i - 2] = arguments[_i];
|
|
19227
|
+
}
|
|
19228
|
+
return function (d) {
|
|
19229
|
+
var _a, _b, _c, _d;
|
|
19230
|
+
var id = $$.getTargetSelectorSuffix(d.id || ((_a = d.data) === null || _a === void 0 ? void 0 : _a.id) || d);
|
|
19231
|
+
var element = select(this);
|
|
19232
|
+
ids.indexOf(id) < 0 && ids.push(id);
|
|
19233
|
+
var point = pattern[ids.indexOf(id) % pattern.length];
|
|
19234
|
+
if ($$.hasValidPointType(point)) {
|
|
19235
|
+
point = $$[point];
|
|
19236
|
+
}
|
|
19237
|
+
else if (!hasValidPointDrawMethods(point || config.point_type)) {
|
|
19238
|
+
var pointId = $$.getDefsPointId(id);
|
|
19239
|
+
var defsPoint = $el.defs.select("#".concat(pointId));
|
|
19240
|
+
if (defsPoint.size() < 1) {
|
|
19241
|
+
insertPointInfoDefs.bind($$)(point, pointId);
|
|
19242
|
+
}
|
|
19243
|
+
if (method === "create") {
|
|
19244
|
+
return (_b = $$.custom) === null || _b === void 0 ? void 0 : _b.create.bind(context).apply(void 0, __spreadArray([element, pointId], args, false));
|
|
19245
|
+
}
|
|
19246
|
+
else if (method === "update") {
|
|
19247
|
+
return (_c = $$.custom) === null || _c === void 0 ? void 0 : _c.update.bind(context).apply(void 0, __spreadArray([element], args, false));
|
|
19248
|
+
}
|
|
19249
|
+
}
|
|
19250
|
+
return (_d = point[method]) === null || _d === void 0 ? void 0 : _d.bind(context).apply(void 0, __spreadArray([element], args, false));
|
|
19251
|
+
};
|
|
19252
|
+
};
|
|
19253
|
+
}
|
|
19254
|
+
};
|
|
19255
|
+
|
|
19256
|
+
/**
|
|
19257
|
+
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
19258
|
+
* billboard.js project is licensed under the MIT license
|
|
19259
|
+
*/
|
|
19260
|
+
var getTransitionName = function () { return getRandom(); };
|
|
19261
|
+
var shapePoint = {
|
|
19131
19262
|
initialOpacityForCircle: function (d) {
|
|
19132
19263
|
var _a = this, config = _a.config, withoutFadeIn = _a.state.withoutFadeIn;
|
|
19133
19264
|
var opacity = config.point_opacity;
|
|
@@ -19440,39 +19571,6 @@ var shapePoint = {
|
|
|
19440
19571
|
}
|
|
19441
19572
|
return sensitivity;
|
|
19442
19573
|
},
|
|
19443
|
-
insertPointInfoDefs: function (point, id) {
|
|
19444
|
-
var _a;
|
|
19445
|
-
var $$ = this;
|
|
19446
|
-
var copyAttr = function (from, target) {
|
|
19447
|
-
var attribs = from.attributes;
|
|
19448
|
-
for (var i = 0, name_1; (name_1 = attribs[i]); i++) {
|
|
19449
|
-
name_1 = name_1.name;
|
|
19450
|
-
target.setAttribute(name_1, from.getAttribute(name_1));
|
|
19451
|
-
}
|
|
19452
|
-
};
|
|
19453
|
-
var doc$1 = new DOMParser().parseFromString(point, "image/svg+xml");
|
|
19454
|
-
var node = doc$1.documentElement;
|
|
19455
|
-
var clone = doc.createElementNS(namespaces.svg, node.nodeName.toLowerCase());
|
|
19456
|
-
clone.id = id;
|
|
19457
|
-
clone.style.fill = "inherit";
|
|
19458
|
-
clone.style.stroke = "inherit";
|
|
19459
|
-
copyAttr(node, clone);
|
|
19460
|
-
if ((_a = node.childNodes) === null || _a === void 0 ? void 0 : _a.length) {
|
|
19461
|
-
var parent_1 = select(clone);
|
|
19462
|
-
if ("innerHTML" in clone) {
|
|
19463
|
-
parent_1.html(node.innerHTML);
|
|
19464
|
-
}
|
|
19465
|
-
else {
|
|
19466
|
-
toArray(node.childNodes).forEach(function (v) {
|
|
19467
|
-
copyAttr(v, parent_1.append(v.tagName).node());
|
|
19468
|
-
});
|
|
19469
|
-
}
|
|
19470
|
-
}
|
|
19471
|
-
$$.$el.defs.node().appendChild(clone);
|
|
19472
|
-
},
|
|
19473
|
-
pointFromDefs: function (id) {
|
|
19474
|
-
return this.$el.defs.select("#".concat(id));
|
|
19475
|
-
},
|
|
19476
19574
|
updatePointClass: function (d) {
|
|
19477
19575
|
var $$ = this;
|
|
19478
19576
|
var circle = $$.$el.circle;
|
|
@@ -19515,42 +19613,6 @@ var shapePoint = {
|
|
|
19515
19613
|
];
|
|
19516
19614
|
};
|
|
19517
19615
|
},
|
|
19518
|
-
generatePoint: function () {
|
|
19519
|
-
var $$ = this;
|
|
19520
|
-
var config = $$.config, datetimeId = $$.state.datetimeId;
|
|
19521
|
-
var ids = [];
|
|
19522
|
-
var pattern = notEmpty(config.point_pattern) ? config.point_pattern : [config.point_type];
|
|
19523
|
-
return function (method, context) {
|
|
19524
|
-
var args = [];
|
|
19525
|
-
for (var _i = 2; _i < arguments.length; _i++) {
|
|
19526
|
-
args[_i - 2] = arguments[_i];
|
|
19527
|
-
}
|
|
19528
|
-
return function (d) {
|
|
19529
|
-
var _a;
|
|
19530
|
-
var id = $$.getTargetSelectorSuffix(d.id || ((_a = d.data) === null || _a === void 0 ? void 0 : _a.id) || d);
|
|
19531
|
-
var element = select(this);
|
|
19532
|
-
ids.indexOf(id) < 0 && ids.push(id);
|
|
19533
|
-
var point = pattern[ids.indexOf(id) % pattern.length];
|
|
19534
|
-
if ($$.hasValidPointType(point)) {
|
|
19535
|
-
point = $$[point];
|
|
19536
|
-
}
|
|
19537
|
-
else if (!$$.hasValidPointDrawMethods(point)) {
|
|
19538
|
-
var pointId = "".concat(datetimeId, "-point").concat(id);
|
|
19539
|
-
var pointFromDefs = $$.pointFromDefs(pointId);
|
|
19540
|
-
if (pointFromDefs.size() < 1) {
|
|
19541
|
-
$$.insertPointInfoDefs(point, pointId);
|
|
19542
|
-
}
|
|
19543
|
-
if (method === "create") {
|
|
19544
|
-
return $$.custom.create.bind(context).apply(void 0, __spreadArray([element, pointId], args, false));
|
|
19545
|
-
}
|
|
19546
|
-
else if (method === "update") {
|
|
19547
|
-
return $$.custom.update.bind(context).apply(void 0, __spreadArray([element], args, false));
|
|
19548
|
-
}
|
|
19549
|
-
}
|
|
19550
|
-
return point[method].bind(context).apply(void 0, __spreadArray([element], args, false));
|
|
19551
|
-
};
|
|
19552
|
-
};
|
|
19553
|
-
},
|
|
19554
19616
|
custom: {
|
|
19555
19617
|
create: function (element, id, fillStyleFn) {
|
|
19556
19618
|
return element.append("use")
|
|
@@ -21602,9 +21664,9 @@ var optTreemap = {
|
|
|
21602
21664
|
* @private
|
|
21603
21665
|
*/
|
|
21604
21666
|
function extendAxis(module, option) {
|
|
21605
|
-
extend(ChartInternal.prototype, internal.concat(module));
|
|
21667
|
+
extend(ChartInternal.prototype, Object.values(internal).concat(module));
|
|
21606
21668
|
extend(Chart.prototype, api);
|
|
21607
|
-
Options.setOptions(options.concat(option || []));
|
|
21669
|
+
Options.setOptions(Object.values(options).concat(option || []));
|
|
21608
21670
|
}
|
|
21609
21671
|
/**
|
|
21610
21672
|
* Extend Line type modules
|
|
@@ -21613,7 +21675,7 @@ function extendAxis(module, option) {
|
|
|
21613
21675
|
* @private
|
|
21614
21676
|
*/
|
|
21615
21677
|
function extendLine(module, option) {
|
|
21616
|
-
extendAxis([shapePoint, shapeLine].concat(module || []));
|
|
21678
|
+
extendAxis([shapePointCommon, shapePoint, shapeLine].concat(module || []));
|
|
21617
21679
|
Options.setOptions([optPoint, optLine].concat(option || []));
|
|
21618
21680
|
}
|
|
21619
21681
|
/**
|
|
@@ -21623,8 +21685,8 @@ function extendLine(module, option) {
|
|
|
21623
21685
|
* @private
|
|
21624
21686
|
*/
|
|
21625
21687
|
function extendArc(module, option) {
|
|
21626
|
-
extend(ChartInternal.prototype, [shapeArc].concat(module || []));
|
|
21627
|
-
Options.setOptions(option);
|
|
21688
|
+
extend(ChartInternal.prototype, [shapeArc, shapePointCommon].concat(module || []));
|
|
21689
|
+
Options.setOptions([optPoint].concat(option || []));
|
|
21628
21690
|
}
|
|
21629
21691
|
// Area types
|
|
21630
21692
|
var area = function () { return (extendLine(shapeArea, [optArea]), (area = function () { return TYPE.AREA; })()); };
|
|
@@ -21641,12 +21703,12 @@ var donut = function () { return (extendArc(undefined, [optArc, optDonut]), (don
|
|
|
21641
21703
|
var gauge = function () { return (extendArc([shapeGauge], [optArc, optGauge]), (gauge = function () { return TYPE.GAUGE; })()); };
|
|
21642
21704
|
var pie = function () { return (extendArc(undefined, [optArc, optPie]), (pie = function () { return TYPE.PIE; })()); };
|
|
21643
21705
|
var polar = function () { return (extendArc([shapePolar], [optArc, optPolar]), (polar = function () { return TYPE.POLAR; })()); };
|
|
21644
|
-
var radar = function () { return (extendArc([shapePoint, shapeRadar], [optPoint, optRadar]), (radar = function () { return TYPE.RADAR; })()); };
|
|
21706
|
+
var radar = function () { return (extendArc([internal.eventrect, shapePoint, shapeRadar], [optPoint, optRadar, { axis_x_categories: options.optAxis.axis_x_categories }]), (radar = function () { return TYPE.RADAR; })()); };
|
|
21645
21707
|
// Axis based types
|
|
21646
|
-
var bar = function () { return (extendAxis([shapeBar], optBar), (bar = function () { return TYPE.BAR; })()); };
|
|
21647
|
-
var bubble = function () { return (extendAxis([shapePoint, shapeBubble], [optBubble, optPoint]), (bubble = function () { return TYPE.BUBBLE; })()); };
|
|
21648
|
-
var candlestick = function () { return (extendAxis([shapeCandlestick], [optCandlestick]), (candlestick = function () { return TYPE.CANDLESTICK; })()); };
|
|
21649
|
-
var scatter = function () { return (extendAxis([shapePoint], [optPoint, optScatter]), (scatter = function () { return TYPE.SCATTER; })()); };
|
|
21708
|
+
var bar = function () { return (extendAxis([shapeBar, shapePointCommon], [optBar, optPoint]), (bar = function () { return TYPE.BAR; })()); };
|
|
21709
|
+
var bubble = function () { return (extendAxis([shapePointCommon, shapePoint, shapeBubble], [optBubble, optPoint]), (bubble = function () { return TYPE.BUBBLE; })()); };
|
|
21710
|
+
var candlestick = function () { return (extendAxis([shapeCandlestick, shapePointCommon], [optCandlestick, optPoint]), (candlestick = function () { return TYPE.CANDLESTICK; })()); };
|
|
21711
|
+
var scatter = function () { return (extendAxis([shapePointCommon, shapePoint], [optPoint, optScatter]), (scatter = function () { return TYPE.SCATTER; })()); };
|
|
21650
21712
|
// Non Axis based types
|
|
21651
21713
|
var treemap = function () { return (extendAxis([shapeTreemap], [optTreemap]), (treemap = function () { return TYPE.TREEMAP; })()); };
|
|
21652
21714
|
|
|
@@ -22897,9 +22959,9 @@ var zoom = {
|
|
|
22897
22959
|
if (config.zoom_type === "drag" && (e && startEvent.clientX === e.clientX && startEvent.clientY === e.clientY)) {
|
|
22898
22960
|
return;
|
|
22899
22961
|
}
|
|
22962
|
+
state.zooming = false;
|
|
22900
22963
|
$$.redrawEventRect();
|
|
22901
22964
|
$$.updateZoom();
|
|
22902
|
-
state.zooming = false;
|
|
22903
22965
|
// do not call event cb when is .unzoom() is called
|
|
22904
22966
|
!isUnZoom && (e || state.dragging) && callFn(config.zoom_onzoomend, $$.api, (_b = $$.state.domain) !== null && _b !== void 0 ? _b : $$.zoom.getDomain());
|
|
22905
22967
|
},
|
|
@@ -23038,6 +23100,11 @@ var zoom = {
|
|
|
23038
23100
|
$el.zoomResetBtn.style("display", null);
|
|
23039
23101
|
}
|
|
23040
23102
|
}
|
|
23103
|
+
},
|
|
23104
|
+
getZoomTransform: function () {
|
|
23105
|
+
var $$ = this;
|
|
23106
|
+
var eventRect = $$.$el.eventRect;
|
|
23107
|
+
return (eventRect === null || eventRect === void 0 ? void 0 : eventRect.node()) ? zoomTransform(eventRect.node()) : { k: 1 };
|
|
23041
23108
|
}
|
|
23042
23109
|
};
|
|
23043
23110
|
|
|
@@ -23362,7 +23429,7 @@ var zoomModule = function () {
|
|
|
23362
23429
|
var defaults = {};
|
|
23363
23430
|
/**
|
|
23364
23431
|
* @namespace bb
|
|
23365
|
-
* @version 3.11.
|
|
23432
|
+
* @version 3.11.2
|
|
23366
23433
|
*/
|
|
23367
23434
|
var bb = {
|
|
23368
23435
|
/**
|
|
@@ -23372,7 +23439,7 @@ var bb = {
|
|
|
23372
23439
|
* bb.version; // "1.0.0"
|
|
23373
23440
|
* @memberof bb
|
|
23374
23441
|
*/
|
|
23375
|
-
version: "3.11.
|
|
23442
|
+
version: "3.11.2",
|
|
23376
23443
|
/**
|
|
23377
23444
|
* Generate chart
|
|
23378
23445
|
* - **NOTE:** Bear in mind for the possiblity of ***throwing an error***, during the generation when:
|
|
@@ -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.2
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
@@ -104,7 +104,7 @@ var Plugin = /** @class */ (function () {
|
|
|
104
104
|
delete _this[key];
|
|
105
105
|
});
|
|
106
106
|
};
|
|
107
|
-
Plugin.version = "3.11.
|
|
107
|
+
Plugin.version = "3.11.2";
|
|
108
108
|
return Plugin;
|
|
109
109
|
}());
|
|
110
110
|
var Plugin$1 = Plugin;
|
|
@@ -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.2
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
@@ -280,7 +280,7 @@ var Plugin = /** @class */ (function () {
|
|
|
280
280
|
delete _this[key];
|
|
281
281
|
});
|
|
282
282
|
};
|
|
283
|
-
Plugin.version = "3.11.
|
|
283
|
+
Plugin.version = "3.11.2";
|
|
284
284
|
return Plugin;
|
|
285
285
|
}());
|
|
286
286
|
var Plugin$1 = Plugin;
|
|
@@ -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.2
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
@@ -494,7 +494,7 @@ var Plugin = /** @class */ (function () {
|
|
|
494
494
|
delete _this[key];
|
|
495
495
|
});
|
|
496
496
|
};
|
|
497
|
-
Plugin.version = "3.11.
|
|
497
|
+
Plugin.version = "3.11.2";
|
|
498
498
|
return Plugin;
|
|
499
499
|
}());
|
|
500
500
|
var Plugin$1 = Plugin;
|
|
@@ -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.2
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
@@ -121,7 +121,7 @@ var Plugin = /** @class */ (function () {
|
|
|
121
121
|
delete _this[key];
|
|
122
122
|
});
|
|
123
123
|
};
|
|
124
|
-
Plugin.version = "3.11.
|
|
124
|
+
Plugin.version = "3.11.2";
|
|
125
125
|
return Plugin;
|
|
126
126
|
}());
|
|
127
127
|
var Plugin$1 = Plugin;
|
|
@@ -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.2
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
@@ -269,7 +269,7 @@ var Plugin = /** @class */ (function () {
|
|
|
269
269
|
delete _this[key];
|
|
270
270
|
});
|
|
271
271
|
};
|
|
272
|
-
Plugin.version = "3.11.
|
|
272
|
+
Plugin.version = "3.11.2";
|
|
273
273
|
return Plugin;
|
|
274
274
|
}());
|
|
275
275
|
var Plugin$1 = Plugin;
|