billboard.js 3.17.3 → 3.17.4

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 (44) hide show
  1. package/dist/billboard.css +1 -1
  2. package/dist/billboard.js +15 -7
  3. package/dist/billboard.min.css +1 -1
  4. package/dist/billboard.min.js +9 -9
  5. package/dist/billboard.pkgd.js +23 -15
  6. package/dist/billboard.pkgd.min.js +20 -20
  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 +15 -7
  10. package/dist/plugin/billboardjs-plugin-sparkline.min.js +3 -3
  11. package/dist/plugin/billboardjs-plugin-stanford.js +15 -7
  12. package/dist/plugin/billboardjs-plugin-stanford.min.js +3 -3
  13. package/dist/plugin/billboardjs-plugin-tableview.js +15 -7
  14. package/dist/plugin/billboardjs-plugin-tableview.min.js +3 -3
  15. package/dist/plugin/billboardjs-plugin-textoverlap.js +15 -7
  16. package/dist/plugin/billboardjs-plugin-textoverlap.min.js +3 -3
  17. package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.js +2 -2
  18. package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.min.js +2 -2
  19. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.js +15 -7
  20. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.min.js +8 -8
  21. package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.js +23 -15
  22. package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.min.js +10 -10
  23. package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.js +15 -7
  24. package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.min.js +10 -10
  25. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.js +15 -7
  26. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.min.js +3 -3
  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 +22 -12
  38. package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +2 -2
  39. package/dist-esm/plugin/billboardjs-plugin-sparkline.js +2 -2
  40. package/dist-esm/plugin/billboardjs-plugin-stanford.js +2 -2
  41. package/dist-esm/plugin/billboardjs-plugin-tableview.js +21 -11
  42. package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +2 -2
  43. package/package.json +1 -1
  44. package/src/module/util.ts +22 -11
@@ -5,7 +5,7 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.17.3
8
+ * @version 3.17.4
9
9
  * @requires billboard.js
10
10
  * @summary billboard.js plugin
11
11
  */
@@ -23528,8 +23528,8 @@ FormatSpecifier.prototype.toString = function() {
23528
23528
  return Math.abs(x = Math.round(x)) >= 1e21 ? x.toLocaleString("en").replace(/,/g, "") : x.toString(10);
23529
23529
  }
