billboard.js 3.2.0 → 3.3.0-next.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 +422 -147
- package/dist/billboard.min.css +2 -2
- package/dist/billboard.min.js +2 -2
- package/dist/billboard.pkgd.js +5645 -3320
- package/dist/billboard.pkgd.min.js +3 -3
- package/dist/plugin/billboardjs-plugin-bubblecompare.d.ts +7 -0
- 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.d.ts +7 -0
- package/dist/plugin/billboardjs-plugin-sparkline.js +19 -14
- package/dist/plugin/billboardjs-plugin-sparkline.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-stanford.d.ts +7 -0
- package/dist/plugin/billboardjs-plugin-stanford.js +17 -12
- package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-tableview.d.ts +7 -0
- package/dist/plugin/billboardjs-plugin-tableview.js +19 -14
- package/dist/plugin/billboardjs-plugin-tableview.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-textoverlap.d.ts +7 -0
- package/dist/plugin/billboardjs-plugin-textoverlap.js +17 -12
- package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.js +5061 -3202
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.js +5087 -3223
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.js +5086 -3222
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.js +5080 -3216
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.js +5079 -3215
- 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 +723 -484
- package/dist-esm/plugin/billboardjs-plugin-bubblecompare.d.ts +7 -0
- package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-sparkline.d.ts +7 -0
- package/dist-esm/plugin/billboardjs-plugin-sparkline.js +8 -8
- package/dist-esm/plugin/billboardjs-plugin-stanford.d.ts +7 -0
- package/dist-esm/plugin/billboardjs-plugin-stanford.js +15 -15
- package/dist-esm/plugin/billboardjs-plugin-tableview.d.ts +7 -0
- package/dist-esm/plugin/billboardjs-plugin-tableview.js +6 -6
- package/dist-esm/plugin/billboardjs-plugin-textoverlap.d.ts +7 -0
- package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +4 -4
- package/package.json +60 -60
- package/src/Chart/api/data.ts +3 -4
- package/src/ChartInternal/Axis/Axis.ts +15 -9
- package/src/ChartInternal/ChartInternal.ts +11 -2
- package/src/ChartInternal/data/IData.ts +9 -0
- package/src/ChartInternal/data/convert.ts +1 -1
- package/src/ChartInternal/data/data.ts +29 -12
- package/src/ChartInternal/internals/domain.ts +31 -31
- package/src/ChartInternal/internals/legend.ts +2 -1
- package/src/ChartInternal/internals/redraw.ts +2 -2
- package/src/ChartInternal/internals/scale.ts +3 -2
- package/src/ChartInternal/internals/size.ts +32 -1
- package/src/ChartInternal/internals/text.ts +4 -4
- package/src/ChartInternal/internals/tooltip.ts +4 -0
- package/src/ChartInternal/shape/arc.ts +3 -5
- package/src/ChartInternal/shape/bar.ts +89 -34
- package/src/ChartInternal/shape/radar.ts +2 -0
- package/src/ChartInternal/shape/shape.ts +72 -11
- package/src/Plugin/sparkline/index.ts +2 -2
- package/src/Plugin/tableview/index.ts +1 -1
- package/src/config/Options/axis/x.ts +27 -7
- package/src/config/Options/axis/y.ts +24 -3
- package/src/config/Options/axis/y2.ts +24 -3
- package/src/config/Options/common/main.ts +11 -1
- package/src/config/Options/data/data.ts +25 -3
- package/src/config/Options/shape/bar.ts +9 -2
- package/src/module/util.ts +19 -20
- 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/axis.d.ts +18 -4
- package/types/options.d.ts +43 -36
- package/types/plugin/tableview/index.d.ts +3 -3
- package/types/plugin/tableview/options.d.ts +1 -1
- package/types/types.d.ts +9 -6
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 3.
|
|
8
|
+
* @version 3.3.0-next.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.
|
|
147
|
+
Plugin.version = "#3.3.0-next.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.
|
|
8
|
+
* @version 3.3.0-next.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.
|
|
271
|
+
Plugin.version = "#3.3.0-next.2#";
|
|
272
272
|
|
|
273
273
|
/**
|
|
274
274
|
* Copyright (c) 2021 ~ present NAVER Corp.
|
|
@@ -520,15 +520,15 @@ 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 () {
|
|
527
527
|
var $$ = this.$$;
|
|
528
528
|
var getBarW = $$.getBarW, getIndices = $$.getIndices;
|
|
529
529
|
// override internal methods to positioning bars
|
|
530
|
-
$$.getIndices = function (indices,
|
|
531
|
-
return caller === "getShapeX" ? {} : getIndices.call(this, indices,
|
|
530
|
+
$$.getIndices = function (indices, d, caller) {
|
|
531
|
+
return caller === "getShapeX" ? {} : getIndices.call(this, indices, d);
|
|
532
532
|
};
|
|
533
533
|
$$.getBarW = function (type, axis) {
|
|
534
534
|
return getBarW.call(this, type, axis, 1);
|
|
@@ -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.
|
|
8
|
+
* @version 3.3.0-next.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.
|
|
470
|
+
Plugin.version = "#3.3.0-next.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.
|
|
8
|
+
* @version 3.3.0-next.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.
|
|
173
|
+
Plugin.version = "#3.3.0-next.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.
|
|
8
|
+
* @version 3.3.0-next.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.
|
|
303
|
+
Plugin.version = "#3.3.0-next.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.
|
|
3
|
+
"version": "3.3.0-next.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",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"scripts": {
|
|
22
22
|
"start": "webpack serve --open",
|
|
23
23
|
"start:plugin": "cross-env PLUGIN=true webpack-dev-server --open",
|
|
24
|
-
"build": "npm run build:production && npm run build:packaged && npm run build:theme && npm run build:plugin && npm run build:esm && npm run build:cjs",
|
|
24
|
+
"build": "npm run build:production && npm run build:packaged && npm run build:theme && npm run build:plugin && npm run build:esm && npm run build:cjs && npm run build:plugin:types",
|
|
25
25
|
"build:cjs": "node ./config/cjs.js",
|
|
26
26
|
"build:esm": "rollup -c ./config/rollup/esm.js",
|
|
27
27
|
"build:production": "cross-env NODE_ENV=production webpack",
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"build:theme": "cross-env NODE_ENV=theme webpack",
|
|
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
|
-
"build:plugin": "cross-env NODE_ENV=plugin webpack && cross-env NODE_ENV=plugin MODE=min webpack &&
|
|
34
|
-
"
|
|
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:types": "node ./config/type.d-plugin.js",
|
|
35
35
|
"release": "semantic-release",
|
|
36
36
|
"lint": "npm run lint:types && eslint src --ext .ts",
|
|
37
37
|
"lint:types": "dtslint --onlyTestTsNext types",
|
|
@@ -90,39 +90,39 @@
|
|
|
90
90
|
"d3-scale": "^4.0.2",
|
|
91
91
|
"d3-selection": "^3.0.0",
|
|
92
92
|
"d3-shape": "^3.0.1",
|
|
93
|
-
"d3-time-format": "^4.
|
|
93
|
+
"d3-time-format": "^4.1.0",
|
|
94
94
|
"d3-transition": "^3.0.1",
|
|
95
95
|
"d3-zoom": "^3.0.0"
|
|
96
96
|
},
|
|
97
97
|
"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": "^
|
|
98
|
+
"@babel/core": "^7.16.5",
|
|
99
|
+
"@babel/eslint-parser": "^7.16.5",
|
|
100
|
+
"@babel/plugin-proposal-class-properties": "^7.16.5",
|
|
101
|
+
"@babel/plugin-proposal-object-rest-spread": "^7.16.5",
|
|
102
|
+
"@babel/plugin-transform-runtime": "^7.16.5",
|
|
103
|
+
"@babel/preset-env": "^7.16.5",
|
|
104
|
+
"@babel/preset-typescript": "^7.16.5",
|
|
105
|
+
"@babel/runtime": "^7.16.5",
|
|
106
|
+
"@commitlint/cli": "^15.0.0",
|
|
107
|
+
"@commitlint/config-conventional": "^16.0.0",
|
|
108
108
|
"@rollup/plugin-babel": "^5.3.0",
|
|
109
|
-
"@rollup/plugin-node-resolve": "^13.
|
|
110
|
-
"@rollup/plugin-replace": "^3.0.
|
|
111
|
-
"@rollup/plugin-typescript": "^8.
|
|
112
|
-
"@semantic-release/changelog": "^6.0.
|
|
113
|
-
"@semantic-release/commit-analyzer": "^9.0.
|
|
114
|
-
"@semantic-release/exec": "^6.0.
|
|
115
|
-
"@semantic-release/git": "^10.0.
|
|
116
|
-
"@semantic-release/npm": "^8.0.
|
|
117
|
-
"@semantic-release/release-notes-generator": "^10.0.
|
|
118
|
-
"@types/chai": "^4.
|
|
119
|
-
"@types/d3": "^7.
|
|
109
|
+
"@rollup/plugin-node-resolve": "^13.1.1",
|
|
110
|
+
"@rollup/plugin-replace": "^3.0.1",
|
|
111
|
+
"@rollup/plugin-typescript": "^8.3.0",
|
|
112
|
+
"@semantic-release/changelog": "^6.0.1",
|
|
113
|
+
"@semantic-release/commit-analyzer": "^9.0.2",
|
|
114
|
+
"@semantic-release/exec": "^6.0.3",
|
|
115
|
+
"@semantic-release/git": "^10.0.1",
|
|
116
|
+
"@semantic-release/npm": "^8.0.3",
|
|
117
|
+
"@semantic-release/release-notes-generator": "^10.0.3",
|
|
118
|
+
"@types/chai": "^4.3.0",
|
|
119
|
+
"@types/d3": "^7.1.0",
|
|
120
120
|
"@types/mocha": "^9.0.0",
|
|
121
|
-
"@types/sinon": "^10.0.
|
|
122
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
123
|
-
"@typescript-eslint/parser": "^
|
|
121
|
+
"@types/sinon": "^10.0.6",
|
|
122
|
+
"@typescript-eslint/eslint-plugin": "^5.8.1",
|
|
123
|
+
"@typescript-eslint/parser": "^5.8.1",
|
|
124
124
|
"babel-helper-modules": "^6.0.0",
|
|
125
|
-
"babel-loader": "^8.2.
|
|
125
|
+
"babel-loader": "^8.2.3",
|
|
126
126
|
"babel-plugin-add-module-exports": "^1.0.4",
|
|
127
127
|
"babel-plugin-minify-constant-folding": "^0.5.0",
|
|
128
128
|
"babel-plugin-minify-dead-code-elimination": "^0.5.1",
|
|
@@ -135,30 +135,30 @@
|
|
|
135
135
|
"better-docs": "^2.3.2",
|
|
136
136
|
"chai": "^4.3.4",
|
|
137
137
|
"clean-webpack-plugin": "^4.0.0",
|
|
138
|
-
"cloc": "^2.
|
|
139
|
-
"core-js": "^3.
|
|
138
|
+
"cloc": "^2.9.0",
|
|
139
|
+
"core-js": "^3.20.1",
|
|
140
140
|
"coveralls": "^3.1.1",
|
|
141
141
|
"cross-env": "^7.0.3",
|
|
142
|
-
"css-loader": "^6.
|
|
143
|
-
"css-minimizer-webpack-plugin": "^3.
|
|
142
|
+
"css-loader": "^6.5.1",
|
|
143
|
+
"css-minimizer-webpack-plugin": "^3.3.1",
|
|
144
144
|
"d3-color": "^3.0.1",
|
|
145
145
|
"d3-delaunay": "^6.0.2",
|
|
146
|
-
"d3-format": "^3.0
|
|
146
|
+
"d3-format": "^3.1.0",
|
|
147
147
|
"d3-polygon": "^3.0.1",
|
|
148
148
|
"docdash": "^1.2.0",
|
|
149
|
-
"dtslint": "^4.1
|
|
150
|
-
"eslint": "^
|
|
149
|
+
"dtslint": "^4.2.1",
|
|
150
|
+
"eslint": "^8.5.0",
|
|
151
151
|
"eslint-config-naver": "^2.1.0",
|
|
152
|
-
"eslint-plugin-import": "^2.
|
|
153
|
-
"eslint-plugin-jsdoc": "^
|
|
154
|
-
"eslint-webpack-plugin": "^3.
|
|
155
|
-
"exports-loader": "^3.
|
|
152
|
+
"eslint-plugin-import": "^2.25.3",
|
|
153
|
+
"eslint-plugin-jsdoc": "^37.4.2",
|
|
154
|
+
"eslint-webpack-plugin": "^3.1.1",
|
|
155
|
+
"exports-loader": "^3.1.0",
|
|
156
156
|
"hammer-simulator": "0.0.1",
|
|
157
|
-
"husky": "^7.0.
|
|
157
|
+
"husky": "^7.0.4",
|
|
158
158
|
"istanbul-instrumenter-loader": "^3.0.1",
|
|
159
|
-
"istanbul-lib-instrument": "^5.0
|
|
159
|
+
"istanbul-lib-instrument": "^5.1.0",
|
|
160
160
|
"jsdoc": "^3.6.7",
|
|
161
|
-
"karma": "^6.3.
|
|
161
|
+
"karma": "^6.3.9",
|
|
162
162
|
"karma-chai": "^0.1.0",
|
|
163
163
|
"karma-chrome-launcher": "^3.1.0",
|
|
164
164
|
"karma-coverage-istanbul-reporter": "^3.0.3",
|
|
@@ -169,29 +169,29 @@
|
|
|
169
169
|
"karma-sourcemap-loader": "^0.3.8",
|
|
170
170
|
"karma-webpack": "^5.0.0",
|
|
171
171
|
"lite-fixture": "^1.0.2",
|
|
172
|
-
"mini-css-extract-plugin": "^2.4.
|
|
173
|
-
"mocha": "^9.1.
|
|
174
|
-
"node-sass": "^
|
|
172
|
+
"mini-css-extract-plugin": "^2.4.5",
|
|
173
|
+
"mocha": "^9.1.3",
|
|
174
|
+
"node-sass": "^7.0.1",
|
|
175
175
|
"regenerator-runtime": "^0.13.7",
|
|
176
|
-
"rollup": "^2.
|
|
176
|
+
"rollup": "^2.62.0",
|
|
177
177
|
"rollup-plugin-delete": "^2.0.0",
|
|
178
|
-
"sass-loader": "^12.
|
|
179
|
-
"semantic-release": "^18.0.
|
|
178
|
+
"sass-loader": "^12.4.0",
|
|
179
|
+
"semantic-release": "^18.0.1",
|
|
180
180
|
"simulant": "^0.2.2",
|
|
181
|
-
"sinon": "^
|
|
182
|
-
"string-replace-loader": "^3.0
|
|
183
|
-
"style-loader": "^3.3.
|
|
184
|
-
"terser-webpack-plugin": "^5.
|
|
181
|
+
"sinon": "^12.0.1",
|
|
182
|
+
"string-replace-loader": "^3.1.0",
|
|
183
|
+
"style-loader": "^3.3.1",
|
|
184
|
+
"terser-webpack-plugin": "^5.3.0",
|
|
185
185
|
"tslib": "^2.3.1",
|
|
186
|
-
"typescript": "^4.4
|
|
187
|
-
"webpack": "^5.
|
|
188
|
-
"webpack-bundle-analyzer": "^4.
|
|
186
|
+
"typescript": "^4.5.4",
|
|
187
|
+
"webpack": "^5.65.0",
|
|
188
|
+
"webpack-bundle-analyzer": "^4.5.0",
|
|
189
189
|
"webpack-clean": "^1.2.5",
|
|
190
|
-
"webpack-cli": "^4.
|
|
190
|
+
"webpack-cli": "^4.9.1",
|
|
191
191
|
"webpack-common-shake": "^2.1.0",
|
|
192
|
-
"webpack-dev-server": "^4.
|
|
192
|
+
"webpack-dev-server": "^4.7.2",
|
|
193
193
|
"webpack-merge": "^5.8.0",
|
|
194
|
-
"webpackbar": "^5.0.
|
|
194
|
+
"webpackbar": "^5.0.2",
|
|
195
195
|
"write-file-webpack-plugin": "^4.5.1"
|
|
196
196
|
}
|
|
197
197
|
}
|
package/src/Chart/api/data.ts
CHANGED
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import {DataItem} from "../../../types/types";
|
|
6
6
|
import {extend, isUndefined, isArray} from "../../module/util";
|
|
7
|
-
|
|
8
|
-
type DataParam = {x: number, value: number, id: string, index: number}[];
|
|
7
|
+
import {IDataRow} from "../../ChartInternal/data/IData";
|
|
9
8
|
|
|
10
9
|
/**
|
|
11
10
|
* Get data loaded in the chart.
|
|
@@ -173,7 +172,7 @@ extend(data, {
|
|
|
173
172
|
* chart.data.min();
|
|
174
173
|
* // --> [{x: 0, value: 30, id: "data1", index: 0}, ...]
|
|
175
174
|
*/
|
|
176
|
-
min: function():
|
|
175
|
+
min: function(): IDataRow[] {
|
|
177
176
|
return this.internal.getMinMaxData().min;
|
|
178
177
|
},
|
|
179
178
|
|
|
@@ -188,7 +187,7 @@ extend(data, {
|
|
|
188
187
|
* chart.data.max();
|
|
189
188
|
* // --> [{x: 3, value: 400, id: "data1", index: 3}, ...]
|
|
190
189
|
*/
|
|
191
|
-
max: function():
|
|
190
|
+
max: function(): IDataRow[] {
|
|
192
191
|
return this.internal.getMinMaxData().max;
|
|
193
192
|
}
|
|
194
193
|
});
|
|
@@ -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
|
|
|
@@ -945,13 +945,16 @@ class Axis {
|
|
|
945
945
|
|
|
946
946
|
// subchart x axis should be aligned with x axis culling
|
|
947
947
|
const id = type === "subX" ? "x" : type;
|
|
948
|
-
|
|
948
|
+
|
|
949
|
+
const cullingOptionPrefix = `axis_${id}_tick_culling`;
|
|
950
|
+
const toCull = config[cullingOptionPrefix];
|
|
949
951
|
|
|
950
952
|
if (axis && toCull) {
|
|
951
|
-
const
|
|
952
|
-
const tickValues = sortValue(
|
|
953
|
+
const tickNodes = axis.selectAll(".tick");
|
|
954
|
+
const tickValues = sortValue(tickNodes.data());
|
|
953
955
|
const tickSize = tickValues.length;
|
|
954
|
-
const cullingMax = config[
|
|
956
|
+
const cullingMax = config[`${cullingOptionPrefix}_max`];
|
|
957
|
+
const lines = config[`${cullingOptionPrefix}_lines`];
|
|
955
958
|
let intervalForCulling;
|
|
956
959
|
|
|
957
960
|
if (tickSize) {
|
|
@@ -962,11 +965,14 @@ class Axis {
|
|
|
962
965
|
}
|
|
963
966
|
}
|
|
964
967
|
|
|
965
|
-
|
|
966
|
-
|
|
968
|
+
tickNodes.each(function(d) {
|
|
969
|
+
if (tickValues.indexOf(d) % intervalForCulling) {
|
|
970
|
+
(lines ? this.querySelector("text") : this)
|
|
971
|
+
.style.display = "none";
|
|
972
|
+
}
|
|
967
973
|
});
|
|
968
974
|
} else {
|
|
969
|
-
|
|
975
|
+
tickNodes.style("display", null);
|
|
970
976
|
}
|
|
971
977
|
|
|
972
978
|
// set/unset x_axis_tick_clippath
|
|
@@ -79,7 +79,7 @@ export default class ChartInternal {
|
|
|
79
79
|
subY: null,
|
|
80
80
|
subY2: null,
|
|
81
81
|
zoom: null
|
|
82
|
-
}
|
|
82
|
+
};
|
|
83
83
|
|
|
84
84
|
// original values
|
|
85
85
|
public org = {
|
|
@@ -182,6 +182,14 @@ export default class ChartInternal {
|
|
|
182
182
|
state.hasAxis = !$$.hasArcType();
|
|
183
183
|
state.hasRadar = !state.hasAxis && $$.hasType("radar");
|
|
184
184
|
|
|
185
|
+
// when 'padding=false' is set, disable axes and subchart. Because they are useless.
|
|
186
|
+
if (config.padding === false) {
|
|
187
|
+
config.axis_x_show = false;
|
|
188
|
+
config.axis_y_show = false;
|
|
189
|
+
config.axis_y2_show = false;
|
|
190
|
+
config.subchart_show = false;
|
|
191
|
+
}
|
|
192
|
+
|
|
185
193
|
$$.initParams();
|
|
186
194
|
|
|
187
195
|
const bindto = {
|
|
@@ -290,7 +298,8 @@ export default class ChartInternal {
|
|
|
290
298
|
state.isLegendLeft = config.legend_inset_anchor === "top-left" ||
|
|
291
299
|
config.legend_inset_anchor === "bottom-left";
|
|
292
300
|
|
|
293
|
-
state.
|
|
301
|
+
state.rotatedPadding.top = $$.getResettedPadding(state.rotatedPadding.top);
|
|
302
|
+
state.rotatedPadding.right = isRotated && !config.axis_x_show ? 0 : 30;
|
|
294
303
|
|
|
295
304
|
state.inputType = convertInputType(
|
|
296
305
|
config.interaction_inputType_mouse,
|