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.
Files changed (45) hide show
  1. package/dist/billboard.css +2 -3
  2. package/dist/billboard.js +29 -19
  3. package/dist/billboard.min.css +2 -2
  4. package/dist/billboard.min.js +2 -2
  5. package/dist/billboard.pkgd.js +2969 -2381
  6. package/dist/billboard.pkgd.min.js +2 -2
  7. package/dist/plugin/billboardjs-plugin-bubblecompare.js +2 -2
  8. package/dist/plugin/billboardjs-plugin-bubblecompare.min.js +2 -2
  9. package/dist/plugin/billboardjs-plugin-sparkline.js +9 -5
  10. package/dist/plugin/billboardjs-plugin-sparkline.min.js +2 -2
  11. package/dist/plugin/billboardjs-plugin-stanford.js +9 -5
  12. package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
  13. package/dist/plugin/billboardjs-plugin-tableview.js +9 -5
  14. package/dist/plugin/billboardjs-plugin-tableview.min.js +2 -2
  15. package/dist/plugin/billboardjs-plugin-textoverlap.js +9 -5
  16. package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
  17. package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.js +2943 -2365
  18. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.js +2950 -2368
  19. package/dist/plugin/pkgd/billboardjs-plugin-stanford.js +2951 -2369
  20. package/dist/plugin/pkgd/billboardjs-plugin-tableview.js +2952 -2370
  21. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.js +2953 -2371
  22. package/dist/theme/datalab.css +2 -2
  23. package/dist/theme/datalab.min.css +2 -2
  24. package/dist/theme/graph.css +2 -2
  25. package/dist/theme/graph.min.css +2 -2
  26. package/dist/theme/insight.css +2 -2
  27. package/dist/theme/insight.min.css +2 -2
  28. package/dist-esm/billboard.js +378 -377
  29. package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +2 -2
  30. package/dist-esm/plugin/billboardjs-plugin-sparkline.js +6 -6
  31. package/dist-esm/plugin/billboardjs-plugin-stanford.js +15 -15
  32. package/dist-esm/plugin/billboardjs-plugin-tableview.js +6 -6
  33. package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +4 -4
  34. package/package.json +37 -38
  35. package/src/ChartInternal/Axis/Axis.ts +2 -2
  36. package/src/ChartInternal/internals/legend.ts +2 -1
  37. package/src/ChartInternal/internals/redraw.ts +2 -2
  38. package/src/ChartInternal/shape/arc.ts +1 -5
  39. package/src/ChartInternal/shape/bar.ts +10 -2
  40. package/src/module/util.ts +3 -5
  41. package/src/scss/billboard.scss +1 -13
  42. package/src/scss/theme/datalab.scss +1 -7
  43. package/src/scss/theme/graph.scss +1 -2
  44. package/src/scss/theme/insight.scss +1 -2
  45. 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.1
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.1#";
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.1
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.1#";
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] " + msg);
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") + "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
  }
@@ -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.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 '" + 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.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("." + 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
  };
@@ -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.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.1#";
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("{=" + 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, "");
@@ -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.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.1#";
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." + (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.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",
@@ -95,32 +94,32 @@
95
94
  "d3-zoom": "^3.0.0"
96
95
  },
97
96
  "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",
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
108
  "@rollup/plugin-node-resolve": "^13.0.6",
110
109
  "@rollup/plugin-replace": "^3.0.0",
111
110
  "@rollup/plugin-typescript": "^8.3.0",
112
- "@semantic-release/changelog": "^6.0.0",
111
+ "@semantic-release/changelog": "^6.0.1",
113
112
  "@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",
113
+ "@semantic-release/exec": "^6.0.2",
114
+ "@semantic-release/git": "^10.0.1",
115
+ "@semantic-release/npm": "^8.0.3",
117
116
  "@semantic-release/release-notes-generator": "^10.0.2",
118
117
  "@types/chai": "^4.2.22",
