billboard.js 3.11.1 → 3.11.3

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 (59) hide show
  1. package/README.md +1 -1
  2. package/dist/billboard.css +1 -1
  3. package/dist/billboard.js +209 -124
  4. package/dist/billboard.min.css +1 -1
  5. package/dist/billboard.min.js +2 -2
  6. package/dist/billboard.pkgd.js +209 -124
  7. package/dist/billboard.pkgd.min.js +2 -2
  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.js +2 -2
  11. package/dist/plugin/billboardjs-plugin-sparkline.min.js +2 -2
  12. package/dist/plugin/billboardjs-plugin-stanford.js +2 -2
  13. package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
  14. package/dist/plugin/billboardjs-plugin-tableview.js +2 -2
  15. package/dist/plugin/billboardjs-plugin-tableview.min.js +2 -2
  16. package/dist/plugin/billboardjs-plugin-textoverlap.js +2 -2
  17. package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
  18. package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.js +2 -2
  19. package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.min.js +2 -2
  20. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.js +2 -2
  21. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.min.js +2 -2
  22. package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.js +2 -2
  23. package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.min.js +2 -2
  24. package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.js +2 -2
  25. package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.min.js +2 -2
  26. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.js +2 -2
  27. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.min.js +2 -2
  28. package/dist/theme/dark.css +1 -1
  29. package/dist/theme/dark.min.css +1 -1
  30. package/dist/theme/datalab.css +1 -1
  31. package/dist/theme/datalab.min.css +1 -1
  32. package/dist/theme/graph.css +1 -1
  33. package/dist/theme/graph.min.css +1 -1
  34. package/dist/theme/insight.css +1 -1
  35. package/dist/theme/insight.min.css +1 -1
  36. package/dist/theme/modern.css +1 -1
  37. package/dist/theme/modern.min.css +1 -1
  38. package/dist-esm/billboard.js +182 -132
  39. package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +2 -2
  40. package/dist-esm/plugin/billboardjs-plugin-sparkline.js +2 -2
  41. package/dist-esm/plugin/billboardjs-plugin-stanford.js +2 -2
  42. package/dist-esm/plugin/billboardjs-plugin-tableview.js +2 -2
  43. package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +2 -2
  44. package/package.json +17 -17
  45. package/src/ChartInternal/ChartInternal.ts +2 -2
  46. package/src/ChartInternal/data/IData.ts +2 -2
  47. package/src/ChartInternal/data/data.ts +1 -1
  48. package/src/ChartInternal/data/load.ts +7 -1
  49. package/src/ChartInternal/internals/clip.ts +1 -6
  50. package/src/ChartInternal/internals/legend.ts +6 -5
  51. package/src/ChartInternal/internals/redraw.ts +2 -1
  52. package/src/ChartInternal/internals/tooltip.ts +10 -6
  53. package/src/ChartInternal/shape/point.common.ts +134 -0
  54. package/src/ChartInternal/shape/point.ts +3 -95
  55. package/src/ChartInternal/shape/shape.ts +1 -1
  56. package/src/config/Options/common/legend.ts +1 -1
  57. package/src/config/Store/State.ts +1 -1
  58. package/src/config/resolver/axis.ts +4 -4
  59. package/src/config/resolver/shape.ts +22 -10