23530
23530
  function formatDecimalParts(x, p) {
23531
- if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf("e")) < 0) return null;
23532
- var i, coefficient = x.slice(0, i);
23531
+ if (!isFinite(x) || x === 0) return null;
23532
+ var i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf("e"), coefficient = x.slice(0, i);
23533
23533
  return [
23534
23534
  coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,
23535
23535
  +x.slice(i + 1)
@@ -23596,7 +23596,7 @@ function formatDecimalParts(x, p) {
23596
23596
  var prefixExponent;
23597
23597
  /* harmony default export */ function formatPrefixAuto(x, p) {
23598
23598
  var d = formatDecimalParts(x, p);
23599
- if (!d) return x + "";
23599
+ if (!d) return prefixExponent = void 0, x.toPrecision(p);
23600
23600
  var coefficient = d[0], exponent = d[1], i = exponent - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3) + 1, n = coefficient.length;
23601
23601
  return i === n ? coefficient : i > n ? coefficient + new Array(i - n + 1).join("0") : i > 0 ? coefficient.slice(0, i) + "." + coefficient.slice(i) : "0." + new Array(1 - i).join("0") + formatDecimalParts(x, Math.max(0, p + i - 1))[0];
23602
23602
  }
@@ -23647,13 +23647,13 @@ var prefixExponent;
23647
23647
  var map = Array.prototype.map, prefixes = ["y", "z", "a", "f", "p", "n", "\xB5", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y"];
23648
23648
  /* harmony default export */ function locale(locale) {
23649
23649
  var group = locale.grouping === void 0 || locale.thousands === void 0 ? src_identity : formatGroup(map.call(locale.grouping, Number), locale.thousands + ""), currencyPrefix = locale.currency === void 0 ? "" : locale.currency[0] + "", currencySuffix = locale.currency === void 0 ? "" : locale.currency[1] + "", decimal = locale.decimal === void 0 ? "." : locale.decimal + "", numerals = locale.numerals === void 0 ? src_identity : formatNumerals(map.call(locale.numerals, String)), percent = locale.percent === void 0 ? "%" : locale.percent + "", minus = locale.minus === void 0 ? "\u2212" : locale.minus + "", nan = locale.nan === void 0 ? "NaN" : locale.nan + "";
23650
- function newFormat(specifier) {
23650
+ function newFormat(specifier, options) {
23651
23651
  specifier = formatSpecifier(specifier);
23652
23652
  var fill = specifier.fill, align = specifier.align, sign = specifier.sign, symbol = specifier.symbol, zero = specifier.zero, width = specifier.width, comma = specifier.comma, precision = specifier.precision, trim = specifier.trim, type = specifier.type;
23653
23653
  if (type === "n") comma = true, type = "g";
23654
23654
  else if (!formatTypes[type]) precision === void 0 && (precision = 12), trim = true, type = "g";
23655
23655
  if (zero || fill === "0" && align === "=") zero = true, fill = "0", align = "=";
23656
- var prefix = symbol === "$" ? currencyPrefix : symbol === "#" && /[boxX]/.test(type) ? "0" + type.toLowerCase() : "", suffix = symbol === "$" ? currencySuffix : /[%p]/.test(type) ? percent : "";
23656
+ var prefix = ((options == null ? void 0 : options.prefix) !== void 0 ? options.prefix : "") + (symbol === "$" ? currencyPrefix : symbol === "#" && /[boxX]/.test(type) ? "0" + type.toLowerCase() : ""), suffix = (symbol === "$" ? currencySuffix : /[%p]/.test(type) ? percent : "") + ((options == null ? void 0 : options.suffix) !== void 0 ? options.suffix : "");
23657
23657
  var formatType = formatTypes[type], maybeSuffix = /[defgprs%]/.test(type);
23658
23658
  precision = precision === void 0 ? 6 : /[gprs]/.test(type) ? Math.max(1, Math.min(21, precision)) : Math.max(0, Math.min(20, precision));
23659
23659
  function format(value) {
@@ -23668,7 +23668,7 @@ var map = Array.prototype.map, prefixes = ["y", "z", "a", "f", "p", "n", "\xB5",
23668
23668
  if (trim) value = formatTrim(value);
23669
23669
  if (valueNegative && +value === 0 && sign !== "+") valueNegative = false;
23670
23670
  valuePrefix = (valueNegative ? sign === "(" ? sign : minus : sign === "-" || sign === "(" ? "" : sign) + valuePrefix;
23671
- valueSuffix = (type === "s" ? prefixes[8 + prefixExponent / 3] : "") + valueSuffix + (valueNegative && sign === "(" ? ")" : "");
23671
+ valueSuffix = (type === "s" && !isNaN(value) && prefixExponent !== void 0 ? prefixes[8 + prefixExponent / 3] : "") + valueSuffix + (valueNegative && sign === "(" ? ")" : "");
23672
23672
  if (maybeSuffix) {
23673
23673
  i = -1, n = value.length;
23674
23674
  while (++i < n) {
@@ -23705,9 +23705,9 @@ var map = Array.prototype.map, prefixes = ["y", "z", "a", "f", "p", "n", "\xB5",
23705
23705
  return format;
23706
23706
  }
23707
23707
  function formatPrefix(specifier, value) {
23708
- var f = newFormat((specifier = formatSpecifier(specifier), specifier.type = "f", specifier)), e = Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3, k = Math.pow(10, -e), prefix = prefixes[8 + e / 3];
23708
+ var e = Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3, k = Math.pow(10, -e), f = newFormat((specifier = formatSpecifier(specifier), specifier.type = "f", specifier), { suffix: prefixes[8 + e / 3] });
23709
23709
  return function(value2) {
23710
- return f(k * value2) + prefix;
23710
+ return f(k * value2);
23711
23711
  };
23712
23712
  }
23713
23713
  return {
@@ -26862,20 +26862,28 @@ function endall(transition, cb) {
26862
26862
  transition.call(end);
26863
26863
  }
26864
26864
  }
26865
- const dangerousTags = "script|iframe|object|embed|form|input|button|textarea|select|style|link|meta|base|svg|math";
26865
+ const DANGEROUS_TAGS = "script|iframe|object|embed|form|input|button|textarea|select|style|link|meta|base|math|isindex";
26866
26866
  const sanitizeRx = {
26867
26867
  tags: new RegExp(
26868
- `<(${dangerousTags})[\\s\\S]*?>[\\s\\S]*?<\\/\\1>|<(${dangerousTags})[^>]*\\/?>`,
26868
+ `<(${DANGEROUS_TAGS})\\b[\\s\\S]*?>([\\s\\S]*?<\\/(${DANGEROUS_TAGS})\\s*>)?`,
26869
26869
  "gi"
26870
26870
  ),
26871
- eventHandlers: /\s*on\w+\s*=\s*["'][^"']*["']|\s*on\w+\s*=\s*[^\s>]+/gi,
26872
- dangerousUrls: /(href|src|action|formaction|xlink:href)\s*=\s*["']?\s*(javascript|data|vbscript):[^"'\s>]*/gi
26871
+ // Handles: whitespace, slash, quotes before event handlers (e.g., <img/onerror=...>, <img src="x"onerror=...>)
26872
+ eventHandlers: /[\s/"']+on\w+\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/gi,
26873
+ // Handles: javascript/data/vbscript URIs with optional whitespace/newlines between protocol and colon
26874
+ dangerousURIs: /(href|src|action|xlink:href)\s*=\s*["']?\s*(javascript|data|vbscript)\s*:/gi
26873
26875
  };
26874
26876
  function sanitize(str) {
26875
26877
  if (!isString(str) || !str || str.indexOf("<") === -1) {
26876
26878
  return str;
26877
26879
  }
26878
- return str.replace(sanitizeRx.tags, "").replace(sanitizeRx.eventHandlers, "").replace(sanitizeRx.dangerousUrls, '$1=""');
26880
+ let result = str;
26881
+ let prev;
26882
+ do {
26883
+ prev = result;
26884
+ result = result.replace(sanitizeRx.tags, "").replace(sanitizeRx.eventHandlers, "").replace(sanitizeRx.dangerousURIs, '$1=""');
26885
+ } while (result !== prev);
26886
+ return result;
26879
26887
  }
26880
26888
  function setTextValue(node, text, dy = [-1, 1], toMiddle = false) {
26881
26889
  if (!node || !isString(text)) {
@@ -27347,7 +27355,7 @@ class Plugin {
27347
27355
  });
27348
27356
  }
27349
27357
  }
27350
- __publicField(Plugin, "version", "3.17.3");
27358
+ __publicField(Plugin, "version", "3.17.4");
27351
27359
 
27352
27360
  ;// ./node_modules/d3-axis/src/identity.js
27353
27361
  /* harmony default export */ function d3_axis_src_identity(x) {