billboard.js 3.2.1 → 3.3.0

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.
Files changed (82) hide show
  1. package/dist/billboard.css +2 -3
  2. package/dist/billboard.js +424 -114
  3. package/dist/billboard.min.css +2 -2
  4. package/dist/billboard.min.js +2 -2
  5. package/dist/billboard.pkgd.js +5415 -3250
  6. package/dist/billboard.pkgd.min.js +4 -4
  7. package/dist/plugin/billboardjs-plugin-bubblecompare.d.ts +7 -0
  8. package/dist/plugin/billboardjs-plugin-bubblecompare.js +2 -2
  9. package/dist/plugin/billboardjs-plugin-bubblecompare.min.js +2 -2
  10. package/dist/plugin/billboardjs-plugin-sparkline.d.ts +7 -0
  11. package/dist/plugin/billboardjs-plugin-sparkline.js +19 -14
  12. package/dist/plugin/billboardjs-plugin-sparkline.min.js +2 -2
  13. package/dist/plugin/billboardjs-plugin-stanford.d.ts +7 -0
  14. package/dist/plugin/billboardjs-plugin-stanford.js +17 -12
  15. package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
  16. package/dist/plugin/billboardjs-plugin-tableview.d.ts +7 -0
  17. package/dist/plugin/billboardjs-plugin-tableview.js +19 -14
  18. package/dist/plugin/billboardjs-plugin-tableview.min.js +2 -2
  19. package/dist/plugin/billboardjs-plugin-textoverlap.d.ts +7 -0
  20. package/dist/plugin/billboardjs-plugin-textoverlap.js +17 -12
  21. package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
  22. package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.js +5056 -3201
  23. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.js +5082 -3222
  24. package/dist/plugin/pkgd/billboardjs-plugin-stanford.js +5081 -3221
  25. package/dist/plugin/pkgd/billboardjs-plugin-tableview.js +5075 -3215
  26. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.js +5074 -3214
  27. package/dist/theme/datalab.css +2 -2
  28. package/dist/theme/datalab.min.css +2 -2
  29. package/dist/theme/graph.css +2 -2
  30. package/dist/theme/graph.min.css +2 -2
  31. package/dist/theme/insight.css +2 -2
  32. package/dist/theme/insight.min.css +2 -2
  33. package/dist-esm/billboard.js +737 -456
  34. package/dist-esm/plugin/billboardjs-plugin-bubblecompare.d.ts +7 -0
  35. package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +2 -2
  36. package/dist-esm/plugin/billboardjs-plugin-sparkline.d.ts +7 -0
  37. package/dist-esm/plugin/billboardjs-plugin-sparkline.js +8 -8
  38. package/dist-esm/plugin/billboardjs-plugin-stanford.d.ts +7 -0
  39. package/dist-esm/plugin/billboardjs-plugin-stanford.js +15 -15
  40. package/dist-esm/plugin/billboardjs-plugin-tableview.d.ts +7 -0
  41. package/dist-esm/plugin/billboardjs-plugin-tableview.js +6 -6
  42. package/dist-esm/plugin/billboardjs-plugin-textoverlap.d.ts +7 -0
  43. package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +4 -4
  44. package/package.json +52 -52
  45. package/src/Chart/api/chart.ts +7 -1
  46. package/src/Chart/api/data.ts +3 -4
  47. package/src/ChartInternal/Axis/Axis.ts +15 -9
  48. package/src/ChartInternal/ChartInternal.ts +13 -2
  49. package/src/ChartInternal/data/IData.ts +9 -0
  50. package/src/ChartInternal/data/convert.ts +1 -1
  51. package/src/ChartInternal/data/data.ts +28 -11
  52. package/src/ChartInternal/interactions/interaction.ts +36 -4
  53. package/src/ChartInternal/internals/domain.ts +4 -2
  54. package/src/ChartInternal/internals/legend.ts +2 -1
  55. package/src/ChartInternal/internals/redraw.ts +2 -2
  56. package/src/ChartInternal/internals/scale.ts +3 -2
  57. package/src/ChartInternal/internals/size.ts +32 -1
  58. package/src/ChartInternal/internals/text.ts +2 -2
  59. package/src/ChartInternal/internals/tooltip.ts +4 -1
  60. package/src/ChartInternal/shape/arc.ts +3 -5
  61. package/src/ChartInternal/shape/bar.ts +89 -34
  62. package/src/ChartInternal/shape/radar.ts +2 -0
  63. package/src/ChartInternal/shape/shape.ts +72 -11
  64. package/src/Plugin/sparkline/index.ts +2 -2
  65. package/src/Plugin/tableview/index.ts +1 -1
  66. package/src/config/Options/axis/x.ts +27 -7
  67. package/src/config/Options/axis/y.ts +24 -3
  68. package/src/config/Options/axis/y2.ts +24 -3
  69. package/src/config/Options/common/main.ts +11 -1
  70. package/src/config/Options/data/data.ts +22 -0
  71. package/src/config/Options/shape/bar.ts +9 -2
  72. package/src/module/util.ts +19 -20
  73. package/src/scss/billboard.scss +1 -13
  74. package/src/scss/theme/datalab.scss +1 -7
  75. package/src/scss/theme/graph.scss +1 -2
  76. package/src/scss/theme/insight.scss +1 -2
  77. package/types/axis.d.ts +22 -8
  78. package/types/chart.d.ts +1 -1
  79. package/types/options.d.ts +40 -33
  80. package/types/plugin/tableview/index.d.ts +3 -3
  81. package/types/plugin/tableview/options.d.ts +1 -1
  82. package/types/types.d.ts +9 -6
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Copyright (c) 2017 ~ present NAVER Corp.
3
+ * billboard.js project is licensed under the MIT license
4
+ */
5
+ import PluginClass from "../../types/plugin/bubblecompare";
6
+
7
+ export default PluginClass;
@@ -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.1
8
+ * @version 3.3.0
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.1#";
147
+ Plugin.version = "#3.3.0#";
148
148
 
