billboard.js 3.2.0-next.5 → 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 +8 -8
- package/dist/billboard.js +109 -68
- package/dist/billboard.min.css +2 -2
- package/dist/billboard.min.js +2 -2
- package/dist/billboard.pkgd.js +3794 -2736
- package/dist/billboard.pkgd.min.js +3 -3
- 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 +3433 -2617
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.js +3451 -2631
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.js +3485 -2655
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.js +3453 -2633
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.js +3450 -2630
- package/dist/theme/datalab.css +6 -4
- package/dist/theme/datalab.min.css +2 -2
- package/dist/theme/graph.css +6 -4
- package/dist/theme/graph.min.css +2 -2
- package/dist/theme/insight.css +6 -4
- package/dist/theme/insight.min.css +2 -2
- package/dist-esm/billboard.js +446 -420
- 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 +52 -53
- package/src/Chart/api/load.ts +7 -0
- package/src/Chart/api/zoom.ts +9 -6
- package/src/ChartInternal/Axis/Axis.ts +2 -2
- package/src/ChartInternal/ChartInternal.ts +1 -1
- package/src/ChartInternal/data/data.ts +1 -1
- package/src/ChartInternal/interactions/eventrect.ts +21 -3
- package/src/ChartInternal/interactions/zoom.ts +1 -1
- package/src/ChartInternal/internals/domain.ts +27 -29
- package/src/ChartInternal/internals/legend.ts +2 -1
- package/src/ChartInternal/internals/redraw.ts +2 -2
- package/src/ChartInternal/internals/text.ts +2 -2
- package/src/ChartInternal/shape/arc.ts +2 -6
- package/src/ChartInternal/shape/bar.ts +10 -2
- package/src/config/Options/data/data.ts +3 -3
- package/src/config/Options/shape/line.ts +6 -1
- package/src/module/util.ts +3 -5
- package/src/scss/billboard.scss +3 -13
- package/src/scss/theme/datalab.scss +3 -7
- package/src/scss/theme/graph.scss +3 -2
- package/src/scss/theme/insight.scss +3 -2
- package/types/chart.d.ts +2 -2
- package/types/options.d.ts +3 -3
- package/types/types.d.ts +5 -2
|
@@ -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
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
@@ -144,7 +144,7 @@ var Plugin = /*#__PURE__*/function () {
|
|
|
144
144
|
return Plugin;
|
|
145
145
|
}();
|
|
146
146
|
|
|
147
|
-
Plugin.version = "#3.2.
|
|
147
|
+
Plugin.version = "#3.2.2#";
|
|
148
148
|
|
|
149
149
|
/**
|
|
150
150
|
* Bubble compare diagram plugin.<br>
|
|
@@ -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
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
@@ -268,7 +268,7 @@ var Plugin = /*#__PURE__*/function () {
|
|
|
268
268
|
return Plugin;
|
|
269
269
|
}();
|
|
270
270
|
|
|
271
|
-
Plugin.version = "#3.2.
|
|
271
|
+
Plugin.version = "#3.2.2#";
|
|
272
272
|
|
|
273
273
|
/**
|
|
274
274
|
* Copyright (c) 2021 ~ present NAVER Corp.
|
|
@@ -520,7 +520,7 @@ var Sparkline = /** @class */ (function (_super) {
|
|
|
520
520
|
msg = "Contains non supported chart types.";
|
|
521
521
|
}
|
|
522
522
|
if (msg) {
|
|
523
|
-
throw new Error("[Sparkline plugin] "
|
|
523
|
+
throw new Error("[Sparkline plugin] ".concat(msg));
|
|
524
524
|
}
|
|
525
525
|
};
|
|
526
526
|
Sparkline.prototype.overrideInternals = function () {
|
|
@@ -587,7 +587,7 @@ var Sparkline = /** @class */ (function (_super) {
|
|
|
587
587
|
var _this = this;
|
|
588
588
|
if (bind === void 0) { bind = true; }
|
|
589
589
|
if (this.$$.config.interaction_enabled) {
|
|
590
|
-
var method_1 = (bind ? "add" : "remove"
|
|
590
|
+
var method_1 = "".concat(bind ? "add" : "remove", "EventListener");
|
|
591
591
|
this.element
|
|
592
592
|
.forEach(function (el) {
|
|
593
593
|
var svg = el.querySelector("svg");
|
|
@@ -639,11 +639,11 @@ var Sparkline = /** @class */ (function (_super) {
|
|
|
639
639
|
}
|
|
640
640
|
data.map(function (v) { return v.id; })
|
|
641
641
|
.forEach(function (id, i) {
|
|
642
|
-
var selector = "."
|
|
642
|
+
var selector = ".".concat(CLASS.target, "-").concat(id);
|
|
643
643
|
var shape = $el.main.selectAll(selector);
|
|
644
644
|
var svg = el[i].querySelector("svg");
|
|
645
645
|
if (!svg) {
|
|
646
|
-
el[i].innerHTML = svgWrapper
|
|
646
|
+
el[i].innerHTML = "".concat(svgWrapper, "</svg>");
|
|
647
647
|
svg = el[i].querySelector("svg");
|
|
648
648
|
svg.__id = id;
|
|
649
649
|
}
|
|
@@ -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
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
@@ -336,7 +336,7 @@ function parseDate(date) {
|
|
|
336
336
|
}
|
|
337
337
|
if (!parsedDate || isNaN(+parsedDate)) {
|
|
338
338
|
console && console.error &&
|
|
339
|
-
console.error("Failed to parse x '"
|
|
339
|
+
console.error("Failed to parse x '".concat(date, "' to Date object"));
|
|
340
340
|
}
|
|
341
341
|
return parsedDate;
|
|
342
342
|
}
|
|
@@ -467,7 +467,7 @@ var Plugin = /*#__PURE__*/function () {
|
|
|
467
467
|
return Plugin;
|
|
468
468
|
}();
|
|
469
469
|
|
|
470
|
-
Plugin.version = "#3.2.
|
|
470
|
+
Plugin.version = "#3.2.2#";
|
|
471
471
|
|
|
472
472
|
/**
|
|
473
473
|
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
@@ -749,9 +749,9 @@ var Elements = /** @class */ (function () {
|
|
|
749
749
|
var xvCustom = this.xvCustom.bind($$);
|
|
750
750
|
var yvCustom = this.yvCustom.bind($$);
|
|
751
751
|
// Stanford-Lines
|
|
752
|
-
var stanfordLine = main.select("."
|
|
752
|
+
var stanfordLine = main.select(".".concat(CLASS.stanfordLines))
|
|
753
753
|
.style("shape-rendering", "geometricprecision")
|
|
754
|
-
.selectAll("."
|
|
754
|
+
.selectAll(".".concat(CLASS.stanfordLine))
|
|
755
755
|
.data(this.owner.config.lines);
|
|
756
756
|
// exit
|
|
757
757
|
stanfordLine.exit().transition()
|
|
@@ -764,7 +764,7 @@ var Elements = /** @class */ (function () {
|
|
|
764
764
|
.style("opacity", "0");
|
|
765
765
|
stanfordLineEnter
|
|
766
766
|
.merge(stanfordLine)
|
|
767
|
-
.attr("class", function (d) { return CLASS.stanfordLine + (d["class"] ? " "
|
|
767
|
+
.attr("class", function (d) { return CLASS.stanfordLine + (d["class"] ? " ".concat(d["class"]) : ""); })
|
|
768
768
|
.select("line")
|
|
769
769
|
.transition()
|
|
770
770
|
.duration(duration)
|
|
@@ -783,8 +783,8 @@ var Elements = /** @class */ (function () {
|
|
|
783
783
|
var yvCustom = this.yvCustom.bind($$);
|
|
784
784
|
var countPointsInRegion = this.owner.countEpochsInRegion.bind($$);
|
|
785
785
|
// Stanford-Regions
|
|
786
|
-
var stanfordRegion = main.select("."
|
|
787
|
-
.selectAll("."
|
|
786
|
+
var stanfordRegion = main.select(".".concat(CLASS.stanfordRegions))
|
|
787
|
+
.selectAll(".".concat(CLASS.stanfordRegion))
|
|
788
788
|
.data(this.owner.config.regions);
|
|
789
789
|
// exit
|
|
790
790
|
stanfordRegion.exit().transition()
|
|
@@ -801,7 +801,7 @@ var Elements = /** @class */ (function () {
|
|
|
801
801
|
stanfordRegion = stanfordRegionEnter.merge(stanfordRegion);
|
|
802
802
|
// update
|
|
803
803
|
stanfordRegion
|
|
804
|
-
.attr("class", function (d) { return CLASS.stanfordRegion + (d["class"] ? " "
|
|
804
|
+
.attr("class", function (d) { return CLASS.stanfordRegion + (d["class"] ? " ".concat(d["class"]) : ""); })
|
|
805
805
|
.select("polygon")
|
|
806
806
|
.transition()
|
|
807
807
|
.duration(duration)
|
|
@@ -885,7 +885,7 @@ var ColorScale = /** @class */ (function () {
|
|
|
885
885
|
.attr("height", height)
|
|
886
886
|
.attr("class", CLASS.colorScale);
|
|
887
887
|
this.colorScale.append("g")
|
|
888
|
-
.attr("transform", "translate(0, "
|
|
888
|
+
.attr("transform", "translate(0, ".concat(config.padding_top, ")"))
|
|
889
889
|
.selectAll("bars")
|
|
890
890
|
.data(points)
|
|
891
891
|
.enter()
|
|
@@ -916,7 +916,7 @@ var ColorScale = /** @class */ (function () {
|
|
|
916
916
|
// Draw Axis
|
|
917
917
|
var axis = this.colorScale.append("g")
|
|
918
918
|
.attr("class", "legend axis")
|
|
919
|
-
.attr("transform", "translate("
|
|
919
|
+
.attr("transform", "translate(".concat(barWidth, ",0)"))
|
|
920
920
|
.call(legendAxis);
|
|
921
921
|
if (scaleFormat === "pow10") {
|
|
922
922
|
axis.selectAll(".tick text")
|
|
@@ -927,7 +927,7 @@ var ColorScale = /** @class */ (function () {
|
|
|
927
927
|
.attr("dy", "-.7em") // https://bl.ocks.org/mbostock/6738229
|
|
928
928
|
.text(function (d) { return Math.round(Math.log(d) / Math.LN10); });
|
|
929
929
|
}
|
|
930
|
-
this.colorScale.attr("transform", "translate("
|
|
930
|
+
this.colorScale.attr("transform", "translate(".concat($$.state.current.width - this.xForColorScale(), ", 0)"));
|
|
931
931
|
};
|
|
932
932
|
ColorScale.prototype.xForColorScale = function () {
|
|
933
933
|
return this.owner.config.padding_right +
|
|
@@ -1118,11 +1118,11 @@ var Stanford = /** @class */ (function (_super) {
|
|
|
1118
1118
|
var config = this.$$.config;
|
|
1119
1119
|
if (isEmpty(config.tooltip_contents)) {
|
|
1120
1120
|
config.tooltip_contents = function (d, defaultTitleFormat, defaultValueFormat, color) {
|
|
1121
|
-
var html = "<table class=\""
|
|
1121
|
+
var html = "<table class=\"".concat(CLASS$1.tooltip, "\"><tbody>");
|
|
1122
1122
|
d.forEach(function (v) {
|
|
1123
|
-
html += "<tr>\n\t\t\t\t\t\t\t<th>"
|
|
1123
|
+
html += "<tr>\n\t\t\t\t\t\t\t<th>".concat(defaultTitleFormat(config.data_x), "</th>\n\t\t\t\t\t\t\t<th class=\"value\">").concat(defaultValueFormat(v.x), "</th>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th>").concat(defaultTitleFormat(v.id), "</th>\n\t\t\t\t\t\t\t<th class=\"value\">").concat(defaultValueFormat(v.value), "</th>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr class=\"").concat(CLASS$1.tooltipName, "-").concat(v.id, "\">\n\t\t\t\t\t\t\t<td class=\"name\"><span style=\"background-color:").concat(color(v), "\"></span>").concat(defaultTitleFormat("Epochs"), "</td>\n\t\t\t\t\t\t\t<td class=\"value\">").concat(defaultValueFormat(v.epochs), "</td>\n\t\t\t\t\t\t</tr>");
|
|
1124
1124
|
});
|
|
1125
|
-
return html
|
|
1125
|
+
return "".concat(html, "</tbody></table>");
|
|
1126
1126
|
};
|
|
1127
1127
|
}
|
|
1128
1128
|
};
|
|
@@ -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
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
@@ -170,7 +170,7 @@ var Plugin = /*#__PURE__*/function () {
|
|
|
170
170
|
return Plugin;
|
|
171
171
|
}();
|
|
172
172
|
|
|
173
|
-
Plugin.version = "#3.2.
|
|
173
|
+
Plugin.version = "#3.2.2#";
|
|
174
174
|
|
|
175
175
|
/**
|
|
176
176
|
* Copyright (c) 2021 ~ present NAVER Corp.
|
|
@@ -410,7 +410,7 @@ function mergeObj(target) {
|
|
|
410
410
|
function tplProcess(tpl, data) {
|
|
411
411
|
var res = tpl;
|
|
412
412
|
for (var x in data) {
|
|
413
|
-
res = res.replace(new RegExp("{="
|
|
413
|
+
res = res.replace(new RegExp("{=".concat(x, "}"), "g"), data[x]);
|
|
414
414
|
}
|
|
415
415
|
return res;
|
|
416
416
|
}
|
|
@@ -506,7 +506,7 @@ var TableView = /** @class */ (function (_super) {
|
|
|
506
506
|
TableView.prototype.$init = function () {
|
|
507
507
|
var _a;
|
|
508
508
|
var _b = this.config, className = _b["class"], selector = _b.selector, style = _b.style;
|
|
509
|
-
var element = document.querySelector(selector || "."
|
|
509
|
+
var element = document.querySelector(selector || ".".concat(className || defaultStyle["class"]));
|
|
510
510
|
if (!element) {
|
|
511
511
|
var chart = this.$$.$el.chart.node();
|
|
512
512
|
element = document.createElement("table");
|
|
@@ -552,11 +552,11 @@ var TableView = /** @class */ (function (_super) {
|
|
|
552
552
|
});
|
|
553
553
|
});
|
|
554
554
|
rows.forEach(function (v) {
|
|
555
|
-
tbody += "<tr>"
|
|
555
|
+
tbody += "<tr>".concat(v.map(function (d, i) { return tplProcess(i ? tpl.tbody : tpl.tbodyHeader, {
|
|
556
556
|
value: i === 0 ?
|
|
557
557
|
config.categoryFormat.bind(_this)(d) :
|
|
558
558
|
(isNumber(d) ? d.toLocaleString() : "")
|
|
559
|
-
}); }).join("")
|
|
559
|
+
}); }).join(""), "</tr>");
|
|
560
560
|
});
|
|
561
561
|
var rx = /<[^>]+><\/[^>]+>/g;
|
|
562
562
|
var r = tplProcess(tpl.body, _assign(_assign({}, config), { title: config.title || $$.config.title_text || "", thead: thead, tbody: tbody })).replace(rx, "");
|
|
@@ -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
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
@@ -300,7 +300,7 @@ var Plugin = /*#__PURE__*/function () {
|
|
|
300
300
|
return Plugin;
|
|
301
301
|
}();
|
|
302
302
|
|
|
303
|
-
Plugin.version = "#3.2.
|
|
303
|
+
Plugin.version = "#3.2.2#";
|
|
304
304
|
|
|
305
305
|
/**
|
|
306
306
|
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
@@ -453,8 +453,8 @@ var TextOverlap = /** @class */ (function (_super) {
|
|
|
453
453
|
"middle" : (angle === 0 ? "start" : "end");
|
|
454
454
|
this.style.display = polygonArea$1 < area ? "none" : "";
|
|
455
455
|
this.setAttribute("text-anchor", txtAnchor);
|
|
456
|
-
this.setAttribute("dy", "0."
|
|
457
|
-
this.setAttribute("transform", "translate("
|
|
456
|
+
this.setAttribute("dy", "0.".concat(angle === 1 ? 71 : 35, "em"));
|
|
457
|
+
this.setAttribute("transform", "translate(".concat(xTranslate, ", ").concat(yTranslate, ")"));
|
|
458
458
|
}
|
|
459
459
|
i++;
|
|
460
460
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "billboard.js",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.2",
|
|
4
4
|
"description": "Re-usable easy interface JavaScript chart library, based on D3 v4+",
|
|
5
5
|
"homepage": "https://naver.github.io/billboard.js/",
|
|
6
6
|
"main": "dist/billboard.js",
|
|
@@ -31,7 +31,6 @@
|
|
|
31
31
|
"build:production:analyzer": "cross-env ANALYZER=true npm run build:production",
|
|
32
32
|
"build:packaged:analyzer": "cross-env ANALYZER=true npm run build:packaged",
|
|
33
33
|
"build:plugin": "cross-env NODE_ENV=plugin webpack && cross-env NODE_ENV=plugin MODE=min webpack && cross-env NODE_ENV=plugin MODE=pkgd webpack",
|
|
34
|
-
"_build:plugin": "cross-env NODE_ENV=plugin MODE=pkgd webpack",
|
|
35
34
|
"release": "semantic-release",
|
|
36
35
|
"lint": "npm run lint:types && eslint src --ext .ts",
|
|
37
36
|
"lint:types": "dtslint --onlyTestTsNext types",
|
|
@@ -87,7 +86,7 @@
|
|
|
87
86
|
"d3-dsv": "^3.0.1",
|
|
88
87
|
"d3-ease": "^3.0.1",
|
|
89
88
|
"d3-interpolate": "^3.0.1",
|
|
90
|
-
"d3-scale": "^4.0.
|
|
89
|
+
"d3-scale": "^4.0.2",
|
|
91
90
|
"d3-selection": "^3.0.0",
|
|
92
91
|
"d3-shape": "^3.0.1",
|
|
93
92
|
"d3-time-format": "^4.0.0",
|
|
@@ -95,34 +94,34 @@
|
|
|
95
94
|
"d3-zoom": "^3.0.0"
|
|
96
95
|
},
|
|
97
96
|
"devDependencies": {
|
|
98
|
-
"@babel/core": "^7.
|
|
99
|
-
"@babel/eslint-parser": "^7.
|
|
100
|
-
"@babel/plugin-proposal-class-properties": "^7.
|
|
101
|
-
"@babel/plugin-proposal-object-rest-spread": "^7.
|
|
102
|
-
"@babel/plugin-transform-runtime": "^7.
|
|
103
|
-
"@babel/preset-env": "^7.
|
|
104
|
-
"@babel/preset-typescript": "^7.
|
|
105
|
-
"@babel/runtime": "^7.
|
|
106
|
-
"@commitlint/cli": "^
|
|
107
|
-
"@commitlint/config-conventional": "^
|
|
97
|
+
"@babel/core": "^7.16.0",
|
|
98
|
+
"@babel/eslint-parser": "^7.16.3",
|
|
99
|
+
"@babel/plugin-proposal-class-properties": "^7.16.0",
|
|
100
|
+
"@babel/plugin-proposal-object-rest-spread": "^7.16.0",
|
|
101
|
+
"@babel/plugin-transform-runtime": "^7.16.4",
|
|
102
|
+
"@babel/preset-env": "^7.16.4",
|
|
103
|
+
"@babel/preset-typescript": "^7.16.0",
|
|
104
|
+
"@babel/runtime": "^7.16.3",
|
|
105
|
+
"@commitlint/cli": "^15.0.0",
|
|
106
|
+
"@commitlint/config-conventional": "^15.0.0",
|
|
108
107
|
"@rollup/plugin-babel": "^5.3.0",
|
|
109
|
-
"@rollup/plugin-node-resolve": "^13.0.
|
|
108
|
+
"@rollup/plugin-node-resolve": "^13.0.6",
|
|
110
109
|
"@rollup/plugin-replace": "^3.0.0",
|
|
111
|
-
"@rollup/plugin-typescript": "^8.
|
|
112
|
-
"@semantic-release/changelog": "^
|
|
113
|
-
"@semantic-release/commit-analyzer": "^
|
|
114
|
-
"@semantic-release/exec": "^
|
|
115
|
-
"@semantic-release/git": "^
|
|
116
|
-
"@semantic-release/npm": "^
|
|
117
|
-
"@semantic-release/release-notes-generator": "^
|
|
118
|
-
"@types/chai": "^4.2.
|
|
119
|
-
"@types/d3": "^7.
|
|
110
|
+
"@rollup/plugin-typescript": "^8.3.0",
|
|
111
|
+
"@semantic-release/changelog": "^6.0.1",
|
|
112
|
+
"@semantic-release/commit-analyzer": "^9.0.1",
|
|
113
|
+
"@semantic-release/exec": "^6.0.2",
|
|
114
|
+
"@semantic-release/git": "^10.0.1",
|
|
115
|
+
"@semantic-release/npm": "^8.0.3",
|
|
116
|
+
"@semantic-release/release-notes-generator": "^10.0.2",
|
|
117
|
+
"@types/chai": "^4.2.22",
|
|
118
|
+
"@types/d3": "^7.1.0",
|
|
120
119
|
"@types/mocha": "^9.0.0",
|
|
121
|
-
"@types/sinon": "^10.0.
|
|
122
|
-
"@typescript-eslint/eslint-plugin": "^4.
|
|
123
|
-
"@typescript-eslint/parser": "^4.
|
|
120
|
+
"@types/sinon": "^10.0.6",
|
|
121
|
+
"@typescript-eslint/eslint-plugin": "^5.4.0",
|
|
122
|
+
"@typescript-eslint/parser": "^5.4.0",
|
|
124
123
|
"babel-helper-modules": "^6.0.0",
|
|
125
|
-
"babel-loader": "^8.2.
|
|
124
|
+
"babel-loader": "^8.2.3",
|
|
126
125
|
"babel-plugin-add-module-exports": "^1.0.4",
|
|
127
126
|
"babel-plugin-minify-constant-folding": "^0.5.0",
|
|
128
127
|
"babel-plugin-minify-dead-code-elimination": "^0.5.1",
|
|
@@ -136,29 +135,29 @@
|
|
|
136
135
|
"chai": "^4.3.4",
|
|
137
136
|
"clean-webpack-plugin": "^4.0.0",
|
|
138
137
|
"cloc": "^2.8.0",
|
|
139
|
-
"core-js": "^3.
|
|
138
|
+
"core-js": "^3.19.1",
|
|
140
139
|
"coveralls": "^3.1.1",
|
|
141
140
|
"cross-env": "^7.0.3",
|
|
142
|
-
"css-loader": "^6.
|
|
143
|
-
"css-minimizer-webpack-plugin": "^3.
|
|
141
|
+
"css-loader": "^6.5.1",
|
|
142
|
+
"css-minimizer-webpack-plugin": "^3.1.4",
|
|
144
143
|
"d3-color": "^3.0.1",
|
|
145
144
|
"d3-delaunay": "^6.0.2",
|
|
146
145
|
"d3-format": "^3.0.1",
|
|
147
146
|
"d3-polygon": "^3.0.1",
|
|
148
147
|
"docdash": "^1.2.0",
|
|
149
|
-
"dtslint": "^4.1
|
|
150
|
-
"eslint": "^
|
|
148
|
+
"dtslint": "^4.2.1",
|
|
149
|
+
"eslint": "^8.2.0",
|
|
151
150
|
"eslint-config-naver": "^2.1.0",
|
|
152
|
-
"eslint-plugin-import": "^2.
|
|
153
|
-
"eslint-plugin-jsdoc": "^
|
|
154
|
-
"eslint-webpack-plugin": "^3.
|
|
155
|
-
"exports-loader": "^3.
|
|
151
|
+
"eslint-plugin-import": "^2.25.3",
|
|
152
|
+
"eslint-plugin-jsdoc": "^37.0.3",
|
|
153
|
+
"eslint-webpack-plugin": "^3.1.1",
|
|
154
|
+
"exports-loader": "^3.1.0",
|
|
156
155
|
"hammer-simulator": "0.0.1",
|
|
157
|
-
"husky": "^7.0.
|
|
156
|
+
"husky": "^7.0.4",
|
|
158
157
|
"istanbul-instrumenter-loader": "^3.0.1",
|
|
159
|
-
"istanbul-lib-instrument": "^5.0
|
|
158
|
+
"istanbul-lib-instrument": "^5.1.0",
|
|
160
159
|
"jsdoc": "^3.6.7",
|
|
161
|
-
"karma": "^6.3.
|
|
160
|
+
"karma": "^6.3.9",
|
|
162
161
|
"karma-chai": "^0.1.0",
|
|
163
162
|
"karma-chrome-launcher": "^3.1.0",
|
|
164
163
|
"karma-coverage-istanbul-reporter": "^3.0.3",
|
|
@@ -169,29 +168,29 @@
|
|
|
169
168
|
"karma-sourcemap-loader": "^0.3.8",
|
|
170
169
|
"karma-webpack": "^5.0.0",
|
|
171
170
|
"lite-fixture": "^1.0.2",
|
|
172
|
-
"mini-css-extract-plugin": "^2.
|
|
173
|
-
"mocha": "^9.1.
|
|
171
|
+
"mini-css-extract-plugin": "^2.4.5",
|
|
172
|
+
"mocha": "^9.1.3",
|
|
174
173
|
"node-sass": "^6.0.1",
|
|
175
174
|
"regenerator-runtime": "^0.13.7",
|
|
176
|
-
"rollup": "^2.
|
|
175
|
+
"rollup": "^2.60.0",
|
|
177
176
|
"rollup-plugin-delete": "^2.0.0",
|
|
178
|
-
"sass-loader": "^12.
|
|
179
|
-
"semantic-release": "^
|
|
177
|
+
"sass-loader": "^12.3.0",
|
|
178
|
+
"semantic-release": "^18.0.0",
|
|
180
179
|
"simulant": "^0.2.2",
|
|
181
|
-
"sinon": "^
|
|
180
|
+
"sinon": "^12.0.1",
|
|
182
181
|
"string-replace-loader": "^3.0.3",
|
|
183
|
-
"style-loader": "^3.
|
|
184
|
-
"terser-webpack-plugin": "^5.2.
|
|
182
|
+
"style-loader": "^3.3.1",
|
|
183
|
+
"terser-webpack-plugin": "^5.2.5",
|
|
185
184
|
"tslib": "^2.3.1",
|
|
186
|
-
"typescript": "^4.
|
|
187
|
-
"webpack": "^5.
|
|
188
|
-
"webpack-bundle-analyzer": "^4.
|
|
185
|
+
"typescript": "^4.5.2",
|
|
186
|
+
"webpack": "^5.64.1",
|
|
187
|
+
"webpack-bundle-analyzer": "^4.5.0",
|
|
189
188
|
"webpack-clean": "^1.2.5",
|
|
190
|
-
"webpack-cli": "^4.
|
|
189
|
+
"webpack-cli": "^4.9.1",
|
|
191
190
|
"webpack-common-shake": "^2.1.0",
|
|
192
|
-
"webpack-dev-server": "^4.
|
|
191
|
+
"webpack-dev-server": "^4.5.0",
|
|
193
192
|
"webpack-merge": "^5.8.0",
|
|
194
|
-
"webpackbar": "^5.0.
|
|
193
|
+
"webpackbar": "^5.0.2",
|
|
195
194
|
"write-file-webpack-plugin": "^4.5.1"
|
|
196
195
|
}
|
|
197
196
|
}
|
package/src/Chart/api/load.ts
CHANGED
|
@@ -127,6 +127,13 @@ export default {
|
|
|
127
127
|
* value: ["upload", "download"]
|
|
128
128
|
* }
|
|
129
129
|
* });
|
|
130
|
+
* @example
|
|
131
|
+
* chart.load({
|
|
132
|
+
* json: {
|
|
133
|
+
* data1:[30, 20, 50, 40, 60, 50],
|
|
134
|
+
* data2:[200, 130, 90, 240, 130, 220],
|
|
135
|
+
* }
|
|
136
|
+
* });
|
|
130
137
|
*/
|
|
131
138
|
load(args): void {
|
|
132
139
|
const $$ = this.internal;
|
package/src/Chart/api/zoom.ts
CHANGED
|
@@ -35,22 +35,25 @@ function withinRange(domain: (number|Date)[], current, range: number[]): boolean
|
|
|
35
35
|
* // Zoom to specified domain range
|
|
36
36
|
* chart.zoom([10, 20]);
|
|
37
37
|
*
|
|
38
|
+
* // For timeseries, the domain value can be string, but the format should match with the 'data.xFormat' option.
|
|
39
|
+
* chart.zoom(["2021-02-03", "2021-02-08"]);
|
|
40
|
+
*
|
|
38
41
|
* // Get the current zoomed domain range
|
|
39
42
|
* chart.zoom();
|
|
40
43
|
*/
|
|
41
|
-
const zoom = function(domainValue?: (number|
|
|
44
|
+
const zoom = function(domainValue?: (Date|number|string)[]): (Date|number)[]|undefined {
|
|
42
45
|
const $$ = this.internal;
|
|
43
|
-
const {$el, config, org, scale} = $$;
|
|
46
|
+
const {$el, axis, config, org, scale} = $$;
|
|
44
47
|
const isRotated = config.axis_rotated;
|
|
45
|
-
const isCategorized =
|
|
48
|
+
const isCategorized = axis.isCategorized();
|
|
46
49
|
let domain = domainValue;
|
|
47
50
|
|
|
48
51
|
if (config.zoom_enabled && domain) {
|
|
49
|
-
if (
|
|
52
|
+
if (axis.isTimeSeries()) {
|
|
50
53
|
domain = domain.map(x => parseDate.bind($$)(x));
|
|
51
54
|
}
|
|
52
55
|
|
|
53
|
-
if (withinRange(domain, $$.getZoomDomain(true), $$.getZoomDomain())) {
|
|
56
|
+
if (withinRange(domain as (number|Date)[], $$.getZoomDomain(true), $$.getZoomDomain())) {
|
|
54
57
|
if (isCategorized) {
|
|
55
58
|
domain = domain.map((v, i) => Number(v) + (i === 0 ? 0 : 1));
|
|
56
59
|
}
|
|
@@ -89,7 +92,7 @@ const zoom = function(domainValue?: (number|Date)[]): (number|Date)[]|undefined
|
|
|
89
92
|
scale.zoom.domain() : scale.x.orgDomain();
|
|
90
93
|
}
|
|
91
94
|
|
|
92
|
-
return domain;
|
|
95
|
+
return domain as (Date|number)[];
|
|
93
96
|
};
|
|
94
97
|
|
|
95
98
|
extend(zoom, {
|
|
@@ -631,8 +631,8 @@ class Axis {
|
|
|
631
631
|
const dummy = chart.append("svg")
|
|
632
632
|
.style("visibility", "hidden")
|
|
633
633
|
.style("position", "fixed")
|
|
634
|
-
.style("top", "
|
|
635
|
-
.style("left", "
|
|
634
|
+
.style("top", "0")
|
|
635
|
+
.style("left", "0");
|
|
636
636
|
|
|
637
637
|
axis.create(dummy);
|
|
638
638
|
|
|
@@ -406,15 +406,33 @@ export default {
|
|
|
406
406
|
|
|
407
407
|
state.event = event;
|
|
408
408
|
|
|
409
|
+
if (!d) {
|
|
410
|
+
return;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
let {index} = d;
|
|
414
|
+
const stepType = config.line_step_type;
|
|
415
|
+
|
|
416
|
+
// tooltip position match for step-before & step-after
|
|
417
|
+
if (config.line_step_tooltipMatch && $$.hasType("step") && /^step\-(before|after)$/.test(stepType)) {
|
|
418
|
+
const scale = $$.scale.zoom || $$.scale.x;
|
|
419
|
+
const xs = $$.axis.xs[index];
|
|
420
|
+
const inverted = scale.invert(getPointer(event, this)[0]);
|
|
421
|
+
|
|
422
|
+
if (stepType === "step-after" && inverted < xs) {
|
|
423
|
+
index -= 1;
|
|
424
|
+
} else if (stepType === "step-before" && inverted > xs) {
|
|
425
|
+
index += 1;
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
|
|
409
429
|
// do nothing while dragging/flowing
|
|
410
430
|
if (state.dragging || state.flowing || $$.hasArcType() ||
|
|
411
|
-
|
|
431
|
+
(config.tooltip_grouped && index === eventReceiver.currentIdx)
|
|
412
432
|
) {
|
|
413
433
|
return;
|
|
414
434
|
}
|
|
415
435
|
|
|
416
|
-
const {index} = d;
|
|
417
|
-
|
|
418
436
|
if (index !== eventReceiver.currentIdx) {
|
|
419
437
|
$$.setOverOut(false, eventReceiver.currentIdx);
|
|
420
438
|
eventReceiver.currentIdx = index;
|
|
@@ -210,7 +210,7 @@ export default {
|
|
|
210
210
|
|
|
211
211
|
if (startEvent?.type.indexOf("touch") > -1) {
|
|
212
212
|
startEvent = startEvent.changedTouches[0];
|
|
213
|
-
e = e
|
|
213
|
+
e = e?.changedTouches?.[0];
|
|
214
214
|
}
|
|
215
215
|
|
|
216
216
|
// if click, do nothing. otherwise, click interaction will be canceled.
|
|
@@ -19,41 +19,39 @@ export default {
|
|
|
19
19
|
if (dataGroups.length > 0) {
|
|
20
20
|
const hasValue = $$[`has${isMin ? "Negative" : "Positive"}ValueInTargets`](targets);
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
dataGroups.forEach(groupIds => {
|
|
23
23
|
// Determine baseId
|
|
24
|
-
idsInGroup =
|
|
24
|
+
const idsInGroup = groupIds
|
|
25
|
+
.filter(v => ids.indexOf(v) >= 0);
|
|
25
26
|
|
|
26
|
-
if (idsInGroup.length
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
const baseId = idsInGroup[0];
|
|
31
|
-
const baseAxisId = axis.getId(baseId);
|
|
32
|
-
|
|
33
|
-
// Initialize base value. Set to 0 if not match with the condition
|
|
34
|
-
if (hasValue && ys[baseId]) {
|
|
35
|
-
ys[baseId] = ys[baseId].map(v => (
|
|
36
|
-
(isMin ? v < 0 : v > 0) ? v : 0
|
|
37
|
-
));
|
|
38
|
-
}
|
|
27
|
+
if (idsInGroup.length) {
|
|
28
|
+
const baseId = idsInGroup[0];
|
|
29
|
+
const baseAxisId = axis.getId(baseId);
|
|
39
30
|
|
|
40
|
-
|
|
41
|
-
if (
|
|
42
|
-
|
|
31
|
+
// Initialize base value. Set to 0 if not match with the condition
|
|
32
|
+
if (hasValue && ys[baseId]) {
|
|
33
|
+
ys[baseId] = ys[baseId]
|
|
34
|
+
.map(v => ((isMin ? v < 0 : v > 0) ? v : 0));
|
|
43
35
|
}
|
|
44
36
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
37
|
+
idsInGroup
|
|
38
|
+
.filter((v, i) => i > 0)
|
|
39
|
+
.forEach(id => {
|
|
40
|
+
if (ys[id]) {
|
|
41
|
+
const axisId = axis.getId(id);
|
|
42
|
+
|
|
43
|
+
ys[id].forEach((v, i) => {
|
|
44
|
+
const val = +v;
|
|
45
|
+
const meetCondition = isMin ? val > 0 : val < 0;
|
|
46
|
+
|
|
47
|
+
if (axisId === baseAxisId && !(hasValue && meetCondition)) {
|
|
48
|
+
ys[baseId][i] += val;
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
});
|
|
55
53
|
}
|
|
56
|
-
}
|
|
54
|
+
});
|
|
57
55
|
}
|
|
58
56
|
|
|
59
57
|
return getMinMax(type, Object.keys(ys).map(key => getMinMax(type, ys[key])));
|
|
@@ -622,8 +622,9 @@ export default {
|
|
|
622
622
|
.attr("href", (data, idx, selection) => {
|
|
623
623
|
const node = selection[idx];
|
|
624
624
|
const nodeName = node.nodeName.toLowerCase();
|
|
625
|
+
const id = $$.getTargetSelectorSuffix(data);
|
|
625
626
|
|
|
626
|
-
return nodeName === "use" ? `#${state.datetimeId}-point
|
|
627
|
+
return nodeName === "use" ? `#${state.datetimeId}-point${id}` : undefined;
|
|
627
628
|
});
|
|
628
629
|
} else {
|
|
629
630
|
l.append("line")
|