119
118
  "@types/d3": "^7.1.0",
120
119
  "@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",
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
124
  "babel-loader": "^8.2.3",
126
125
  "babel-plugin-add-module-exports": "^1.0.4",
@@ -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.18.3",
138
+ "core-js": "^3.19.1",
140
139
  "coveralls": "^3.1.1",
141
140
  "cross-env": "^7.0.3",
142
- "css-loader": "^6.4.0",
143
- "css-minimizer-webpack-plugin": "^3.1.1",
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.2.0",
150
- "eslint": "^8.0.1",
148
+ "dtslint": "^4.2.1",
149
+ "eslint": "^8.2.0",
151
150
  "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",
151
+ "eslint-plugin-import": "^2.25.3",
152
+ "eslint-plugin-jsdoc": "^37.0.3",
153
+ "eslint-webpack-plugin": "^3.1.1",
155
154
  "exports-loader": "^3.1.0",
156
155
  "hammer-simulator": "0.0.1",
157
156
  "husky": "^7.0.4",
158
157
  "istanbul-instrumenter-loader": "^3.0.1",
159
- "istanbul-lib-instrument": "^5.0.4",
158
+ "istanbul-lib-instrument": "^5.1.0",
160
159
  "jsdoc": "^3.6.7",
161
- "karma": "^6.3.5",
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.4.3",
171
+ "mini-css-extract-plugin": "^2.4.5",
173
172
  "mocha": "^9.1.3",
174
173
  "node-sass": "^6.0.1",
175
174
  "regenerator-runtime": "^0.13.7",
176
- "rollup": "^2.58.0",
175
+ "rollup": "^2.60.0",
177
176
  "rollup-plugin-delete": "^2.0.0",
178
- "sass-loader": "^12.2.0",
177
+ "sass-loader": "^12.3.0",
179
178
  "semantic-release": "^18.0.0",
180
179
  "simulant": "^0.2.2",
181
- "sinon": "^11.1.2",
180
+ "sinon": "^12.0.1",
182
181
  "string-replace-loader": "^3.0.3",
183
182
  "style-loader": "^3.3.1",
184
- "terser-webpack-plugin": "^5.2.4",
183
+ "terser-webpack-plugin": "^5.2.5",
185
184
  "tslib": "^2.3.1",
186
- "typescript": "^4.4.4",
187
- "webpack": "^5.59.1",
185
+ "typescript": "^4.5.2",
186
+ "webpack": "^5.64.1",
188
187
  "webpack-bundle-analyzer": "^4.5.0",
189
188
  "webpack-clean": "^1.2.5",
190
189
  "webpack-cli": "^4.9.1",
191
190
  "webpack-common-shake": "^2.1.0",
192
- "webpack-dev-server": "^4.3.1",
191
+ "webpack-dev-server": "^4.5.0",
193
192
  "webpack-merge": "^5.8.0",
194
- "webpackbar": "^5.0.0-3",
193
+ "webpackbar": "^5.0.2",
195
194
  "write-file-webpack-plugin": "^4.5.1"
196
195
  }
197
196
  }
@@ -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
 
@@ -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-${data}` : undefined;
627
+ return nodeName === "use" ? `#${state.datetimeId}-point${id}` : undefined;
627
628
  });