149
149
  /**
150
150
  * Bubble compare diagram plugin.<br>
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Copyright (c) 2017 ~ present NAVER Corp.
3
+ * billboard.js project is licensed under the MIT license
4
+ */
5
+ import PluginClass from "../../types/plugin/sparkline";
6
+
7
+ export default PluginClass;
@@ -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.1
8
+ * @version 3.3.0
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.1#";
271
+ Plugin.version = "#3.3.0#";
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] " + msg);
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, id, caller) {
531
- return caller === "getShapeX" ? {} : getIndices.call(this, indices, id);
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") + "EventListener";
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 = "." + CLASS.target + "-" + id;
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 + "</svg>";
646
+ el[i].innerHTML = "".concat(svgWrapper, "</svg>");
647
647
  svg = el[i].querySelector("svg");
648
648
  svg.__id = id;
649
649
  }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Copyright (c) 2017 ~ present NAVER Corp.
3
+ * billboard.js project is licensed under the MIT license
4
+ */
5
+ import PluginClass from "../../types/plugin/stanford";
6
+
7
+ export default PluginClass;
@@ -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.1
8
+ * @version 3.3.0
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 '" + date + "' to Date object");
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.1#";
470
+ Plugin.version = "#3.3.0#";
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("." + CLASS.stanfordLines)
752
+ var stanfordLine = main.select(".".concat(CLASS.stanfordLines))
753
753
  .style("shape-rendering", "geometricprecision")