package/README.md CHANGED
@@ -40,7 +40,7 @@ If you have any questions, checkout the previous posts or create a new one at:
40
40
  - [Issue with 'question' label](https://github.com/naver/billboard.js/issues?utf8=%E2%9C%93&q=label%3Aquestion)
41
41
 
42
42
  ## Supported chart types
43
- <img src="https://naver.github.io/billboard.js/img/chart-types.png?v=11" width=800>
43
+ <img src="https://naver.github.io/billboard.js/img/chart-types.png?v=13" width=800>
44
44
 
45
45
  ## Download and Installation
46
46
 
@@ -5,7 +5,7 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.11.1
8
+ * @version 3.11.3
9
9
  */
10
10
  /*-- Chart --*/
11
11
  .bb svg {
package/dist/billboard.js CHANGED
@@ -5,7 +5,7 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.11.1
8
+ * @version 3.11.3
9
9
  */
10
10
  (function webpackUniversalModuleDefinition(root, factory) {
11
11
  if(typeof exports === 'object' && typeof module === 'object')
@@ -3273,7 +3273,7 @@ var data_this = undefined;
3273
3273
  * - rectangle
3274
3274
  * @property {boolean} [legend.format] Set formatter function for legend text.
3275
3275
  * The argument:<br>
3276
- * - `id`: legend text(which is data id) value
3276
+ * - `id`: legend text value. When `data.names` is specified, will pass from it, otherwise will pass data id.
3277
3277
  * @property {boolean} [legend.tooltip=false] Show full legend text value using system tooltip(via `<title>` element).
3278
3278
  * @property {boolean} [legend.usePoint=false] Whether to use custom points in legend.
3279
3279
  * @see [Demo: format](https://naver.github.io/billboard.js/demo/#Legend.LegendFormat)
@@ -5687,7 +5687,8 @@ function callDone(fn, resizeAfter) {
5687
5687
  const $$ = this,
5688
5688
  state = $$.state,
5689
5689
  $el = $$.$el,
5690
- $T = $$.$T;
5690
+ $T = $$.$T,
5691
+ hasLegendDefsPoint = !!($$.hasLegendDefsPoint != null && $$.hasLegendDefsPoint());
5691
5692
  let done = customDoneCb,
5692
5693
  targetIds = rawTargetIds;
5693
5694
  // reset internally cached data
@@ -5715,14 +5716,17 @@ function callDone(fn, resizeAfter) {
5715
5716
  }.bind(this)));
5716
5717
  $T(targets).style("opacity", "0").remove().call(endall, done);
5717
5718
  targetIds.forEach(function (id) {
5718
- var _this4 = this;
5719
+ var _this4 = this,
5720
+ _$el$defs;
5719
5721
  _newArrowCheck(this, _this3);
5722
+ const suffixId = $$.getTargetSelectorSuffix(id);
5723
+
5720
5724
  // Reset fadein for future load
5721
5725
  state.withoutFadeIn[id] = !1;
5722
5726
 
5723
5727
  // Remove target's elements
5724
5728
  if ($el.legend) {
5725
- $el.legend.selectAll("." + $LEGEND.legendItem + $$.getTargetSelectorSuffix(id)).remove();
5729
+ $el.legend.selectAll("." + $LEGEND.legendItem + suffixId).remove();
5726
5730
  }
5727
5731
 
5728
5732
  // Remove target
@@ -5730,6 +5734,9 @@ function callDone(fn, resizeAfter) {
5730
5734
  _newArrowCheck(this, _this4);
5731
5735
  return t.id !== id;
5732
5736
  }.bind(this));
5737
+
5738
+ // Remove custom point def element
5739
+ hasLegendDefsPoint && ((_$el$defs = $el.defs) == null ? void 0 : _$el$defs.select("#" + $$.getDefsPointId(suffixId)).remove());
5733
5740
  }.bind(this));
5734
5741
 
5735
5742
  // since treemap uses different data types, it needs to be transformed
@@ -6960,13 +6967,17 @@ function getLegendColor(id) {
6960
6967
  /**
6961
6968
  * Get formatted text value
6962
6969
  * @param {string} id Legend text id
6970
+ * @param {boolean} formatted Whether or not to format the text
6963
6971
  * @returns {string} Formatted legend text
6964
6972
  */
6965
- function getFormattedText(id) {
6973
+ function getFormattedText(id, formatted) {
6966
6974
  var _config$data_names$id;
6975
+ if (formatted === void 0) {
6976
+ formatted = !0;
6977
+ }
6967
6978
  const config = this.config;
6968
6979
  let text = (_config$data_names$id = config.data_names[id]) != null ? _config$data_names$id : id;
6969
- if (isFunction(config.legend_format)) {
6980
+ if (formatted && isFunction(config.legend_format)) {
6970
6981
  text = config.legend_format(text);
6971
6982
  }
6972
6983
  return text;
@@ -7471,10 +7482,13 @@ function getFormattedText(id) {
7471
7482
  if (config.legend_tooltip) {
7472
7483
  legend.selectAll("title").data(targetIdz).text(function (id) {
7473
7484
  _newArrowCheck(this, _this4);
7474
- return id;
7485
+ return getFormattedText.bind($$)(id, !1);
7475
7486
  }.bind(this));
7476
7487
  }
7477
- const texts = legend.selectAll("text").data(targetIdz).text(getFormattedText.bind($$)) // MEMO: needed for update
7488
+ const texts = legend.selectAll("text").data(targetIdz).text(function (id) {
7489
+ _newArrowCheck(this, _this4);
7490
+ return getFormattedText.bind($$)(id);
7491
+ }.bind(this)) // MEMO: needed for update
7478
7492
  .each(function (id, i) {
7479
7493
  updatePositions(this, id, i);
7480
7494
  });
@@ -7615,7 +7629,10 @@ function getFormattedText(id) {
7615
7629
  return id;
7616
7630
  }.bind(this));
7617
7631
  }
7618
- l.append("text").text(getFormattedText.bind($$)).each(function (id, i) {
7632
+ l.append("text").text(function (id) {
7633
+ _newArrowCheck(this, _this6);
7634
+ return getFormattedText.bind($$)(id);
7635
+ }.bind(this)).each(function (id, i) {
7619
7636
  updatePositions(this, id, i);
7620
7637
  }).style("pointer-events", $$.getStylePropValue("none")).attr("x", isLegendRightOrInset ? posFn.xText : -200).attr("y", isLegendRightOrInset ? -200 : posFn.yText);
7621
7638
  l.append("rect").attr("class", $LEGEND.legendItemEvent).style("fill-opacity", $$.getStylePropValue("0")).attr("x", isLegendRightOrInset ? posFn.xRect : -200).attr("y", isLegendRightOrInset ? -200 : posFn.yRect);
@@ -7805,10 +7822,10 @@ var external_commonjs_d3_transition_commonjs2_d3_transition_amd_d3_transition_ro
7805
7822
  // treemap
7806
7823
  treemap && $$.updateTreemap(durationForExit);
7807
7824
  }
7808
-
7809
- // @TODO: Axis & Radar type
7810
7825
  if (!state.resizing && !treemap && ($$.hasPointType() || state.hasRadar)) {
7811
7826
  $$.updateCircle();
7827
+ } else if ($$.hasLegendDefsPoint != null && $$.hasLegendDefsPoint()) {
7828
+ $$.data.targets.forEach($$.point("create", this));
7812
7829
  }
7813
7830
 
7814
7831
  // text
@@ -8598,6 +8615,7 @@ function getGroupedDataPointsFn(d) {
8598
8615
  },
8599
8616
  getBarW: function getBarW(type, axis, targetsNum) {
8600
8617
  var _config$data_groups,
8618
+ _$$$getZoomTransform,
8601
8619
  _config$axis_x_min,
8602
8620
  _config$axis_x_max,
8603
8621
  _this11 = this;
@@ -8608,8 +8626,10 @@ function getGroupedDataPointsFn(d) {
8608
8626
  maxDataCount = $$.getMaxDataCount(),
8609
8627
  isGrouped = type === "bar" && ((_config$data_groups = config.data_groups) == null ? void 0 : _config$data_groups.length),
8610
8628
  configName = type + "_width",
8611
- _$$$getZoomTransform = $$.getZoomTransform(),
8612
- k = _$$$getZoomTransform.k,
8629
+ _ref2 = (_$$$getZoomTransform = $$.getZoomTransform == null ? void 0 : $$.getZoomTransform()) != null ? _$$$getZoomTransform : {
8630
+ k: 1
8631
+ },
8632
+ k = _ref2.k,
8613
8633
  xMinMax = [(_config$axis_x_min = config.axis_x_min) != null ? _config$axis_x_min : org.xDomain[0], (_config$axis_x_max = config.axis_x_max) != null ? _config$axis_x_max : org.xDomain[1]].map($$.axis.isTimeSeries() ? parseDate.bind($$) : Number);
8614
8634
  let tickInterval = axis.tickInterval(maxDataCount);
8615
8635
  if (scale.zoom && !$$.axis.isCategorized() && k > 1) {
@@ -10071,11 +10091,11 @@ function getTextXPos(pos, width) {
10071
10091
  width = _state.width,
10072
10092
  height = _state.height,
10073
10093
  current = _state.current,
10094
+ hasRadar = _state.hasRadar,
10095
+ hasTreemap = _state.hasTreemap,
10074
10096
  isLegendRight = _state.isLegendRight,
10075
10097
  inputType = _state.inputType,
10076
10098
  hasGauge = $$.hasType("gauge") && !config.gauge_fullCircle,
10077
- hasTreemap = state.hasTreemap,
10078
- hasRadar = state.hasRadar,
10079
10099
  isRotated = config.axis_rotated,
10080
10100
  hasArcType = $$.hasArcType(),
10081
10101
  svgLeft = $$.getSvgLeft(!0);
@@ -10089,10 +10109,14 @@ function getTextXPos(pos, width) {
10089
10109
  x += x >= width / 2 ? 15 : -(tWidth + 15);
10090
10110
  y += 15;
10091
10111
  } else if (hasArcType) {
10092
- if (!(inputType === "touch")) {
10093
- var _$$$getTitlePadding;
10112
+ if (inputType !== "touch") {
10113
+ var _$$$getTitlePadding, _config$arc_rangeText;
10114
+ let titlePadding = (_$$$getTitlePadding = $$.getTitlePadding == null ? void 0 : $$.getTitlePadding()) != null ? _$$$getTitlePadding : 0;
10115
+ if (titlePadding && hasGauge && (_config$arc_rangeText = config.arc_rangeText_values) != null && _config$arc_rangeText.length) {
10116
+ titlePadding += 10;
10117
+ }
10094
10118
  x += (width - (isLegendRight ? $$.getLegendWidth() : 0)) / 2;
10095
- y += (hasGauge ? height : height / 2 + tHeight) + ((_$$$getTitlePadding = $$.getTitlePadding == null ? void 0 : $$.getTitlePadding()) != null ? _$$$getTitlePadding : 0);
10119
+ y += (hasGauge ? height : height / 2 + tHeight) + titlePadding;
10096
10120
  }
10097
10121
  } else if (hasTreemap) {
10098
10122
  y += tHeight;
@@ -10914,7 +10938,7 @@ let ChartInternal = /*#__PURE__*/function () {
10914
10938
  config.axis_y2_show = !1;
10915
10939
  config.subchart_show = !1;
10916
10940
  }
10917
- if ($$.hasPointType()) {
10941
+ if ($$.hasPointType() || $$.hasLegendDefsPoint != null && $$.hasLegendDefsPoint()) {
10918
10942
  $$.point = $$.generatePoint();
10919
10943
  }
10920
10944
  if (state.hasAxis) {
@@ -11021,7 +11045,7 @@ let ChartInternal = /*#__PURE__*/function () {
11021
11045
 
11022
11046
  // Define defs
11023
11047
  const hasColorPatterns = isFunction(config.color_tiles) && $$.patterns;
11024
- if (hasAxis || hasColorPatterns || hasPolar || hasTreemap || config.data_labels_backgroundColors) {
11048
+ if (hasAxis || hasColorPatterns || hasPolar || hasTreemap || config.data_labels_backgroundColors || $$.hasLegendDefsPoint != null && $$.hasLegendDefsPoint()) {
11025
11049
  $el.defs = $el.svg.append("defs");
11026
11050
  if (hasAxis) {
11027
11051
  ["id", "idXAxis", "idYAxis", "idGrid"].forEach(function (v) {
@@ -16324,8 +16348,7 @@ var external_commonjs_d3_ease_commonjs2_d3_ease_amd_d3_ease_root_d3_ = __webpack
16324
16348
  if (!config.clipPath && /-clip$/.test(id) || !config.axis_x_clipPath && /-clip-xaxis$/.test(id) || !config.axis_y_clipPath && /-clip-yaxis$/.test(id)) {
16325
16349
  return null;
16326
16350
  }
16327
- const isIE9 = win.navigator ? win.navigator.appVersion.toLowerCase().indexOf("msie 9.") >= 0 : !1;
16328
- return "url(" + (isIE9 ? "" : browser_doc.URL.split("#")[0]) + "#" + id + ")";
16351
+ return "url(#" + id + ")";
16329
16352
  },
16330
16353
  appendClip: function appendClip(parent, id) {
16331
16354
  id && parent.append("clipPath").attr("id", id).append("rect");
@@ -19031,8 +19054,20 @@ function axis_objectSpread(e) { for (var r = 1, t; r < arguments.length; r++) {
19031
19054
 
19032
19055
 
19033
19056
  const api = [api_axis, api_category, flow, api_grid, group, api_regions, x];
19034
- const internal = [Axis, clip, eventrect, interactions_flow, internals_grid, region, size_axis];
19035
- const options = [data_axis, axis_axis, common_grid];
19057
+ const internal = {
19058
+ axis: Axis,
19059
+ clip: clip,
19060
+ eventrect: eventrect,
19061
+ flow: interactions_flow,
19062
+ grid: internals_grid,
19063
+ region: region,
19064
+ sizeAxis: size_axis
19065
+ };
19066
+ const options = {
19067
+ optDataAxis: data_axis,
19068
+ optAxis: axis_axis,
19069
+ optGrid: common_grid
19070
+ };
19036
19071
  // EXTERNAL MODULE: external {"commonjs":"d3-interpolate","commonjs2":"d3-interpolate","amd":"d3-interpolate","root":"d3"}
19037
19072
  var external_commonjs_d3_interpolate_commonjs2_d3_interpolate_amd_d3_interpolate_root_d3_ = __webpack_require__(12);
19038
19073
  ;// CONCATENATED MODULE: ./src/ChartInternal/shape/arc.ts
@@ -21205,6 +21240,130 @@ function candlestick_objectSpread(e) { for (var r = 1, t; r < arguments.length;
21205
21240
  return linePoint === !0 || isArray(linePoint) && linePoint.indexOf(d.id) !== -1;
21206
21241
  }
21207
21242
  });
21243
+ ;// CONCATENATED MODULE: ./src/ChartInternal/shape/point.common.ts
21244
+
21245
+ /**
21246
+ * Copyright (c) 2017 ~ present NAVER Corp.
21247
+ * billboard.js project is licensed under the MIT license
21248
+ */
21249
+
21250
+
21251
+
21252
+
21253
+ /**
21254
+ * Check if point draw methods are valid
21255
+ * @param {string} point point type
21256
+ * @returns {boolean}
21257
+ * @private
21258
+ */
21259
+ function hasValidPointDrawMethods(point) {
21260
+ return isObjectType(point) && isFunction(point.create) && isFunction(point.update);
21261
+ }
21262
+
21263
+ /**
21264
+ * Insert point info defs element
21265
+ * @param {string} point Point element
21266
+ * @param {string} id Point id
21267
+ * @private
21268
+ */
21269
+ function insertPointInfoDefs(point, id) {
21270
+ var _this = this,
21271
+ _node$childNodes;
21272
+ const $$ = this,
21273
+ copyAttr = function (from, target) {
21274
+ _newArrowCheck(this, _this);
21275
+ const attribs = from.attributes;
21276
+ for (let i = 0, name; name = attribs[i]; i++) {
21277
+ name = name.name;
21278
+ target.setAttribute(name, from.getAttribute(name));
21279
+ }
21280
+ }.bind(this),
21281
+ doc = new DOMParser().parseFromString(point, "image/svg+xml"),
21282
+ node = doc.documentElement,
21283
+ clone = browser_doc.createElementNS(external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.namespaces.svg, node.nodeName.toLowerCase());
21284
+ clone.id = id;
21285
+ clone.style.fill = "inherit";
21286
+ clone.style.stroke = "inherit";
21287
+ copyAttr(node, clone);
21288
+ if ((_node$childNodes = node.childNodes) != null && _node$childNodes.length) {
21289
+ const parent = (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(clone);
21290
+ if ("innerHTML" in clone) {
21291
+ parent.html(node.innerHTML);
21292
+ } else {
21293
+ toArray(node.childNodes).forEach(function (v) {
21294
+ _newArrowCheck(this, _this);
21295
+ copyAttr(v, parent.append(v.tagName).node());
21296
+ }.bind(this));
21297
+ }
21298
+ }
21299
+ $$.$el.defs.node().appendChild(clone);
21300
+ }
21301
+ /* harmony default export */ var point_common = ({
21302
+ /**
21303
+ * Check if point type option is valid
21304
+ * @param {string} type point type
21305
+ * @returns {boolean}
21306
+ * @private
21307
+ */
21308
+ hasValidPointType: function hasValidPointType(type) {
21309
+ return /^(circle|rect(angle)?|polygon|ellipse|use)$/i.test(type || this.config.point_type);
21310
+ },
21311
+ /**
21312
+ * Check if pattern point is set to be used on legend
21313
+ * @returns {boolean}
21314
+ * @private
21315
+ */
21316
+ hasLegendDefsPoint: function hasLegendDefsPoint() {
21317
+ var _config$point_pattern;
21318
+ const config = this.config;
21319
+ return config.legend_show && ((_config$point_pattern = config.point_pattern) == null ? void 0 : _config$point_pattern.length) && config.legend_usePoint;
21320
+ },
21321
+ getDefsPointId: function getDefsPointId(id) {
21322
+ const datetimeId = this.state.datetimeId;
21323
+ return datetimeId + "-point" + id;
21324
+ },
21325
+ /**
21326
+ * Get generate point function
21327
+ * @returns {Function}
21328
+ * @private
21329
+ */
21330
+ generatePoint: function generatePoint() {
21331
+ const $$ = this,
21332
+ $el = $$.$el,
21333
+ config = $$.config,
21334
+ ids = [],
21335
+ pattern = notEmpty(config.point_pattern) ? config.point_pattern : [config.point_type];
21336
+ return function (method, context) {
21337
+ for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
21338
+ args[_key - 2] = arguments[_key];
21339
+ }
21340
+ return function (d) {
21341
+ var _d$data, _point$method;
21342
+ const id = $$.getTargetSelectorSuffix(d.id || ((_d$data = d.data) == null ? void 0 : _d$data.id) || d),
21343
+ element = (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(this);
21344
+ ids.indexOf(id) < 0 && ids.push(id);
21345
+ let point = pattern[ids.indexOf(id) % pattern.length];
21346
+ if ($$.hasValidPointType(point)) {
21347
+ point = $$[point];
21348
+ } else if (!hasValidPointDrawMethods(point || config.point_type)) {
21349
+ const pointId = $$.getDefsPointId(id),
21350
+ defsPoint = $el.defs.select("#" + pointId);
21351
+ if (defsPoint.size() < 1) {
21352
+ insertPointInfoDefs.bind($$)(point, pointId);
21353
+ }
21354
+ if (method === "create") {
21355
+ var _$$$custom;
21356
+ return (_$$$custom = $$.custom) == null ? void 0 : _$$$custom.create.bind(context).apply(void 0, [element, pointId].concat(args));
21357
+ } else if (method === "update") {
21358
+ var _$$$custom2;
21359
+ return (_$$$custom2 = $$.custom) == null ? void 0 : _$$$custom2.update.bind(context).apply(void 0, [element].concat(args));
21360
+ }
21361
+ }
21362
+ return (_point$method = point[method]) == null ? void 0 : _point$method.bind(context).apply(void 0, [element].concat(args));
21363
+ };
21364
+ };
21365
+ }
21366
+ });
21208
21367
  ;// CONCATENATED MODULE: ./src/ChartInternal/shape/point.ts
21209
21368
 
21210
21369
  var point_this = undefined;
@@ -21215,19 +21374,11 @@ var point_this = undefined;
21215
21374
 
21216
21375
 
21217
21376
 
21218
-
21219
21377
  const getTransitionName = function () {
21220
21378
  _newArrowCheck(this, point_this);
21221
21379
  return getRandom();
21222
21380
  }.bind(undefined);
21223
21381
  /* harmony default export */ var point = ({
21224
- hasValidPointType: function hasValidPointType(type) {
21225
- return /^(circle|rect(angle)?|polygon|ellipse|use)$/i.test(type || this.config.point_type);
21226
- },
21227
- hasValidPointDrawMethods: function hasValidPointDrawMethods(type) {
21228
- const pointType = type || this.config.point_type;
21229
- return isObjectType(pointType) && isFunction(pointType.create) && isFunction(pointType.update);
21230
- },
21231
21382
  initialOpacityForCircle: function initialOpacityForCircle(d) {
21232
21383
  const config = this.config,
21233
21384
  withoutFadeIn = this.state.withoutFadeIn;
@@ -21541,41 +21692,6 @@ const getTransitionName = function () {
21541
21692
  }
21542
21693
  return sensitivity;
21543
21694
  },
21544
- insertPointInfoDefs: function insertPointInfoDefs(point, id) {
21545
- var _this7 = this,
21546
- _node$childNodes;
21547
- const $$ = this,
21548
- copyAttr = function (from, target) {
21549
- _newArrowCheck(this, _this7);
21550
- const attribs = from.attributes;
21551
- for (let i = 0, name; name = attribs[i]; i++) {
21552
- name = name.name;
21553
- target.setAttribute(name, from.getAttribute(name));
21554
- }
21555
- }.bind(this),
21556
- doc = new DOMParser().parseFromString(point, "image/svg+xml"),
21557
- node = doc.documentElement,
21558
- clone = browser_doc.createElementNS(external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.namespaces.svg, node.nodeName.toLowerCase());
21559
- clone.id = id;
21560
- clone.style.fill = "inherit";
21561
- clone.style.stroke = "inherit";
21562
- copyAttr(node, clone);
21563
- if ((_node$childNodes = node.childNodes) != null && _node$childNodes.length) {
21564
- const parent = (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(clone);
21565
- if ("innerHTML" in clone) {
21566
- parent.html(node.innerHTML);
21567
- } else {
21568
- toArray(node.childNodes).forEach(function (v) {
21569
- _newArrowCheck(this, _this7);
21570
- copyAttr(v, parent.append(v.tagName).node());
21571
- }.bind(this));
21572
- }
21573
- }
21574
- $$.$el.defs.node().appendChild(clone);
21575
- },
21576
- pointFromDefs: function pointFromDefs(id) {
21577
- return this.$el.defs.select("#" + id);
21578
- },
21579
21695
  updatePointClass: function updatePointClass(d) {
21580
21696
  const $$ = this,
21581
21697
  circle = $$.$el.circle;
@@ -21592,7 +21708,7 @@ const getTransitionName = function () {
21592
21708
  return pointClass;
21593
21709
  },
21594
21710
  generateGetLinePoints: function generateGetLinePoints(lineIndices, isSub) {
21595
- var _this8 = this;
21711
+ var _this7 = this;
21596
21712
  // partial duplication of generateGetBarPoints
21597
21713
  const $$ = this,
21598
21714
  config = $$.config,
@@ -21601,7 +21717,7 @@ const getTransitionName = function () {
21601
21717
  lineOffset = $$.getShapeOffset($$.isLineType, lineIndices, isSub),
21602
21718
  yScale = $$.getYScaleById.bind($$);
21603
21719
  return function (d, i) {
21604
- _newArrowCheck(this, _this8);
21720
+ _newArrowCheck(this, _this7);
21605
21721
  const y0 = yScale.call($$, d.id, isSub)($$.getShapeYMin(d.id)),
21606
21722
  offset = lineOffset(d, i) || y0,
21607
21723
  posX = x(d); // offset is for stacked area chart
@@ -21619,56 +21735,22 @@ const getTransitionName = function () {
21619
21735
  point, point];
21620
21736
  }.bind(this);
21621
21737
  },
21622
- generatePoint: function generatePoint() {
21623
- const $$ = this,
21624
- config = $$.config,
21625
- datetimeId = $$.state.datetimeId,
21626
- ids = [],
21627
- pattern = notEmpty(config.point_pattern) ? config.point_pattern : [config.point_type];
21628
- return function (method, context) {
21629
- for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
21630
- args[_key - 2] = arguments[_key];
21631
- }
21632
- return function (d) {
21633
- var _d$data;
21634
- const id = $$.getTargetSelectorSuffix(d.id || ((_d$data = d.data) == null ? void 0 : _d$data.id) || d),
21635
- element = (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(this);
21636
- ids.indexOf(id) < 0 && ids.push(id);
21637
- let point = pattern[ids.indexOf(id) % pattern.length];
21638
- if ($$.hasValidPointType(point)) {
21639
- point = $$[point];
21640
- } else if (!$$.hasValidPointDrawMethods(point)) {
21641
- const pointId = datetimeId + "-point" + id,
21642
- pointFromDefs = $$.pointFromDefs(pointId);
21643
- if (pointFromDefs.size() < 1) {
21644
- $$.insertPointInfoDefs(point, pointId);
21645
- }
21646
- if (method === "create") {
21647
- return $$.custom.create.bind(context).apply(void 0, [element, pointId].concat(args));
21648
- } else if (method === "update") {
21649
- return $$.custom.update.bind(context).apply(void 0, [element].concat(args));
21650
- }
21651
- }
21652
- return point[method].bind(context).apply(void 0, [element].concat(args));
21653
- };
21654
- };
21655
- },
21656
21738
  custom: {
21657
21739
  create: function create(element, id, fillStyleFn) {
21658
21740
  return element.append("use").attr("xlink:href", "#" + id).attr("class", this.updatePointClass.bind(this)).style("fill", fillStyleFn).node();
21659
21741
  },
21660
21742
  update: function update(element, xPosFn, yPosFn, fillStyleFn, withTransition, flow, selectedCircles) {
21661
- var _this9 = this;
21743
+ var _this8 = this;
21662
21744
  const $$ = this,
21663
21745
  _element$node$getBBox = element.node().getBBox(),
21664
21746
  width = _element$node$getBBox.width,
21665
21747
  height = _element$node$getBBox.height,
21666
21748
  xPosFn2 = function (d) {
21667
- _newArrowCheck(this, _this9);
21749
+ _newArrowCheck(this, _this8);
21668
21750
  return isValue(d.value) ? xPosFn(d) - width / 2 : 0;
21669
21751
  }.bind(this),
21670
21752
  yPosFn2 = function (d) {
21671
- _newArrowCheck(this, _this9);
21753
+ _newArrowCheck(this, _this8);
21672
21754
  return isValue(d.value) ? yPosFn(d) - height / 2 : 0;
21673
21755
  }.bind(this);
21674
21756
  let mainCircles = element;
@@ -21706,23 +21788,23 @@ const getTransitionName = function () {
21706
21788
  // 'rectangle' data point
21707
21789
  rectangle: {
21708
21790
  create: function create(element, sizeFn, fillStyleFn) {
21709
- var _this10 = this;
21791
+ var _this9 = this;
21710
21792
  const rectSizeFn = function (d) {
21711
- _newArrowCheck(this, _this10);
21793
+ _newArrowCheck(this, _this9);
21712
21794
  return sizeFn(d) * 2;
21713
21795
  }.bind(this);
21714
21796
  return element.append("rect").attr("class", this.updatePointClass.bind(this)).attr("width", rectSizeFn).attr("height", rectSizeFn).style("fill", fillStyleFn).node();
21715
21797
  },
21716
21798
  update: function update(element, xPosFn, yPosFn, fillStyleFn, withTransition, flow, selectedCircles) {
21717
- var _this11 = this;
21799
+ var _this10 = this;
21718
21800
  const $$ = this,
21719
21801
  r = $$.config.point_r,
21720
21802
  rectXPosFn = function (d) {
21721
- _newArrowCheck(this, _this11);
21803
+ _newArrowCheck(this, _this10);
21722
21804
  return xPosFn(d) - r;
21723
21805
  }.bind(this),
21724
21806
  rectYPosFn = function (d) {
21725
- _newArrowCheck(this, _this11);
21807
+ _newArrowCheck(this, _this10);
21726
21808
  return yPosFn(d) - r;
21727
21809
  }.bind(this);
21728
21810
  let mainCircles = element;
@@ -23852,6 +23934,7 @@ var shape_this = undefined;
23852
23934
 
23853
23935
 
23854
23936
 
23937
+
23855
23938
  // Options
23856
23939
 
23857
23940
 
@@ -23879,9 +23962,9 @@ var shape_this = undefined;
23879
23962
  * @private
23880
23963
  */
23881
23964
  function extendAxis(module, option) {
23882
- extend(ChartInternal.prototype, internal.concat(module));
23965
+ extend(ChartInternal.prototype, Object.values(internal).concat(module));
23883
23966
  extend(Chart.prototype, api);
23884
- Options.setOptions(options.concat(option || []));
23967
+ Options.setOptions(Object.values(options).concat(option || []));
23885
23968
  }
23886
23969
 
23887
23970
  /**
@@ -23891,7 +23974,7 @@ function extendAxis(module, option) {
23891
23974
  * @private
23892
23975
  */
23893
23976
  function extendLine(module, option) {
23894
- extendAxis([point, line].concat(module || []));
23977
+ extendAxis([point_common, point, line].concat(module || []));
23895
23978
  Options.setOptions([common_point, shape_line].concat(option || []));
23896
23979
  }
23897
23980
 
@@ -23902,8 +23985,8 @@ function extendLine(module, option) {
23902
23985
  * @private
23903
23986
  */
23904
23987
  function extendArc(module, option) {
23905
- extend(ChartInternal.prototype, [arc].concat(module || []));
23906
- Options.setOptions(option);
23988
+ extend(ChartInternal.prototype, [arc, point_common].concat(module || []));
23989
+ Options.setOptions([common_point].concat(option || []));
23907
23990
  }
23908
23991
 
23909
23992
  // Area types
@@ -24006,7 +24089,9 @@ let _area = function area() {
24006
24089
  resolver_shape_radar = function () {
24007
24090
  var _this14 = this;
24008
24091
  _newArrowCheck(this, shape_this);
24009
- return extendArc([point, radar], [common_point, shape_radar]), (resolver_shape_radar = function () {
24092
+ return extendArc([internal.eventrect, point, radar], [common_point, shape_radar, {
24093
+ axis_x_categories: options.optAxis.axis_x_categories
24094
+ }]), (resolver_shape_radar = function () {
24010
24095
  _newArrowCheck(this, _this14);
24011
24096
  return TYPE.RADAR;
24012
24097
  }.bind(this))();
@@ -24014,7 +24099,7 @@ let _area = function area() {
24014
24099
  resolver_shape_bar = function () {
24015
24100
  var _this15 = this;
24016
24101
  _newArrowCheck(this, shape_this);
24017
- return extendAxis([bar], shape_bar), (resolver_shape_bar = function () {
24102
+ return extendAxis([bar, point_common], [shape_bar, common_point]), (resolver_shape_bar = function () {
24018
24103
  _newArrowCheck(this, _this15);
24019
24104
  return TYPE.BAR;
24020
24105
  }.bind(this))();
@@ -24022,7 +24107,7 @@ let _area = function area() {
24022
24107
  resolver_shape_bubble = function () {
24023
24108
  var _this16 = this;
24024
24109
  _newArrowCheck(this, shape_this);
24025
- return extendAxis([point, bubble], [shape_bubble, common_point]), (resolver_shape_bubble = function () {
24110
+ return extendAxis([point_common, point, bubble], [shape_bubble, common_point]), (resolver_shape_bubble = function () {
24026
24111
  _newArrowCheck(this, _this16);
24027
24112
  return TYPE.BUBBLE;
24028
24113
  }.bind(this))();
@@ -24030,7 +24115,7 @@ let _area = function area() {
24030
24115
  resolver_shape_candlestick = function () {
24031
24116
  var _this17 = this;
24032
24117
  _newArrowCheck(this, shape_this);
24033
- return extendAxis([candlestick], [shape_candlestick]), (resolver_shape_candlestick = function () {
24118
+ return extendAxis([candlestick, point_common], [shape_candlestick, common_point]), (resolver_shape_candlestick = function () {
24034
24119
  _newArrowCheck(this, _this17);
24035
24120
  return TYPE.CANDLESTICK;
24036
24121
  }.bind(this))();
@@ -24038,7 +24123,7 @@ let _area = function area() {
24038
24123
  shape_scatter = function () {
24039
24124
  var _this18 = this;
24040
24125
  _newArrowCheck(this, shape_this);
24041
- return extendAxis([point], [common_point, scatter]), (shape_scatter = function () {
24126
+ return extendAxis([point_common, point], [common_point, scatter]), (shape_scatter = function () {
24042
24127
  _newArrowCheck(this, _this18);
24043
24128
  return TYPE.SCATTER;
24044
24129
  }.bind(this))();
@@ -25950,7 +26035,7 @@ let _defaults = {};
25950
26035
 
25951
26036
  /**
25952
26037
  * @namespace bb
25953
- * @version 3.11.1
26038
+ * @version 3.11.3
25954
26039
  */
25955
26040
  const bb = {
25956
26041
  /**
@@ -25960,7 +26045,7 @@ const bb = {
25960
26045
  * bb.version; // "1.0.0"
25961
26046
  * @memberof bb
25962
26047
  */
25963
- version: "3.11.1",
26048
+ version: "3.11.3",
25964
26049
  /**
25965
26050
  * Generate chart
25966
26051
  * - **NOTE:** Bear in mind for the possiblity of ***throwing an error***, during the generation when:
@@ -5,5 +5,5 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.11.1
8
+ * @version 3.11.3
9
9
  */.bb svg{font:10px sans-serif;-webkit-tap-highlight-color:rgba(0,0,0,0)}.bb line,.bb path{fill:none;stroke:#000}.bb .bb-button,.bb text{-webkit-user-select:none;-moz-user-select:none;user-select:none}.bb-legend-item-tile,.bb-xgrid-focus,.bb-ygrid,.bb-ygrid-focus{shape-rendering:crispEdges}.bb-chart-arc .bb-gauge-value,.bb-chart-arcs .bb-needle{fill:#000}.bb-chart-arc path{stroke:#fff}.bb-chart-arc rect{stroke:#fff;stroke-width:1}.bb-chart-arc text{fill:#fff;font-size:13px}.bb-axis{shape-rendering:crispEdges}.bb-grid{pointer-events:none}.bb-grid line{stroke:#aaa}.bb-grid text{fill:#aaa}.bb-xgrid,.bb-ygrid{stroke-dasharray:3 3}.bb-text.bb-empty{fill:grey;font-size:2em}.bb-line{stroke-width:1px}.bb-circle._expanded_{stroke-width:1px;stroke:#fff}.bb-selected-circle{fill:#fff;stroke-width:2px}.bb-bar{stroke-width:0}.bb-bar._expanded_{fill-opacity:.75}.bb-candlestick{stroke-width:1px}.bb-candlestick._expanded_{fill-opacity:.75}.bb-circles.bb-focused,.bb-target.bb-focused{opacity:1}.bb-circles.bb-focused path.bb-line,.bb-circles.bb-focused path.bb-step,.bb-target.bb-focused path.bb-line,.bb-target.bb-focused path.bb-step{stroke-width:2px}.bb-circles.bb-defocused,.bb-target.bb-defocused{opacity:.3!important}.bb-circles.bb-defocused .text-overlapping,.bb-target.bb-defocused .text-overlapping{opacity:.05!important}.bb-region{fill:#4682b4}.bb-brush .extent,.bb-region rect,.bb-zoom-brush{fill-opacity:.1}.bb-legend-item{font-size:12px;user-select:none}.bb-legend-item-hidden{opacity:.15}.bb-legend-background{opacity:.75;fill:#fff;stroke:#d3d3d3;stroke-width:1}.bb-title{font:14px sans-serif}.bb-chart-treemaps rect{stroke:#fff;stroke-width:1px}.bb-tooltip-container{user-select:none;z-index:10}.bb-tooltip{background-color:#fff;border-collapse:collapse;border-spacing:0;box-shadow:7px 7px 12px -9px #777;empty-cells:show;opacity:.9;white-space:nowrap}.bb-tooltip tr{border:1px solid #ccc}.bb-tooltip th{background-color:#aaa;color:#fff;font-size:14px;padding:2px 5px;text-align:left}.bb-tooltip td{background-color:#fff;border-left:1px dotted #999;font-size:13px;padding:3px 6px}.bb-tooltip td>span,.bb-tooltip td>svg{display:inline-block;height:10px;margin-right:6px;width:10px}.bb-tooltip.value{text-align:right}.bb-area{stroke-width:0;opacity:.2}.bb-chart-arcs-title{dominant-baseline:middle;font-size:1.3em}text.bb-chart-arcs-gauge-title{dominant-baseline:middle;font-size:2.7em}.bb-chart-arcs .bb-chart-arcs-background{fill:#e0e0e0;stroke:#fff}.bb-chart-arcs .bb-chart-arcs-gauge-unit{fill:#000;font-size:16px}.bb-chart-arcs .bb-chart-arcs-gauge-max,.bb-chart-arcs .bb-chart-arcs-gauge-min{fill:#777}.bb-chart-arcs .bb-levels circle{fill:none;stroke:#848282;stroke-width:.5px}.bb-chart-arcs .bb-levels text{fill:#848282}.bb-chart-radars .bb-levels polygon{fill:none;stroke:#848282;stroke-width:.5px}.bb-chart-radars .bb-levels text{fill:#848282}.bb-chart-radars .bb-axis line{stroke:#848282;stroke-width:.5px}.bb-chart-radars .bb-axis text{cursor:default;font-size:1.15em}.bb-chart-radars .bb-shapes polygon{fill-opacity:.2;stroke-width:1px}.bb-button{position:absolute;right:10px;top:10px}.bb-button .bb-zoom-reset{background-color:#fff;border:1px solid #ccc;border-radius:5px;cursor:pointer;font-size:11px;padding:5px}