billboard.js 3.2.1 → 3.2.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 +2 -3
- package/dist/billboard.js +29 -19
- package/dist/billboard.min.css +2 -2
- package/dist/billboard.min.js +2 -2
- package/dist/billboard.pkgd.js +2969 -2381
- 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 +9 -5
- package/dist/plugin/billboardjs-plugin-sparkline.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-stanford.js +9 -5
- package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-tableview.js +9 -5
- package/dist/plugin/billboardjs-plugin-tableview.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-textoverlap.js +9 -5
- package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.js +2943 -2365
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.js +2950 -2368
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.js +2951 -2369
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.js +2952 -2370
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.js +2953 -2371
- package/dist/theme/datalab.css +2 -2
- package/dist/theme/datalab.min.css +2 -2
- package/dist/theme/graph.css +2 -2
- package/dist/theme/graph.min.css +2 -2
- package/dist/theme/insight.css +2 -2
- package/dist/theme/insight.min.css +2 -2
- package/dist-esm/billboard.js +378 -377
- package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-sparkline.js +6 -6
- package/dist-esm/plugin/billboardjs-plugin-stanford.js +15 -15
- package/dist-esm/plugin/billboardjs-plugin-tableview.js +6 -6
- package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +4 -4
- package/package.json +37 -38
- package/src/ChartInternal/Axis/Axis.ts +2 -2
- package/src/ChartInternal/internals/legend.ts +2 -1
- package/src/ChartInternal/internals/redraw.ts +2 -2
- package/src/ChartInternal/shape/arc.ts +1 -5
- package/src/ChartInternal/shape/bar.ts +10 -2
- package/src/module/util.ts +3 -5
- package/src/scss/billboard.scss +1 -13
- package/src/scss/theme/datalab.scss +1 -7
- package/src/scss/theme/graph.scss +1 -2
- package/src/scss/theme/insight.scss +1 -2
- package/types/types.d.ts +5 -2
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.2.
|
|
8
|
+
* @version 3.2.2
|
|
9
9
|
*/
|
|
10
10
|
import { timeParse, utcParse, timeFormat, utcFormat } from 'd3-time-format';
|
|
11
11
|
import { pointer, select, namespaces, selectAll } from 'd3-selection';
|
|
@@ -414,7 +414,7 @@ function setTextValue(node, text, dy, toMiddle) {
|
|
|
414
414
|
multiline.forEach(function (v, i) {
|
|
415
415
|
node.append("tspan")
|
|
416
416
|
.attr("x", 0)
|
|
417
|
-
.attr("dy", (i === 0 ? dy[0] * len_1 : dy[1]
|
|
417
|
+
.attr("dy", "".concat(i === 0 ? dy[0] * len_1 : dy[1], "em"))
|
|
418
418
|
.text(v);
|
|
419
419
|
});
|
|
420
420
|
}
|
|
@@ -468,11 +468,10 @@ function getPathBox(path) {
|
|
|
468
468
|
* @private
|
|
469
469
|
*/
|
|
470
470
|
function getPointer(event, element) {
|
|
471
|
-
var
|
|
472
|
-
var
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
return pointer$1;
|
|
471
|
+
var _a;
|
|
472
|
+
var touches = event && ((_a = (event.touches || (event.sourceEvent && event.sourceEvent.touches))) === null || _a === void 0 ? void 0 : _a[0]);
|
|
473
|
+
var pointer$1 = pointer(touches || event, element);
|
|
474
|
+
return pointer$1.map(function (v) { return (isNaN(v) ? 0 : v); });
|
|
476
475
|
}
|
|
477
476
|
/**
|
|
478
477
|
* Return brush selection array
|
|
@@ -489,7 +488,7 @@ function getBrushSelection(ctx) {
|
|
|
489
488
|
selection = event.selection;
|
|
490
489
|
// check from brush area selection
|
|
491
490
|
}
|
|
492
|
-
else if (main && (selection = main.select("."
|
|
491
|
+
else if (main && (selection = main.select(".".concat(CLASS.brush)).node())) {
|
|
493
492
|
selection = brushSelection(selection);
|
|
494
493
|
}
|
|
495
494
|
return selection;
|
|
@@ -647,7 +646,7 @@ function getCssRules(styleSheets) {
|
|
|
647
646
|
}
|
|
648
647
|
}
|
|
649
648
|
catch (e) {
|
|
650
|
-
console.error("Error while reading rules from "
|
|
649
|
+
console.error("Error while reading rules from ".concat(sheet.href, ": ").concat(e.toString()));
|
|
651
650
|
}
|
|
652
651
|
});
|
|
653
652
|
return rules;
|
|
@@ -834,7 +833,7 @@ var emulateEvent = {
|
|
|
834
833
|
function tplProcess(tpl, data) {
|
|
835
834
|
var res = tpl;
|
|
836
835
|
for (var x in data) {
|
|
837
|
-
res = res.replace(new RegExp("{="
|
|
836
|
+
res = res.replace(new RegExp("{=".concat(x, "}"), "g"), data[x]);
|
|
838
837
|
}
|
|
839
838
|
return res;
|
|
840
839
|
}
|
|
@@ -859,7 +858,7 @@ function parseDate(date) {
|
|
|
859
858
|
}
|
|
860
859
|
if (!parsedDate || isNaN(+parsedDate)) {
|
|
861
860
|
console && console.error &&
|
|
862
|
-
console.error("Failed to parse x '"
|
|
861
|
+
console.error("Failed to parse x '".concat(date, "' to Date object"));
|
|
863
862
|
}
|
|
864
863
|
return parsedDate;
|
|
865
864
|
}
|
|
@@ -914,7 +913,7 @@ function checkModuleImport(ctx) {
|
|
|
914
913
|
}
|
|
915
914
|
}
|
|
916
915
|
}
|
|
917
|
-
type && logError("Please, make sure if %c"
|
|
916
|
+
type && logError("Please, make sure if %c".concat(camelize(type)), "module has been imported and specified correctly.");
|
|
918
917
|
}
|
|
919
918
|
/**
|
|
920
919
|
* Log error and throw error
|
|
@@ -928,10 +927,10 @@ function logError(head, tail) {
|
|
|
928
927
|
var info = "https://github.com/naver/billboard.js/wiki/CHANGELOG-v2#modularization-by-its-functionality";
|
|
929
928
|
var hasConsole = (_a = win.console) === null || _a === void 0 ? void 0 : _a.error;
|
|
930
929
|
if (hasConsole) {
|
|
931
|
-
console.error("\u274C "
|
|
930
|
+
console.error("\u274C ".concat(prefix, " ").concat(head), "background:red;color:white;display:block;font-size:15px", tail);
|
|
932
931
|
console.info("%cℹ️", "font-size:15px", info);
|
|
933
932
|
}
|
|
934
|
-
throw Error(prefix
|
|
933
|
+
throw Error("".concat(prefix, " ").concat(head.replace(/\%c([a-z-]+)/i, "'$1' "), " ").concat(tail));
|
|
935
934
|
}
|
|
936
935
|
|
|
937
936
|
/**
|
|
@@ -2987,7 +2986,7 @@ var dataConvert = {
|
|
|
2987
2986
|
data = {};
|
|
2988
2987
|
["url", "mimeType", "headers", "keys", "json", "keys", "rows", "columns"]
|
|
2989
2988
|
.forEach(function (v) {
|
|
2990
|
-
var key = "data_"
|
|
2989
|
+
var key = "data_".concat(v);
|
|
2991
2990
|
if (key in args) {
|
|
2992
2991
|
data[v] = args[key];
|
|
2993
2992
|
}
|
|
@@ -3036,10 +3035,10 @@ var dataConvert = {
|
|
|
3036
3035
|
if (req.readyState === 4) {
|
|
3037
3036
|
if (req.status === 200) {
|
|
3038
3037
|
var response = req.responseText;
|
|
3039
|
-
response && done.call(_this, _this["convert"
|
|
3038
|
+
response && done.call(_this, _this["convert".concat(capitalize(mimeType), "ToData")](mimeType === "json" ? JSON.parse(response) : response, keys));
|
|
3040
3039
|
}
|
|
3041
3040
|
else {
|
|
3042
|
-
throw new Error(url
|
|
3041
|
+
throw new Error("".concat(url, ": Something went wrong loading!"));
|
|
3043
3042
|
}
|
|
3044
3043
|
}
|
|
3045
3044
|
};
|
|
@@ -3136,7 +3135,7 @@ var dataConvert = {
|
|
|
3136
3135
|
var newRow_1 = {};
|
|
3137
3136
|
row.forEach(function (v, j) {
|
|
3138
3137
|
if (isUndefined(v)) {
|
|
3139
|
-
throw new Error("Source data is missing a component at ("
|
|
3138
|
+
throw new Error("Source data is missing a component at (".concat(i, ", ").concat(j, ")!"));
|
|
3140
3139
|
}
|
|
3141
3140
|
newRow_1[keys[j]] = v;
|
|
3142
3141
|
});
|
|
@@ -3155,7 +3154,7 @@ var dataConvert = {
|
|
|
3155
3154
|
newRows[j - 1] = {};
|
|
3156
3155
|
}
|
|
3157
3156
|
if (isUndefined(v)) {
|
|
3158
|
-
throw new Error("Source data is missing a component at ("
|
|
3157
|
+
throw new Error("Source data is missing a component at (".concat(i, ", ").concat(j, ")!"));
|
|
3159
3158
|
}
|
|
3160
3159
|
newRows[j - 1][key] = v;
|
|
3161
3160
|
}
|
|
@@ -3208,7 +3207,7 @@ var dataConvert = {
|
|
|
3208
3207
|
// check x is defined
|
|
3209
3208
|
ids.forEach(function (id) {
|
|
3210
3209
|
if (!_this.data.xs[id]) {
|
|
3211
|
-
throw new Error("x is not defined for id = \""
|
|
3210
|
+
throw new Error("x is not defined for id = \"".concat(id, "\"."));
|
|
3212
3211
|
}
|
|
3213
3212
|
});
|
|
3214
3213
|
// convert to target
|
|
@@ -3864,7 +3863,7 @@ var data$1 = {
|
|
|
3864
3863
|
data
|
|
3865
3864
|
.filter(function (v) { return $$.isBarType(v.id); })
|
|
3866
3865
|
.forEach(function (v) {
|
|
3867
|
-
var shape = main.select("."
|
|
3866
|
+
var shape = main.select(".".concat(CLASS.bars).concat($$.getTargetSelectorSuffix(v.id), " .").concat(CLASS.bar, "-").concat(v.index)).node();
|
|
3868
3867
|
if (!closest && $$.isWithinBar(shape)) {
|
|
3869
3868
|
closest = v;
|
|
3870
3869
|
}
|
|
@@ -3942,7 +3941,7 @@ var data$1 = {
|
|
|
3942
3941
|
updateDataAttributes: function (name, attrs) {
|
|
3943
3942
|
var $$ = this;
|
|
3944
3943
|
var config = $$.config;
|
|
3945
|
-
var current = config["data_"
|
|
3944
|
+
var current = config["data_".concat(name)];
|
|
3946
3945
|
if (isUndefined(attrs)) {
|
|
3947
3946
|
return current;
|
|
3948
3947
|
}
|
|
@@ -4156,7 +4155,7 @@ var dataLoad = {
|
|
|
4156
4155
|
state.withoutFadeIn[id] = false;
|
|
4157
4156
|
// Remove target's elements
|
|
4158
4157
|
if ($el.legend) {
|
|
4159
|
-
$el.legend.selectAll("."
|
|
4158
|
+
$el.legend.selectAll(".".concat(CLASS.legendItem).concat($$.getTargetSelectorSuffix(id))).remove();
|
|
4160
4159
|
}
|
|
4161
4160
|
// Remove target
|
|
4162
4161
|
$$.data.targets = $$.data.targets.filter(function (t) { return t.id !== id; });
|
|
@@ -4187,7 +4186,7 @@ var interaction = {
|
|
|
4187
4186
|
return;
|
|
4188
4187
|
}
|
|
4189
4188
|
}
|
|
4190
|
-
main.selectAll("."
|
|
4189
|
+
main.selectAll(".".concat(CLASS.shape, "-").concat(index))
|
|
4191
4190
|
.each(function () {
|
|
4192
4191
|
var _a;
|
|
4193
4192
|
select(this).classed(CLASS.EXPANDED, true);
|
|
@@ -4266,11 +4265,11 @@ var interaction = {
|
|
|
4266
4265
|
var callback_1 = config[isOver ? "data_onover" : "data_onout"].bind($$.api);
|
|
4267
4266
|
config.color_onover && $$.setOverColor(isOver, d, isArc);
|
|
4268
4267
|
if (isArc) {
|
|
4269
|
-
callback_1(d, main.select("."
|
|
4268
|
+
callback_1(d, main.select(".".concat(CLASS.arc).concat($$.getTargetSelectorSuffix(d.id))).node());
|
|
4270
4269
|
}
|
|
4271
4270
|
else if (!config.tooltip_grouped) {
|
|
4272
4271
|
var last_1 = $$.cache.get(KEY.setOverOut) || [];
|
|
4273
|
-
var shape = main.selectAll("."
|
|
4272
|
+
var shape = main.selectAll(".".concat(CLASS.shape, "-").concat(d))
|
|
4274
4273
|
.filter(function (d) {
|
|
4275
4274
|
return $$.isWithinShape(this, d);
|
|
4276
4275
|
});
|
|
@@ -4295,7 +4294,7 @@ var interaction = {
|
|
|
4295
4294
|
$$.showCircleFocus($$.getAllValuesOnIndex(d, true)) :
|
|
4296
4295
|
$$.setExpand(d, null, true);
|
|
4297
4296
|
}
|
|
4298
|
-
!$$.isMultipleX() && main.selectAll("."
|
|
4297
|
+
!$$.isMultipleX() && main.selectAll(".".concat(CLASS.shape, "-").concat(d))
|
|
4299
4298
|
.each(function (d) {
|
|
4300
4299
|
callback_1(d, this);
|
|
4301
4300
|
});
|
|
@@ -4350,7 +4349,7 @@ var interaction = {
|
|
|
4350
4349
|
var $$ = this;
|
|
4351
4350
|
var config = $$.config, _a = $$.state, eventReceiver = _a.eventReceiver, hasAxis = _a.hasAxis, hasRadar = _a.hasRadar, _b = $$.$el, eventRect = _b.eventRect, arcs = _b.arcs, radar = _b.radar;
|
|
4352
4351
|
var isMultipleX = $$.isMultipleX();
|
|
4353
|
-
var element = (hasRadar ? radar.axes.select("."
|
|
4352
|
+
var element = (hasRadar ? radar.axes.select(".".concat(CLASS.axis, "-").concat(index, " text")) : (eventRect || arcs.selectAll(".".concat(CLASS.target, " path")).filter(function (d, i) { return i === index; }))).node();
|
|
4354
4353
|
var _c = element.getBoundingClientRect(), width = _c.width, left = _c.left, top = _c.top;
|
|
4355
4354
|
if (hasAxis && !hasRadar && !isMultipleX) {
|
|
4356
4355
|
var coords = eventReceiver.coords[index];
|
|
@@ -4391,7 +4390,7 @@ var interaction = {
|
|
|
4391
4390
|
*/
|
|
4392
4391
|
var classModule = {
|
|
4393
4392
|
generateClass: function (prefix, targetId) {
|
|
4394
|
-
return " "
|
|
4393
|
+
return " ".concat(prefix, " ").concat(prefix + this.getTargetSelectorSuffix(targetId));
|
|
4395
4394
|
},
|
|
4396
4395
|
/**
|
|
4397
4396
|
* Get class string
|
|
@@ -4419,7 +4418,7 @@ var classModule = {
|
|
|
4419
4418
|
*/
|
|
4420
4419
|
getChartClass: function (type) {
|
|
4421
4420
|
var _this = this;
|
|
4422
|
-
return function (d) { return CLASS["chart"
|
|
4421
|
+
return function (d) { return CLASS["chart".concat(type)] + _this.classTarget((d.data ? d.data : d).id); };
|
|
4423
4422
|
},
|
|
4424
4423
|
generateExtraLineClass: function () {
|
|
4425
4424
|
var $$ = this;
|
|
@@ -4435,13 +4434,13 @@ var classModule = {
|
|
|
4435
4434
|
};
|
|
4436
4435
|
},
|
|
4437
4436
|
classRegion: function (d, i) {
|
|
4438
|
-
return this.generateClass(CLASS.region, i)
|
|
4437
|
+
return "".concat(this.generateClass(CLASS.region, i), " ").concat("class" in d ? d["class"] : "");
|
|
4439
4438
|
},
|
|
4440
4439
|
classTarget: function (id) {
|
|
4441
4440
|
var additionalClassSuffix = this.config.data_classes[id];
|
|
4442
4441
|
var additionalClass = "";
|
|
4443
4442
|
if (additionalClassSuffix) {
|
|
4444
|
-
additionalClass = " "
|
|
4443
|
+
additionalClass = " ".concat(CLASS.target, "-").concat(additionalClassSuffix);
|
|
4445
4444
|
}
|
|
4446
4445
|
return this.generateClass(CLASS.target, id) + additionalClass;
|
|
4447
4446
|
},
|
|
@@ -4449,20 +4448,20 @@ var classModule = {
|
|
|
4449
4448
|
return this.classFocused(d) + this.classDefocused(d);
|
|
4450
4449
|
},
|
|
4451
4450
|
classFocused: function (d) {
|
|
4452
|
-
return " "
|
|
4451
|
+
return " ".concat(this.state.focusedTargetIds.indexOf(d.id) >= 0 ? CLASS.focused : "");
|
|
4453
4452
|
},
|
|
4454
4453
|
classDefocused: function (d) {
|
|
4455
|
-
return " "
|
|
4454
|
+
return " ".concat(this.state.defocusedTargetIds.indexOf(d.id) >= 0 ? CLASS.defocused : "");
|
|
4456
4455
|
},
|
|
4457
4456
|
getTargetSelectorSuffix: function (targetId) {
|
|
4458
|
-
var targetStr = targetId || targetId === 0 ? "-"
|
|
4457
|
+
var targetStr = targetId || targetId === 0 ? "-".concat(targetId) : "";
|
|
4459
4458
|
return targetStr.replace(/([\s?!@#$%^&*()_=+,.<>'":;\[\]\/|~`{}\\])/g, "-");
|
|
4460
4459
|
},
|
|
4461
4460
|
selectorTarget: function (id, prefix) {
|
|
4462
4461
|
var pfx = prefix || "";
|
|
4463
4462
|
var target = this.getTargetSelectorSuffix(id);
|
|
4464
4463
|
// select target & circle
|
|
4465
|
-
return pfx
|
|
4464
|
+
return "".concat(pfx, ".").concat(CLASS.target + target, ", ").concat(pfx, ".").concat(CLASS.circles + target);
|
|
4466
4465
|
},
|
|
4467
4466
|
selectorTargets: function (idsValue, prefix) {
|
|
4468
4467
|
var _this = this;
|
|
@@ -4471,7 +4470,7 @@ var classModule = {
|
|
|
4471
4470
|
ids.map(function (id) { return _this.selectorTarget(id, prefix); }) : null;
|
|
4472
4471
|
},
|
|
4473
4472
|
selectorLegend: function (id) {
|
|
4474
|
-
return "."
|
|
4473
|
+
return ".".concat(CLASS.legendItem + this.getTargetSelectorSuffix(id));
|
|
4475
4474
|
},
|
|
4476
4475
|
selectorLegends: function (ids) {
|
|
4477
4476
|
var _this = this;
|
|
@@ -4570,10 +4569,10 @@ var color = {
|
|
|
4570
4569
|
// Add background color to patterns
|
|
4571
4570
|
var colorizedPatterns = pattern.map(function (p, index) {
|
|
4572
4571
|
var color = p.replace(/[#\(\)\s,]/g, "");
|
|
4573
|
-
var id = $$.state.datetimeId
|
|
4572
|
+
var id = "".concat($$.state.datetimeId, "-pattern-").concat(color, "-").concat(index);
|
|
4574
4573
|
return colorizePattern(tiles_1[index % tiles_1.length], p, id);
|
|
4575
4574
|
});
|
|
4576
|
-
pattern = colorizedPatterns.map(function (p) { return "url(#"
|
|
4575
|
+
pattern = colorizedPatterns.map(function (p) { return "url(#".concat(p.id, ")"); });
|
|
4577
4576
|
$$.patterns = colorizedPatterns;
|
|
4578
4577
|
}
|
|
4579
4578
|
return function (d) {
|
|
@@ -4640,14 +4639,14 @@ var color = {
|
|
|
4640
4639
|
ids = Object.keys(backgroundColors);
|
|
4641
4640
|
}
|
|
4642
4641
|
ids.forEach(function (v) {
|
|
4643
|
-
var id = state.datetimeId
|
|
4642
|
+
var id = "".concat(state.datetimeId, "-labels-bg").concat($$.getTargetSelectorSuffix(v));
|
|
4644
4643
|
$el.defs.append("filter")
|
|
4645
4644
|
.attr("x", "0")
|
|
4646
4645
|
.attr("y", "0")
|
|
4647
4646
|
.attr("width", "1")
|
|
4648
4647
|
.attr("height", "1")
|
|
4649
4648
|
.attr("id", id)
|
|
4650
|
-
.html("<feFlood flood-color=\""
|
|
4649
|
+
.html("<feFlood flood-color=\"".concat(v === "" ? backgroundColors : backgroundColors[v], "\" /><feComposite in=\"SourceGraphic\"/>"));
|
|
4651
4650
|
});
|
|
4652
4651
|
}
|
|
4653
4652
|
},
|
|
@@ -4677,8 +4676,8 @@ var color = {
|
|
|
4677
4676
|
}
|
|
4678
4677
|
main.selectAll(isObject(d) ?
|
|
4679
4678
|
// when is Arc type
|
|
4680
|
-
"."
|
|
4681
|
-
"."
|
|
4679
|
+
".".concat(CLASS.arc).concat($$.getTargetSelectorSuffix(d.id)) :
|
|
4680
|
+
".".concat(CLASS.shape, "-").concat(d)).style("fill", color);
|
|
4682
4681
|
}
|
|
4683
4682
|
};
|
|
4684
4683
|
|
|
@@ -4691,7 +4690,7 @@ var domain = {
|
|
|
4691
4690
|
var ids = $$.mapToIds(targets);
|
|
4692
4691
|
var ys = $$.getValuesAsIdKeyed(targets);
|
|
4693
4692
|
if (dataGroups.length > 0) {
|
|
4694
|
-
var hasValue_1 = $$["has"
|
|
4693
|
+
var hasValue_1 = $$["has".concat(isMin ? "Negative" : "Positive", "ValueInTargets")](targets);
|
|
4695
4694
|
dataGroups.forEach(function (groupIds) {
|
|
4696
4695
|
// Determine baseId
|
|
4697
4696
|
var idsInGroup = groupIds
|
|
@@ -4737,7 +4736,7 @@ var domain = {
|
|
|
4737
4736
|
getYDomain: function (targets, axisId, xDomain) {
|
|
4738
4737
|
var $$ = this;
|
|
4739
4738
|
var axis = $$.axis, config = $$.config, scale = $$.scale;
|
|
4740
|
-
var pfx = "axis_"
|
|
4739
|
+
var pfx = "axis_".concat(axisId);
|
|
4741
4740
|
if ($$.isStackNormalized()) {
|
|
4742
4741
|
return [0, 100];
|
|
4743
4742
|
}
|
|
@@ -4756,17 +4755,17 @@ var domain = {
|
|
|
4756
4755
|
$$.getYDomain(targets, "y2", xDomain);
|
|
4757
4756
|
}
|
|
4758
4757
|
}
|
|
4759
|
-
var yMin = config[pfx
|
|
4760
|
-
var yMax = config[pfx
|
|
4761
|
-
var center = config[pfx
|
|
4762
|
-
var isInverted = config[pfx
|
|
4758
|
+
var yMin = config["".concat(pfx, "_min")];
|
|
4759
|
+
var yMax = config["".concat(pfx, "_max")];
|
|
4760
|
+
var center = config["".concat(pfx, "_center")];
|
|
4761
|
+
var isInverted = config["".concat(pfx, "_inverted")];
|
|
4763
4762
|
var showHorizontalDataLabel = $$.hasDataLabel() && config.axis_rotated;
|
|
4764
4763
|
var showVerticalDataLabel = $$.hasDataLabel() && !config.axis_rotated;
|
|
4765
4764
|
var yDomainMin = $$.getYDomainMinMax(yTargets, "min");
|
|
4766
4765
|
var yDomainMax = $$.getYDomainMinMax(yTargets, "max");
|
|
4767
4766
|
var isZeroBased = __spreadArray([TYPE.BAR, TYPE.BUBBLE, TYPE.SCATTER], TYPE_BY_CATEGORY.Line, true).some(function (v) {
|
|
4768
4767
|
var type = v.indexOf("area") > -1 ? "area" : v;
|
|
4769
|
-
return $$.hasType(v, yTargets) && config[type
|
|
4768
|
+
return $$.hasType(v, yTargets) && config["".concat(type, "_zerobased")];
|
|
4770
4769
|
});
|
|
4771
4770
|
// MEMO: avoid inverting domain unexpectedly
|
|
4772
4771
|
yDomainMin = isValue(yMin) ? yMin :
|
|
@@ -4817,7 +4816,7 @@ var domain = {
|
|
|
4817
4816
|
}
|
|
4818
4817
|
// if padding is set, the domain will be updated relative the current domain value
|
|
4819
4818
|
// ex) $$.height=300, padding.top=150, domainLength=4 --> domain=6
|
|
4820
|
-
var p = config[pfx
|
|
4819
|
+
var p = config["".concat(pfx, "_padding")];
|
|
4821
4820
|
if (notEmpty(p)) {
|
|
4822
4821
|
["bottom", "top"].forEach(function (v) {
|
|
4823
4822
|
padding[v] = axis.getPadding(p, v, padding[v], domainLength);
|
|
@@ -4835,7 +4834,7 @@ var domain = {
|
|
|
4835
4834
|
getXDomainMinMax: function (targets, type) {
|
|
4836
4835
|
var _a;
|
|
4837
4836
|
var $$ = this;
|
|
4838
|
-
var configValue = $$.config["axis_x_"
|
|
4837
|
+
var configValue = $$.config["axis_x_".concat(type)];
|
|
4839
4838
|
var dataValue = getMinMax$1(type, targets.map(function (t) { return getMinMax$1(type, t.values.map(function (v) { return v.x; })); }));
|
|
4840
4839
|
var value = isObject(configValue) ? configValue.value : configValue;
|
|
4841
4840
|
value = isDefined(value) && ((_a = $$.axis) === null || _a === void 0 ? void 0 : _a.isTimeSeries()) ? parseDate.bind(this)(value) : value;
|
|
@@ -5015,7 +5014,7 @@ var domain = {
|
|
|
5015
5014
|
*/
|
|
5016
5015
|
function getFormat($$, typeValue, v) {
|
|
5017
5016
|
var config = $$.config;
|
|
5018
|
-
var type = "axis_"
|
|
5017
|
+
var type = "axis_".concat(typeValue, "_tick_format");
|
|
5019
5018
|
var format = config[type] ?
|
|
5020
5019
|
config[type] : $$.defaultValueFormat;
|
|
5021
5020
|
return format(v);
|
|
@@ -5043,7 +5042,7 @@ var format = {
|
|
|
5043
5042
|
return isValue(v) ? +v : "";
|
|
5044
5043
|
},
|
|
5045
5044
|
defaultArcValueFormat: function (v, ratio) {
|
|
5046
|
-
return (ratio * 100).toFixed(1)
|
|
5045
|
+
return "".concat((ratio * 100).toFixed(1), "%");
|
|
5047
5046
|
},
|
|
5048
5047
|
dataLabelFormat: function (targetId) {
|
|
5049
5048
|
var $$ = this;
|
|
@@ -5119,7 +5118,7 @@ var legend$1 = {
|
|
|
5119
5118
|
$$.updateLegendElement(targetIds || $$.mapToIds($$.data.targets), optionz, transitions);
|
|
5120
5119
|
}
|
|
5121
5120
|
// toggle legend state
|
|
5122
|
-
$el.legend.selectAll("."
|
|
5121
|
+
$el.legend.selectAll(".".concat(CLASS.legendItem))
|
|
5123
5122
|
.classed(CLASS.legendItemHidden, function (id) {
|
|
5124
5123
|
var hide = !$$.isTargetToShow(id);
|
|
5125
5124
|
if (hide) {
|
|
@@ -5236,7 +5235,7 @@ var legend$1 = {
|
|
|
5236
5235
|
updateLegendItemColor: function (id, color) {
|
|
5237
5236
|
var legend = this.$el.legend;
|
|
5238
5237
|
if (legend) {
|
|
5239
|
-
legend.select("."
|
|
5238
|
+
legend.select(".".concat(CLASS.legendItem, "-").concat(id, " line"))
|
|
5240
5239
|
.style("stroke", color);
|
|
5241
5240
|
}
|
|
5242
5241
|
},
|
|
@@ -5281,7 +5280,7 @@ var legend$1 = {
|
|
|
5281
5280
|
var $$ = this;
|
|
5282
5281
|
var legend = $$.$el.legend, $T = $$.$T;
|
|
5283
5282
|
var targetIdz = $$.mapToTargetIds(targetIds);
|
|
5284
|
-
legend && $T(legend.selectAll("."
|
|
5283
|
+
legend && $T(legend.selectAll(".".concat(CLASS.legendItem))
|
|
5285
5284
|
.filter(function (id) { return targetIdz.indexOf(id) >= 0; })
|
|
5286
5285
|
.classed(CLASS.legendItemFocused, focus))
|
|
5287
5286
|
.style("opacity", function () {
|
|
@@ -5296,7 +5295,7 @@ var legend$1 = {
|
|
|
5296
5295
|
revertLegend: function () {
|
|
5297
5296
|
var $$ = this;
|
|
5298
5297
|
var legend = $$.$el.legend, $T = $$.$T;
|
|
5299
|
-
legend && $T(legend.selectAll("."
|
|
5298
|
+
legend && $T(legend.selectAll(".".concat(CLASS.legendItem))
|
|
5300
5299
|
.classed(CLASS.legendItemFocused, false))
|
|
5301
5300
|
.style("opacity", null);
|
|
5302
5301
|
},
|
|
@@ -5398,7 +5397,7 @@ var legend$1 = {
|
|
|
5398
5397
|
if (!callFn(config.legend_item_onout, api, id)) {
|
|
5399
5398
|
select(this).classed(CLASS.legendItemFocused, false);
|
|
5400
5399
|
if (hasGauge) {
|
|
5401
|
-
$$.undoMarkOverlapped($$, "."
|
|
5400
|
+
$$.undoMarkOverlapped($$, ".".concat(CLASS.gaugeValue));
|
|
5402
5401
|
}
|
|
5403
5402
|
$$.api.revert();
|
|
5404
5403
|
}
|
|
@@ -5407,7 +5406,7 @@ var legend$1 = {
|
|
|
5407
5406
|
if (!callFn(config.legend_item_onover, api, id)) {
|
|
5408
5407
|
select(this).classed(CLASS.legendItemFocused, true);
|
|
5409
5408
|
if (hasGauge) {
|
|
5410
|
-
$$.markOverlapped(id, $$, "."
|
|
5409
|
+
$$.markOverlapped(id, $$, ".".concat(CLASS.gaugeValue));
|
|
5411
5410
|
}
|
|
5412
5411
|
if (!state.transiting && $$.isTargetToShow(id)) {
|
|
5413
5412
|
api.focus(id);
|
|
@@ -5535,7 +5534,7 @@ var legend$1 = {
|
|
|
5535
5534
|
var yForLegendTile = function (id, i) { return yForLegend(id, i) + 4; };
|
|
5536
5535
|
var pos = -200;
|
|
5537
5536
|
// Define g for legend area
|
|
5538
|
-
var l = legend.selectAll("."
|
|
5537
|
+
var l = legend.selectAll(".".concat(CLASS.legendItem))
|
|
5539
5538
|
.data(targetIdz)
|
|
5540
5539
|
.enter()
|
|
5541
5540
|
.append("g");
|
|
@@ -5578,7 +5577,8 @@ var legend$1 = {
|
|
|
5578
5577
|
.attr("href", function (data, idx, selection) {
|
|
5579
5578
|
var node = selection[idx];
|
|
5580
5579
|
var nodeName = node.nodeName.toLowerCase();
|
|
5581
|
-
|
|
5580
|
+
var id = $$.getTargetSelectorSuffix(data);
|
|
5581
|
+
return nodeName === "use" ? "#".concat(state.datetimeId, "-point").concat(id) : undefined;
|
|
5582
5582
|
});
|
|
5583
5583
|
}
|
|
5584
5584
|
else {
|
|
@@ -5593,9 +5593,9 @@ var legend$1 = {
|
|
|
5593
5593
|
.attr("stroke-width", config.legend_item_tile_height);
|
|
5594
5594
|
}
|
|
5595
5595
|
// Set background for inset legend
|
|
5596
|
-
background = legend.select("."
|
|
5596
|
+
background = legend.select(".".concat(CLASS.legendBackground, " rect"));
|
|
5597
5597
|
if (state.isLegendInset && maxWidth > 0 && background.size() === 0) {
|
|
5598
|
-
background = legend.insert("g", "."
|
|
5598
|
+
background = legend.insert("g", ".".concat(CLASS.legendItem))
|
|
5599
5599
|
.attr("class", CLASS.legendBackground)
|
|
5600
5600
|
.append("rect");
|
|
5601
5601
|
}
|
|
@@ -5608,7 +5608,7 @@ var legend$1 = {
|
|
|
5608
5608
|
$T(texts, withTransition)
|
|
5609
5609
|
.attr("x", xForLegendText)
|
|
5610
5610
|
.attr("y", yForLegendText);
|
|
5611
|
-
var rects = legend.selectAll("rect."
|
|
5611
|
+
var rects = legend.selectAll("rect.".concat(CLASS.legendItemEvent))
|
|
5612
5612
|
.data(targetIdz);
|
|
5613
5613
|
$T(rects, withTransition)
|
|
5614
5614
|
.attr("width", function (id) { return widths[id]; })
|
|
@@ -5616,7 +5616,7 @@ var legend$1 = {
|
|
|
5616
5616
|
.attr("x", xForLegendRect)
|
|
5617
5617
|
.attr("y", yForLegendRect);
|
|
5618
5618
|
if (usePoint) {
|
|
5619
|
-
var tiles = legend.selectAll("."
|
|
5619
|
+
var tiles = legend.selectAll(".".concat(CLASS.legendItemPoint))
|
|
5620
5620
|
.data(targetIdz);
|
|
5621
5621
|
$T(tiles, withTransition)
|
|
5622
5622
|
.each(function () {
|
|
@@ -5652,7 +5652,7 @@ var legend$1 = {
|
|
|
5652
5652
|
});
|
|
5653
5653
|
}
|
|
5654
5654
|
else {
|
|
5655
|
-
var tiles = legend.selectAll("line."
|
|
5655
|
+
var tiles = legend.selectAll("line.".concat(CLASS.legendItemTile))
|
|
5656
5656
|
.data(targetIdz);
|
|
5657
5657
|
$T(tiles, withTransition)
|
|
5658
5658
|
.style("stroke", getColor)
|
|
@@ -5686,8 +5686,7 @@ var redraw = {
|
|
|
5686
5686
|
var main = $el.main;
|
|
5687
5687
|
state.redrawing = true;
|
|
5688
5688
|
var targetsToShow = $$.filterTargetsToShow($$.data.targets);
|
|
5689
|
-
var initializing = options.initializing;
|
|
5690
|
-
var flow = options.flow;
|
|
5689
|
+
var flow = options.flow, initializing = options.initializing;
|
|
5691
5690
|
var wth = $$.getWithOption(options);
|
|
5692
5691
|
var duration = wth.Transition ? config.transition_duration : 0;
|
|
5693
5692
|
var durationForExit = wth.TransitionForExit ? duration : 0;
|
|
@@ -5713,7 +5712,7 @@ var redraw = {
|
|
|
5713
5712
|
// @TODO: Make 'init' state to be accessible everywhere not passing as argument.
|
|
5714
5713
|
$$.axis.redrawAxis(targetsToShow, wth, transitions, flow, initializing);
|
|
5715
5714
|
// Data empty label positioning and text.
|
|
5716
|
-
config.data_empty_label_text && main.select("text."
|
|
5715
|
+
config.data_empty_label_text && main.select("text.".concat(CLASS.text, ".").concat(CLASS.empty))
|
|
5717
5716
|
.attr("x", state.width / 2)
|
|
5718
5717
|
.attr("y", state.height / 2)
|
|
5719
5718
|
.text(config.data_empty_label_text)
|
|
@@ -5725,11 +5724,11 @@ var redraw = {
|
|
|
5725
5724
|
["bar", "candlestick", "line", "area"].forEach(function (v) {
|
|
5726
5725
|
var name = capitalize(v);
|
|
5727
5726
|
if ((/^(line|area)$/.test(v) && $$.hasTypeOf(name)) || $$.hasType(v)) {
|
|
5728
|
-
$$["update"
|
|
5727
|
+
$$["update".concat(name)](wth.TransitionForExit);
|
|
5729
5728
|
}
|
|
5730
5729
|
});
|
|
5731
5730
|
// circles for select
|
|
5732
|
-
$el.text && main.selectAll("."
|
|
5731
|
+
$el.text && main.selectAll(".".concat(CLASS.selectedCircles))
|
|
5733
5732
|
.filter($$.isBarType.bind($$))
|
|
5734
5733
|
.selectAll("circle")
|
|
5735
5734
|
.remove();
|
|
@@ -5829,7 +5828,7 @@ var redraw = {
|
|
|
5829
5828
|
var name = capitalize(v);
|
|
5830
5829
|
var drawFn = shape.type[v];
|
|
5831
5830
|
if ((/^(area|line)$/.test(v) && $$.hasTypeOf(name)) || $$.hasType(v)) {
|
|
5832
|
-
list.push($$["redraw"
|
|
5831
|
+
list.push($$["redraw".concat(name)](drawFn, withTransition));
|
|
5833
5832
|
}
|
|
5834
5833
|
});
|
|
5835
5834
|
!flow && grid.main && list.push($$.updateGridFocus());
|
|
@@ -5874,6 +5873,7 @@ var redraw = {
|
|
|
5874
5873
|
redrawWithoutRescale: function () {
|
|
5875
5874
|
this.redraw({
|
|
5876
5875
|
withY: false,
|
|
5876
|
+
withLegend: true,
|
|
5877
5877
|
withSubchart: false,
|
|
5878
5878
|
withEventRect: false,
|
|
5879
5879
|
withTransitionForAxis: false
|
|
@@ -6093,8 +6093,8 @@ var shape = {
|
|
|
6093
6093
|
["bar", "candlestick", "line", "area"].forEach(function (v) {
|
|
6094
6094
|
var name = capitalize(/^(bubble|scatter)$/.test(v) ? "line" : v);
|
|
6095
6095
|
if ($$.hasType(v) || $$.hasTypeOf(name) || (v === "line" && ($$.hasType("bubble") || $$.hasType("scatter")))) {
|
|
6096
|
-
var indices = $$.getShapeIndices($$["is"
|
|
6097
|
-
var drawFn = $$["generateDraw"
|
|
6096
|
+
var indices = $$.getShapeIndices($$["is".concat(name, "Type")]);
|
|
6097
|
+
var drawFn = $$["generateDraw".concat(name)];
|
|
6098
6098
|
shape.indices[v] = indices;
|
|
6099
6099
|
shape.type[v] = drawFn ? drawFn.bind($$)(indices, false) : undefined;
|
|
6100
6100
|
}
|
|
@@ -6309,14 +6309,14 @@ var shape = {
|
|
|
6309
6309
|
var config = $$.config, org = $$.org, scale = $$.scale;
|
|
6310
6310
|
var maxDataCount = $$.getMaxDataCount();
|
|
6311
6311
|
var isGrouped = type === "bar" && config.data_groups.length;
|
|
6312
|
-
var configName = type
|
|
6312
|
+
var configName = "".concat(type, "_width");
|
|
6313
6313
|
var tickInterval = scale.zoom && !$$.axis.isCategorized() ?
|
|
6314
6314
|
(org.xDomain.map(function (v) { return scale.zoom(v); })
|
|
6315
6315
|
.reduce(function (a, c) { return Math.abs(a) + c; }) / maxDataCount) : axis.tickInterval(maxDataCount);
|
|
6316
6316
|
var getWidth = function (id) {
|
|
6317
6317
|
var width = id ? config[configName][id] : config[configName];
|
|
6318
|
-
var ratio = id ? width.ratio : config[configName
|
|
6319
|
-
var max = id ? width.max : config[configName
|
|
6318
|
+
var ratio = id ? width.ratio : config["".concat(configName, "_ratio")];
|
|
6319
|
+
var max = id ? width.max : config["".concat(configName, "_max")];
|
|
6320
6320
|
var w = isNumber(width) ?
|
|
6321
6321
|
width : targetsNum ? (tickInterval * ratio) / targetsNum : 0;
|
|
6322
6322
|
return max && w > max ? max : w;
|
|
@@ -6344,7 +6344,7 @@ var shape = {
|
|
|
6344
6344
|
getShapeByIndex: function (shapeName, i, id) {
|
|
6345
6345
|
var $$ = this;
|
|
6346
6346
|
var $el = $$.$el;
|
|
6347
|
-
var suffix = (isValue(i) ? "-"
|
|
6347
|
+
var suffix = (isValue(i) ? "-".concat(i) : "");
|
|
6348
6348
|
var shape = $el[shapeName];
|
|
6349
6349
|
// filter from shape reference if has
|
|
6350
6350
|
if (shape && !shape.empty()) {
|
|
@@ -6354,8 +6354,8 @@ var shape = {
|
|
|
6354
6354
|
}
|
|
6355
6355
|
else {
|
|
6356
6356
|
shape = (id ? $el.main
|
|
6357
|
-
.selectAll("."
|
|
6358
|
-
.selectAll("."
|
|
6357
|
+
.selectAll(".".concat(CLASS["".concat(shapeName, "s")]).concat($$.getTargetSelectorSuffix(id))) : $el.main)
|
|
6358
|
+
.selectAll(".".concat(CLASS[shapeName]).concat(suffix));
|
|
6359
6359
|
}
|
|
6360
6360
|
return shape;
|
|
6361
6361
|
},
|
|
@@ -6455,7 +6455,7 @@ var size = {
|
|
|
6455
6455
|
var $$ = this;
|
|
6456
6456
|
var config = $$.config, hasAxis = $$.state.hasAxis;
|
|
6457
6457
|
var axisId = config.axis_rotated ? "y" : "x";
|
|
6458
|
-
var axesLen = hasAxis ? config["axis_"
|
|
6458
|
+
var axesLen = hasAxis ? config["axis_".concat(axisId, "_axes")].length : 0;
|
|
6459
6459
|
var padding = isValue(config.padding_bottom) ?
|
|
6460
6460
|
config.padding_bottom : 0;
|
|
6461
6461
|
return padding + (axesLen ? $$.getHorizontalAxisHeight(axisId) * axesLen : 0);
|
|
@@ -6465,7 +6465,7 @@ var size = {
|
|
|
6465
6465
|
var config = $$.config, hasAxis = $$.state.hasAxis;
|
|
6466
6466
|
var isRotated = config.axis_rotated;
|
|
6467
6467
|
var axisId = isRotated ? "x" : "y";
|
|
6468
|
-
var axesLen = hasAxis ? config["axis_"
|
|
6468
|
+
var axesLen = hasAxis ? config["axis_".concat(axisId, "_axes")].length : 0;
|
|
6469
6469
|
var axisWidth = hasAxis ? $$.getAxisWidthByAxisId(axisId, withoutRecompute) : 0;
|
|
6470
6470
|
var padding;
|
|
6471
6471
|
if (isValue(config.padding_left)) {
|
|
@@ -6515,7 +6515,7 @@ var size = {
|
|
|
6515
6515
|
* @private
|
|
6516
6516
|
*/
|
|
6517
6517
|
getParentRectValue: function (key) {
|
|
6518
|
-
var offsetName = "offset"
|
|
6518
|
+
var offsetName = "offset".concat(capitalize(key));
|
|
6519
6519
|
var parent = this.$el.chart.node();
|
|
6520
6520
|
var v = 0;
|
|
6521
6521
|
while (v < 30 && parent && parent.tagName !== "BODY") {
|
|
@@ -6555,7 +6555,7 @@ var size = {
|
|
|
6555
6555
|
var config = $$.config, $el = $$.$el;
|
|
6556
6556
|
var hasLeftAxisRect = config.axis_rotated || (!config.axis_rotated && !config.axis_y_inner);
|
|
6557
6557
|
var leftAxisClass = config.axis_rotated ? CLASS.axisX : CLASS.axisY;
|
|
6558
|
-
var leftAxis = $el.main.select("."
|
|
6558
|
+
var leftAxis = $el.main.select(".".concat(leftAxisClass)).node();
|
|
6559
6559
|
var svgRect = leftAxis && hasLeftAxisRect ? leftAxis.getBoundingClientRect() : { right: 0 };
|
|
6560
6560
|
var chartRect = $el.chart.node().getBoundingClientRect();
|
|
6561
6561
|
var hasArc = $$.hasArcType();
|
|
@@ -6582,23 +6582,23 @@ var size = {
|
|
|
6582
6582
|
.attr("width", current.width)
|
|
6583
6583
|
.attr("height", current.height);
|
|
6584
6584
|
if (hasAxis) {
|
|
6585
|
-
var brush = svg.select("."
|
|
6585
|
+
var brush = svg.select(".".concat(CLASS.brush, " .overlay"));
|
|
6586
6586
|
var brushSize = { width: 0, height: 0 };
|
|
6587
6587
|
if (brush.size()) {
|
|
6588
6588
|
brushSize.width = +brush.attr("width");
|
|
6589
6589
|
brushSize.height = +brush.attr("height");
|
|
6590
6590
|
}
|
|
6591
|
-
svg.selectAll(["#"
|
|
6591
|
+
svg.selectAll(["#".concat(clip.id), "#".concat(clip.idGrid)])
|
|
6592
6592
|
.select("rect")
|
|
6593
6593
|
.attr("width", width)
|
|
6594
6594
|
.attr("height", height);
|
|
6595
|
-
svg.select("#"
|
|
6595
|
+
svg.select("#".concat(clip.idXAxis))
|
|
6596
6596
|
.select("rect")
|
|
6597
6597
|
.call($$.setXAxisClipPath.bind($$));
|
|
6598
|
-
svg.select("#"
|
|
6598
|
+
svg.select("#".concat(clip.idYAxis))
|
|
6599
6599
|
.select("rect")
|
|
6600
6600
|
.call($$.setYAxisClipPath.bind($$));
|
|
6601
|
-
clip.idSubchart && svg.select("#"
|
|
6601
|
+
clip.idSubchart && svg.select("#".concat(clip.idSubchart))
|
|
6602
6602
|
.select("rect")
|
|
6603
6603
|
.attr("width", width)
|
|
6604
6604
|
.attr("height", brushSize.height);
|
|
@@ -6709,7 +6709,7 @@ var text = {
|
|
|
6709
6709
|
*/
|
|
6710
6710
|
initText: function () {
|
|
6711
6711
|
var $el = this.$el;
|
|
6712
|
-
$el.main.select("."
|
|
6712
|
+
$el.main.select(".".concat(CLASS.chart)).append("g")
|
|
6713
6713
|
.attr("class", CLASS.chartTexts);
|
|
6714
6714
|
},
|
|
6715
6715
|
/**
|
|
@@ -6722,7 +6722,7 @@ var text = {
|
|
|
6722
6722
|
var classChartText = $$.getChartClass("Text");
|
|
6723
6723
|
var classTexts = $$.getClass("texts", "id");
|
|
6724
6724
|
var classFocus = $$.classFocus.bind($$);
|
|
6725
|
-
var mainTextUpdate = $$.$el.main.select("."
|
|
6725
|
+
var mainTextUpdate = $$.$el.main.select(".".concat(CLASS.chartTexts)).selectAll(".".concat(CLASS.chartText))
|
|
6726
6726
|
.data(targets)
|
|
6727
6727
|
.attr("class", function (d) { return classChartText(d) + classFocus(d); });
|
|
6728
6728
|
var mainTextEnter = mainTextUpdate.enter().append("g")
|
|
@@ -6740,8 +6740,8 @@ var text = {
|
|
|
6740
6740
|
var $$ = this;
|
|
6741
6741
|
var $el = $$.$el, $T = $$.$T, config = $$.config;
|
|
6742
6742
|
var classText = $$.getClass("text", "index");
|
|
6743
|
-
var text = $el.main.selectAll("."
|
|
6744
|
-
.selectAll("."
|
|
6743
|
+
var text = $el.main.selectAll(".".concat(CLASS.texts))
|
|
6744
|
+
.selectAll(".".concat(CLASS.text))
|
|
6745
6745
|
.data($$.labelishData.bind($$));
|
|
6746
6746
|
$T(text.exit())
|
|
6747
6747
|
.style("fill-opacity", "0")
|
|
@@ -6822,7 +6822,7 @@ var text = {
|
|
|
6822
6822
|
var id = isString(backgroundColor) ? "" : $$.getTargetSelectorSuffix(("id" in d ? d.id : d.data.id));
|
|
6823
6823
|
var filter = $el.defs.select(["filter[id*='labels-bg", "']"].join(id));
|
|
6824
6824
|
if (filter.size()) {
|
|
6825
|
-
color = "url(#"
|
|
6825
|
+
color = "url(#".concat(filter.attr("id"), ")");
|
|
6826
6826
|
}
|
|
6827
6827
|
}
|
|
6828
6828
|
return color || null;
|
|
@@ -6851,7 +6851,7 @@ var text = {
|
|
|
6851
6851
|
var posY = y.bind(this)(d, i);
|
|
6852
6852
|
// when is multiline
|
|
6853
6853
|
if (this.childElementCount) {
|
|
6854
|
-
node.attr("transform", "translate("
|
|
6854
|
+
node.attr("transform", "translate(".concat(posX, " ").concat(posY, ")"));
|
|
6855
6855
|
}
|
|
6856
6856
|
else {
|
|
6857
6857
|
node.attr("x", posX).attr("y", posY);
|
|
@@ -6875,7 +6875,7 @@ var text = {
|
|
|
6875
6875
|
base = base.querySelector("text");
|
|
6876
6876
|
}
|
|
6877
6877
|
var text = base.textContent;
|
|
6878
|
-
var cacheKey = KEY.textRect
|
|
6878
|
+
var cacheKey = "".concat(KEY.textRect, "-").concat(text.replace(/\W/g, "_"));
|
|
6879
6879
|
var rect = $$.cache.get(cacheKey);
|
|
6880
6880
|
if (!rect) {
|
|
6881
6881
|
$$.$el.svg.append("text")
|
|
@@ -6905,7 +6905,7 @@ var text = {
|
|
|
6905
6905
|
var getter = forX ? $$.getXForText : $$.getYForText;
|
|
6906
6906
|
$$.hasType("radar") && types.push("radar");
|
|
6907
6907
|
types.forEach(function (v) {
|
|
6908
|
-
points[v] = $$["generateGet"
|
|
6908
|
+
points[v] = $$["generateGet".concat(capitalize(v), "Points")](indices[v], false);
|
|
6909
6909
|
});
|
|
6910
6910
|
return function (d, i) {
|
|
6911
6911
|
var type = ($$.isAreaType(d) && "area") ||
|
|
@@ -7122,7 +7122,7 @@ var text = {
|
|
|
7122
7122
|
if (ratio === void 0) { ratio = 0; }
|
|
7123
7123
|
var $$ = this;
|
|
7124
7124
|
var config = $$.config;
|
|
7125
|
-
var threshold = config[type
|
|
7125
|
+
var threshold = config["".concat(type, "_label_threshold")] || 0;
|
|
7126
7126
|
return ratio >= threshold;
|
|
7127
7127
|
}
|
|
7128
7128
|
};
|
|
@@ -7180,7 +7180,7 @@ var title = {
|
|
|
7180
7180
|
if (title) {
|
|
7181
7181
|
var y = $$.yForTitle.call($$);
|
|
7182
7182
|
if (/g/i.test(title.node().tagName)) {
|
|
7183
|
-
title.attr("transform", "translate("
|
|
7183
|
+
title.attr("transform", "translate(".concat(getTextPos(config.title_position, current.width), ", ").concat(y, ")"));
|
|
7184
7184
|
}
|
|
7185
7185
|
else {
|
|
7186
7186
|
title.attr("x", $$.xForTitle.call($$)).attr("y", y);
|
|
@@ -7315,12 +7315,12 @@ var tooltip$1 = {
|
|
|
7315
7315
|
var $$ = this;
|
|
7316
7316
|
var api = $$.api, config = $$.config, state = $$.state;
|
|
7317
7317
|
var _a = ["title", "name", "value"].map(function (v) {
|
|
7318
|
-
var fn = config["tooltip_format_"
|
|
7318
|
+
var fn = config["tooltip_format_".concat(v)];
|
|
7319
7319
|
return isFunction(fn) ? fn.bind(api) : fn;
|
|
7320
7320
|
}), titleFormat = _a[0], nameFormat = _a[1], valueFormat = _a[2];
|
|
7321
7321
|
titleFormat = titleFormat || defaultTitleFormat;
|
|
7322
7322
|
nameFormat = nameFormat || (function (name) { return name; });
|
|
7323
|
-
valueFormat = valueFormat || ($$.isStackNormalized() ? function (v, ratio) { return (ratio * 100).toFixed(2)
|
|
7323
|
+
valueFormat = valueFormat || ($$.isStackNormalized() ? function (v, ratio) { return "".concat((ratio * 100).toFixed(2), "%"); } : defaultValueFormat);
|
|
7324
7324
|
var order = config.tooltip_order;
|
|
7325
7325
|
var getRowValue = function (row) { return ($$.axis && $$.isBubbleZType(row) ? $$.getBubbleZData(row.value, "z") : $$.getBaseValue(row)); };
|
|
7326
7326
|
var getBgColor = $$.levelColor ? function (row) { return $$.levelColor(row.value); } : function (row) { return color(row); };
|
|
@@ -7370,21 +7370,21 @@ var tooltip$1 = {
|
|
|
7370
7370
|
sanitise(titleFormat ? titleFormat(row.x) : row.x);
|
|
7371
7371
|
text = tplProcess(tpl[0], {
|
|
7372
7372
|
CLASS_TOOLTIP: CLASS.tooltip,
|
|
7373
|
-
TITLE: isValue(title) ? (tplStr ? title : "<tr><th colspan=\"2\">"
|
|
7373
|
+
TITLE: isValue(title) ? (tplStr ? title : "<tr><th colspan=\"2\">".concat(title, "</th></tr>")) : ""
|
|
7374
7374
|
});
|
|
7375
7375
|
}
|
|
7376
7376
|
if (!row.ratio && $$.$el.arcs) {
|
|
7377
|
-
row.ratio = $$.getRatio("arc", $$.$el.arcs.select("path."
|
|
7377
|
+
row.ratio = $$.getRatio("arc", $$.$el.arcs.select("path.".concat(CLASS.arc, "-").concat(row.id)).data()[0]);
|
|
7378
7378
|
}
|
|
7379
7379
|
param = [row.ratio, row.id, row.index, d];
|
|
7380
7380
|
value = sanitise(valueFormat.apply(void 0, __spreadArray([getRowValue(row)], param, false)));
|
|
7381
7381
|
if ($$.isAreaRangeType(row)) {
|
|
7382
7382
|
var _b = ["high", "low"].map(function (v) { return sanitise(valueFormat.apply(void 0, __spreadArray([$$.getRangedData(row, v)], param, false))); }), high = _b[0], low = _b[1];
|
|
7383
|
-
value = "<b>Mid:</b> "
|
|
7383
|
+
value = "<b>Mid:</b> ".concat(value, " <b>High:</b> ").concat(high, " <b>Low:</b> ").concat(low);
|
|
7384
7384
|
}
|
|
7385
7385
|
else if ($$.isCandlestickType(row)) {
|
|
7386
7386
|
var _c = ["open", "high", "low", "close", "volume"].map(function (v) { return sanitise(valueFormat.apply(void 0, __spreadArray([$$.getRangedData(row, v, "candlestick")], param, false))); }), open_1 = _c[0], high = _c[1], low = _c[2], close_1 = _c[3], volume = _c[4];
|
|
7387
|
-
value = "<b>Open:</b> "
|
|
7387
|
+
value = "<b>Open:</b> ".concat(open_1, " <b>High:</b> ").concat(high, " <b>Low:</b> ").concat(low, " <b>Close:</b> ").concat(close_1).concat(volume ? " <b>Volume:</b> ".concat(volume) : "");
|
|
7388
7388
|
}
|
|
7389
7389
|
if (value !== undefined) {
|
|
7390
7390
|
// Skip elements when their name is set to null
|
|
@@ -7395,7 +7395,7 @@ var tooltip$1 = {
|
|
|
7395
7395
|
var color_1 = getBgColor(row);
|
|
7396
7396
|
var contentValue_1 = {
|
|
7397
7397
|
CLASS_TOOLTIP_NAME: CLASS.tooltipName + $$.getTargetSelectorSuffix(row.id),
|
|
7398
|
-
COLOR: (tplStr || !$$.patterns) ? color_1 : "<svg><rect style=\"fill:"
|
|
7398
|
+
COLOR: (tplStr || !$$.patterns) ? color_1 : "<svg><rect style=\"fill:".concat(color_1, "\" width=\"10\" height=\"10\"></rect></svg>"),
|
|
7399
7399
|
NAME: name_1,
|
|
7400
7400
|
VALUE: value
|
|
7401
7401
|
};
|
|
@@ -7411,7 +7411,7 @@ var tooltip$1 = {
|
|
|
7411
7411
|
for (i = 0; i < len; i++) {
|
|
7412
7412
|
_loop_1();
|
|
7413
7413
|
}
|
|
7414
|
-
return text
|
|
7414
|
+
return "".concat(text, "</table>");
|
|
7415
7415
|
},
|
|
7416
7416
|
/**
|
|
7417
7417
|
* Get the content template string
|
|
@@ -7420,7 +7420,7 @@ var tooltip$1 = {
|
|
|
7420
7420
|
* @private
|
|
7421
7421
|
*/
|
|
7422
7422
|
getTooltipContentTemplate: function (tplStr) {
|
|
7423
|
-
return (tplStr || "<table class=\"{=CLASS_TOOLTIP}\"><tbody>\n\t\t\t\t{=TITLE}\n\t\t\t\t{{<tr class=\"{=CLASS_TOOLTIP_NAME}\">\n\t\t\t\t\t<td class=\"name\">"
|
|
7423
|
+
return (tplStr || "<table class=\"{=CLASS_TOOLTIP}\"><tbody>\n\t\t\t\t{=TITLE}\n\t\t\t\t{{<tr class=\"{=CLASS_TOOLTIP_NAME}\">\n\t\t\t\t\t<td class=\"name\">".concat(this.patterns ? "{=COLOR}" : "<span style=\"background-color:{=COLOR}\"></span>", "{=NAME}</td>\n\t\t\t\t\t<td class=\"value\">{=VALUE}</td>\n\t\t\t\t</tr>}}\n\t\t\t</tbody></table>"))
|
|
7424
7424
|
.replace(/(\r?\n|\t)/g, "")
|
|
7425
7425
|
.split(/{{(.*)}}/);
|
|
7426
7426
|
},
|
|
@@ -7530,7 +7530,7 @@ var tooltip$1 = {
|
|
|
7530
7530
|
var pos_1 = fnPos(dataToShow, width, height, eventRect, currPos);
|
|
7531
7531
|
["top", "left"].forEach(function (v) {
|
|
7532
7532
|
var value = pos_1[v];
|
|
7533
|
-
tooltip.style(v, value
|
|
7533
|
+
tooltip.style(v, "".concat(value, "px"));
|
|
7534
7534
|
// Remember left pos in percentage to be used on resize call
|
|
7535
7535
|
if (v === "left" && !datum.xPosInPercent) {
|
|
7536
7536
|
datum.xPosInPercent = value / state.current.width * 100;
|
|
@@ -7555,7 +7555,7 @@ var tooltip$1 = {
|
|
|
7555
7555
|
if (diff < 0) {
|
|
7556
7556
|
value += diff;
|
|
7557
7557
|
}
|
|
7558
|
-
tooltip.style("left", value
|
|
7558
|
+
tooltip.style("left", "".concat(value, "px"));
|
|
7559
7559
|
}
|
|
7560
7560
|
});
|
|
7561
7561
|
},
|
|
@@ -7664,26 +7664,26 @@ var transform = {
|
|
|
7664
7664
|
x = state.width / 2 - width;
|
|
7665
7665
|
y = asHalfPixel(state.margin.top);
|
|
7666
7666
|
}
|
|
7667
|
-
return "translate("
|
|
7667
|
+
return "translate(".concat(x, ", ").concat(y, ")");
|
|
7668
7668
|
},
|
|
7669
7669
|
transformMain: function (withTransition, transitions) {
|
|
7670
7670
|
var $$ = this;
|
|
7671
7671
|
var main = $$.$el.main, $T = $$.$T;
|
|
7672
7672
|
var xAxis = (transitions === null || transitions === void 0 ? void 0 : transitions.axisX) ?
|
|
7673
7673
|
transitions.axisX :
|
|
7674
|
-
$T(main.select("."
|
|
7674
|
+
$T(main.select(".".concat(CLASS.axisX)), withTransition);
|
|
7675
7675
|
var yAxis = (transitions === null || transitions === void 0 ? void 0 : transitions.axisY) ?
|
|
7676
7676
|
transitions.axisY :
|
|
7677
|
-
$T(main.select("."
|
|
7677
|
+
$T(main.select(".".concat(CLASS.axisY)), withTransition);
|
|
7678
7678
|
var y2Axis = (transitions === null || transitions === void 0 ? void 0 : transitions.axisY2) ?
|
|
7679
7679
|
transitions.axisY2 :
|
|
7680
|
-
$T(main.select("."
|
|
7680
|
+
$T(main.select(".".concat(CLASS.axisY2)), withTransition);
|
|
7681
7681
|
$T(main, withTransition)
|
|
7682
7682
|
.attr("transform", $$.getTranslate("main"));
|
|
7683
7683
|
xAxis.attr("transform", $$.getTranslate("x"));
|
|
7684
7684
|
yAxis.attr("transform", $$.getTranslate("y"));
|
|
7685
7685
|
y2Axis.attr("transform", $$.getTranslate("y2"));
|
|
7686
|
-
main.select("."
|
|
7686
|
+
main.select(".".concat(CLASS.chartArcs))
|
|
7687
7687
|
.attr("transform", $$.getTranslate("arc"));
|
|
7688
7688
|
},
|
|
7689
7689
|
transformAll: function (withTransition, transitions) {
|
|
@@ -8079,7 +8079,7 @@ var ChartInternal = /** @class */ (function () {
|
|
|
8079
8079
|
var _a = $$, config = _a.config, format = _a.format, state = _a.state;
|
|
8080
8080
|
var isRotated = config.axis_rotated;
|
|
8081
8081
|
// datetime to be used for uniqueness
|
|
8082
|
-
state.datetimeId = "bb-"
|
|
8082
|
+
state.datetimeId = "bb-".concat(+new Date());
|
|
8083
8083
|
$$.color = $$.generateColor();
|
|
8084
8084
|
$$.levelColor = $$.generateLevelColor();
|
|
8085
8085
|
if ($$.hasPointType()) {
|
|
@@ -8204,7 +8204,7 @@ var ChartInternal = /** @class */ (function () {
|
|
|
8204
8204
|
// text when empty
|
|
8205
8205
|
if (config.data_empty_label_text) {
|
|
8206
8206
|
main.append("text")
|
|
8207
|
-
.attr("class", CLASS.text
|
|
8207
|
+
.attr("class", "".concat(CLASS.text, " ").concat(CLASS.empty))
|
|
8208
8208
|
.attr("text-anchor", "middle") // horizontal centering of text at x position in all browsers.
|
|
8209
8209
|
.attr("dominant-baseline", "middle"); // vertical centering of text at y position in all browsers, except IE.
|
|
8210
8210
|
}
|
|
@@ -8280,7 +8280,7 @@ var ChartInternal = /** @class */ (function () {
|
|
|
8280
8280
|
}
|
|
8281
8281
|
}
|
|
8282
8282
|
types.forEach(function (v) {
|
|
8283
|
-
$$["init"
|
|
8283
|
+
$$["init".concat(v)]();
|
|
8284
8284
|
});
|
|
8285
8285
|
notEmpty($$.config.data_labels) && !$$.hasArcType(null, ["radar"]) && $$.initText();
|
|
8286
8286
|
};
|
|
@@ -8347,7 +8347,7 @@ var ChartInternal = /** @class */ (function () {
|
|
|
8347
8347
|
["bar", "candlestick", "line"].forEach(function (v) {
|
|
8348
8348
|
var name = capitalize(v);
|
|
8349
8349
|
if ((v === "line" && $$.hasTypeOf(name)) || $$.hasType(v)) {
|
|
8350
|
-
$$["updateTargetsFor"
|
|
8350
|
+
$$["updateTargetsFor".concat(name)](targets.filter($$["is".concat(name, "Type")].bind($$)));
|
|
8351
8351
|
}
|
|
8352
8352
|
});
|
|
8353
8353
|
// Sub Chart
|
|
@@ -8374,7 +8374,7 @@ var ChartInternal = /** @class */ (function () {
|
|
|
8374
8374
|
ChartInternal.prototype.showTargets = function () {
|
|
8375
8375
|
var $$ = this;
|
|
8376
8376
|
var svg = $$.$el.svg, $T = $$.$T;
|
|
8377
|
-
$T(svg.selectAll("."
|
|
8377
|
+
$T(svg.selectAll(".".concat(CLASS.target))
|
|
8378
8378
|
.filter(function (d) { return $$.isTargetToShow(d.id); })).style("opacity", null);
|
|
8379
8379
|
};
|
|
8380
8380
|
ChartInternal.prototype.getWithOption = function (options) {
|
|
@@ -8398,7 +8398,7 @@ var ChartInternal = /** @class */ (function () {
|
|
|
8398
8398
|
if (isString(defVal)) {
|
|
8399
8399
|
defVal = withOptions[defVal];
|
|
8400
8400
|
}
|
|
8401
|
-
withOptions[key] = getOption(options, "with"
|
|
8401
|
+
withOptions[key] = getOption(options, "with".concat(key), defVal);
|
|
8402
8402
|
});
|
|
8403
8403
|
return withOptions;
|
|
8404
8404
|
};
|
|
@@ -8871,7 +8871,7 @@ var apiData = { data: data };
|
|
|
8871
8871
|
* @see https://developer.mozilla.org/ko/docs/Web/API/WindowBase64/Base64_encoding_and_decoding
|
|
8872
8872
|
*/
|
|
8873
8873
|
var b64EncodeUnicode = function (str) { return btoa(encodeURIComponent(str)
|
|
8874
|
-
.replace(/%([0-9A-F]{2})/g, function (match, p) { return String.fromCharCode(Number("0x"
|
|
8874
|
+
.replace(/%([0-9A-F]{2})/g, function (match, p) { return String.fromCharCode(Number("0x".concat(p))); })); };
|
|
8875
8875
|
/**
|
|
8876
8876
|
* Convert svg node to data url
|
|
8877
8877
|
* @param {HTMLElement} node target node
|
|
@@ -8895,9 +8895,9 @@ function nodeToSvgDataUrl(node, option, orgSize) {
|
|
|
8895
8895
|
var styleXml = serializer.serializeToString(style);
|
|
8896
8896
|
// foreignObject not supported in IE11 and below
|
|
8897
8897
|
// https://msdn.microsoft.com/en-us/library/hh834675(v=vs.85).aspx
|
|
8898
|
-
var dataStr =
|
|
8898
|
+
var dataStr = "<svg xmlns=\"".concat(namespaces.svg, "\" width=\"").concat(width, "\" height=\"").concat(height, "\" \n\t\tviewBox=\"0 0 ").concat(orgSize.width, " ").concat(orgSize.height, "\" \n\t\tpreserveAspectRatio=\"").concat((option === null || option === void 0 ? void 0 : option.preserveAspectRatio) === false ? "none" : "xMinYMid meet", "\">\n\t\t\t<foreignObject width=\"100%\" height=\"100%\">\n\t\t\t\t").concat(styleXml, "\n\t\t\t\t").concat(nodeXml.replace(/(url\()[^#]+/g, "$1"), "\n\t\t\t</foreignObject></svg>")
|
|
8899
8899
|
.replace("/\n/g", "%0A");
|
|
8900
|
-
return "data:image/svg+xml;base64,"
|
|
8900
|
+
return "data:image/svg+xml;base64,".concat(b64EncodeUnicode(dataStr));
|
|
8901
8901
|
}
|
|
8902
8902
|
var apiExport = {
|
|
8903
8903
|
/**
|
|
@@ -9003,7 +9003,7 @@ var apiFocus = {
|
|
|
9003
9003
|
if ($$.hasArcType() && !state.hasRadar) {
|
|
9004
9004
|
$$.expandArc(targetIds);
|
|
9005
9005
|
$$.hasType("gauge") &&
|
|
9006
|
-
$$.markOverlapped(targetIdsValue, $$, "."
|
|
9006
|
+
$$.markOverlapped(targetIdsValue, $$, ".".concat(CLASS.gaugeValue));
|
|
9007
9007
|
}
|
|
9008
9008
|
$$.toggleFocusLegend(targetIds, true);
|
|
9009
9009
|
state.focusedTargetIds = targetIds;
|
|
@@ -9035,7 +9035,7 @@ var apiFocus = {
|
|
|
9035
9035
|
if ($$.hasArcType()) {
|
|
9036
9036
|
$$.unexpandArc(targetIds);
|
|
9037
9037
|
$$.hasType("gauge") &&
|
|
9038
|
-
$$.undoMarkOverlapped($$, "."
|
|
9038
|
+
$$.undoMarkOverlapped($$, ".".concat(CLASS.gaugeValue));
|
|
9039
9039
|
}
|
|
9040
9040
|
$$.toggleFocusLegend(targetIds, false);
|
|
9041
9041
|
state.focusedTargetIds = state.focusedTargetIds.filter(function (id) { return targetIds.indexOf(id) < 0; });
|
|
@@ -9373,7 +9373,7 @@ function showHide(show, targetIdsValue, options) {
|
|
|
9373
9373
|
.map(function (v) { return targetIds.indexOf(v) > -1 && v; })
|
|
9374
9374
|
.filter(Boolean);
|
|
9375
9375
|
$$.state.toggling = true;
|
|
9376
|
-
$$[(show ? "remove" : "add"
|
|
9376
|
+
$$["".concat(show ? "remove" : "add", "HiddenTargetIds")](targetIds);
|
|
9377
9377
|
var targets = $$.$el.svg.selectAll($$.selectorTargets(targetIds));
|
|
9378
9378
|
var opacity = show ? null : "0";
|
|
9379
9379
|
if (show && hiddenIds.length) {
|
|
@@ -9390,7 +9390,7 @@ function showHide(show, targetIdsValue, options) {
|
|
|
9390
9390
|
}
|
|
9391
9391
|
targets.style("opacity", opacity);
|
|
9392
9392
|
});
|
|
9393
|
-
options.withLegend && $$[(show ? "show" : "hide"
|
|
9393
|
+
options.withLegend && $$["".concat(show ? "show" : "hide", "Legend")](targetIds);
|
|
9394
9394
|
$$.redraw({
|
|
9395
9395
|
withUpdateOrgXDomain: true,
|
|
9396
9396
|
withUpdateXDomain: true,
|
|
@@ -9721,9 +9721,9 @@ extend(Chart.prototype, [
|
|
|
9721
9721
|
*/
|
|
9722
9722
|
function setMinMax($$, type, value) {
|
|
9723
9723
|
var config = $$.config;
|
|
9724
|
-
var axisX = "axis_x_"
|
|
9725
|
-
var axisY = "axis_y_"
|
|
9726
|
-
var axisY2 = "axis_y2_"
|
|
9724
|
+
var axisX = "axis_x_".concat(type);
|
|
9725
|
+
var axisY = "axis_y_".concat(type);
|
|
9726
|
+
var axisY2 = "axis_y2_".concat(type);
|
|
9727
9727
|
if (isDefined(value)) {
|
|
9728
9728
|
if (isObjectType(value)) {
|
|
9729
9729
|
isValue(value.x) && (config[axisX] = value.x);
|
|
@@ -9750,9 +9750,9 @@ function setMinMax($$, type, value) {
|
|
|
9750
9750
|
function getMinMax($$, type) {
|
|
9751
9751
|
var config = $$.config;
|
|
9752
9752
|
return {
|
|
9753
|
-
x: config["axis_x_"
|
|
9754
|
-
y: config["axis_y_"
|
|
9755
|
-
y2: config["axis_y2_"
|
|
9753
|
+
x: config["axis_x_".concat(type)],
|
|
9754
|
+
y: config["axis_y_".concat(type)],
|
|
9755
|
+
y2: config["axis_y2_".concat(type)]
|
|
9756
9756
|
};
|
|
9757
9757
|
}
|
|
9758
9758
|
/**
|
|
@@ -10210,8 +10210,8 @@ extend(regions, {
|
|
|
10210
10210
|
var config = $$.config, $T = $$.$T;
|
|
10211
10211
|
var options = optionsValue || {};
|
|
10212
10212
|
var classes = getOption(options, "classes", [CLASS.region]);
|
|
10213
|
-
var regions = $$.$el.main.select("."
|
|
10214
|
-
.selectAll(classes.map(function (c) { return "."
|
|
10213
|
+
var regions = $$.$el.main.select(".".concat(CLASS.regions))
|
|
10214
|
+
.selectAll(classes.map(function (c) { return ".".concat(c); }));
|
|
10215
10215
|
$T(regions)
|
|
10216
10216
|
.style("opacity", "0")
|
|
10217
10217
|
.remove();
|
|
@@ -10548,8 +10548,8 @@ var AxisRendererHelper = /** @class */ (function () {
|
|
|
10548
10548
|
AxisRendererHelper.prototype.getTickTransformSetter = function (id) {
|
|
10549
10549
|
var config = this.config;
|
|
10550
10550
|
var fn = id === "x" ?
|
|
10551
|
-
function (value) { return "translate("
|
|
10552
|
-
function (value) { return "translate(0,"
|
|
10551
|
+
function (value) { return "translate(".concat(value + config.tickOffset, ",0)"); } :
|
|
10552
|
+
function (value) { return "translate(0,".concat(value, ")"); };
|
|
10553
10553
|
return function (selection, scale) {
|
|
10554
10554
|
selection.attr("transform", function (d) { return fn(Math.ceil(scale(d))); });
|
|
10555
10555
|
};
|
|
@@ -10695,13 +10695,13 @@ var AxisRenderer = /** @class */ (function () {
|
|
|
10695
10695
|
// // get the axis' tick position configuration
|
|
10696
10696
|
var id = params.id;
|
|
10697
10697
|
var tickTextPos = id && /^(x|y|y2)$/.test(id) ?
|
|
10698
|
-
params.config["axis_"
|
|
10698
|
+
params.config["axis_".concat(id, "_tick_text_position")] : { x: 0, y: 0 };
|
|
10699
10699
|
// tick visiblity
|
|
10700
|
-
var prefix = id === "subX" ? "subchart_axis_x" : "axis_"
|
|
10701
|
-
var axisShow = params.config[prefix
|
|
10700
|
+
var prefix = id === "subX" ? "subchart_axis_x" : "axis_".concat(id);
|
|
10701
|
+
var axisShow = params.config["".concat(prefix, "_show")];
|
|
10702
10702
|
var tickShow = {
|
|
10703
|
-
tick: axisShow ? params.config[prefix
|
|
10704
|
-
text: axisShow ? params.config[prefix
|
|
10703
|
+
tick: axisShow ? params.config["".concat(prefix, "_tick_show")] : false,
|
|
10704
|
+
text: axisShow ? params.config["".concat(prefix, "_tick_text_show")] : false
|
|
10705
10705
|
};
|
|
10706
10706
|
var $g;
|
|
10707
10707
|
g.each(function () {
|
|
@@ -10722,8 +10722,8 @@ var AxisRenderer = /** @class */ (function () {
|
|
|
10722
10722
|
.attr("d", function () {
|
|
10723
10723
|
var outerTickSized = config.outerTickSize * sign;
|
|
10724
10724
|
return isTopBottom ?
|
|
10725
|
-
"M"
|
|
10726
|
-
"M"
|
|
10725
|
+
"M".concat(range[0], ",").concat(outerTickSized, "V0H").concat(range[1], "V").concat(outerTickSized) :
|
|
10726
|
+
"M".concat(outerTickSized, ",").concat(range[0], "H0V").concat(range[1], "H").concat(outerTickSized);
|
|
10727
10727
|
});
|
|
10728
10728
|
if (tickShow.tick || tickShow.text) {
|
|
10729
10729
|
// count of tick data in array
|
|
@@ -10784,7 +10784,7 @@ var AxisRenderer = /** @class */ (function () {
|
|
|
10784
10784
|
});
|
|
10785
10785
|
var lineUpdate = tick.select("line");
|
|
10786
10786
|
var textUpdate = tick.select("text");
|
|
10787
|
-
tickEnter.select("line").attr(axisPx
|
|
10787
|
+
tickEnter.select("line").attr("".concat(axisPx, "2"), innerTickSize * sign);
|
|
10788
10788
|
tickEnter.select("text").attr(axisPx, tickLength * sign);
|
|
10789
10789
|
ctx.setTickLineTextPosition(lineUpdate, textUpdate);
|
|
10790
10790
|
// Append <title> for tooltip display
|
|
@@ -10859,7 +10859,7 @@ var AxisRenderer = /** @class */ (function () {
|
|
|
10859
10859
|
orient === "top" && value.reverse();
|
|
10860
10860
|
return !r ? "middle" : value[r > 0 ? 0 : 1];
|
|
10861
10861
|
};
|
|
10862
|
-
var textTransform = function (r) { return (r ? "rotate("
|
|
10862
|
+
var textTransform = function (r) { return (r ? "rotate(".concat(r, ")") : null); };
|
|
10863
10863
|
var yForText = function (r) {
|
|
10864
10864
|
var r2 = r / (orient === "bottom" ? 15 : 23);
|
|
10865
10865
|
return r ? 11.5 - 2.5 * r2 * (r > 0 ? 1 : -1) : tickLength;
|
|
@@ -11084,7 +11084,7 @@ var Axis = /** @class */ (function () {
|
|
|
11084
11084
|
this.setOrient();
|
|
11085
11085
|
}
|
|
11086
11086
|
Axis.prototype.getAxisClassName = function (id) {
|
|
11087
|
-
return CLASS.axis
|
|
11087
|
+
return "".concat(CLASS.axis, " ").concat(CLASS["axis".concat(capitalize(id))]);
|
|
11088
11088
|
};
|
|
11089
11089
|
Axis.prototype.isHorizontal = function ($$, forHorizontal) {
|
|
11090
11090
|
var isRotated = $$.config.axis_rotated;
|
|
@@ -11100,11 +11100,11 @@ var Axis = /** @class */ (function () {
|
|
|
11100
11100
|
};
|
|
11101
11101
|
Axis.prototype.isTimeSeries = function (id) {
|
|
11102
11102
|
if (id === void 0) { id = "x"; }
|
|
11103
|
-
return this.owner.config["axis_"
|
|
11103
|
+
return this.owner.config["axis_".concat(id, "_type")] === "timeseries";
|
|
11104
11104
|
};
|
|
11105
11105
|
Axis.prototype.isLog = function (id) {
|
|
11106
11106
|
if (id === void 0) { id = "x"; }
|
|
11107
|
-
return this.owner.config["axis_"
|
|
11107
|
+
return this.owner.config["axis_".concat(id, "_type")] === "log";
|
|
11108
11108
|
};
|
|
11109
11109
|
Axis.prototype.isTimeSeriesY = function () {
|
|
11110
11110
|
return this.isTimeSeries("y");
|
|
@@ -11129,7 +11129,7 @@ var Axis = /** @class */ (function () {
|
|
|
11129
11129
|
config.axis_y2_show && target.push("y2");
|
|
11130
11130
|
target.forEach(function (v) {
|
|
11131
11131
|
var classAxis = _this.getAxisClassName(v);
|
|
11132
|
-
var classLabel = CLASS["axis"
|
|
11132
|
+
var classLabel = CLASS["axis".concat(v.toUpperCase(), "Label")];
|
|
11133
11133
|
axis[v] = main.append("g")
|
|
11134
11134
|
.attr("class", classAxis)
|
|
11135
11135
|
.attr("clip-path", function () {
|
|
@@ -11143,7 +11143,7 @@ var Axis = /** @class */ (function () {
|
|
|
11143
11143
|
return res;
|
|
11144
11144
|
})
|
|
11145
11145
|
.attr("transform", $$.getTranslate(v))
|
|
11146
|
-
.style("visibility", config["axis_"
|
|
11146
|
+
.style("visibility", config["axis_".concat(v, "_show")] ? null : "hidden");
|
|
11147
11147
|
axis[v].append("text")
|
|
11148
11148
|
.attr("class", classLabel)
|
|
11149
11149
|
.attr("transform", ["rotate(-90)", null][v === "x" ? +!isRotated : +isRotated])
|
|
@@ -11175,7 +11175,7 @@ var Axis = /** @class */ (function () {
|
|
|
11175
11175
|
var $$ = this.owner;
|
|
11176
11176
|
var config = $$.config;
|
|
11177
11177
|
var axes = [];
|
|
11178
|
-
var axesConfig = config["axis_"
|
|
11178
|
+
var axesConfig = config["axis_".concat(id, "_axes")];
|
|
11179
11179
|
var isRotated = config.axis_rotated;
|
|
11180
11180
|
var d3Axis;
|
|
11181
11181
|
if (id === "x") {
|
|
@@ -11210,7 +11210,7 @@ var Axis = /** @class */ (function () {
|
|
|
11210
11210
|
var $$ = this.owner;
|
|
11211
11211
|
var config = $$.config, main = $$.$el.main;
|
|
11212
11212
|
Object.keys(this.axesList).forEach(function (id) {
|
|
11213
|
-
var axesConfig = config["axis_"
|
|
11213
|
+
var axesConfig = config["axis_".concat(id, "_axes")];
|
|
11214
11214
|
var scale = $$.scale[id].copy();
|
|
11215
11215
|
var range = scale.range();
|
|
11216
11216
|
_this.axesList[id].forEach(function (v, i) {
|
|
@@ -11220,12 +11220,12 @@ var Axis = /** @class */ (function () {
|
|
|
11220
11220
|
if (!range.every(function (v, i) { return v === axisRange[i]; })) {
|
|
11221
11221
|
v.scale().range(range);
|
|
11222
11222
|
}
|
|
11223
|
-
var className = _this.getAxisClassName(id)
|
|
11224
|
-
var g = main.select("."
|
|
11223
|
+
var className = "".concat(_this.getAxisClassName(id), "-").concat(i + 1);
|
|
11224
|
+
var g = main.select(".".concat(className.replace(/\s/, ".")));
|
|
11225
11225
|
if (g.empty()) {
|
|
11226
11226
|
g = main.append("g")
|
|
11227
11227
|
.attr("class", className)
|
|
11228
|
-
.style("visibility", config["axis_"
|
|
11228
|
+
.style("visibility", config["axis_".concat(id, "_show")] ? null : "hidden")
|
|
11229
11229
|
.call(v);
|
|
11230
11230
|
}
|
|
11231
11231
|
else {
|
|
@@ -11270,7 +11270,7 @@ var Axis = /** @class */ (function () {
|
|
|
11270
11270
|
tickFormat = (id === "subX") ? $$.format.subXAxisTick : $$.format.xAxisTick;
|
|
11271
11271
|
}
|
|
11272
11272
|
else {
|
|
11273
|
-
var fn = config["axis_"
|
|
11273
|
+
var fn = config["axis_".concat(id, "_tick_format")];
|
|
11274
11274
|
if (isFunction(fn)) {
|
|
11275
11275
|
tickFormat = fn.bind($$.api);
|
|
11276
11276
|
}
|
|
@@ -11291,7 +11291,7 @@ var Axis = /** @class */ (function () {
|
|
|
11291
11291
|
orgXScale: $$.scale.x
|
|
11292
11292
|
});
|
|
11293
11293
|
if (!isX) {
|
|
11294
|
-
axisParams.tickStepSize = config["axis_"
|
|
11294
|
+
axisParams.tickStepSize = config["axis_".concat(type, "_tick_stepSize")];
|
|
11295
11295
|
}
|
|
11296
11296
|
var axis = new AxisRenderer(axisParams)
|
|
11297
11297
|
.scale((isX && $$.scale.zoom) || scale)
|
|
@@ -11307,14 +11307,14 @@ var Axis = /** @class */ (function () {
|
|
|
11307
11307
|
}
|
|
11308
11308
|
tickValues && axis.tickValues(tickValues);
|
|
11309
11309
|
// Set tick
|
|
11310
|
-
axis.tickFormat(tickFormat || (!isX && ($$.isStackNormalized() && (function (x) { return x
|
|
11310
|
+
axis.tickFormat(tickFormat || (!isX && ($$.isStackNormalized() && (function (x) { return "".concat(x, "%"); }))));
|
|
11311
11311
|
if (isCategory) {
|
|
11312
11312
|
axis.tickCentered(config.axis_x_tick_centered);
|
|
11313
11313
|
if (isEmpty(config.axis_x_tick_culling)) {
|
|
11314
11314
|
config.axis_x_tick_culling = false;
|
|
11315
11315
|
}
|
|
11316
11316
|
}
|
|
11317
|
-
var tickCount = config["axis_"
|
|
11317
|
+
var tickCount = config["axis_".concat(type, "_tick_count")];
|
|
11318
11318
|
tickCount && axis.ticks(tickCount);
|
|
11319
11319
|
return axis;
|
|
11320
11320
|
};
|
|
@@ -11380,13 +11380,13 @@ var Axis = /** @class */ (function () {
|
|
|
11380
11380
|
};
|
|
11381
11381
|
Axis.prototype.getTickValues = function (id) {
|
|
11382
11382
|
var $$ = this.owner;
|
|
11383
|
-
var tickValues = $$.config["axis_"
|
|
11384
|
-
var axis = $$[id
|
|
11383
|
+
var tickValues = $$.config["axis_".concat(id, "_tick_values")];
|
|
11384
|
+
var axis = $$["".concat(id, "Axis")];
|
|
11385
11385
|
return (isFunction(tickValues) ? tickValues.call($$.api) : tickValues) ||
|
|
11386
11386
|
(axis ? axis.tickValues() : undefined);
|
|
11387
11387
|
};
|
|
11388
11388
|
Axis.prototype.getLabelOptionByAxisId = function (id) {
|
|
11389
|
-
return this.owner.config["axis_"
|
|
11389
|
+
return this.owner.config["axis_".concat(id, "_label")];
|
|
11390
11390
|
};
|
|
11391
11391
|
Axis.prototype.getLabelText = function (id) {
|
|
11392
11392
|
var option = this.getLabelOptionByAxisId(id);
|
|
@@ -11397,7 +11397,7 @@ var Axis = /** @class */ (function () {
|
|
|
11397
11397
|
var config = $$.config;
|
|
11398
11398
|
var option = this.getLabelOptionByAxisId(id);
|
|
11399
11399
|
if (isString(option)) {
|
|
11400
|
-
config["axis_"
|
|
11400
|
+
config["axis_".concat(id, "_label")] = text;
|
|
11401
11401
|
}
|
|
11402
11402
|
else if (option) {
|
|
11403
11403
|
option.text = text;
|
|
@@ -11468,7 +11468,7 @@ var Axis = /** @class */ (function () {
|
|
|
11468
11468
|
var config = $$.config;
|
|
11469
11469
|
var isRotated = config.axis_rotated;
|
|
11470
11470
|
var isInner = this.getAxisLabelPosition(id).isInner;
|
|
11471
|
-
var tickRotate = config["axis_"
|
|
11471
|
+
var tickRotate = config["axis_".concat(id, "_tick_rotate")] ? $$.getHorizontalAxisHeight(id) : 0;
|
|
11472
11472
|
var maxTickWidth = this.getMaxTickWidth(id);
|
|
11473
11473
|
var dy;
|
|
11474
11474
|
if (id === "x") {
|
|
@@ -11507,7 +11507,7 @@ var Axis = /** @class */ (function () {
|
|
|
11507
11507
|
}
|
|
11508
11508
|
else {
|
|
11509
11509
|
dy = isInner ?
|
|
11510
|
-
dy[3] : (dy[4] + (config["axis_"
|
|
11510
|
+
dy[3] : (dy[4] + (config["axis_".concat(id, "_inner")] ? 0 : (maxTickWidth + dy[4]))) * (id === "y" ? -1 : 1);
|
|
11511
11511
|
}
|
|
11512
11512
|
}
|
|
11513
11513
|
return dy;
|
|
@@ -11517,13 +11517,13 @@ var Axis = /** @class */ (function () {
|
|
|
11517
11517
|
var config = $$.config, current = $$.state.current, _a = $$.$el, svg = _a.svg, chart = _a.chart;
|
|
11518
11518
|
var currentTickMax = current.maxTickWidths[id];
|
|
11519
11519
|
var maxWidth = 0;
|
|
11520
|
-
if (withoutRecompute || !config["axis_"
|
|
11520
|
+
if (withoutRecompute || !config["axis_".concat(id, "_show")] || $$.filterTargetsToShow().length === 0) {
|
|
11521
11521
|
return currentTickMax.size;
|
|
11522
11522
|
}
|
|
11523
11523
|
if (svg) {
|
|
11524
11524
|
var isYAxis_1 = /^y2?$/.test(id);
|
|
11525
11525
|
var targetsToShow = $$.filterTargetsToShow($$.data.targets);
|
|
11526
|
-
var scale = $$.scale[id].copy().domain($$["get"
|
|
11526
|
+
var scale = $$.scale[id].copy().domain($$["get".concat(isYAxis_1 ? "Y" : "X", "Domain")](targetsToShow, id));
|
|
11527
11527
|
var domain = scale.domain();
|
|
11528
11528
|
var isDomainSame = domain[0] === domain[1] && domain.every(function (v) { return v > 0; });
|
|
11529
11529
|
var isCurrentMaxTickDomainSame = isArray(currentTickMax.domain) &&
|
|
@@ -11541,8 +11541,8 @@ var Axis = /** @class */ (function () {
|
|
|
11541
11541
|
currentTickMax.ticks.splice(0);
|
|
11542
11542
|
}
|
|
11543
11543
|
var axis = this.getAxis(id, scale, false, false, true);
|
|
11544
|
-
var tickCount = config["axis_"
|
|
11545
|
-
var tickValues = config["axis_"
|
|
11544
|
+
var tickCount = config["axis_".concat(id, "_tick_count")];
|
|
11545
|
+
var tickValues = config["axis_".concat(id, "_tick_values")];
|
|
11546
11546
|
// Make to generate the final tick text to be rendered
|
|
11547
11547
|
// https://github.com/naver/billboard.js/issues/920
|
|
11548
11548
|
// Do not generate if 'tick values' option is given
|
|
@@ -11554,8 +11554,8 @@ var Axis = /** @class */ (function () {
|
|
|
11554
11554
|
var dummy = chart.append("svg")
|
|
11555
11555
|
.style("visibility", "hidden")
|
|
11556
11556
|
.style("position", "fixed")
|
|
11557
|
-
.style("top", "
|
|
11558
|
-
.style("left", "
|
|
11557
|
+
.style("top", "0")
|
|
11558
|
+
.style("left", "0");
|
|
11559
11559
|
axis.create(dummy);
|
|
11560
11560
|
dummy.selectAll("text")
|
|
11561
11561
|
.each(function (d, i) {
|
|
@@ -11634,9 +11634,9 @@ var Axis = /** @class */ (function () {
|
|
|
11634
11634
|
var $$ = this.owner;
|
|
11635
11635
|
var main = $$.$el.main, $T = $$.$T;
|
|
11636
11636
|
var labels = {
|
|
11637
|
-
x: main.select("."
|
|
11638
|
-
y: main.select("."
|
|
11639
|
-
y2: main.select("."
|
|
11637
|
+
x: main.select(".".concat(CLASS.axisX, " .").concat(CLASS.axisXLabel)),
|
|
11638
|
+
y: main.select(".".concat(CLASS.axisY, " .").concat(CLASS.axisYLabel)),
|
|
11639
|
+
y2: main.select(".".concat(CLASS.axisY2, " .").concat(CLASS.axisY2Label))
|
|
11640
11640
|
};
|
|
11641
11641
|
Object.keys(labels).filter(function (id) { return !labels[id].empty(); })
|
|
11642
11642
|
.forEach(function (v) {
|
|
@@ -11717,7 +11717,7 @@ var Axis = /** @class */ (function () {
|
|
|
11717
11717
|
axis.config.withoutTransition = true;
|
|
11718
11718
|
}
|
|
11719
11719
|
$axis.style("opacity", opacity);
|
|
11720
|
-
axis.create(transitions["axis"
|
|
11720
|
+
axis.create(transitions["axis".concat(capitalize(id))]);
|
|
11721
11721
|
}
|
|
11722
11722
|
});
|
|
11723
11723
|
this.updateAxes();
|
|
@@ -11758,8 +11758,8 @@ var Axis = /** @class */ (function () {
|
|
|
11758
11758
|
["y", "y2"].forEach(function (key) {
|
|
11759
11759
|
var axisScale = scale[key];
|
|
11760
11760
|
if (axisScale) {
|
|
11761
|
-
var tickValues = config["axis_"
|
|
11762
|
-
var tickCount = config["axis_"
|
|
11761
|
+
var tickValues = config["axis_".concat(key, "_tick_values")];
|
|
11762
|
+
var tickCount = config["axis_".concat(key, "_tick_count")];
|
|
11763
11763
|
axisScale.domain($$.getYDomain(targetsToShow, key, xDomainForZoom));
|
|
11764
11764
|
if (!tickValues && tickCount) {
|
|
11765
11765
|
var axis = $$.axis[key];
|
|
@@ -11793,12 +11793,12 @@ var Axis = /** @class */ (function () {
|
|
|
11793
11793
|
var axis = $el.axis[type];
|
|
11794
11794
|
// subchart x axis should be aligned with x axis culling
|
|
11795
11795
|
var id = type === "subX" ? "x" : type;
|
|
11796
|
-
var toCull = config["axis_"
|
|
11796
|
+
var toCull = config["axis_".concat(id, "_tick_culling")];
|
|
11797
11797
|
if (axis && toCull) {
|
|
11798
11798
|
var tickText = axis.selectAll(".tick text");
|
|
11799
11799
|
var tickValues_1 = sortValue(tickText.data());
|
|
11800
11800
|
var tickSize = tickValues_1.length;
|
|
11801
|
-
var cullingMax = config["axis_"
|
|
11801
|
+
var cullingMax = config["axis_".concat(id, "_tick_culling_max")];
|
|
11802
11802
|
var intervalForCulling_1;
|
|
11803
11803
|
if (tickSize) {
|
|
11804
11804
|
for (var i = 1; i < tickSize; i++) {
|
|
@@ -11817,7 +11817,7 @@ var Axis = /** @class */ (function () {
|
|
|
11817
11817
|
// set/unset x_axis_tick_clippath
|
|
11818
11818
|
if (type === "x") {
|
|
11819
11819
|
var clipPath = current.maxTickWidths.x.clipPath ? clip.pathXAxisTickTexts : null;
|
|
11820
|
-
$el.svg.selectAll("."
|
|
11820
|
+
$el.svg.selectAll(".".concat(CLASS.axisX, " .tick text"))
|
|
11821
11821
|
.attr("clip-path", clipPath);
|
|
11822
11822
|
}
|
|
11823
11823
|
}
|
|
@@ -11838,7 +11838,7 @@ var eventrect = {
|
|
|
11838
11838
|
*/
|
|
11839
11839
|
initEventRect: function () {
|
|
11840
11840
|
var $$ = this;
|
|
11841
|
-
$$.$el.main.select("."
|
|
11841
|
+
$$.$el.main.select(".".concat(CLASS.chart))
|
|
11842
11842
|
.append("g")
|
|
11843
11843
|
.attr("class", CLASS.eventRects)
|
|
11844
11844
|
.style("fill-opacity", "0");
|
|
@@ -11856,12 +11856,12 @@ var eventrect = {
|
|
|
11856
11856
|
$$.updateEventRect($el.eventRect, true);
|
|
11857
11857
|
}
|
|
11858
11858
|
else {
|
|
11859
|
-
var eventRects = $$.$el.main.select("."
|
|
11859
|
+
var eventRects = $$.$el.main.select(".".concat(CLASS.eventRects))
|
|
11860
11860
|
.style("cursor", config.zoom_enabled && config.zoom_type !== "drag" ? (config.axis_rotated ? "ns-resize" : "ew-resize") : null)
|
|
11861
11861
|
.classed(CLASS.eventRectsMultiple, isMultipleX)
|
|
11862
11862
|
.classed(CLASS.eventRectsSingle, !isMultipleX);
|
|
11863
11863
|
// append event <rect>
|
|
11864
|
-
var eventRectUpdate = eventRects.selectAll("."
|
|
11864
|
+
var eventRectUpdate = eventRects.selectAll(".".concat(CLASS.eventRect))
|
|
11865
11865
|
.data([0])
|
|
11866
11866
|
.enter()
|
|
11867
11867
|
.append("rect");
|
|
@@ -11916,7 +11916,7 @@ var eventrect = {
|
|
|
11916
11916
|
var preventEvent = function (event) {
|
|
11917
11917
|
var eventType = event.type;
|
|
11918
11918
|
var touch = event.changedTouches[0];
|
|
11919
|
-
var currentXY = touch["client"
|
|
11919
|
+
var currentXY = touch["client".concat(config.axis_rotated ? "Y" : "X")];
|
|
11920
11920
|
// prevent document scrolling
|
|
11921
11921
|
if (eventType === "touchstart") {
|
|
11922
11922
|
if (isPrevented) {
|
|
@@ -12105,7 +12105,7 @@ var eventrect = {
|
|
|
12105
12105
|
$$.showGridFocus(selectedData);
|
|
12106
12106
|
// Show cursor as pointer if point is close to mouse position
|
|
12107
12107
|
if ($$.isBarType(closest.id) || $$.dist(closest, mouse) < config.point_sensitivity) {
|
|
12108
|
-
$$.$el.svg.select("."
|
|
12108
|
+
$$.$el.svg.select(".".concat(CLASS.eventRect)).style("cursor", "pointer");
|
|
12109
12109
|
if (!state.mouseover) {
|
|
12110
12110
|
config.data_onover.call($$.api, closest);
|
|
12111
12111
|
state.mouseover = closest;
|
|
@@ -12119,7 +12119,7 @@ var eventrect = {
|
|
|
12119
12119
|
unselectRect: function () {
|
|
12120
12120
|
var $$ = this;
|
|
12121
12121
|
var config = $$.config, _a = $$.$el, circle = _a.circle, tooltip = _a.tooltip;
|
|
12122
|
-
$$.$el.svg.select("."
|
|
12122
|
+
$$.$el.svg.select(".".concat(CLASS.eventRect)).style("cursor", null);
|
|
12123
12123
|
$$.hideGridFocus();
|
|
12124
12124
|
if (tooltip) {
|
|
12125
12125
|
$$.hideTooltip();
|
|
@@ -12215,7 +12215,7 @@ var eventrect = {
|
|
|
12215
12215
|
return;
|
|
12216
12216
|
}
|
|
12217
12217
|
var index = d.index;
|
|
12218
|
-
main.selectAll("."
|
|
12218
|
+
main.selectAll(".".concat(CLASS.shape, "-").concat(index))
|
|
12219
12219
|
.each(function (d2) {
|
|
12220
12220
|
var _a;
|
|
12221
12221
|
if (config.data_selection_grouped || $$.isWithinShape(this, d2)) {
|
|
@@ -12268,8 +12268,8 @@ var eventrect = {
|
|
|
12268
12268
|
}
|
|
12269
12269
|
// select if selection enabled
|
|
12270
12270
|
if ($$.isBarType(closest.id) || $$.dist(closest, mouse) < config.point_sensitivity) {
|
|
12271
|
-
$$.$el.main.selectAll("."
|
|
12272
|
-
.selectAll("."
|
|
12271
|
+
$$.$el.main.selectAll(".".concat(CLASS.shapes).concat($$.getTargetSelectorSuffix(closest.id)))
|
|
12272
|
+
.selectAll(".".concat(CLASS.shape, "-").concat(closest.index))
|
|
12273
12273
|
.each(function () {
|
|
12274
12274
|
var _a;
|
|
12275
12275
|
if (config.data_selection_grouped || $$.isWithinShape(this, closest)) {
|
|
@@ -12378,13 +12378,13 @@ var flow = {
|
|
|
12378
12378
|
["circle", "text", "shape", "eventRect"].forEach(function (v) {
|
|
12379
12379
|
var target = [];
|
|
12380
12380
|
for (var i = 0; i < flowLength; i++) {
|
|
12381
|
-
target.push("."
|
|
12381
|
+
target.push(".".concat(CLASS[v], "-").concat(i));
|
|
12382
12382
|
}
|
|
12383
|
-
svg.selectAll("."
|
|
12383
|
+
svg.selectAll(".".concat(CLASS["".concat(v, "s")])) // circles, shapes, texts, eventRects
|
|
12384
12384
|
.selectAll(target)
|
|
12385
12385
|
.remove();
|
|
12386
12386
|
});
|
|
12387
|
-
svg.select("."
|
|
12387
|
+
svg.select(".".concat(CLASS.xgrid))
|
|
12388
12388
|
.remove();
|
|
12389
12389
|
}
|
|
12390
12390
|
// draw again for removing flowed elements and reverting attr
|
|
@@ -12483,7 +12483,7 @@ var flow = {
|
|
|
12483
12483
|
x(flowStart.x) - x(flowEnd.x);
|
|
12484
12484
|
}
|
|
12485
12485
|
var scaleX = (diffDomain(orgDomain) / diffDomain(domain));
|
|
12486
|
-
return "translate("
|
|
12486
|
+
return "translate(".concat(translateX, ",0) scale(").concat(scaleX, ",1)");
|
|
12487
12487
|
}
|
|
12488
12488
|
};
|
|
12489
12489
|
|
|
@@ -12496,10 +12496,10 @@ var clip = {
|
|
|
12496
12496
|
var $$ = this;
|
|
12497
12497
|
var clip = $$.state.clip;
|
|
12498
12498
|
// MEMO: clipId needs to be unique because it conflicts when multiple charts exist
|
|
12499
|
-
clip.id = $$.state.datetimeId
|
|
12500
|
-
clip.idXAxis = clip.id
|
|
12501
|
-
clip.idYAxis = clip.id
|
|
12502
|
-
clip.idGrid = clip.id
|
|
12499
|
+
clip.id = "".concat($$.state.datetimeId, "-clip");
|
|
12500
|
+
clip.idXAxis = "".concat(clip.id, "-xaxis");
|
|
12501
|
+
clip.idYAxis = "".concat(clip.id, "-yaxis");
|
|
12502
|
+
clip.idGrid = "".concat(clip.id, "-grid");
|
|
12503
12503
|
// Define 'clip-path' attribute values
|
|
12504
12504
|
clip.path = $$.getClipPath(clip.id);
|
|
12505
12505
|
clip.pathXAxis = $$.getClipPath(clip.idXAxis);
|
|
@@ -12517,7 +12517,7 @@ var clip = {
|
|
|
12517
12517
|
var isIE9 = win.navigator ?
|
|
12518
12518
|
win.navigator.appVersion
|
|
12519
12519
|
.toLowerCase().indexOf("msie 9.") >= 0 : false;
|
|
12520
|
-
return "url("
|
|
12520
|
+
return "url(".concat((isIE9 ? "" : doc.URL.split("#")[0]), "#").concat(id, ")");
|
|
12521
12521
|
},
|
|
12522
12522
|
appendClip: function (parent, id) {
|
|
12523
12523
|
id && parent.append("clipPath")
|
|
@@ -12571,7 +12571,7 @@ var clip = {
|
|
|
12571
12571
|
var config = $$.config, _a = $$.state, clip = _a.clip, xAxisHeight = _a.xAxisHeight, defs = $$.$el.defs;
|
|
12572
12572
|
var newXAxisHeight = $$.getHorizontalAxisHeight("x");
|
|
12573
12573
|
if (defs && !clip.idXAxisTickTexts) {
|
|
12574
|
-
var clipId = clip.id
|
|
12574
|
+
var clipId = "".concat(clip.id, "-xaxisticktexts");
|
|
12575
12575
|
$$.appendClip(defs, clipId);
|
|
12576
12576
|
clip.pathXAxisTickTexts = $$.getClipPath(clip.idXAxisTickTexts);
|
|
12577
12577
|
clip.idXAxisTickTexts = clipId;
|
|
@@ -12600,7 +12600,7 @@ var clip = {
|
|
|
12600
12600
|
var $$ = this;
|
|
12601
12601
|
var _a = $$.state, clip = _a.clip, current = _a.current, svg = $$.$el.svg;
|
|
12602
12602
|
if (svg) {
|
|
12603
|
-
svg.select("#"
|
|
12603
|
+
svg.select("#".concat(clip.idXAxisTickTexts, " rect"))
|
|
12604
12604
|
.attr("width", current.maxTickWidths.x.clipPath)
|
|
12605
12605
|
.attr("height", 30);
|
|
12606
12606
|
}
|
|
@@ -12653,7 +12653,7 @@ var grid = {
|
|
|
12653
12653
|
hasGrid: function () {
|
|
12654
12654
|
var config = this.config;
|
|
12655
12655
|
return ["x", "y"]
|
|
12656
|
-
.some(function (v) { return config["grid_"
|
|
12656
|
+
.some(function (v) { return config["grid_".concat(v, "_show")] || config["grid_".concat(v, "_lines")].length; });
|
|
12657
12657
|
},
|
|
12658
12658
|
initGrid: function () {
|
|
12659
12659
|
var $$ = this;
|
|
@@ -12664,9 +12664,9 @@ var grid = {
|
|
|
12664
12664
|
var $$ = this;
|
|
12665
12665
|
var config = $$.config, clip = $$.state.clip, $el = $$.$el;
|
|
12666
12666
|
if (config.grid_x_lines.length || config.grid_y_lines.length) {
|
|
12667
|
-
$el.gridLines.main = $el.main.insert("g", "."
|
|
12667
|
+
$el.gridLines.main = $el.main.insert("g", ".".concat(CLASS.chart).concat(config.grid_lines_front ? " + *" : ""))
|
|
12668
12668
|
.attr("clip-path", clip.pathGrid)
|
|
12669
|
-
.attr("class", CLASS.grid
|
|
12669
|
+
.attr("class", "".concat(CLASS.grid, " ").concat(CLASS.gridLines));
|
|
12670
12670
|
$el.gridLines.main.append("g").attr("class", CLASS.xgridLines);
|
|
12671
12671
|
$el.gridLines.main.append("g").attr("class", CLASS.ygridLines);
|
|
12672
12672
|
$el.gridLines.x = selectAll([]);
|
|
@@ -12690,8 +12690,8 @@ var grid = {
|
|
|
12690
12690
|
"y1": 0,
|
|
12691
12691
|
"y2": state.height
|
|
12692
12692
|
};
|
|
12693
|
-
grid.x = main.select("."
|
|
12694
|
-
.selectAll("."
|
|
12693
|
+
grid.x = main.select(".".concat(CLASS.xgrids))
|
|
12694
|
+
.selectAll(".".concat(CLASS.xgrid))
|
|
12695
12695
|
.data(xgridData);
|
|
12696
12696
|
grid.x.exit().remove();
|
|
12697
12697
|
grid.x = grid.x.enter()
|
|
@@ -12715,8 +12715,8 @@ var grid = {
|
|
|
12715
12715
|
var isRotated = config.axis_rotated;
|
|
12716
12716
|
var gridValues = $$.axis.y.tickValues() || $$.scale.y.ticks(config.grid_y_ticks);
|
|
12717
12717
|
var pos = function (d) { return Math.ceil($$.scale.y(d)); };
|
|
12718
|
-
grid.y = main.select("."
|
|
12719
|
-
.selectAll("."
|
|
12718
|
+
grid.y = main.select(".".concat(CLASS.ygrids))
|
|
12719
|
+
.selectAll(".".concat(CLASS.ygrid))
|
|
12720
12720
|
.data(gridValues);
|
|
12721
12721
|
grid.y.exit().remove();
|
|
12722
12722
|
grid.y = grid.y
|
|
@@ -12749,8 +12749,8 @@ var grid = {
|
|
|
12749
12749
|
var config = $$.config, _a = $$.$el, gridLines = _a.gridLines, main = _a.main, $T = $$.$T;
|
|
12750
12750
|
var isRotated = config.axis_rotated;
|
|
12751
12751
|
config.grid_x_show && $$.updateXGrid();
|
|
12752
|
-
var xLines = main.select("."
|
|
12753
|
-
.selectAll("."
|
|
12752
|
+
var xLines = main.select(".".concat(CLASS.xgridLines))
|
|
12753
|
+
.selectAll(".".concat(CLASS.xgridLine))
|
|
12754
12754
|
.data(config.grid_x_lines);
|
|
12755
12755
|
// exit
|
|
12756
12756
|
$T(xLines.exit())
|
|
@@ -12766,7 +12766,7 @@ var grid = {
|
|
|
12766
12766
|
.style("opacity", "0");
|
|
12767
12767
|
xLines = xgridLine.merge(xLines);
|
|
12768
12768
|
$T(xLines
|
|
12769
|
-
.attr("class", function (d) { return (CLASS.xgridLine
|
|
12769
|
+
.attr("class", function (d) { return "".concat(CLASS.xgridLine, " ").concat(d["class"] || "").trim(); })
|
|
12770
12770
|
.select("text")
|
|
12771
12771
|
.attr("text-anchor", getGridTextAnchor)
|
|
12772
12772
|
.attr("dx", getGridTextDx))
|
|
@@ -12783,8 +12783,8 @@ var grid = {
|
|
|
12783
12783
|
var config = $$.config, _a = $$.state, width = _a.width, height = _a.height, $el = $$.$el, $T = $$.$T;
|
|
12784
12784
|
var isRotated = config.axis_rotated;
|
|
12785
12785
|
config.grid_y_show && $$.updateYGrid();
|
|
12786
|
-
var ygridLines = $el.main.select("."
|
|
12787
|
-
.selectAll("."
|
|
12786
|
+
var ygridLines = $el.main.select(".".concat(CLASS.ygridLines))
|
|
12787
|
+
.selectAll(".".concat(CLASS.ygridLine))
|
|
12788
12788
|
.data(config.grid_y_lines);
|
|
12789
12789
|
// exit
|
|
12790
12790
|
$T(ygridLines.exit())
|
|
@@ -12801,7 +12801,7 @@ var grid = {
|
|
|
12801
12801
|
// update
|
|
12802
12802
|
var yv = $$.yv.bind($$);
|
|
12803
12803
|
$T(ygridLines
|
|
12804
|
-
.attr("class", function (d) { return (CLASS.ygridLine
|
|
12804
|
+
.attr("class", function (d) { return "".concat(CLASS.ygridLine, " ").concat(d["class"] || "").trim(); })
|
|
12805
12805
|
.select("line"))
|
|
12806
12806
|
.attr("x1", isRotated ? yv : 0)
|
|
12807
12807
|
.attr("x2", isRotated ? yv : width)
|
|
@@ -12842,7 +12842,7 @@ var grid = {
|
|
|
12842
12842
|
var $$ = this;
|
|
12843
12843
|
var config = $$.config, clip = $$.state.clip, $el = $$.$el;
|
|
12844
12844
|
var isFront = config.grid_front;
|
|
12845
|
-
var className = "."
|
|
12845
|
+
var className = ".".concat(CLASS[isFront && $el.gridLines.main ? "gridLines" : "chart"]).concat(isFront ? " + *" : "");
|
|
12846
12846
|
var grid = $el.main.insert("g", className)
|
|
12847
12847
|
.attr("clip-path", clip.pathGrid)
|
|
12848
12848
|
.attr("class", CLASS.grid);
|
|
@@ -12875,7 +12875,7 @@ var grid = {
|
|
|
12875
12875
|
var $$ = this;
|
|
12876
12876
|
var config = $$.config, _b = $$.state, width = _b.width, height = _b.height;
|
|
12877
12877
|
var isRotated = config.axis_rotated;
|
|
12878
|
-
var focusEl = $$.$el.main.selectAll("line."
|
|
12878
|
+
var focusEl = $$.$el.main.selectAll("line.".concat(CLASS.xgridFocus, ", line.").concat(CLASS.ygridFocus));
|
|
12879
12879
|
var dataToShow = (data || [focusEl.datum()]).filter(function (d) { return d && isValue($$.getBaseValue(d)); });
|
|
12880
12880
|
// Hide when bubble/scatter/stanford plot exists
|
|
12881
12881
|
if (!config.tooltip_show || dataToShow.length === 0 || $$.hasType("bubble") || $$.hasArcType()) {
|
|
@@ -12934,7 +12934,7 @@ var grid = {
|
|
|
12934
12934
|
var $$ = this;
|
|
12935
12935
|
var _b = $$.state, inputType = _b.inputType, resizing = _b.resizing, main = $$.$el.main;
|
|
12936
12936
|
if (inputType === "mouse" || !resizing) {
|
|
12937
|
-
main.selectAll("line."
|
|
12937
|
+
main.selectAll("line.".concat(CLASS.xgridFocus, ", line.").concat(CLASS.ygridFocus))
|
|
12938
12938
|
.style("visibility", "hidden");
|
|
12939
12939
|
(_a = $$.hideCircleFocus) === null || _a === void 0 ? void 0 : _a.call($$);
|
|
12940
12940
|
}
|
|
@@ -12943,7 +12943,7 @@ var grid = {
|
|
|
12943
12943
|
var _a;
|
|
12944
12944
|
var $$ = this;
|
|
12945
12945
|
var _b = $$.state, inputType = _b.inputType, width = _b.width, height = _b.height, resizing = _b.resizing, grid = $$.$el.grid;
|
|
12946
|
-
var xgridFocus = grid.main.select("line."
|
|
12946
|
+
var xgridFocus = grid.main.select("line.".concat(CLASS.xgridFocus));
|
|
12947
12947
|
if (inputType === "touch") {
|
|
12948
12948
|
if (xgridFocus.empty()) {
|
|
12949
12949
|
resizing && ((_a = $$.showCircleFocus) === null || _a === void 0 ? void 0 : _a.call($$));
|
|
@@ -12966,7 +12966,7 @@ var grid = {
|
|
|
12966
12966
|
},
|
|
12967
12967
|
generateGridData: function (type, scale) {
|
|
12968
12968
|
var $$ = this;
|
|
12969
|
-
var tickNum = $$.$el.main.select("."
|
|
12969
|
+
var tickNum = $$.$el.main.select(".".concat(CLASS.axisX))
|
|
12970
12970
|
.selectAll(".tick")
|
|
12971
12971
|
.size();
|
|
12972
12972
|
var gridData = [];
|
|
@@ -12974,7 +12974,7 @@ var grid = {
|
|
|
12974
12974
|
var xDomain = $$.getXDomain();
|
|
12975
12975
|
var _a = xDomain.map(function (v) { return v.getFullYear(); }), firstYear = _a[0], lastYear = _a[1];
|
|
12976
12976
|
for (var i = firstYear; i <= lastYear; i++) {
|
|
12977
|
-
gridData.push(new Date(i
|
|
12977
|
+
gridData.push(new Date("".concat(i, "-01-01 00:00:00")));
|
|
12978
12978
|
}
|
|
12979
12979
|
}
|
|
12980
12980
|
else {
|
|
@@ -13003,12 +13003,12 @@ var grid = {
|
|
|
13003
13003
|
var toShow = function (line) { return !toRemove(line); };
|
|
13004
13004
|
var classLines = forX ? CLASS.xgridLines : CLASS.ygridLines;
|
|
13005
13005
|
var classLine = forX ? CLASS.xgridLine : CLASS.ygridLine;
|
|
13006
|
-
$T($$.$el.main.select("."
|
|
13007
|
-
.selectAll("."
|
|
13006
|
+
$T($$.$el.main.select(".".concat(classLines))
|
|
13007
|
+
.selectAll(".".concat(classLine))
|
|
13008
13008
|
.filter(toRemove))
|
|
13009
13009
|
.style("opacity", "0")
|
|
13010
13010
|
.remove();
|
|
13011
|
-
var gridLines = "grid_"
|
|
13011
|
+
var gridLines = "grid_".concat(forX ? "x" : "y", "_lines");
|
|
13012
13012
|
config[gridLines] = config[gridLines].filter(toShow);
|
|
13013
13013
|
}
|
|
13014
13014
|
};
|
|
@@ -13036,7 +13036,7 @@ var region = {
|
|
|
13036
13036
|
region.main.style("visibility", $$.hasArcType() ? "hidden" : null);
|
|
13037
13037
|
// select <g> element
|
|
13038
13038
|
var list = region.main
|
|
13039
|
-
.selectAll("."
|
|
13039
|
+
.selectAll(".".concat(CLASS.region))
|
|
13040
13040
|
.data(config.regions);
|
|
13041
13041
|
$T(list.exit())
|
|
13042
13042
|
.style("opacity", "0")
|
|
@@ -13208,7 +13208,7 @@ var sizeAxis = {
|
|
|
13208
13208
|
getAxisTickRotate: function (id) {
|
|
13209
13209
|
var $$ = this;
|
|
13210
13210
|
var axis = $$.axis, config = $$.config, state = $$.state, $el = $$.$el;
|
|
13211
|
-
var rotate = config["axis_"
|
|
13211
|
+
var rotate = config["axis_".concat(id, "_tick_rotate")];
|
|
13212
13212
|
if (id === "x") {
|
|
13213
13213
|
var allowedXAxisTypes = axis.isCategorized() || axis.isTimeSeries();
|
|
13214
13214
|
if (config.axis_x_tick_fit && allowedXAxisTypes) {
|
|
@@ -15059,9 +15059,9 @@ var shapeArc = {
|
|
|
15059
15059
|
var config = $$.config;
|
|
15060
15060
|
var dataType = config.data_type;
|
|
15061
15061
|
var padding = config.pie_padding;
|
|
15062
|
-
var startingAngle = config[dataType
|
|
15062
|
+
var startingAngle = config["".concat(dataType, "_startingAngle")] || 0;
|
|
15063
15063
|
var padAngle = ($$.hasType("pie") && padding ? padding * 0.01 :
|
|
15064
|
-
config[dataType
|
|
15064
|
+
config["".concat(dataType, "_padAngle")]) || 0;
|
|
15065
15065
|
$$.pie = pie$1()
|
|
15066
15066
|
.startAngle(startingAngle)
|
|
15067
15067
|
.endAngle(startingAngle + (2 * Math.PI))
|
|
@@ -15268,7 +15268,7 @@ var shapeArc = {
|
|
|
15268
15268
|
var y1 = Math.sin(updated.endAngle - Math.PI / 2);
|
|
15269
15269
|
var x = Math.cos(updated.endAngle - Math.PI / 2) * (radiusExpanded + 25);
|
|
15270
15270
|
var y = y1 * (radiusExpanded + 15 - Math.abs(y1 * 10)) + 3;
|
|
15271
|
-
translate = "translate("
|
|
15271
|
+
translate = "translate(".concat(x, ",").concat(y, ")");
|
|
15272
15272
|
}
|
|
15273
15273
|
else if (!$$.hasType("gauge") || $$.data.targets.length > 1) {
|
|
15274
15274
|
var outerRadius = $$.getRadius(d).outerRadius;
|
|
@@ -15283,7 +15283,7 @@ var shapeArc = {
|
|
|
15283
15283
|
else {
|
|
15284
15284
|
ratio = outerRadius && (h ? (36 / outerRadius > 0.375 ? 1.175 - 36 / outerRadius : 0.8) * outerRadius / h : 0);
|
|
15285
15285
|
}
|
|
15286
|
-
translate = "translate("
|
|
15286
|
+
translate = "translate(".concat(x * ratio, ",").concat(y * ratio, ")");
|
|
15287
15287
|
}
|
|
15288
15288
|
}
|
|
15289
15289
|
return translate;
|
|
@@ -15327,14 +15327,14 @@ var shapeArc = {
|
|
|
15327
15327
|
var interval_1 = setInterval(function () {
|
|
15328
15328
|
if (!transiting) {
|
|
15329
15329
|
clearInterval(interval_1);
|
|
15330
|
-
$el.legend.selectAll("."
|
|
15330
|
+
$el.legend.selectAll(".".concat(CLASS.legendItemFocused)).size() > 0 &&
|
|
15331
15331
|
$$.expandArc(targetIds);
|
|
15332
15332
|
}
|
|
15333
15333
|
}, 10);
|
|
15334
15334
|
return;
|
|
15335
15335
|
}
|
|
15336
15336
|
var newTargetIds = $$.mapToTargetIds(targetIds);
|
|
15337
|
-
$el.svg.selectAll($$.selectorTargets(newTargetIds, "."
|
|
15337
|
+
$el.svg.selectAll($$.selectorTargets(newTargetIds, ".".concat(CLASS.chartArc)))
|
|
15338
15338
|
.each(function (d) {
|
|
15339
15339
|
if (!$$.shouldExpand(d.data.id)) {
|
|
15340
15340
|
return;
|
|
@@ -15357,12 +15357,12 @@ var shapeArc = {
|
|
|
15357
15357
|
return;
|
|
15358
15358
|
}
|
|
15359
15359
|
var newTargetIds = $$.mapToTargetIds(targetIds);
|
|
15360
|
-
svg.selectAll($$.selectorTargets(newTargetIds, "."
|
|
15360
|
+
svg.selectAll($$.selectorTargets(newTargetIds, ".".concat(CLASS.chartArc)))
|
|
15361
15361
|
.selectAll("path")
|
|
15362
15362
|
.transition()
|
|
15363
15363
|
.duration(function (d) { return $$.getExpandConfig(d.data.id, "duration"); })
|
|
15364
15364
|
.attr("d", $$.svgArc);
|
|
15365
|
-
svg.selectAll(""
|
|
15365
|
+
svg.selectAll("".concat(CLASS.arc))
|
|
15366
15366
|
.style("opacity", null);
|
|
15367
15367
|
},
|
|
15368
15368
|
/**
|
|
@@ -15389,7 +15389,7 @@ var shapeArc = {
|
|
|
15389
15389
|
else if ($$.isPieType(id)) {
|
|
15390
15390
|
type = "pie";
|
|
15391
15391
|
}
|
|
15392
|
-
return type ? config[type
|
|
15392
|
+
return type ? config["".concat(type, "_expand_").concat(key)] : def[key];
|
|
15393
15393
|
},
|
|
15394
15394
|
shouldExpand: function (id) {
|
|
15395
15395
|
var $$ = this;
|
|
@@ -15402,7 +15402,7 @@ var shapeArc = {
|
|
|
15402
15402
|
var $$ = this;
|
|
15403
15403
|
var config = $$.config;
|
|
15404
15404
|
return ["pie", "donut", "gauge"]
|
|
15405
|
-
.some(function (v) { return $$.hasType(v) && config[v
|
|
15405
|
+
.some(function (v) { return $$.hasType(v) && config["".concat(v, "_label_show")]; });
|
|
15406
15406
|
},
|
|
15407
15407
|
getArcLabelFormat: function () {
|
|
15408
15408
|
var $$ = this;
|
|
@@ -15419,7 +15419,7 @@ var shapeArc = {
|
|
|
15419
15419
|
getArcTitle: function () {
|
|
15420
15420
|
var $$ = this;
|
|
15421
15421
|
var type = ($$.hasType("donut") && "donut") || ($$.hasType("gauge") && "gauge");
|
|
15422
|
-
return type ? $$.config[type
|
|
15422
|
+
return type ? $$.config["".concat(type, "_title")] : "";
|
|
15423
15423
|
},
|
|
15424
15424
|
updateTargetsForArc: function (targets) {
|
|
15425
15425
|
var $$ = this;
|
|
@@ -15428,9 +15428,9 @@ var shapeArc = {
|
|
|
15428
15428
|
var classChartArc = $$.getChartClass("Arc");
|
|
15429
15429
|
var classArcs = $$.getClass("arcs", true);
|
|
15430
15430
|
var classFocus = $$.classFocus.bind($$);
|
|
15431
|
-
var chartArcs = $el.main.select("."
|
|
15431
|
+
var chartArcs = $el.main.select(".".concat(CLASS.chartArcs));
|
|
15432
15432
|
var mainPieUpdate = chartArcs
|
|
15433
|
-
.selectAll("."
|
|
15433
|
+
.selectAll(".".concat(CLASS.chartArc))
|
|
15434
15434
|
.data($$.pie(targets))
|
|
15435
15435
|
.attr("class", function (d) { return classChartArc(d) + classFocus(d.data); });
|
|
15436
15436
|
var mainPieEnter = mainPieUpdate.enter().append("g")
|
|
@@ -15443,14 +15443,14 @@ var shapeArc = {
|
|
|
15443
15443
|
.style("opacity", "0")
|
|
15444
15444
|
.style("text-anchor", "middle")
|
|
15445
15445
|
.style("pointer-events", "none");
|
|
15446
|
-
$el.text = chartArcs.selectAll("."
|
|
15446
|
+
$el.text = chartArcs.selectAll(".".concat(CLASS.target, " text"));
|
|
15447
15447
|
// MEMO: can not keep same color..., but not bad to update color in redraw
|
|
15448
15448
|
// mainPieUpdate.exit().remove();
|
|
15449
15449
|
},
|
|
15450
15450
|
initArc: function () {
|
|
15451
15451
|
var $$ = this;
|
|
15452
15452
|
var $el = $$.$el;
|
|
15453
|
-
$el.arcs = $el.main.select("."
|
|
15453
|
+
$el.arcs = $el.main.select(".".concat(CLASS.chart))
|
|
15454
15454
|
.append("g")
|
|
15455
15455
|
.attr("class", CLASS.chartArcs)
|
|
15456
15456
|
.attr("transform", $$.getTranslate("arc"));
|
|
@@ -15468,11 +15468,7 @@ var shapeArc = {
|
|
|
15468
15468
|
var text = $$.$el.arcs.append("text")
|
|
15469
15469
|
.attr("class", CLASS[hasGauge ? "chartArcsGaugeTitle" : "chartArcsTitle"])
|
|
15470
15470
|
.style("text-anchor", "middle");
|
|
15471
|
-
|
|
15472
|
-
text
|
|
15473
|
-
.attr("dy", "-0.3em")
|
|
15474
|
-
.style("font-size", "27px");
|
|
15475
|
-
}
|
|
15471
|
+
hasGauge && text.attr("dy", "-0.3em");
|
|
15476
15472
|
setTextValue(text, title, hasGauge ? undefined : [-0.6, 1.35], true);
|
|
15477
15473
|
}
|
|
15478
15474
|
},
|
|
@@ -15481,8 +15477,8 @@ var shapeArc = {
|
|
|
15481
15477
|
var config = $$.config, state = $$.state, main = $$.$el.main;
|
|
15482
15478
|
var hasInteraction = config.interaction_enabled;
|
|
15483
15479
|
var isSelectable = hasInteraction && config.data_selection_isselectable;
|
|
15484
|
-
var mainArc = main.selectAll("."
|
|
15485
|
-
.selectAll("."
|
|
15480
|
+
var mainArc = main.selectAll(".".concat(CLASS.arcs))
|
|
15481
|
+
.selectAll(".".concat(CLASS.arc))
|
|
15486
15482
|
.data($$.arcData.bind($$));
|
|
15487
15483
|
mainArc.exit()
|
|
15488
15484
|
.transition()
|
|
@@ -15571,15 +15567,15 @@ var shapeArc = {
|
|
|
15571
15567
|
var isFullCircle = config.gauge_fullCircle;
|
|
15572
15568
|
var startAngle = $$.getStartAngle();
|
|
15573
15569
|
var endAngle = isFullCircle ? startAngle + $$.getArcLength() : startAngle * -1;
|
|
15574
|
-
var backgroundArc = $$.$el.arcs.select((hasMultiArcGauge ? "g" : ""
|
|
15570
|
+
var backgroundArc = $$.$el.arcs.select("".concat(hasMultiArcGauge ? "g" : "", ".").concat(CLASS.chartArcsBackground));
|
|
15575
15571
|
if (hasMultiArcGauge) {
|
|
15576
15572
|
var index_1 = 0;
|
|
15577
15573
|
backgroundArc = backgroundArc
|
|
15578
|
-
.selectAll("path."
|
|
15574
|
+
.selectAll("path.".concat(CLASS.chartArcsBackground))
|
|
15579
15575
|
.data($$.data.targets);
|
|
15580
15576
|
backgroundArc.enter()
|
|
15581
15577
|
.append("path")
|
|
15582
|
-
.attr("class", function (d, i) { return CLASS.chartArcsBackground
|
|
15578
|
+
.attr("class", function (d, i) { return "".concat(CLASS.chartArcsBackground, " ").concat(CLASS.chartArcsBackground, "-").concat(i); })
|
|
15583
15579
|
.merge(backgroundArc)
|
|
15584
15580
|
.style("fill", (config.gauge_background) || null)
|
|
15585
15581
|
.attr("d", function (_a) {
|
|
@@ -15702,35 +15698,35 @@ var shapeArc = {
|
|
|
15702
15698
|
var text;
|
|
15703
15699
|
// for gauge type, update text when has no title & multi data
|
|
15704
15700
|
if (!(hasGauge && $$.data.targets.length === 1 && config.gauge_title)) {
|
|
15705
|
-
text = main.selectAll("."
|
|
15701
|
+
text = main.selectAll(".".concat(CLASS.chartArc))
|
|
15706
15702
|
.select("text")
|
|
15707
15703
|
.style("opacity", "0")
|
|
15708
15704
|
.attr("class", function (d) { return ($$.isGaugeType(d.data) ? CLASS.gaugeValue : null); })
|
|
15709
15705
|
.call($$.textForArcLabel.bind($$))
|
|
15710
15706
|
.attr("transform", $$.transformForArcLabel.bind($$))
|
|
15711
15707
|
.style("font-size", function (d) { return ($$.isGaugeType(d.data) && $$.data.targets.length === 1 && !hasMultiArcGauge ?
|
|
15712
|
-
Math.round(state.radius / 5)
|
|
15708
|
+
"".concat(Math.round(state.radius / 5), "px") : null); })
|
|
15713
15709
|
.transition()
|
|
15714
15710
|
.duration(duration)
|
|
15715
15711
|
.style("opacity", function (d) { return ($$.isTargetToShow(d.data.id) && $$.isArcType(d.data) ? null : "0"); });
|
|
15716
15712
|
hasMultiArcGauge && text.attr("dy", "-.1em");
|
|
15717
15713
|
}
|
|
15718
|
-
main.select("."
|
|
15714
|
+
main.select(".".concat(CLASS.chartArcsTitle))
|
|
15719
15715
|
.style("opacity", $$.hasType("donut") || hasGauge ? null : "0");
|
|
15720
15716
|
if (hasGauge) {
|
|
15721
15717
|
var isFullCircle = config.gauge_fullCircle;
|
|
15722
|
-
isFullCircle && (text === null || text === void 0 ? void 0 : text.attr("dy", ""
|
|
15718
|
+
isFullCircle && (text === null || text === void 0 ? void 0 : text.attr("dy", "".concat(hasMultiArcGauge ? 0 : Math.round(state.radius / 14))));
|
|
15723
15719
|
if (config.gauge_label_show) {
|
|
15724
|
-
arcs.select("."
|
|
15725
|
-
.attr("dy", (isFullCircle ? 1.5 : 0.75
|
|
15720
|
+
arcs.select(".".concat(CLASS.chartArcsGaugeUnit))
|
|
15721
|
+
.attr("dy", "".concat(isFullCircle ? 1.5 : 0.75, "em"))
|
|
15726
15722
|
.text(config.gauge_units);
|
|
15727
|
-
arcs.select("."
|
|
15728
|
-
.attr("dx", -1 * (state.innerRadius + ((state.radius - state.innerRadius) / (isFullCircle ? 1 : 2)))
|
|
15723
|
+
arcs.select(".".concat(CLASS.chartArcsGaugeMin))
|
|
15724
|
+
.attr("dx", "".concat(-1 * (state.innerRadius + ((state.radius - state.innerRadius) / (isFullCircle ? 1 : 2))), "px"))
|
|
15729
15725
|
.attr("dy", "1.2em")
|
|
15730
15726
|
.text($$.textForGaugeMinMax(config.gauge_min, false));
|
|
15731
15727
|
// show max text when isn't fullCircle
|
|
15732
|
-
!isFullCircle && arcs.select("."
|
|
15733
|
-
.attr("dx", state.innerRadius + ((state.radius - state.innerRadius) / 2)
|
|
15728
|
+
!isFullCircle && arcs.select(".".concat(CLASS.chartArcsGaugeMax))
|
|
15729
|
+
.attr("dx", "".concat(state.innerRadius + ((state.radius - state.innerRadius) / 2), "px"))
|
|
15734
15730
|
.attr("dy", "1.2em")
|
|
15735
15731
|
.text($$.textForGaugeMinMax(config.gauge_max, true));
|
|
15736
15732
|
}
|
|
@@ -15747,19 +15743,19 @@ var shapeArea = {
|
|
|
15747
15743
|
var $$ = this;
|
|
15748
15744
|
var config = $$.config;
|
|
15749
15745
|
mainLine
|
|
15750
|
-
.insert("g", "."
|
|
15746
|
+
.insert("g", ".".concat(CLASS[config.area_front ? "circles" : "lines"]))
|
|
15751
15747
|
.attr("class", $$.getClass("areas", true));
|
|
15752
15748
|
},
|
|
15753
15749
|
updateAreaGradient: function () {
|
|
15754
15750
|
var $$ = this;
|
|
15755
15751
|
var config = $$.config, datetimeId = $$.state.datetimeId, defs = $$.$el.defs;
|
|
15756
15752
|
$$.data.targets.forEach(function (d) {
|
|
15757
|
-
var id = datetimeId
|
|
15758
|
-
if ($$.isAreaType(d) && defs.select("#"
|
|
15753
|
+
var id = "".concat(datetimeId, "-areaGradient").concat($$.getTargetSelectorSuffix(d.id));
|
|
15754
|
+
if ($$.isAreaType(d) && defs.select("#".concat(id)).empty()) {
|
|
15759
15755
|
var color_1 = $$.color(d);
|
|
15760
15756
|
var _a = config.area_linearGradient, _b = _a.x, x = _b === void 0 ? [0, 0] : _b, _c = _a.y, y = _c === void 0 ? [0, 1] : _c, _d = _a.stops, stops = _d === void 0 ? [[0, color_1, 1], [1, color_1, 0]] : _d;
|
|
15761
15757
|
var linearGradient_1 = defs.append("linearGradient")
|
|
15762
|
-
.attr("id", ""
|
|
15758
|
+
.attr("id", "".concat(id))
|
|
15763
15759
|
.attr("x1", x[0])
|
|
15764
15760
|
.attr("x2", x[1])
|
|
15765
15761
|
.attr("y1", y[0])
|
|
@@ -15777,7 +15773,7 @@ var shapeArea = {
|
|
|
15777
15773
|
updateAreaColor: function (d) {
|
|
15778
15774
|
var $$ = this;
|
|
15779
15775
|
return $$.config.area_linearGradient ?
|
|
15780
|
-
"url(#"
|
|
15776
|
+
"url(#".concat($$.state.datetimeId, "-areaGradient").concat($$.getTargetSelectorSuffix(d.id), ")") :
|
|
15781
15777
|
$$.color(d);
|
|
15782
15778
|
},
|
|
15783
15779
|
/**
|
|
@@ -15792,8 +15788,8 @@ var shapeArea = {
|
|
|
15792
15788
|
var config = $$.config, state = $$.state, $el = $$.$el, $T = $$.$T;
|
|
15793
15789
|
var $root = isSub ? $el.subchart : $el;
|
|
15794
15790
|
config.area_linearGradient && $$.updateAreaGradient();
|
|
15795
|
-
var area = $root.main.selectAll("."
|
|
15796
|
-
.selectAll("."
|
|
15791
|
+
var area = $root.main.selectAll(".".concat(CLASS.areas))
|
|
15792
|
+
.selectAll(".".concat(CLASS.area))
|
|
15797
15793
|
.data($$.lineData.bind($$));
|
|
15798
15794
|
$T(area.exit(), withTransition)
|
|
15799
15795
|
.style("opacity", "0")
|
|
@@ -15878,7 +15874,7 @@ var shapeArea = {
|
|
|
15878
15874
|
x0 = $$.scale.x(values[0].x);
|
|
15879
15875
|
y0 = $$.getYScaleById(d.id)(values[0].value);
|
|
15880
15876
|
}
|
|
15881
|
-
path = isRotated ? "M "
|
|
15877
|
+
path = isRotated ? "M ".concat(y0, " ").concat(x0) : "M ".concat(x0, " ").concat(y0);
|
|
15882
15878
|
}
|
|
15883
15879
|
return path || "M 0 0";
|
|
15884
15880
|
};
|
|
@@ -15917,11 +15913,16 @@ var shapeArea = {
|
|
|
15917
15913
|
*/
|
|
15918
15914
|
var shapeBar = {
|
|
15919
15915
|
initBar: function () {
|
|
15920
|
-
var $el =
|
|
15921
|
-
$el.bar = $el.main.select("."
|
|
15916
|
+
var _a = this, $el = _a.$el, config = _a.config, clip = _a.state.clip;
|
|
15917
|
+
$el.bar = $el.main.select(".".concat(CLASS.chart))
|
|
15922
15918
|
// should positioned at the beginning of the shape node to not overlap others
|
|
15923
15919
|
.insert("g", ":first-child")
|
|
15924
15920
|
.attr("class", CLASS.chartBars);
|
|
15921
|
+
// set clip-path attribute when condition meet
|
|
15922
|
+
// https://github.com/naver/billboard.js/issues/2421
|
|
15923
|
+
if (config.clipPath === false && (config.bar_radius || config.bar_radius_ratio)) {
|
|
15924
|
+
$el.bar.attr("clip-path", clip.pathXAxis.replace(/#[^)]*/, "#".concat(clip.id)));
|
|
15925
|
+
}
|
|
15925
15926
|
},
|
|
15926
15927
|
updateTargetsForBar: function (targets) {
|
|
15927
15928
|
var $$ = this;
|
|
@@ -15933,8 +15934,8 @@ var shapeBar = {
|
|
|
15933
15934
|
if (!$el.bar) {
|
|
15934
15935
|
$$.initBar();
|
|
15935
15936
|
}
|
|
15936
|
-
var mainBarUpdate = $$.$el.main.select("."
|
|
15937
|
-
.selectAll("."
|
|
15937
|
+
var mainBarUpdate = $$.$el.main.select(".".concat(CLASS.chartBars))
|
|
15938
|
+
.selectAll(".".concat(CLASS.chartBar))
|
|
15938
15939
|
.data(
|
|
15939
15940
|
// remove
|
|
15940
15941
|
targets.filter(function (v) { return !v.values.every(function (d) { return !isNumber(d.value); }); }))
|
|
@@ -15961,8 +15962,8 @@ var shapeBar = {
|
|
|
15961
15962
|
var $root = isSub ? $el.subchart : $el;
|
|
15962
15963
|
var classBar = $$.getClass("bar", true);
|
|
15963
15964
|
var initialOpacity = $$.initialOpacity.bind($$);
|
|
15964
|
-
var bar = $root.main.selectAll("."
|
|
15965
|
-
.selectAll("."
|
|
15965
|
+
var bar = $root.main.selectAll(".".concat(CLASS.bars))
|
|
15966
|
+
.selectAll(".".concat(CLASS.bar))
|
|
15966
15967
|
.data($$.labelishData.bind($$));
|
|
15967
15968
|
$T(bar.exit(), withTransition)
|
|
15968
15969
|
.style("opacity", "0")
|
|
@@ -16011,21 +16012,21 @@ var shapeBar = {
|
|
|
16011
16012
|
var isNegative = d.value < 0;
|
|
16012
16013
|
var pathRadius = ["", ""];
|
|
16013
16014
|
var radius = 0;
|
|
16014
|
-
if (getRadius && !isGrouped) {
|
|
16015
|
+
if (d.value !== 0 && getRadius && !isGrouped) {
|
|
16015
16016
|
var index = isRotated ? indexY : indexX;
|
|
16016
16017
|
var barW = points[2][index] - points[0][index];
|
|
16017
16018
|
radius = getRadius(barW);
|
|
16018
|
-
var arc = "a"
|
|
16019
|
-
pathRadius[+!isRotated] = ""
|
|
16020
|
-
pathRadius[+isRotated] = ""
|
|
16019
|
+
var arc = "a".concat(radius, ",").concat(radius, " ").concat(isNegative ? "1 0 0" : "0 0 1", " ");
|
|
16020
|
+
pathRadius[+!isRotated] = "".concat(arc).concat(radius, ",").concat(radius);
|
|
16021
|
+
pathRadius[+isRotated] = "".concat(arc).concat([-radius, radius][isRotated ? "sort" : "reverse"]());
|
|
16021
16022
|
isNegative && pathRadius.reverse();
|
|
16022
16023
|
}
|
|
16023
16024
|
// path string data shouldn't be containing new line chars
|
|
16024
16025
|
// https://github.com/naver/billboard.js/issues/530
|
|
16025
16026
|
var path = isRotated ?
|
|
16026
|
-
"H"
|
|
16027
|
-
"V"
|
|
16028
|
-
return "M"
|
|
16027
|
+
"H".concat(points[1][indexX] - radius, " ").concat(pathRadius[0], "V").concat(points[2][indexY] - radius, " ").concat(pathRadius[1], "H").concat(points[3][indexX]) :
|
|
16028
|
+
"V".concat(points[1][indexY] + (isNegative ? -radius : radius), " ").concat(pathRadius[0], "H").concat(points[2][indexX] - radius, " ").concat(pathRadius[1], "V").concat(points[3][indexY]);
|
|
16029
|
+
return "M".concat(points[0][indexX], ",").concat(points[0][indexY]).concat(path, "z");
|
|
16029
16030
|
};
|
|
16030
16031
|
},
|
|
16031
16032
|
generateGetBarPoints: function (barIndices, isSub) {
|
|
@@ -16082,7 +16083,7 @@ var shapeBar = {
|
|
|
16082
16083
|
var shapeCandlestick = {
|
|
16083
16084
|
initCandlestick: function () {
|
|
16084
16085
|
var $el = this.$el;
|
|
16085
|
-
$el.candlestick = $el.main.select("."
|
|
16086
|
+
$el.candlestick = $el.main.select(".".concat(CLASS.chart))
|
|
16086
16087
|
// should positioned at the beginning of the shape node to not overlap others
|
|
16087
16088
|
.append("g")
|
|
16088
16089
|
.attr("class", CLASS.chartCandlesticks);
|
|
@@ -16101,8 +16102,8 @@ var shapeCandlestick = {
|
|
|
16101
16102
|
if (!$el.candlestick) {
|
|
16102
16103
|
$$.initCandlestick();
|
|
16103
16104
|
}
|
|
16104
|
-
var mainUpdate = $$.$el.main.select("."
|
|
16105
|
-
.selectAll("."
|
|
16105
|
+
var mainUpdate = $$.$el.main.select(".".concat(CLASS.chartCandlesticks))
|
|
16106
|
+
.selectAll(".".concat(CLASS.chartCandlestick))
|
|
16106
16107
|
.data(targets)
|
|
16107
16108
|
.attr("class", function (d) { return classChart(d) + classFocus(d); });
|
|
16108
16109
|
mainUpdate.enter().append("g")
|
|
@@ -16122,8 +16123,8 @@ var shapeCandlestick = {
|
|
|
16122
16123
|
var $root = isSub ? $el.subchart : $el;
|
|
16123
16124
|
var classSetter = $$.getClass("candlestick", true);
|
|
16124
16125
|
var initialOpacity = $$.initialOpacity.bind($$);
|
|
16125
|
-
var candlestick = $root.main.selectAll("."
|
|
16126
|
-
.selectAll("."
|
|
16126
|
+
var candlestick = $root.main.selectAll(".".concat(CLASS.chartCandlestick))
|
|
16127
|
+
.selectAll(".".concat(CLASS.candlestick))
|
|
16127
16128
|
.data($$.labelishData.bind($$));
|
|
16128
16129
|
$T(candlestick.exit(), withTransition)
|
|
16129
16130
|
.style("opacity", "0")
|
|
@@ -16164,10 +16165,10 @@ var shapeCandlestick = {
|
|
|
16164
16165
|
g.classed(CLASS[isUp ? "valueUp" : "valueDown"], true);
|
|
16165
16166
|
}
|
|
16166
16167
|
var path = isRotated ?
|
|
16167
|
-
"H"
|
|
16168
|
-
"V"
|
|
16168
|
+
"H".concat(points[1][1], " V").concat(points[1][0], " H").concat(points[0][1]) :
|
|
16169
|
+
"V".concat(points[1][1], " H").concat(points[1][0], " V").concat(points[0][1]);
|
|
16169
16170
|
g.select("path")
|
|
16170
|
-
.attr("d", "M"
|
|
16171
|
+
.attr("d", "M".concat(points[0][indexX], ",").concat(points[0][indexY]).concat(path, "z"))
|
|
16171
16172
|
.style("fill", function (d) {
|
|
16172
16173
|
var color = isUp ? $$.color(d) : (isObject(downColor) ? downColor[d.id] : downColor);
|
|
16173
16174
|
return color || $$.color(d);
|
|
@@ -16336,12 +16337,12 @@ var shapeGauge = {
|
|
|
16336
16337
|
var $$ = this;
|
|
16337
16338
|
var config = $$.config, state = $$.state, $el = $$.$el;
|
|
16338
16339
|
var hiddenTargetIds = $$.state.hiddenTargetIds;
|
|
16339
|
-
var arcLabelLines = $el.main.selectAll("."
|
|
16340
|
-
.selectAll("."
|
|
16340
|
+
var arcLabelLines = $el.main.selectAll(".".concat(CLASS.arcs))
|
|
16341
|
+
.selectAll(".".concat(CLASS.arcLabelLine))
|
|
16341
16342
|
.data($$.arcData.bind($$));
|
|
16342
16343
|
var mainArcLabelLine = arcLabelLines.enter()
|
|
16343
16344
|
.append("rect")
|
|
16344
|
-
.attr("class", function (d) { return CLASS.arcLabelLine
|
|
16345
|
+
.attr("class", function (d) { return "".concat(CLASS.arcLabelLine, " ").concat(CLASS.target, " ").concat(CLASS.target, "-").concat(d.data.id); })
|
|
16345
16346
|
.merge(arcLabelLines);
|
|
16346
16347
|
mainArcLabelLine
|
|
16347
16348
|
.style("fill", function (d) { return ($$.levelColor ? $$.levelColor(d.data.values[0].value) : $$.color(d.data)); })
|
|
@@ -16362,7 +16363,7 @@ var shapeGauge = {
|
|
|
16362
16363
|
lineLength = state.radiusExpanded - state.radius + innerLineLength;
|
|
16363
16364
|
x = Math.cos(linePositioningAngle) * arcInnerRadius;
|
|
16364
16365
|
y = Math.sin(linePositioningAngle) * arcInnerRadius;
|
|
16365
|
-
transform = "rotate("
|
|
16366
|
+
transform = "rotate(".concat(lineAngle * 180 / Math.PI, ", ").concat(x, ", ").concat(y, ")");
|
|
16366
16367
|
}
|
|
16367
16368
|
select(this)
|
|
16368
16369
|
.attr("x", x)
|
|
@@ -16370,7 +16371,7 @@ var shapeGauge = {
|
|
|
16370
16371
|
.attr("width", lineLength)
|
|
16371
16372
|
.attr("height", lineThickness)
|
|
16372
16373
|
.attr("transform", transform)
|
|
16373
|
-
.style("stroke-dasharray", "0, "
|
|
16374
|
+
.style("stroke-dasharray", "0, ".concat(lineLength + lineThickness, ", 0"));
|
|
16374
16375
|
});
|
|
16375
16376
|
},
|
|
16376
16377
|
textForGaugeMinMax: function (value, isMax) {
|
|
@@ -16462,7 +16463,7 @@ var shapeBubble = {
|
|
|
16462
16463
|
var shapeLine = {
|
|
16463
16464
|
initLine: function () {
|
|
16464
16465
|
var $el = this.$el;
|
|
16465
|
-
$el.line = $el.main.select("."
|
|
16466
|
+
$el.line = $el.main.select(".".concat(CLASS.chart)).append("g")
|
|
16466
16467
|
.attr("class", CLASS.chartLines);
|
|
16467
16468
|
},
|
|
16468
16469
|
updateTargetsForLine: function (t) {
|
|
@@ -16475,8 +16476,8 @@ var shapeLine = {
|
|
|
16475
16476
|
$$.initLine();
|
|
16476
16477
|
}
|
|
16477
16478
|
var targets = t.filter(function (d) { return !($$.isScatterType(d) || $$.isBubbleType(d)); });
|
|
16478
|
-
var mainLineUpdate = main.select("."
|
|
16479
|
-
.selectAll("."
|
|
16479
|
+
var mainLineUpdate = main.select(".".concat(CLASS.chartLines))
|
|
16480
|
+
.selectAll(".".concat(CLASS.chartLine))
|
|
16480
16481
|
.data(targets)
|
|
16481
16482
|
.attr("class", function (d) { return classChartLine(d) + classFocus(d); });
|
|
16482
16483
|
var mainLineEnter = mainLineUpdate.enter().append("g")
|
|
@@ -16504,15 +16505,15 @@ var shapeLine = {
|
|
|
16504
16505
|
var extraLineClasses = $$.format.extraLineClasses, $el = $$.$el, $T = $$.$T;
|
|
16505
16506
|
var $root = isSub ? $el.subchart : $el;
|
|
16506
16507
|
var line = $root.main
|
|
16507
|
-
.selectAll("."
|
|
16508
|
-
.selectAll("."
|
|
16508
|
+
.selectAll(".".concat(CLASS.lines))
|
|
16509
|
+
.selectAll(".".concat(CLASS.line))
|
|
16509
16510
|
.data($$.lineData.bind($$));
|
|
16510
16511
|
$T(line.exit(), withTransition)
|
|
16511
16512
|
.style("opacity", "0")
|
|
16512
16513
|
.remove();
|
|
16513
16514
|
$root.line = line.enter()
|
|
16514
16515
|
.append("path")
|
|
16515
|
-
.attr("class", function (d) { return $$.getClass("line", true)(d)
|
|
16516
|
+
.attr("class", function (d) { return "".concat($$.getClass("line", true)(d), " ").concat(extraLineClasses(d) || ""); })
|
|
16516
16517
|
.style("stroke", $$.color)
|
|
16517
16518
|
.merge(line)
|
|
16518
16519
|
.style("opacity", $$.initialOpacity.bind($$))
|
|
@@ -16609,7 +16610,7 @@ var shapeLine = {
|
|
|
16609
16610
|
x0 = x(values[0].x);
|
|
16610
16611
|
y0 = y(values[0].value);
|
|
16611
16612
|
}
|
|
16612
|
-
path = isRotated ? "M "
|
|
16613
|
+
path = isRotated ? "M ".concat(y0, " ").concat(x0) : "M ".concat(x0, " ").concat(y0);
|
|
16613
16614
|
}
|
|
16614
16615
|
return path || "M 0 0";
|
|
16615
16616
|
};
|
|
@@ -16649,7 +16650,7 @@ var shapeLine = {
|
|
|
16649
16650
|
var xValue = isRotated ? function (dt) { return y(dt.value); } : function (dt) { return x(dt.x); };
|
|
16650
16651
|
var yValue = isRotated ? function (dt) { return x(dt.x); } : function (dt) { return y(dt.value); };
|
|
16651
16652
|
// Define svg generator function for region
|
|
16652
|
-
var generateM = function (points) { return "M"
|
|
16653
|
+
var generateM = function (points) { return "M".concat(points[0][0], ",").concat(points[0][1], "L").concat(points[1][0], ",").concat(points[1][1]); };
|
|
16653
16654
|
var sWithRegion = isTimeSeries ? function (d0, d1, k, timeseriesDiff) {
|
|
16654
16655
|
var x0 = d0.x.getTime();
|
|
16655
16656
|
var xDiff = d1.x - d0.x;
|
|
@@ -16678,7 +16679,7 @@ var shapeLine = {
|
|
|
16678
16679
|
}
|
|
16679
16680
|
// Draw as normal
|
|
16680
16681
|
if (isUndefined(regions) || !style || !hasPrevData) {
|
|
16681
|
-
path += ""
|
|
16682
|
+
path += "".concat(i && hasPrevData ? "L" : "M").concat(xValue(data), ",").concat(yValue(data));
|
|
16682
16683
|
}
|
|
16683
16684
|
else if (hasPrevData) {
|
|
16684
16685
|
try {
|
|
@@ -16750,8 +16751,8 @@ var shapePoint = {
|
|
|
16750
16751
|
var $$ = this;
|
|
16751
16752
|
var main = $$.$el.main;
|
|
16752
16753
|
$$.point = $$.generatePoint();
|
|
16753
|
-
if (($$.hasType("bubble") || $$.hasType("scatter")) && main.select("."
|
|
16754
|
-
main.select("."
|
|
16754
|
+
if (($$.hasType("bubble") || $$.hasType("scatter")) && main.select(".".concat(CLASS.chartCircles)).empty()) {
|
|
16755
|
+
main.select(".".concat(CLASS.chart))
|
|
16755
16756
|
.append("g")
|
|
16756
16757
|
.attr("class", CLASS.chartCircles);
|
|
16757
16758
|
}
|
|
@@ -16773,9 +16774,9 @@ var shapePoint = {
|
|
|
16773
16774
|
if (!targets) {
|
|
16774
16775
|
targets = (data.targets)
|
|
16775
16776
|
.filter(function (d) { return _this.isScatterType(d) || _this.isBubbleType(d); });
|
|
16776
|
-
var mainCircle = $el.main.select("."
|
|
16777
|
+
var mainCircle = $el.main.select(".".concat(CLASS.chartCircles))
|
|
16777
16778
|
.style("pointer-events", "none")
|
|
16778
|
-
.selectAll("."
|
|
16779
|
+
.selectAll(".".concat(CLASS.circles))
|
|
16779
16780
|
.data(targets)
|
|
16780
16781
|
.attr("class", classCircles);
|
|
16781
16782
|
mainCircle.exit().remove();
|
|
@@ -16789,8 +16790,8 @@ var shapePoint = {
|
|
|
16789
16790
|
.style("cursor", function (d) { return (isFunction(isSelectable) && isSelectable(d) ? "pointer" : null); });
|
|
16790
16791
|
// Update date for selected circles
|
|
16791
16792
|
selectionEnabled && targets.forEach(function (t) {
|
|
16792
|
-
$el.main.selectAll("."
|
|
16793
|
-
.selectAll(""
|
|
16793
|
+
$el.main.selectAll(".".concat(CLASS.selectedCircles).concat($$.getTargetSelectorSuffix(t.id)))
|
|
16794
|
+
.selectAll("".concat(CLASS.selectedCircle))
|
|
16794
16795
|
.each(function (d) {
|
|
16795
16796
|
d.value = t.values[d.index].value;
|
|
16796
16797
|
});
|
|
@@ -16803,8 +16804,8 @@ var shapePoint = {
|
|
|
16803
16804
|
var focusOnly = config.point_focus_only;
|
|
16804
16805
|
var $root = isSub ? $el.subchart : $el;
|
|
16805
16806
|
if (config.point_show && !state.toggling) {
|
|
16806
|
-
var circles = $root.main.selectAll("."
|
|
16807
|
-
.selectAll("."
|
|
16807
|
+
var circles = $root.main.selectAll(".".concat(CLASS.circles))
|
|
16808
|
+
.selectAll(".".concat(CLASS.circle))
|
|
16808
16809
|
.data(function (d) { return (($$.isLineType(d) && $$.shouldDrawPointsForLine(d)) ||
|
|
16809
16810
|
$$.isBubbleType(d) || $$.isRadarType(d) || $$.isScatterType(d) ?
|
|
16810
16811
|
(focusOnly ? [d.values[0]] : d.values) : []); });
|
|
@@ -16812,7 +16813,7 @@ var shapePoint = {
|
|
|
16812
16813
|
circles.enter()
|
|
16813
16814
|
.filter(Boolean)
|
|
16814
16815
|
.append($$.point("create", this, $$.pointR.bind($$), $$.color));
|
|
16815
|
-
$root.circle = $root.main.selectAll("."
|
|
16816
|
+
$root.circle = $root.main.selectAll(".".concat(CLASS.circles, " .").concat(CLASS.circle))
|
|
16816
16817
|
.style("stroke", $$.color)
|
|
16817
16818
|
.style("opacity", $$.initialOpacityForCircle.bind($$));
|
|
16818
16819
|
}
|
|
@@ -16822,7 +16823,7 @@ var shapePoint = {
|
|
|
16822
16823
|
var $$ = this;
|
|
16823
16824
|
var rendered = $$.state.rendered, $el = $$.$el, $T = $$.$T;
|
|
16824
16825
|
var $root = isSub ? $el.subchart : $el;
|
|
16825
|
-
var selectedCircles = $root.main.selectAll("."
|
|
16826
|
+
var selectedCircles = $root.main.selectAll(".".concat(CLASS.selectedCircle));
|
|
16826
16827
|
if (!$$.config.point_show) {
|
|
16827
16828
|
return [];
|
|
16828
16829
|
}
|
|
@@ -16840,8 +16841,8 @@ var shapePoint = {
|
|
|
16840
16841
|
return [
|
|
16841
16842
|
mainCircles,
|
|
16842
16843
|
$T(selectedCircles, withTransition)
|
|
16843
|
-
.attr(posAttr
|
|
16844
|
-
.attr(posAttr
|
|
16844
|
+
.attr("".concat(posAttr, "x"), cx)
|
|
16845
|
+
.attr("".concat(posAttr, "y"), cy)
|
|
16845
16846
|
];
|
|
16846
16847
|
},
|
|
16847
16848
|
/**
|
|
@@ -16928,7 +16929,7 @@ var shapePoint = {
|
|
|
16928
16929
|
var _a = this.getBBox(), width = _a.width, height = _a.height;
|
|
16929
16930
|
var x = ratio * (+point.attr("x") + width / 2);
|
|
16930
16931
|
var y = ratio * (+point.attr("y") + height / 2);
|
|
16931
|
-
point.attr("transform", "translate("
|
|
16932
|
+
point.attr("transform", "translate(".concat(x, " ").concat(y, ") scale(").concat(scale, ")"));
|
|
16932
16933
|
}
|
|
16933
16934
|
});
|
|
16934
16935
|
}
|
|
@@ -16943,7 +16944,7 @@ var shapePoint = {
|
|
|
16943
16944
|
.classed(CLASS.EXPANDED, false);
|
|
16944
16945
|
circles.attr("r", r);
|
|
16945
16946
|
!$$.isCirclePoint() &&
|
|
16946
|
-
circles.attr("transform", "scale("
|
|
16947
|
+
circles.attr("transform", "scale(".concat(r(circles) / $$.config.point_r, ")"));
|
|
16947
16948
|
},
|
|
16948
16949
|
pointR: function (d) {
|
|
16949
16950
|
var $$ = this;
|
|
@@ -16975,8 +16976,8 @@ var shapePoint = {
|
|
|
16975
16976
|
var mouse = getPointer(this.state.event, node);
|
|
16976
16977
|
var element = select(node);
|
|
16977
16978
|
var prefix = this.isCirclePoint(node) ? "c" : "";
|
|
16978
|
-
var cx = +element.attr(prefix
|
|
16979
|
-
var cy = +element.attr(prefix
|
|
16979
|
+
var cx = +element.attr("".concat(prefix, "x"));
|
|
16980
|
+
var cy = +element.attr("".concat(prefix, "y"));
|
|
16980
16981
|
// if node don't have cx/y or x/y attribute value
|
|
16981
16982
|
if (!(cx || cy) && node.nodeType === 1) {
|
|
16982
16983
|
var _a = getBoundingRect(node), x = _a.x, y = _a.y;
|
|
@@ -17016,7 +17017,7 @@ var shapePoint = {
|
|
|
17016
17017
|
$$.$el.defs.node().appendChild(clone);
|
|
17017
17018
|
},
|
|
17018
17019
|
pointFromDefs: function (id) {
|
|
17019
|
-
return this.$el.defs.select("#"
|
|
17020
|
+
return this.$el.defs.select("#".concat(id));
|
|
17020
17021
|
},
|
|
17021
17022
|
updatePointClass: function (d) {
|
|
17022
17023
|
var $$ = this;
|
|
@@ -17027,7 +17028,7 @@ var shapePoint = {
|
|
|
17027
17028
|
circle.each(function (d) {
|
|
17028
17029
|
var className = $$.getClass("circle", true)(d);
|
|
17029
17030
|
if (this.getAttribute("class").indexOf(CLASS.EXPANDED) > -1) {
|
|
17030
|
-
className += " "
|
|
17031
|
+
className += " ".concat(CLASS.EXPANDED);
|
|
17031
17032
|
}
|
|
17032
17033
|
this.setAttribute("class", className);
|
|
17033
17034
|
}) : $$.getClass("circle", true)(d);
|
|
@@ -17080,7 +17081,7 @@ var shapePoint = {
|
|
|
17080
17081
|
point = $$[point];
|
|
17081
17082
|
}
|
|
17082
17083
|
else if (!$$.hasValidPointDrawMethods(point)) {
|
|
17083
|
-
var pointId = datetimeId
|
|
17084
|
+
var pointId = "".concat(datetimeId, "-point").concat(id);
|
|
17084
17085
|
var pointFromDefs = $$.pointFromDefs(pointId);
|
|
17085
17086
|
if (pointFromDefs.size() < 1) {
|
|
17086
17087
|
$$.insertPointInfoDefs(point, pointId);
|
|
@@ -17099,7 +17100,7 @@ var shapePoint = {
|
|
|
17099
17100
|
custom: {
|
|
17100
17101
|
create: function (element, id, sizeFn, fillStyleFn) {
|
|
17101
17102
|
return element.append("use")
|
|
17102
|
-
.attr("xlink:href", "#"
|
|
17103
|
+
.attr("xlink:href", "#".concat(id))
|
|
17103
17104
|
.attr("class", this.updatePointClass.bind(this))
|
|
17104
17105
|
.style("fill", fillStyleFn)
|
|
17105
17106
|
.node();
|
|
@@ -17208,7 +17209,7 @@ var shapeRadar = {
|
|
|
17208
17209
|
var $$ = this;
|
|
17209
17210
|
var config = $$.config, current = $$.state.current, $el = $$.$el;
|
|
17210
17211
|
if ($$.hasType("radar")) {
|
|
17211
|
-
$el.radar = $el.main.select("."
|
|
17212
|
+
$el.radar = $el.main.select(".".concat(CLASS.chart)).append("g")
|
|
17212
17213
|
.attr("class", CLASS.chartRadars);
|
|
17213
17214
|
// level
|
|
17214
17215
|
$el.radar.levels = $el.radar.append("g")
|
|
@@ -17272,7 +17273,7 @@ var shapeRadar = {
|
|
|
17272
17273
|
// Adjust radar, circles and texts' position
|
|
17273
17274
|
if (translate) {
|
|
17274
17275
|
radar.attr("transform", translate);
|
|
17275
|
-
main.select("."
|
|
17276
|
+
main.select(".".concat(CLASS.chartTexts)).attr("transform", translate);
|
|
17276
17277
|
$$.generateRadarPoints();
|
|
17277
17278
|
$$.updateRadarLevel();
|
|
17278
17279
|
$$.updateRadarAxes();
|
|
@@ -17310,11 +17311,11 @@ var shapeRadar = {
|
|
|
17310
17311
|
return pos.join(" ");
|
|
17311
17312
|
});
|
|
17312
17313
|
var level = radarLevels
|
|
17313
|
-
.selectAll("."
|
|
17314
|
+
.selectAll(".".concat(CLASS.level))
|
|
17314
17315
|
.data(levelData);
|
|
17315
17316
|
level.exit().remove();
|
|
17316
17317
|
var levelEnter = level.enter().append("g")
|
|
17317
|
-
.attr("class", function (d, i) { return CLASS.level
|
|
17318
|
+
.attr("class", function (d, i) { return "".concat(CLASS.level, " ").concat(CLASS.level, "-").concat(i); });
|
|
17318
17319
|
levelEnter.append("polygon")
|
|
17319
17320
|
.style("visibility", config.radar_level_show ? null : "hidden");
|
|
17320
17321
|
if (showText) {
|
|
@@ -17333,7 +17334,7 @@ var shapeRadar = {
|
|
|
17333
17334
|
}
|
|
17334
17335
|
levelEnter
|
|
17335
17336
|
.merge(level)
|
|
17336
|
-
.attr("transform", function (d) { return "translate("
|
|
17337
|
+
.attr("transform", function (d) { return "translate(".concat(width - levelRatio[d], ", ").concat(height - levelRatio[d], ")"); })
|
|
17337
17338
|
.selectAll("polygon")
|
|
17338
17339
|
.attr("points", function (d) { return points[d]; });
|
|
17339
17340
|
// update level text position
|
|
@@ -17352,7 +17353,7 @@ var shapeRadar = {
|
|
|
17352
17353
|
.data(categories);
|
|
17353
17354
|
axis.exit().remove();
|
|
17354
17355
|
var axisEnter = axis.enter().append("g")
|
|
17355
|
-
.attr("class", function (d, i) { return CLASS.axis
|
|
17356
|
+
.attr("class", function (d, i) { return "".concat(CLASS.axis, "-").concat(i); });
|
|
17356
17357
|
config.radar_axis_line_show && axisEnter.append("line");
|
|
17357
17358
|
config.radar_axis_text_show && axisEnter.append("text");
|
|
17358
17359
|
axis = axisEnter.merge(axis);
|
|
@@ -17399,7 +17400,7 @@ var shapeRadar = {
|
|
|
17399
17400
|
else if (posY < height) {
|
|
17400
17401
|
posY -= y_1;
|
|
17401
17402
|
}
|
|
17402
|
-
return "translate("
|
|
17403
|
+
return "translate(".concat(posX, " ").concat(posY, ")");
|
|
17403
17404
|
});
|
|
17404
17405
|
}
|
|
17405
17406
|
$$.bindEvent();
|
|
@@ -18439,8 +18440,8 @@ var apiSelection = {
|
|
|
18439
18440
|
selected: function (targetId) {
|
|
18440
18441
|
var $$ = this.internal;
|
|
18441
18442
|
var dataPoint = [];
|
|
18442
|
-
$$.$el.main.selectAll("."
|
|
18443
|
-
.selectAll("."
|
|
18443
|
+
$$.$el.main.selectAll(".".concat(CLASS.shapes + $$.getTargetSelectorSuffix(targetId)))
|
|
18444
|
+
.selectAll(".".concat(CLASS.shape))
|
|
18444
18445
|
.filter(function () {
|
|
18445
18446
|
return select(this).classed(CLASS.SELECTED);
|
|
18446
18447
|
})
|
|
@@ -18477,8 +18478,8 @@ var apiSelection = {
|
|
|
18477
18478
|
if (!config.data_selection_enabled) {
|
|
18478
18479
|
return;
|
|
18479
18480
|
}
|
|
18480
|
-
$el.main.selectAll("."
|
|
18481
|
-
.selectAll("."
|
|
18481
|
+
$el.main.selectAll(".".concat(CLASS.shapes))
|
|
18482
|
+
.selectAll(".".concat(CLASS.shape))
|
|
18482
18483
|
.each(function (d, i) {
|
|
18483
18484
|
var shape = select(this);
|
|
18484
18485
|
var id = d.data ? d.data.id : d.id;
|
|
@@ -18523,8 +18524,8 @@ var apiSelection = {
|
|
|
18523
18524
|
if (!config.data_selection_enabled) {
|
|
18524
18525
|
return;
|
|
18525
18526
|
}
|
|
18526
|
-
$el.main.selectAll("."
|
|
18527
|
-
.selectAll("."
|
|
18527
|
+
$el.main.selectAll(".".concat(CLASS.shapes))
|
|
18528
|
+
.selectAll(".".concat(CLASS.shape))
|
|
18528
18529
|
.each(function (d, i) {
|
|
18529
18530
|
var shape = select(this);
|
|
18530
18531
|
var id = d.data ? d.data.id : d.id;
|
|
@@ -18584,12 +18585,12 @@ var apiSubchart = {
|
|
|
18584
18585
|
$$.unbindZoomEvent();
|
|
18585
18586
|
config.subchart_show = !show;
|
|
18586
18587
|
!subchart.main && $$.initSubchart();
|
|
18587
|
-
var $target = subchart.main.selectAll("."
|
|
18588
|
+
var $target = subchart.main.selectAll(".".concat(CLASS.target));
|
|
18588
18589
|
// need to cover when new data has been loaded
|
|
18589
18590
|
if ($$.data.targets.length !== $target.size()) {
|
|
18590
18591
|
$$.updateSizes();
|
|
18591
18592
|
$$.updateTargetsForSubchart($$.data.targets);
|
|
18592
|
-
$target = subchart.main.selectAll("."
|
|
18593
|
+
$target = subchart.main.selectAll(".".concat(CLASS.target));
|
|
18593
18594
|
}
|
|
18594
18595
|
$target.style("opacity", null);
|
|
18595
18596
|
subchart.main.style("display", null);
|
|
@@ -18875,14 +18876,14 @@ var drag = {
|
|
|
18875
18876
|
var maxX = Math.max(sx, mx);
|
|
18876
18877
|
var minY = isSelectionGrouped ? state.margin.top : Math.min(sy, my);
|
|
18877
18878
|
var maxY = isSelectionGrouped ? state.height : Math.max(sy, my);
|
|
18878
|
-
main.select("."
|
|
18879
|
+
main.select(".".concat(CLASS.dragarea))
|
|
18879
18880
|
.attr("x", minX)
|
|
18880
18881
|
.attr("y", minY)
|
|
18881
18882
|
.attr("width", maxX - minX)
|
|
18882
18883
|
.attr("height", maxY - minY);
|
|
18883
18884
|
// TODO: binary search when multiple xs
|
|
18884
|
-
main.selectAll("."
|
|
18885
|
-
.selectAll("."
|
|
18885
|
+
main.selectAll(".".concat(CLASS.shapes))
|
|
18886
|
+
.selectAll(".".concat(CLASS.shape))
|
|
18886
18887
|
.filter(function (d) { return isSelectable === null || isSelectable === void 0 ? void 0 : isSelectable.bind($$.api)(d); })
|
|
18887
18888
|
.each(function (d, i) {
|
|
18888
18889
|
var shape = select(this);
|
|
@@ -18927,7 +18928,7 @@ var drag = {
|
|
|
18927
18928
|
return;
|
|
18928
18929
|
}
|
|
18929
18930
|
state.dragStart = mouse;
|
|
18930
|
-
main.select("."
|
|
18931
|
+
main.select(".".concat(CLASS.chart))
|
|
18931
18932
|
.append("rect")
|
|
18932
18933
|
.attr("class", CLASS.dragarea)
|
|
18933
18934
|
.style("opacity", "0.1");
|
|
@@ -18944,10 +18945,10 @@ var drag = {
|
|
|
18944
18945
|
if ($$.hasArcType() || !config.data_selection_enabled) { // do nothing if not selectable
|
|
18945
18946
|
return;
|
|
18946
18947
|
}
|
|
18947
|
-
$T(main.select("."
|
|
18948
|
+
$T(main.select(".".concat(CLASS.dragarea)))
|
|
18948
18949
|
.style("opacity", "0")
|
|
18949
18950
|
.remove();
|
|
18950
|
-
main.selectAll("."
|
|
18951
|
+
main.selectAll(".".concat(CLASS.shape))
|
|
18951
18952
|
.classed(CLASS.INCLUDED, false);
|
|
18952
18953
|
$$.setDragStatus(false);
|
|
18953
18954
|
}
|
|
@@ -18970,8 +18971,8 @@ var selection = _assign(_assign({}, drag), {
|
|
|
18970
18971
|
var r = $$.pointSelectR.bind($$);
|
|
18971
18972
|
callFn(config.data_onselected, $$.api, d, target.node());
|
|
18972
18973
|
// add selected-circle on low layer g
|
|
18973
|
-
$T(main.select("."
|
|
18974
|
-
.selectAll("."
|
|
18974
|
+
$T(main.select(".".concat(CLASS.selectedCircles).concat($$.getTargetSelectorSuffix(d.id)))
|
|
18975
|
+
.selectAll(".".concat(CLASS.selectedCircle, "-").concat(i))
|
|
18975
18976
|
.data([d])
|
|
18976
18977
|
.enter()
|
|
18977
18978
|
.append("circle")
|
|
@@ -18993,8 +18994,8 @@ var selection = _assign(_assign({}, drag), {
|
|
|
18993
18994
|
var config = $$.config, main = $$.$el.main, $T = $$.$T;
|
|
18994
18995
|
callFn(config.data_onunselected, $$.api, d, target.node());
|
|
18995
18996
|
// remove selected-circle from low layer g
|
|
18996
|
-
$T(main.select("."
|
|
18997
|
-
.selectAll("."
|
|
18997
|
+
$T(main.select(".".concat(CLASS.selectedCircles).concat($$.getTargetSelectorSuffix(d.id)))
|
|
18998
|
+
.selectAll(".".concat(CLASS.selectedCircle, "-").concat(i)))
|
|
18998
18999
|
.attr("r", 0)
|
|
18999
19000
|
.remove();
|
|
19000
19001
|
},
|
|
@@ -19007,7 +19008,7 @@ var selection = _assign(_assign({}, drag), {
|
|
|
19007
19008
|
* @private
|
|
19008
19009
|
*/
|
|
19009
19010
|
togglePoint: function (selected, target, d, i) {
|
|
19010
|
-
var method = (selected ? "" : "un"
|
|
19011
|
+
var method = "".concat(selected ? "" : "un", "selectPoint");
|
|
19011
19012
|
this[method](target, d, i);
|
|
19012
19013
|
},
|
|
19013
19014
|
/**
|
|
@@ -19047,7 +19048,7 @@ var selection = _assign(_assign({}, drag), {
|
|
|
19047
19048
|
* @private
|
|
19048
19049
|
*/
|
|
19049
19050
|
togglePath: function (selected, target, d, i) {
|
|
19050
|
-
this[(selected ? "" : "un"
|
|
19051
|
+
this["".concat(selected ? "" : "un", "selectPath")](target, d, i);
|
|
19051
19052
|
},
|
|
19052
19053
|
/**
|
|
19053
19054
|
* Returns the toggle method of the target
|
|
@@ -19079,12 +19080,12 @@ var selection = _assign(_assign({}, drag), {
|
|
|
19079
19080
|
var toggledShape;
|
|
19080
19081
|
if (config.data_selection_enabled && config.data_selection_isselectable.bind($$.api)(d)) {
|
|
19081
19082
|
if (!config.data_selection_multiple) {
|
|
19082
|
-
var selector = "."
|
|
19083
|
+
var selector = ".".concat(CLASS.shapes);
|
|
19083
19084
|
if (config.data_selection_grouped) {
|
|
19084
19085
|
selector += $$.getTargetSelectorSuffix(d.id);
|
|
19085
19086
|
}
|
|
19086
19087
|
main.selectAll(selector)
|
|
19087
|
-
.selectAll("."
|
|
19088
|
+
.selectAll(".".concat(CLASS.shape))
|
|
19088
19089
|
.each(function (d, i) {
|
|
19089
19090
|
var shape = select(this);
|
|
19090
19091
|
if (shape.classed(CLASS.SELECTED)) {
|
|
@@ -19118,7 +19119,7 @@ var subchart = {
|
|
|
19118
19119
|
// set the brush
|
|
19119
19120
|
$$.brush = (isRotated ? brushY() : brushX()).handleSize(5);
|
|
19120
19121
|
var getBrushSize = function () {
|
|
19121
|
-
var brush = $$.$el.svg.select("."
|
|
19122
|
+
var brush = $$.$el.svg.select(".".concat(CLASS.brush, " .overlay"));
|
|
19122
19123
|
var brushSize = { width: 0, height: 0 };
|
|
19123
19124
|
if (brush.size()) {
|
|
19124
19125
|
brushSize.width = +brush.attr("width");
|
|
@@ -19148,7 +19149,7 @@ var subchart = {
|
|
|
19148
19149
|
.attr("transform", function (d, i) {
|
|
19149
19150
|
var pos = isRotated ?
|
|
19150
19151
|
[33, selection[i] - (i === 0 ? 30 : 24)] : [selection[i], 3];
|
|
19151
|
-
return "translate("
|
|
19152
|
+
return "translate(".concat(pos, ")");
|
|
19152
19153
|
});
|
|
19153
19154
|
}
|
|
19154
19155
|
}
|
|
@@ -19166,7 +19167,7 @@ var subchart = {
|
|
|
19166
19167
|
var _a;
|
|
19167
19168
|
var extent = this.extent()();
|
|
19168
19169
|
if (extent[1].filter(function (v) { return isNaN(v); }).length === 0) {
|
|
19169
|
-
(_a = subchart.main) === null || _a === void 0 ? void 0 : _a.select("."
|
|
19170
|
+
(_a = subchart.main) === null || _a === void 0 ? void 0 : _a.select(".".concat(CLASS.brush)).call(this);
|
|
19170
19171
|
}
|
|
19171
19172
|
return this;
|
|
19172
19173
|
};
|
|
@@ -19189,7 +19190,7 @@ var subchart = {
|
|
|
19189
19190
|
};
|
|
19190
19191
|
$$.brush.getSelection = function () { return (
|
|
19191
19192
|
// @ts-ignore
|
|
19192
|
-
subchart.main ? subchart.main.select("."
|
|
19193
|
+
subchart.main ? subchart.main.select(".".concat(CLASS.brush)) : select([])); };
|
|
19193
19194
|
},
|
|
19194
19195
|
/**
|
|
19195
19196
|
* Initialize the subchart.
|
|
@@ -19202,7 +19203,7 @@ var subchart = {
|
|
|
19202
19203
|
return;
|
|
19203
19204
|
}
|
|
19204
19205
|
var visibility = config.subchart_show ? null : "hidden";
|
|
19205
|
-
var clipId = clip.id
|
|
19206
|
+
var clipId = "".concat(clip.id, "-subchart");
|
|
19206
19207
|
var clipPath = $$.getClipPath(clipId);
|
|
19207
19208
|
clip.idSubchart = clipId;
|
|
19208
19209
|
$$.appendClip(defs, clipId);
|
|
@@ -19220,9 +19221,9 @@ var subchart = {
|
|
|
19220
19221
|
["bar", "line", "bubble", "candlestick", "scatter"].forEach(function (v) {
|
|
19221
19222
|
var type = capitalize(/^(bubble|scatter)$/.test(v) ? "circle" : v);
|
|
19222
19223
|
if ($$.hasType(v) || $$.hasTypeOf(type)) {
|
|
19223
|
-
var chart = main.select("."
|
|
19224
|
-
var chartClassName = CLASS["chart"
|
|
19225
|
-
if (chart.select("."
|
|
19224
|
+
var chart = main.select(".".concat(CLASS.chart));
|
|
19225
|
+
var chartClassName = CLASS["chart".concat(type, "s")];
|
|
19226
|
+
if (chart.select(".".concat(chartClassName)).empty()) {
|
|
19226
19227
|
chart
|
|
19227
19228
|
.append("g")
|
|
19228
19229
|
.attr("class", chartClassName);
|
|
@@ -19263,14 +19264,14 @@ var subchart = {
|
|
|
19263
19264
|
"M 0 18 A 6 6 0 0 0 -6.5 23.5 V 29 A 6 6 0 0 0 0 35 Z M -2 23 V 30 M -4 23 V 30Z",
|
|
19264
19265
|
"M 0 18 A 6 6 0 0 1 6.5 23.5 V 29 A 6 6 0 0 1 0 35 Z M 2 23 V 30 M 4 23 V 30Z"
|
|
19265
19266
|
];
|
|
19266
|
-
$$.brush.handle = brush.selectAll("."
|
|
19267
|
+
$$.brush.handle = brush.selectAll(".".concat(customHandleClass))
|
|
19267
19268
|
.data(isRotated ?
|
|
19268
19269
|
[{ type: "n" }, { type: "s" }] :
|
|
19269
19270
|
[{ type: "w" }, { type: "e" }])
|
|
19270
19271
|
.enter()
|
|
19271
19272
|
.append("path")
|
|
19272
19273
|
.attr("class", customHandleClass)
|
|
19273
|
-
.attr("cursor", (isRotated ? "ns" : "ew"
|
|
19274
|
+
.attr("cursor", "".concat(isRotated ? "ns" : "ew", "-resize"))
|
|
19274
19275
|
.attr("d", function (d) { return path[+/[se]/.test(d.type)]; })
|
|
19275
19276
|
.attr("display", initRange ? null : "none");
|
|
19276
19277
|
},
|
|
@@ -19289,12 +19290,12 @@ var subchart = {
|
|
|
19289
19290
|
var isPointType = /^(bubble|scatter)$/.test(v);
|
|
19290
19291
|
var name = capitalize(isPointType ? "circle" : v);
|
|
19291
19292
|
var chartClass = $$.getChartClass(name, true);
|
|
19292
|
-
var shapeClass = $$.getClass(isPointType ? "circles" : v
|
|
19293
|
-
var shapeChart = main.select("."
|
|
19293
|
+
var shapeClass = $$.getClass(isPointType ? "circles" : "".concat(v, "s"), true);
|
|
19294
|
+
var shapeChart = main.select(".".concat(CLASS["chart".concat("".concat(name, "s"))]));
|
|
19294
19295
|
if (isPointType) {
|
|
19295
19296
|
var circle = shapeChart
|
|
19296
|
-
.selectAll("."
|
|
19297
|
-
.data(targets.filter($$["is"
|
|
19297
|
+
.selectAll(".".concat(CLASS.circles))
|
|
19298
|
+
.data(targets.filter($$["is".concat(capitalize(v), "Type")].bind($$)))
|
|
19298
19299
|
.attr("class", shapeClass);
|
|
19299
19300
|
circle.exit().remove();
|
|
19300
19301
|
circle.enter().append("g")
|
|
@@ -19302,9 +19303,9 @@ var subchart = {
|
|
|
19302
19303
|
}
|
|
19303
19304
|
else {
|
|
19304
19305
|
var shapeUpdate = shapeChart
|
|
19305
|
-
.selectAll("."
|
|
19306
|
+
.selectAll(".".concat(CLASS["chart".concat(name)]))
|
|
19306
19307
|
.attr("class", chartClass)
|
|
19307
|
-
.data(targets.filter($$["is"
|
|
19308
|
+
.data(targets.filter($$["is".concat(name, "Type")].bind($$)));
|
|
19308
19309
|
var shapeEnter = shapeUpdate.enter()
|
|
19309
19310
|
.append("g")
|
|
19310
19311
|
.style("opacity", "0")
|
|
@@ -19318,7 +19319,7 @@ var subchart = {
|
|
|
19318
19319
|
}
|
|
19319
19320
|
});
|
|
19320
19321
|
// -- Brush --//
|
|
19321
|
-
main.selectAll("."
|
|
19322
|
+
main.selectAll(".".concat(CLASS.brush, " rect"))
|
|
19322
19323
|
.attr(config.axis_rotated ? "width" : "height", config.axis_rotated ? state.width2 : state.height2);
|
|
19323
19324
|
}
|
|
19324
19325
|
},
|
|
@@ -19348,10 +19349,10 @@ var subchart = {
|
|
|
19348
19349
|
!brushEmpty($$) && $$.brush.update();
|
|
19349
19350
|
Object.keys(shape.type).forEach(function (v) {
|
|
19350
19351
|
var name = capitalize(v);
|
|
19351
|
-
var drawFn = $$["generateDraw"
|
|
19352
|
+
var drawFn = $$["generateDraw".concat(name)](shape.indices[v], true);
|
|
19352
19353
|
// call shape's update & redraw method
|
|
19353
|
-
$$["update"
|
|
19354
|
-
$$["redraw"
|
|
19354
|
+
$$["update".concat(name)](withTransition, true);
|
|
19355
|
+
$$["redraw".concat(name)](drawFn, withTransition, true);
|
|
19355
19356
|
});
|
|
19356
19357
|
if ($$.hasType("bubble") || $$.hasType("scatter")) {
|
|
19357
19358
|
var cx = shape.pos.cx;
|
|
@@ -19390,7 +19391,7 @@ var subchart = {
|
|
|
19390
19391
|
var subchart = $$.$el.subchart, $T = $$.$T;
|
|
19391
19392
|
var subXAxis = (transitions === null || transitions === void 0 ? void 0 : transitions.axisSubX) ?
|
|
19392
19393
|
transitions.axisSubX :
|
|
19393
|
-
$T(subchart.main.select("."
|
|
19394
|
+
$T(subchart.main.select(".".concat(CLASS.axisX)), withTransition);
|
|
19394
19395
|
subchart.main.attr("transform", $$.getTranslate("context"));
|
|
19395
19396
|
subXAxis.attr("transform", $$.getTranslate("subX"));
|
|
19396
19397
|
},
|
|
@@ -20041,7 +20042,7 @@ var zoomModule = function () {
|
|
|
20041
20042
|
var defaults = {};
|
|
20042
20043
|
/**
|
|
20043
20044
|
* @namespace bb
|
|
20044
|
-
* @version 3.2.
|
|
20045
|
+
* @version 3.2.2
|
|
20045
20046
|
*/
|
|
20046
20047
|
var bb = {
|
|
20047
20048
|
/**
|
|
@@ -20051,7 +20052,7 @@ var bb = {
|
|
|
20051
20052
|
* bb.version; // "1.0.0"
|
|
20052
20053
|
* @memberof bb
|
|
20053
20054
|
*/
|
|
20054
|
-
version: "3.2.
|
|
20055
|
+
version: "3.2.2",
|
|
20055
20056
|
/**
|
|
20056
20057
|
* Generate chart
|
|
20057
20058
|
* - **NOTE:** Bear in mind for the possiblity of ***throwing an error***, during the generation when:
|