754
- .selectAll("." + CLASS.stanfordLine)
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"] ? " " + 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("." + CLASS.stanfordRegions)
787
- .selectAll("." + CLASS.stanfordRegion)
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"] ? " " + 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, " + config.padding_top + ")")
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(" + barWidth + ",0)")
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(" + ($$.state.current.width - this.xForColorScale()) + ", 0)");
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=\"" + CLASS$1.tooltip + "\"><tbody>";
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>" + defaultTitleFormat(config.data_x) + "</th>\n\t\t\t\t\t\t\t<th class=\"value\">" + 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>" + defaultTitleFormat(v.id) + "</th>\n\t\t\t\t\t\t\t<th class=\"value\">" + defaultValueFormat(v.value) + "</th>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr class=\"" + CLASS$1.tooltipName + "-" + v.id + "\">\n\t\t\t\t\t\t\t<td class=\"name\"><span style=\"background-color:" + color(v) + "\"></span>" + defaultTitleFormat("Epochs") + "</td>\n\t\t\t\t\t\t\t<td class=\"value\">" + defaultValueFormat(v.epochs) + "</td>\n\t\t\t\t\t\t</tr>";
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 + "</tbody></table>";
1125
+ return "".concat(html, "</tbody></table>");
1126
1126
  };
1127
1127
  }
1128
1128
  };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Copyright (c) 2017 ~ present NAVER Corp.
3
+ * billboard.js project is licensed under the MIT license
4
+ */
5
+ import PluginClass from "../../types/plugin/tableview";
6
+
7
+ export default PluginClass;
@@ -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.1
8
+ * @version 3.3.0
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.1#";
173
+ Plugin.version = "#3.3.0#";
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("{=" + x + "}", "g"), data[x]);
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 || "." + (className || defaultStyle["class"]));
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>" + v.map(function (d, i) { return tplProcess(i ? tpl.tbody : tpl.tbodyHeader, {
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("") + "</tr>";
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, "");
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Copyright (c) 2017 ~ present NAVER Corp.
3
+ * billboard.js project is licensed under the MIT license
4
+ */
5
+ import PluginClass from "../../types/plugin/textoverlap";
6
+
7
+ export default PluginClass;
@@ -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.1
8
+ * @version 3.3.0
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.1#";
303
+ Plugin.version = "#3.3.0#";
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." + (angle === 1 ? 71 : 35) + "em");
457
- this.setAttribute("transform", "translate(" + xTranslate + ", " + yTranslate + ")");
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.1",
3
+ "version": "3.3.0",
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 && cross-env NODE_ENV=plugin MODE=pkgd webpack",
34
- "_build:plugin": "cross-env NODE_ENV=plugin MODE=pkgd webpack",
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",
@@ -89,38 +89,38 @@
89
89
  "d3-interpolate": "^3.0.1",
90
90
  "d3-scale": "^4.0.2",
91
91
  "d3-selection": "^3.0.0",
92
- "d3-shape": "^3.0.1",
93
- "d3-time-format": "^4.0.0",
92
+ "d3-shape": "^3.1.0",
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.15.8",
99
- "@babel/eslint-parser": "^7.15.8",
100
- "@babel/plugin-proposal-class-properties": "^7.14.5",
101
- "@babel/plugin-proposal-object-rest-spread": "^7.15.6",
102
- "@babel/plugin-transform-runtime": "^7.15.8",
103
- "@babel/preset-env": "^7.15.8",
104
- "@babel/preset-typescript": "^7.15.0",
105
- "@babel/runtime": "^7.15.4",
106
- "@commitlint/cli": "^13.2.1",
107
- "@commitlint/config-conventional": "^13.2.0",
98
+ "@babel/core": "^7.16.7",
99
+ "@babel/eslint-parser": "^7.16.5",
100
+ "@babel/plugin-proposal-class-properties": "^7.16.7",
101
+ "@babel/plugin-proposal-object-rest-spread": "^7.16.7",
102
+ "@babel/plugin-transform-runtime": "^7.16.8",
103
+ "@babel/preset-env": "^7.16.8",
104
+ "@babel/preset-typescript": "^7.16.7",
105
+ "@babel/runtime": "^7.16.7",
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.0.6",
110
- "@rollup/plugin-replace": "^3.0.0",
109
+ "@rollup/plugin-node-resolve": "^13.1.3",
110
+ "@rollup/plugin-replace": "^3.0.1",
111
111
  "@rollup/plugin-typescript": "^8.3.0",
