billboard.js 3.14.0 → 3.14.1

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 (46) hide show
  1. package/dist/billboard.css +1 -1
  2. package/dist/billboard.js +13 -12
  3. package/dist/billboard.min.css +1 -1
  4. package/dist/billboard.min.js +9 -9
  5. package/dist/billboard.pkgd.js +1554 -913
  6. package/dist/billboard.pkgd.min.js +18 -18
  7. package/dist/plugin/billboardjs-plugin-bubblecompare.js +3 -3
  8. package/dist/plugin/billboardjs-plugin-bubblecompare.min.js +2 -2
  9. package/dist/plugin/billboardjs-plugin-sparkline.js +3 -3
  10. package/dist/plugin/billboardjs-plugin-sparkline.min.js +2 -2
  11. package/dist/plugin/billboardjs-plugin-stanford.js +3 -3
  12. package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
  13. package/dist/plugin/billboardjs-plugin-tableview.js +3 -3
  14. package/dist/plugin/billboardjs-plugin-tableview.min.js +2 -2
  15. package/dist/plugin/billboardjs-plugin-textoverlap.js +3 -3
  16. package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
  17. package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.js +1607 -967
  18. package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.min.js +5 -5
  19. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.js +1608 -968
  20. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.min.js +7 -7
  21. package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.js +1609 -969
  22. package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.min.js +15 -15
  23. package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.js +1610 -970
  24. package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.min.js +8 -8
  25. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.js +1611 -971
  26. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.min.js +7 -7
  27. package/dist/theme/dark.css +1 -1
  28. package/dist/theme/dark.min.css +1 -1
  29. package/dist/theme/datalab.css +1 -1
  30. package/dist/theme/datalab.min.css +1 -1
  31. package/dist/theme/graph.css +1 -1
  32. package/dist/theme/graph.min.css +1 -1
  33. package/dist/theme/insight.css +1 -1
  34. package/dist/theme/insight.min.css +1 -1
  35. package/dist/theme/modern.css +1 -1
  36. package/dist/theme/modern.min.css +1 -1
  37. package/dist-esm/billboard.js +20 -20
  38. package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +2 -2
  39. package/dist-esm/plugin/billboardjs-plugin-sparkline.js +4 -77
  40. package/dist-esm/plugin/billboardjs-plugin-stanford.js +4 -77
  41. package/dist-esm/plugin/billboardjs-plugin-tableview.js +4 -77
  42. package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +3 -66
  43. package/package.json +20 -20
  44. package/src/ChartInternal/interactions/eventrect.ts +1 -4
  45. package/src/ChartInternal/internals/tooltip.ts +4 -5
  46. package/src/ChartInternal/shape/point.ts +7 -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.14.0
8
+ * @version 3.14.1
9
9
  * @requires billboard.js
10
10
  * @summary billboard.js plugin
11
11
  */
@@ -79,50 +79,6 @@ var doc = win === null || win === void 0 ? void 0 : win.document;
79
79
 
80
80
  var isDefined = function (v) { return typeof v !== "undefined"; };
81
81
  var isObjectType = function (v) { return typeof v === "object"; };
82
- /**
83
- * Check if is array
84
- * @param {Array} arr Data to be checked
85
- * @returns {boolean}
86
- * @private
87
- */
88
- var isArray = function (arr) { return Array.isArray(arr); };
89
- /**
90
- * Check if is object
91
- * @param {object} obj Data to be checked
92
- * @returns {boolean}
93
- * @private
94
- */
95
- var isObject = function (obj) { return obj && !(obj === null || obj === void 0 ? void 0 : obj.nodeType) && isObjectType(obj) && !isArray(obj); };
96
- /**
97
- * Merge object returning new object
98
- * @param {object} target Target object
99
- * @param {object} objectN Source object
100
- * @returns {object} merged target object
101
- * @private
102
- */
103
- function mergeObj(target) {
104
- var objectN = [];
105
- for (var _i = 1; _i < arguments.length; _i++) {
106
- objectN[_i - 1] = arguments[_i];
107
- }
108
- if (!objectN.length || (objectN.length === 1 && !objectN[0])) {
109
- return target;
110
- }
111
- var source = objectN.shift();
112
- if (isObject(target) && isObject(source)) {
113
- Object.keys(source).forEach(function (key) {
114
- var value = source[key];
115
- if (isObject(value)) {
116
- !target[key] && (target[key] = {});
117
- target[key] = mergeObj(target[key], value);
118
- }
119
- else {
120
- target[key] = isArray(value) ? value.concat() : value;
121
- }
122
- });
123
- }
124
- return mergeObj.apply(void 0, __spreadArray([target], objectN, false));
125
- }
126
82
  // emulate event