628
629
  } else {
629
630
  l.append("line")
@@ -16,8 +16,7 @@ export default {
16
16
  state.redrawing = true;
17
17
 
18
18
  const targetsToShow = $$.filterTargetsToShow($$.data.targets);
19
- const initializing = options.initializing;
20
- const flow = options.flow;
19
+ const {flow, initializing} = options;
21
20
  const wth = $$.getWithOption(options);
22
21
  const duration = wth.Transition ? config.transition_duration : 0;
23
22
  const durationForExit = wth.TransitionForExit ? duration : 0;
@@ -247,6 +246,7 @@ export default {
247
246
  redrawWithoutRescale() {
248
247
  this.redraw({
249
248
  withY: false,
249
+ withLegend: true,
250
250
  withSubchart: false,
251
251
  withEventRect: false,
252
252
  withTransitionForAxis: false
@@ -536,11 +536,7 @@ export default {
536
536
  .attr("class", CLASS[hasGauge ? "chartArcsGaugeTitle" : "chartArcsTitle"])
537
537
  .style("text-anchor", "middle");
538
538
 
539
- if (hasGauge) {
540
- text
541
- .attr("dy", "-0.3em")
542
- .style("font-size", "27px");
543
- }
539
+ hasGauge && text.attr("dy", "-0.3em");
544
540
 
545
541
  setTextValue(text, title, hasGauge ? undefined : [-0.6, 1.35], true);
546
542
  }
@@ -7,12 +7,20 @@ import {getPointer, getRandom, getRectSegList, isNumber} from "../../module/util
7
7
 
8
8
  export default {
9
9
  initBar(): void {
10
- const {$el} = this;
10
+ const {$el, config, state: {clip}} = this;
11
11
 
12
12
  $el.bar = $el.main.select(`.${CLASS.chart}`)
13
13
  // should positioned at the beginning of the shape node to not overlap others
14
14
  .insert("g", ":first-child")
15
15
  .attr("class", CLASS.chartBars);
16
+
17
+ // set clip-path attribute when condition meet
18
+ // https://github.com/naver/billboard.js/issues/2421
19
+ if (config.clipPath === false && (
20
+ config.bar_radius || config.bar_radius_ratio
21
+ )) {
22
+ $el.bar.attr("clip-path", clip.pathXAxis.replace(/#[^)]*/, `#${clip.id}`));
23
+ }
16
24
  },
17
25
 
18
26
  updateTargetsForBar(targets): void {
@@ -122,7 +130,7 @@ export default {
122
130
  const pathRadius = ["", ""];
123
131
  let radius = 0;
124
132
 
125
- if (getRadius && !isGrouped) {
133
+ if (d.value !== 0 && getRadius && !isGrouped) {
126
134
  const index = isRotated ? indexY : indexX;
127
135
  const barW = points[2][index] - points[0][index];
128
136
 
@@ -262,12 +262,10 @@ function getPathBox(
262
262
  * @private
263
263
  */
264
264
  function getPointer(event, element?: Element): number[] {
265
- const touches = event && (event.touches || (event.sourceEvent && event.sourceEvent.touches));
266
- const pointer = event ?
267
- d3Pointer(touches ? touches[0] : event, element) :
268
- [0, 0];
265
+ const touches = event && (event.touches || (event.sourceEvent && event.sourceEvent.touches))?.[0];
266
+ const pointer = d3Pointer(touches || event, element);
269
267
 
270
- return pointer;
268
+ return pointer.map(v => (isNaN(v) ? 0 : v));
271
269
  }
272
270
 
273
271
  /**
@@ -51,15 +51,6 @@
51
51
  shape-rendering: crispEdges;
52
52
  }
53
53
 
54
- .bb-axis-x .tick {}
55
- .bb-axis-x-label {}
56
-
57
- .bb-axis-y .tick {}
58
- .bb-axis-y-label {}
59
-
60
- .bb-axis-y2 .tick {}
61
- .bb-axis-y2-label {}
62
-
63
54
  /*-- Grid --*/
64
55
  .bb-grid {
65
56
  pointer-events: none;
@@ -155,9 +146,6 @@
155
146
  fill-opacity: .1;
156
147
  }
157
148
 
158
- /*-- Select - Drag --*/
159
- .bb-dragarea {}
160
-
161
149
  /*-- Legend --*/
162
150
  .bb-legend-item {
163
151
  font-size: 12px;
@@ -239,7 +227,7 @@
239
227
  font-size: 1.3em;
240
228
  }
241
229
 
242
- .bb-chart-arcs-gauge-title {
230
+ text.bb-chart-arcs-gauge-title {
243
231
  dominant-baseline: middle;
244
232
  font-size: 2.7em;
245
233
  }
@@ -42,7 +42,6 @@ $text-font-size: 11px;
42
42
  .bb-axis-y text, .bb-axis-y2 text {
43
43
  fill: #737373;
44
44
  }
45
- .bb-axis-y2 .tick {}
46
45
 
47
46
  .bb-event-rects {
48
47
  fill-opacity: 1 !important;
@@ -212,10 +211,6 @@ $text-font-size: 11px;
212
211
  font-size: 13px;
213
212
  padding: 2px 8px;
214
213
  text-align:left;
215
- // border-bottom: solid 2px red;
216
- // background-color: #000;
217
- // color: #fff;
218
-
219
214
  border-bottom: solid 2px #ff2d2d;
220
215
  background-color: #0b00b1;
221
216
  color: #fffdfd;
@@ -223,7 +218,6 @@ $text-font-size: 11px;
223
218
 
224
219
  td {
225
220
  padding: 4px 6px;
226
- // background-color:#fff;
227
221
 
228
222
  &:first-child {
229
223
  padding-left: 8px;
@@ -290,7 +284,7 @@ $text-font-size: 11px;
290
284
  font-size: 1.3em;
291
285
  }
292
286
 
293
- .bb-chart-arcs-gauge-title {
287
+ text.bb-chart-arcs-gauge-title {
294
288
  dominant-baseline: middle;
295
289
  font-size: 2.7em;
296
290
  }
@@ -52,7 +52,6 @@ $axis-color: #8c8c8c;
52
52
  .bb-axis-y text, .bb-axis-y2 text {
53
53
  fill: $axis-color;
54
54
  }
55
- .bb-axis-y2 .tick {}
56
55
 
57
56
  .bb-event-rects {
58
57
  fill-opacity: 1 !important;
@@ -303,7 +302,7 @@ rect.bb-circle, use.bb-circle {
303
302
  font-size: 1.3em;
304
303
  }
305
304
 
306
- .bb-chart-arcs-gauge-title {
305
+ text.bb-chart-arcs-gauge-title {
307
306
  dominant-baseline: middle;
308
307
  font-size: 2.7em;
309
308
  }
@@ -47,7 +47,6 @@ $font-family: sans-serif, Arial, "nanumgothic", "Dotum";
47
47
  .bb-axis-y text, .bb-axis-y2 text {
48
48
  fill: #737373;
49
49
  }
50
- .bb-axis-y2 .tick {}
51
50
 
52
51
  .bb-event-rects {
53
52
  fill-opacity: 1 !important;
@@ -283,7 +282,7 @@ rect.bb-circle, use.bb-circle {
283
282
  font-size: 1.3em;
284
283
  }
285
284
 
286
- .bb-chart-arcs-gauge-title {
285
+ text.bb-chart-arcs-gauge-title {
287
286
  dominant-baseline: middle;
288
287
  font-size: 2.7em;
289
288
  }
package/types/types.d.ts CHANGED
@@ -2,9 +2,12 @@
2
2
  * Copyright (c) 2017 ~ present NAVER Corp.
3
3
  * billboard.js project is licensed under the MIT license
4
4
  */
5
- import {Selection} from "d3-selection"; /* tslint:disable-line */
5
+ import {Selection} from "d3-selection";
6
6
 
7
- export type PrimitiveArray = Array<string | boolean | number | Date | null>;
7
+ export type PrimitiveArray = Array<
8
+ string | boolean | number | Date | null |
9
+ {[key: string]: number} | number[]
10
+ >;
8
11
  export type ArrayOrString = string[] | string;
9
12
  export type d3Selection = Selection<any, any, any, any>;
10
13
  export type ChartTypes = "area"