112
- "@semantic-release/changelog": "^6.0.0",
113
- "@semantic-release/commit-analyzer": "^9.0.1",
114
- "@semantic-release/exec": "^6.0.1",
115
- "@semantic-release/git": "^10.0.0",
116
- "@semantic-release/npm": "^8.0.2",
117
- "@semantic-release/release-notes-generator": "^10.0.2",
118
- "@types/chai": "^4.2.22",
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
119
  "@types/d3": "^7.1.0",
120
120
  "@types/mocha": "^9.0.0",
121
- "@types/sinon": "^10.0.4",
122
- "@typescript-eslint/eslint-plugin": "^5.1.0",
123
- "@typescript-eslint/parser": "^5.1.0",
121
+ "@types/sinon": "^10.0.6",
122
+ "@typescript-eslint/eslint-plugin": "^5.9.1",
123
+ "@typescript-eslint/parser": "^5.9.1",
124
124
  "babel-helper-modules": "^6.0.0",
125
125
  "babel-loader": "^8.2.3",
126
126
  "babel-plugin-add-module-exports": "^1.0.4",
@@ -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.8.0",
139
- "core-js": "^3.18.3",
138
+ "cloc": "^2.9.0",
139
+ "core-js": "^3.20.2",
140
140
  "coveralls": "^3.1.1",
141
141
  "cross-env": "^7.0.3",
142
- "css-loader": "^6.4.0",
143
- "css-minimizer-webpack-plugin": "^3.1.1",
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.1",
146
+ "d3-format": "^3.1.0",
147
147
  "d3-polygon": "^3.0.1",
148
148
  "docdash": "^1.2.0",
149
- "dtslint": "^4.2.0",
150
- "eslint": "^8.0.1",
149
+ "dtslint": "^4.2.1",
150
+ "eslint": "^8.6.0",
151
151
  "eslint-config-naver": "^2.1.0",
152
- "eslint-plugin-import": "^2.25.2",
153
- "eslint-plugin-jsdoc": "^36.1.1",
154
- "eslint-webpack-plugin": "^3.0.1",
152
+ "eslint-plugin-import": "^2.25.4",
153
+ "eslint-plugin-jsdoc": "^37.6.1",
154
+ "eslint-webpack-plugin": "^3.1.1",
155
155
  "exports-loader": "^3.1.0",
156
156
  "hammer-simulator": "0.0.1",
157
157
  "husky": "^7.0.4",
158
158
  "istanbul-instrumenter-loader": "^3.0.1",
159
- "istanbul-lib-instrument": "^5.0.4",
159
+ "istanbul-lib-instrument": "^5.1.0",
160
160
  "jsdoc": "^3.6.7",
161
- "karma": "^6.3.5",
161
+ "karma": "^6.3.10",
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.3",
172
+ "mini-css-extract-plugin": "^2.4.6",
173
173
  "mocha": "^9.1.3",
174
- "node-sass": "^6.0.1",
174
+ "node-sass": "^7.0.1",
175
175
  "regenerator-runtime": "^0.13.7",
176
- "rollup": "^2.58.0",
176
+ "rollup": "^2.63.0",
177
177
  "rollup-plugin-delete": "^2.0.0",
178
- "sass-loader": "^12.2.0",
179
- "semantic-release": "^18.0.0",
178
+ "sass-loader": "^12.4.0",
179
+ "semantic-release": "^18.0.1",
180
180
  "simulant": "^0.2.2",
181
- "sinon": "^11.1.2",
182
- "string-replace-loader": "^3.0.3",
181
+ "sinon": "^12.0.1",
182
+ "string-replace-loader": "^3.1.0",
183
183
  "style-loader": "^3.3.1",
184
- "terser-webpack-plugin": "^5.2.4",
184
+ "terser-webpack-plugin": "^5.3.0",
185
185
  "tslib": "^2.3.1",
186
- "typescript": "^4.4.4",
187
- "webpack": "^5.59.1",
186
+ "typescript": "^4.5.4",
187
+ "webpack": "^5.65.0",
188
188
  "webpack-bundle-analyzer": "^4.5.0",
189
189
  "webpack-clean": "^1.2.5",