127
83
  ({
128
84
  mouse: (function () {
@@ -153,26 +109,7 @@ function mergeObj(target) {
153
109
  el.dispatchEvent(mouseEvent);
154
110
  };
155
111
  }
156
- })(),
157
- touch: function (el, eventType, params) {
158
- var touchObj = new Touch(mergeObj({
159
- identifier: Date.now(),
160
- target: el,
161
- radiusX: 2.5,
162
- radiusY: 2.5,
163
- rotationAngle: 10,
164
- force: 0.5
165
- }, params));
166
- el.dispatchEvent(new TouchEvent(eventType, {
167
- cancelable: true,
168
- bubbles: true,
169
- shiftKey: true,
170
- touches: [touchObj],
171
- targetTouches: [],
172
- changedTouches: [touchObj]
173
- }));
174
- }
175
- });
112
+ })()});
176
113
 
177
114
  /**
178
115
  * Load configuration option
@@ -267,7 +204,7 @@ var Plugin = /** @class */ (function () {
267
204
  delete _this[key];
268
205
  });
269
206
  };
270
- Plugin.version = "3.14.0";
207
+ Plugin.version = "3.14.1";
271
208
  return Plugin;
272
209
  }());
273
210
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "billboard.js",
3
- "version": "3.14.0",
3
+ "version": "3.14.1",
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",
@@ -104,7 +104,7 @@
104
104
  "devDependencies": {
105
105
  "@commitlint/cli": "^19.5.0",
106
106
  "@commitlint/config-conventional": "^19.5.0",
107
- "@eslint/js": "^9.13.0",
107
+ "@eslint/js": "^9.14.0",
108
108
  "@rollup/plugin-node-resolve": "^15.3.0",
109
109
  "@rollup/plugin-replace": "^6.0.1",
110
110
  "@rollup/plugin-typescript": "^12.1.1",
@@ -118,13 +118,13 @@
118
118
  "@testing-library/react": "^16.0.1",
119
119
  "@types/d3": "^7.4.3",
120
120
  "@types/sinon": "^17.0.3",
121
- "@vitest/browser": "^2.1.3",
122
- "@vitest/coverage-istanbul": "^2.1.3",
123
- "@vitest/ui": "^2.1.3",
121
+ "@vitest/browser": "^2.1.4",
122
+ "@vitest/coverage-istanbul": "^2.1.4",
123
+ "@vitest/ui": "^2.1.4",
124
124
  "better-docs": "^2.7.3",
125
125
  "clean-webpack-plugin": "^4.0.0",
126
126
  "cloc": "2.2.0-cloc",
127
- "core-js": "^3.38.1",
127
+ "core-js": "^3.39.0",
128
128
  "coveralls": "^3.1.1",
129
129
  "cross-env": "^7.0.3",
130
130
  "css-loader": "^7.1.2",
@@ -133,38 +133,38 @@
133
133
  "d3-format": "^3.1.0",
134
134
  "d3-polygon": "^3.0.1",
135
135
  "docdash": "^2.0.2",
136
- "dprint": "^0.47.4",
136
+ "dprint": "^0.47.5",
137
137
  "esbuild-loader": "^4.2.2",
138
- "eslint": "^9.13.0",
138
+ "eslint": "^9.14.0",
139
139
  "eslint-plugin-import": "^2.31.0",
140
- "eslint-plugin-jsdoc": "^50.4.3",
140
+ "eslint-plugin-jsdoc": "^50.5.0",
141
141
  "husky": "^9.1.6",
142
142
  "jsdoc": "^4.0.4",
143
143
  "lint-staged": "^15.2.10",
144
- "mini-css-extract-plugin": "^2.9.1",
145
- "playwright": "^1.48.1",
144
+ "mini-css-extract-plugin": "^2.9.2",
145
+ "playwright": "^1.48.2",
146
146
  "regenerator-runtime": "^0.14.1",
147
- "rollup": "^4.24.0",
147
+ "rollup": "^4.26.0",
148
148
  "rollup-plugin-delete": "^2.1.0",
149
- "sass": "^1.80.3",
150
- "sass-loader": "^16.0.2",
151
- "semantic-release": "^24.1.3",
149
+ "sass": "^1.80.7",
150
+ "sass-loader": "^16.0.3",
151
+ "semantic-release": "^24.2.0",
152
152
  "simulant": "^0.2.2",
153
153
  "sinon": "^19.0.2",
154
154
  "string-replace-loader": "^3.1.0",
155
155
  "style-loader": "^4.0.0",
156
- "tslib": "^2.8.0",
156
+ "tslib": "^2.8.1",
157
157
  "typescript": "^5.6.3",
158
- "typescript-eslint": "^8.11.0",
159
- "vitest": "^2.1.3",
160
- "webpack": "^5.95.0",
158
+ "typescript-eslint": "^8.14.0",
159
+ "vitest": "^2.1.4",
160
+ "webpack": "^5.96.1",
161
161
  "webpack-bundle-analyzer": "^4.10.2",
162
162
  "webpack-clean": "^1.2.5",
163
163
  "webpack-cli": "^5.1.4",
164
164
  "webpack-common-shake": "^2.1.0",
165
165
  "webpack-dev-server": "^5.1.0",
166
166
  "webpack-merge": "^6.0.1",
167
- "webpackbar": "^6.0.1",
167
+ "webpackbar": "^7.0.0",
168
168
  "write-file-webpack-plugin": "^4.5.1"
169
169
  },