190
190
  "webpack-cli": "^4.9.1",
191
191
  "webpack-common-shake": "^2.1.0",
192
- "webpack-dev-server": "^4.3.1",
192
+ "webpack-dev-server": "^4.7.2",
193
193
  "webpack-merge": "^5.8.0",
194
- "webpackbar": "^5.0.0-3",
194
+ "webpackbar": "^5.0.2",
195
195
  "write-file-webpack-plugin": "^4.5.1"
196
196
  }
197
197
  }
@@ -106,12 +106,18 @@ export default {
106
106
  $$.callPluginHook("$willDestroy");
107
107
  $$.charts.splice($$.charts.indexOf(this), 1);
108
108
 
109
+ // detach events
110
+ $$.unbindAllEvents();
111
+
109
112
  // clear timers && pending transition
110
113
  svg.select("*").interrupt();
111
114
  $$.resizeFunction.clear();
112
115
 
113
116
  window.removeEventListener("resize", $$.resizeFunction);
114
- chart.classed("bb", false).html("");
117
+ chart.classed("bb", false)
118
+ .style("position", null)
119
+ .selectChildren()
120
+ .remove();
115
121
 
116
122
  // releasing own references
117
123
  Object.keys(this).forEach(key => {
@@ -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(): DataParam {
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(): DataParam {
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", "0px")
635
- .style("left", "0px");
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
- const toCull = config[`axis_${id}_tick_culling`];
948
+
949
+ const cullingOptionPrefix = `axis_${id}_tick_culling`;
950
+ const toCull = config[cullingOptionPrefix];
949
951
 
950
952
  if (axis && toCull) {
951
- const tickText = axis.selectAll(".tick text");
952
- const tickValues = sortValue(tickText.data());
953
+ const tickNodes = axis.selectAll(".tick");
954
+ const tickValues = sortValue(tickNodes.data());
953
955
  const tickSize = tickValues.length;
954
- const cullingMax = config[`axis_${id}_tick_culling_max`];
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
- tickText.each(function(d) {
966
- this.style.display = tickValues.indexOf(d) % intervalForCulling ? "none" : null;
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
- tickText.style("display", null);
975
+ tickNodes.style("display", null);
970
976
  }
971
977
 
972
978
  // set/unset x_axis_tick_clippath
@@ -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 = {
@@ -202,7 +210,9 @@ export default class ChartInternal {
202
210
  $el.chart = d3Select(document.body.appendChild(document.createElement("div")));
203
211
  }
204
212
 
205
- $el.chart.html("").classed(bindto.classname, true);
213
+ $el.chart.html("")
214
+ .classed(bindto.classname, true)
215
+ .style("position", "relative");
206
216
 
207
217
  $$.initToRender();
208
218
  }
@@ -290,7 +300,8 @@ export default class ChartInternal {
290
300
  state.isLegendLeft = config.legend_inset_anchor === "top-left" ||
291
301
  config.legend_inset_anchor === "bottom-left";
292
302
 
293
- state.rotatedPaddingRight = isRotated && !config.axis_x_show ? 0 : 30;
303
+ state.rotatedPadding.top = $$.getResettedPadding(state.rotatedPadding.top);
304
+ state.rotatedPadding.right = isRotated && !config.axis_x_show ? 0 : 30;
294
305
 
295
306
  state.inputType = convertInputType(
296
307
  config.interaction_inputType_mouse,
@@ -30,3 +30,12 @@ export interface IGridData {
30
30
  text: string;
31
31
  value: number;
32
32
  }
33
+
34
+ export interface IDataIndice {
35
+ [key: string]: number;
36
+ __max__: number;
37
+ }
38
+
39
+ export type TIndices = {} | {
40
+ [key:string]: IDataIndice
41
+ };
@@ -23,7 +23,7 @@ export default {
23
23
  * @returns {object}
24
24
  * @private
25
25
  */
26
- convertData(args, callback: Function): object {
26
+ convertData(args, callback: Function): any[] | false {
27
27
  let data;
28
28
 
29
29
  if (args.bindto) {