170
170
  "packageManager": "yarn@4.3.1"
@@ -671,7 +671,6 @@ export default {
671
671
  clickHandlerForMultipleXS(ctx): void {
672
672
  const $$ = ctx;
673
673
  const {config, state} = $$;
674
- const pointSensitivity = config.point_sensitivity;
675
674
  const targetsToShow = $$.filterTargetsToShow($$.data.targets);
676
675
 
677
676
  if ($$.hasArcType(targetsToShow)) {
@@ -680,9 +679,7 @@ export default {
680
679
 
681
680
  const mouse = getPointer(state.event, this);
682
681
  const closest = $$.findClosestFromTargets(targetsToShow, mouse);
683
- const sensitivity = pointSensitivity === "radius" ? closest?.r : (
684
- isFunction(pointSensitivity) ? closest && pointSensitivity(closest) : pointSensitivity
685
- );
682
+ const sensitivity = $$.getPointSensitivity(closest);
686
683
 
687
684
  if (!closest) {
688
685
  return;
@@ -657,14 +657,13 @@ export default {
657
657
  $$.setExpand(idx, null, true);
658
658
  }
659
659
  }
660
-
661
- // for Arc & Treemap
662
- } else {
660
+ } else { // for Arc & Treemap
663
661
  const {clientX, clientY} = event;
664
662
 
665
663
  setTimeout(() => {
666
- let target = document.elementFromPoint(clientX, clientY);
667
- const data = d3Select(target).datum() as IArcData;
664
+ let target = [clientX, clientY].every(Number.isFinite) &&
665
+ document.elementFromPoint(clientX, clientY);
666
+ const data = target && d3Select(target).datum() as IArcData;
668
667
 
669
668
  if (data) {
670
669
  const d = $$.hasArcType() ?
@@ -374,13 +374,12 @@ export default {
374
374
  },
375
375
 
376
376
  isWithinCircle(node: SVGElement, r?: number): boolean {
377
- const {config, state} = this;
377
+ const {state} = this;
378
378
  const mouse = getPointer(state.event, node);
379
379
  const element = d3Select(node);
380
380
  const prefix = this.isCirclePoint(node) ? "c" : "";
381
- const sensitivity = config.point_sensitivity === "radius" ?
382
- node.getAttribute("r") :
383
- config.point_sensitivity;
381
+ const pointSensitivity = this.getPointSensitivity(element?.datum());
382
+
384
383
  let cx = +element.attr(`${prefix}x`);
385
384
  let cy = +element.attr(`${prefix}y`);
386
385
 
@@ -394,7 +393,7 @@ export default {
394
393
 
395
394
  return Math.sqrt(
396
395
  Math.pow(cx - mouse[0], 2) + Math.pow(cy - mouse[1], 2)
397
- ) < (r || sensitivity);
396
+ ) < (r || pointSensitivity);
398
397
  },
399
398
 
400
399
  /**
@@ -406,7 +405,9 @@ export default {
406
405
  const $$ = this;
407
406
  let sensitivity = $$.config.point_sensitivity;
408
407
 
409
- if (isFunction(sensitivity)) {
408
+ if (!d) {
409
+ return sensitivity;
410
+ } else if (isFunction(sensitivity)) {
410
411
  sensitivity = sensitivity.call($$.api, d);
411
412
  } else if (sensitivity === "radius") {
412
413
  sensitivity = d.r;