billboard.js 3.11.0 → 3.11.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 (57) hide show
  1. package/dist/billboard.css +1 -1
  2. package/dist/billboard.js +230 -134
  3. package/dist/billboard.min.css +1 -1
  4. package/dist/billboard.min.js +2 -2
  5. package/dist/billboard.pkgd.js +226 -128
  6. package/dist/billboard.pkgd.min.js +4 -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 +2 -2
  10. package/dist/plugin/billboardjs-plugin-sparkline.min.js +2 -2
  11. package/dist/plugin/billboardjs-plugin-stanford.js +2 -2
  12. package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
  13. package/dist/plugin/billboardjs-plugin-tableview.js +2 -2
  14. package/dist/plugin/billboardjs-plugin-tableview.min.js +2 -2
  15. package/dist/plugin/billboardjs-plugin-textoverlap.js +2 -2
  16. package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
  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 +2 -2
  20. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.min.js +2 -2
  21. package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.js +2 -2
  22. package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.min.js +2 -2
  23. package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.js +2 -2
  24. package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.min.js +2 -2
  25. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.js +2 -2
  26. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.min.js +2 -2
  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 +189 -122
  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 +2 -2
  42. package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +2 -2
  43. package/package.json +16 -14
  44. package/src/ChartInternal/Axis/AxisRenderer.ts +2 -1
  45. package/src/ChartInternal/ChartInternal.ts +2 -2
  46. package/src/ChartInternal/data/data.ts +1 -1
  47. package/src/ChartInternal/data/load.ts +7 -1
  48. package/src/ChartInternal/interactions/zoom.ts +9 -3
  49. package/src/ChartInternal/internals/redraw.ts +2 -1
  50. package/src/ChartInternal/internals/title.ts +2 -2
  51. package/src/ChartInternal/internals/tooltip.ts +1 -1
  52. package/src/ChartInternal/shape/point.common.ts +134 -0
  53. package/src/ChartInternal/shape/point.ts +3 -95
  54. package/src/ChartInternal/shape/shape.ts +18 -6
  55. package/src/config/Store/State.ts +1 -1
  56. package/src/config/resolver/axis.ts +4 -4
  57. package/src/config/resolver/shape.ts +22 -10
@@ -5,9 +5,11 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.11.0
8
+ * @version 3.11.2
9
9
  *
10
10
  * All-in-one packaged file for ease use of 'billboard.js' with dependant d3.js modules & polyfills.
11
+ * - @types/d3-selection ^3.0.0
12
+ * - @types/d3-transition ^3.0.0
11
13
  * - d3-axis ^3.0.0
12
14
  * - d3-brush ^3.0.0
13
15
  * - d3-drag ^3.0.0
@@ -29147,7 +29149,8 @@ function callDone(fn, resizeAfter) {
29147
29149
  const $$ = this,
29148
29150
  state = $$.state,
29149
29151
  $el = $$.$el,
29150
- $T = $$.$T;
29152
+ $T = $$.$T,
29153
+ hasLegendDefsPoint = !!($$.hasLegendDefsPoint != null && $$.hasLegendDefsPoint());
29151
29154
  let done = customDoneCb,
29152
29155
  targetIds = rawTargetIds;
29153
29156
  // reset internally cached data
@@ -29175,14 +29178,17 @@ function callDone(fn, resizeAfter) {
29175
29178
  }.bind(this)));
29176
29179
  $T(targets).style("opacity", "0").remove().call(endall, done);
29177
29180
  targetIds.forEach(function (id) {
29178
- var _this4 = this;
29181
+ var _this4 = this,
29182
+ _$el$defs;
29179
29183
  _newArrowCheck(this, _this3);
29184
+ const suffixId = $$.getTargetSelectorSuffix(id);
29185
+
29180
29186
  // Reset fadein for future load
29181
29187
  state.withoutFadeIn[id] = !1;
29182
29188
 
29183
29189
  // Remove target's elements
29184
29190
  if ($el.legend) {
29185
- $el.legend.selectAll("." + $LEGEND.legendItem + $$.getTargetSelectorSuffix(id)).remove();
29191
+ $el.legend.selectAll("." + $LEGEND.legendItem + suffixId).remove();
29186
29192
  }
29187
29193
 
29188
29194
  // Remove target
@@ -29190,6 +29196,9 @@ function callDone(fn, resizeAfter) {
29190
29196
  _newArrowCheck(this, _this4);
29191
29197
  return t.id !== id;
29192
29198
  }.bind(this));
29199
+
29200
+ // Remove custom point def element
29201
+ hasLegendDefsPoint && ((_$el$defs = $el.defs) == null ? void 0 : _$el$defs.select("#" + $$.getDefsPointId(suffixId)).remove());
29193
29202
  }.bind(this));
29194
29203
 
29195
29204
  // since treemap uses different data types, it needs to be transformed
@@ -31791,10 +31800,10 @@ function getFormattedText(id) {
31791
31800
  // treemap
31792
31801
  treemap && $$.updateTreemap(durationForExit);
31793
31802
  }
31794
-
31795
- // @TODO: Axis & Radar type
31796
31803
  if (!state.resizing && !treemap && ($$.hasPointType() || state.hasRadar)) {
31797
31804
  $$.updateCircle();
31805
+ } else if ($$.hasLegendDefsPoint != null && $$.hasLegendDefsPoint()) {
31806
+ $$.data.targets.forEach($$.point("create", this));
31798
31807
  }
31799
31808
 
31800
31809
  // text
@@ -34754,29 +34763,46 @@ function getGroupedDataPointsFn(d) {
34754
34763
  return points ? points(d, i)[0][1] : $$.getYScaleById(id)($$.getBaseValue(d));
34755
34764
  },
34756
34765
  getBarW: function getBarW(type, axis, targetsNum) {
34757
- var _this11 = this;
34766
+ var _config$data_groups,
34767
+ _$$$getZoomTransform,
34768
+ _config$axis_x_min,
34769
+ _config$axis_x_max,
34770
+ _this11 = this;
34758
34771
  const $$ = this,
34759
34772
  config = $$.config,
34760
34773
  org = $$.org,
34761
34774
  scale = $$.scale,
34762
34775
  maxDataCount = $$.getMaxDataCount(),
34763
- isGrouped = type === "bar" && config.data_groups.length,
34776
+ isGrouped = type === "bar" && ((_config$data_groups = config.data_groups) == null ? void 0 : _config$data_groups.length),
34764
34777
  configName = type + "_width",
34765
- tickInterval = scale.zoom && !$$.axis.isCategorized() ? org.xDomain.map(function (v) {
34778
+ _ref2 = (_$$$getZoomTransform = $$.getZoomTransform == null ? void 0 : $$.getZoomTransform()) != null ? _$$$getZoomTransform : {
34779
+ k: 1
34780
+ },
34781
+ k = _ref2.k,
34782
+ 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);
34783
+ let tickInterval = axis.tickInterval(maxDataCount);
34784
+ if (scale.zoom && !$$.axis.isCategorized() && k > 1) {
34785
+ const isSameMinMax = xMinMax.every(function (v, i) {
34786
+ _newArrowCheck(this, _this11);
34787
+ return v === org.xDomain[i];
34788
+ }.bind(this));
34789
+ tickInterval = org.xDomain.map(function (v, i) {
34766
34790
  _newArrowCheck(this, _this11);
34767
- return scale.zoom(v);
34791
+ const value = isSameMinMax ? v : v - Math.abs(xMinMax[i]);
34792
+ return scale.zoom(value);
34768
34793
  }.bind(this)).reduce(function (a, c) {
34769
34794
  _newArrowCheck(this, _this11);
34770
34795
  return Math.abs(a) + c;
34771
- }.bind(this)) / maxDataCount : axis.tickInterval(maxDataCount),
34772
- getWidth = function (id) {
34773
- _newArrowCheck(this, _this11);
34774
- const width = id ? config[configName][id] : config[configName],
34775
- ratio = id ? width.ratio : config[configName + "_ratio"],
34776
- max = id ? width.max : config[configName + "_max"],
34777
- w = isNumber(width) ? width : targetsNum ? tickInterval * ratio / targetsNum : 0;
34778
- return max && w > max ? max : w;
34779
- }.bind(this);
34796
+ }.bind(this)) / maxDataCount;
34797
+ }
34798
+ const getWidth = function (id) {
34799
+ _newArrowCheck(this, _this11);
34800
+ const width = id ? config[configName][id] : config[configName],
34801
+ ratio = id ? width.ratio : config[configName + "_ratio"],
34802
+ max = id ? width.max : config[configName + "_max"],
34803
+ w = isNumber(width) ? width : targetsNum ? tickInterval * ratio / targetsNum : 0;
34804
+ return max && w > max ? max : w;
34805
+ }.bind(this);
34780
34806
  let result = getWidth();
34781
34807
  if (!isGrouped && isObjectType(config[configName])) {
34782
34808
  result = {
@@ -35883,9 +35909,9 @@ function getTextXPos(pos, width) {
35883
35909
  */
35884
35910
  getTitlePadding: function getTitlePadding() {
35885
35911
  const $$ = this,
35886
- $el = $$.$el,
35912
+ title = $$.$el.title,
35887
35913
  config = $$.config;
35888
- return (config.title_padding.top || 0) + $$.getTextRect($el.title, $TEXT.title).height + (config.title_padding.bottom || 0);
35914
+ return (config.title_padding.top || 0) + (title ? $$.getTextRect(title, $TEXT.title).height : 0) + (config.title_padding.bottom || 0);
35889
35915
  }
35890
35916
  });
35891
35917
  ;// CONCATENATED MODULE: ./src/ChartInternal/internals/tooltip.ts
@@ -36239,8 +36265,9 @@ function getTextXPos(pos, width) {
36239
36265
  y += 15;
36240
36266
  } else if (hasArcType) {
36241
36267
  if (!(inputType === "touch")) {
36268
+ var _$$$getTitlePadding;
36242
36269
  x += (width - (isLegendRight ? $$.getLegendWidth() : 0)) / 2;
36243
- y += hasGauge ? height : height / 2 + tHeight;
36270
+ y += (hasGauge ? height : height / 2 + tHeight) + ((_$$$getTitlePadding = $$.getTitlePadding == null ? void 0 : $$.getTitlePadding()) != null ? _$$$getTitlePadding : 0);
36244
36271
  }
36245
36272
  } else if (hasTreemap) {
36246
36273
  y += tHeight;
@@ -37062,7 +37089,7 @@ let ChartInternal = /*#__PURE__*/function () {
37062
37089
  config.axis_y2_show = !1;
37063
37090
  config.subchart_show = !1;
37064
37091
  }
37065
- if ($$.hasPointType()) {
37092
+ if ($$.hasPointType() || $$.hasLegendDefsPoint != null && $$.hasLegendDefsPoint()) {
37066
37093
  $$.point = $$.generatePoint();
37067
37094
  }
37068
37095
  if (state.hasAxis) {
@@ -37169,7 +37196,7 @@ let ChartInternal = /*#__PURE__*/function () {
37169
37196
 
37170
37197
  // Define defs
37171
37198
  const hasColorPatterns = isFunction(config.color_tiles) && $$.patterns;
37172
- if (hasAxis || hasColorPatterns || hasPolar || hasTreemap || config.data_labels_backgroundColors) {
37199
+ if (hasAxis || hasColorPatterns || hasPolar || hasTreemap || config.data_labels_backgroundColors || $$.hasLegendDefsPoint != null && $$.hasLegendDefsPoint()) {
37173
37200
  $el.defs = $el.svg.append("defs");
37174
37201
  if (hasAxis) {
37175
37202
  ["id", "idXAxis", "idYAxis", "idGrid"].forEach(function (v) {
@@ -40827,14 +40854,16 @@ let AxisRenderer = /*#__PURE__*/function () {
40827
40854
  if (this.params.isCategory) {
40828
40855
  interval = tickOffset * 2;
40829
40856
  } else {
40830
- const length = this.g.select("path.domain").node().getTotalLength() - outerTickSize * 2;
40857
+ var _this$params$owner$sc;
40858
+ const scale = (_this$params$owner$sc = this.params.owner.scale.zoom) != null ? _this$params$owner$sc : this.helper.scale,
40859
+ length = this.g.select("path.domain").node().getTotalLength() - outerTickSize * 2;
40831
40860
  interval = length / (size || this.g.selectAll("line").size());
40832
40861
 
40833
40862
  // get the interval by its values
40834
40863
  const intervalByValue = tickValues ? tickValues.map(function (v, i, arr) {
40835
40864
  _newArrowCheck(this, _this5);
40836
40865
  const next = i + 1;
40837
- return next < arr.length ? this.helper.scale(arr[next]) - this.helper.scale(v) : null;
40866
+ return next < arr.length ? scale(arr[next]) - scale(v) : null;
40838
40867
  }.bind(this)).filter(Boolean) : [];
40839
40868
  interval = Math.min.apply(Math, intervalByValue.concat([interval]));
40840
40869
  }
@@ -45316,8 +45345,20 @@ function axis_objectSpread(e) { for (var r = 1, t; r < arguments.length; r++) {
45316
45345
 
45317
45346
 
45318
45347
  const api = [api_axis, api_category, flow, api_grid, group, api_regions, x];
45319
- const internal = [Axis, clip, eventrect, interactions_flow, internals_grid, region, size_axis];
45320
- const options = [data_axis, Options_axis_axis, common_grid];
45348
+ const internal = {
45349
+ axis: Axis,
45350
+ clip: clip,
45351
+ eventrect: eventrect,
45352
+ flow: interactions_flow,
45353
+ grid: internals_grid,
45354
+ region: region,
45355
+ sizeAxis: size_axis
45356
+ };
45357
+ const options = {
45358
+ optDataAxis: data_axis,
45359
+ optAxis: Options_axis_axis,
45360
+ optGrid: common_grid
45361
+ };
45321
45362
  ;// CONCATENATED MODULE: ./node_modules/d3-shape/src/array.js
45322
45363
  var slice = Array.prototype.slice;
45323
45364
  /* harmony default export */ function d3_shape_src_array(x) {
@@ -48156,6 +48197,130 @@ function candlestick_objectSpread(e) { for (var r = 1, t; r < arguments.length;
48156
48197
  return linePoint === !0 || isArray(linePoint) && linePoint.indexOf(d.id) !== -1;
48157
48198
  }
48158
48199
  });
48200
+ ;// CONCATENATED MODULE: ./src/ChartInternal/shape/point.common.ts
48201
+
48202
+ /**
48203
+ * Copyright (c) 2017 ~ present NAVER Corp.
48204
+ * billboard.js project is licensed under the MIT license
48205
+ */
48206
+
48207
+
48208
+
48209
+
48210
+ /**
48211
+ * Check if point draw methods are valid
48212
+ * @param {string} point point type
48213
+ * @returns {boolean}
48214
+ * @private
48215
+ */
48216
+ function hasValidPointDrawMethods(point) {
48217
+ return isObjectType(point) && isFunction(point.create) && isFunction(point.update);
48218
+ }
48219
+
48220
+ /**
48221
+ * Insert point info defs element
48222
+ * @param {string} point Point element
48223
+ * @param {string} id Point id
48224
+ * @private
48225
+ */
48226
+ function insertPointInfoDefs(point, id) {
48227
+ var _this = this,
48228
+ _node$childNodes;
48229
+ const $$ = this,
48230
+ copyAttr = function (from, target) {
48231
+ _newArrowCheck(this, _this);
48232
+ const attribs = from.attributes;
48233
+ for (let i = 0, name; name = attribs[i]; i++) {
48234
+ name = name.name;
48235
+ target.setAttribute(name, from.getAttribute(name));
48236
+ }
48237
+ }.bind(this),
48238
+ doc = new DOMParser().parseFromString(point, "image/svg+xml"),
48239
+ node = doc.documentElement,
48240
+ clone = browser_doc.createElementNS(namespaces.svg, node.nodeName.toLowerCase());
48241
+ clone.id = id;
48242
+ clone.style.fill = "inherit";
48243
+ clone.style.stroke = "inherit";
48244
+ copyAttr(node, clone);
48245
+ if ((_node$childNodes = node.childNodes) != null && _node$childNodes.length) {
48246
+ const parent = src_select(clone);
48247
+ if ("innerHTML" in clone) {
48248
+ parent.html(node.innerHTML);
48249
+ } else {
48250
+ toArray(node.childNodes).forEach(function (v) {
48251
+ _newArrowCheck(this, _this);
48252
+ copyAttr(v, parent.append(v.tagName).node());
48253
+ }.bind(this));
48254
+ }
48255
+ }
48256
+ $$.$el.defs.node().appendChild(clone);
48257
+ }
48258
+ /* harmony default export */ var point_common = ({
48259
+ /**
48260
+ * Check if point type option is valid
48261
+ * @param {string} type point type
48262
+ * @returns {boolean}
48263
+ * @private
48264
+ */
48265
+ hasValidPointType: function hasValidPointType(type) {
48266
+ return /^(circle|rect(angle)?|polygon|ellipse|use)$/i.test(type || this.config.point_type);
48267
+ },
48268
+ /**
48269
+ * Check if pattern point is set to be used on legend
48270
+ * @returns {boolean}
48271
+ * @private
48272
+ */
48273
+ hasLegendDefsPoint: function hasLegendDefsPoint() {
48274
+ var _config$point_pattern;
48275
+ const config = this.config;
48276
+ return config.legend_show && ((_config$point_pattern = config.point_pattern) == null ? void 0 : _config$point_pattern.length) && config.legend_usePoint;
48277
+ },
48278
+ getDefsPointId: function getDefsPointId(id) {
48279
+ const datetimeId = this.state.datetimeId;
48280
+ return datetimeId + "-point" + id;
48281
+ },
48282
+ /**
48283
+ * Get generate point function
48284
+ * @returns {Function}
48285
+ * @private
48286
+ */
48287
+ generatePoint: function generatePoint() {
48288
+ const $$ = this,
48289
+ $el = $$.$el,
48290
+ config = $$.config,
48291
+ ids = [],
48292
+ pattern = notEmpty(config.point_pattern) ? config.point_pattern : [config.point_type];
48293
+ return function (method, context) {
48294
+ for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
48295
+ args[_key - 2] = arguments[_key];
48296
+ }
48297
+ return function (d) {
48298
+ var _d$data, _point$method;
48299
+ const id = $$.getTargetSelectorSuffix(d.id || ((_d$data = d.data) == null ? void 0 : _d$data.id) || d),
48300
+ element = src_select(this);
48301
+ ids.indexOf(id) < 0 && ids.push(id);
48302
+ let point = pattern[ids.indexOf(id) % pattern.length];
48303
+ if ($$.hasValidPointType(point)) {
48304
+ point = $$[point];
48305
+ } else if (!hasValidPointDrawMethods(point || config.point_type)) {
48306
+ const pointId = $$.getDefsPointId(id),
48307
+ defsPoint = $el.defs.select("#" + pointId);
48308
+ if (defsPoint.size() < 1) {
48309
+ insertPointInfoDefs.bind($$)(point, pointId);
48310
+ }
48311
+ if (method === "create") {
48312
+ var _$$$custom;
48313
+ return (_$$$custom = $$.custom) == null ? void 0 : _$$$custom.create.bind(context).apply(void 0, [element, pointId].concat(args));
48314
+ } else if (method === "update") {
48315
+ var _$$$custom2;
48316
+ return (_$$$custom2 = $$.custom) == null ? void 0 : _$$$custom2.update.bind(context).apply(void 0, [element].concat(args));
48317
+ }
48318
+ }
48319
+ return (_point$method = point[method]) == null ? void 0 : _point$method.bind(context).apply(void 0, [element].concat(args));
48320
+ };
48321
+ };
48322
+ }
48323
+ });
48159
48324
  ;// CONCATENATED MODULE: ./src/ChartInternal/shape/point.ts
48160
48325
 
48161
48326
  var point_this = undefined;
@@ -48166,19 +48331,11 @@ var point_this = undefined;
48166
48331
 
48167
48332
 
48168
48333
 
48169
-
48170
48334
  const getTransitionName = function () {
48171
48335
  _newArrowCheck(this, point_this);
48172
48336
  return getRandom();
48173
48337
  }.bind(undefined);
48174
48338
  /* harmony default export */ var point = ({
48175
- hasValidPointType: function hasValidPointType(type) {
48176
- return /^(circle|rect(angle)?|polygon|ellipse|use)$/i.test(type || this.config.point_type);
48177
- },
48178
- hasValidPointDrawMethods: function hasValidPointDrawMethods(type) {
48179
- const pointType = type || this.config.point_type;
48180
- return isObjectType(pointType) && isFunction(pointType.create) && isFunction(pointType.update);
48181
- },
48182
48339
  initialOpacityForCircle: function initialOpacityForCircle(d) {
48183
48340
  const config = this.config,
48184
48341
  withoutFadeIn = this.state.withoutFadeIn;
@@ -48492,41 +48649,6 @@ const getTransitionName = function () {
48492
48649
  }
48493
48650
  return sensitivity;
48494
48651
  },
48495
- insertPointInfoDefs: function insertPointInfoDefs(point, id) {
48496
- var _this7 = this,
48497
- _node$childNodes;
48498
- const $$ = this,
48499
- copyAttr = function (from, target) {
48500
- _newArrowCheck(this, _this7);
48501
- const attribs = from.attributes;
48502
- for (let i = 0, name; name = attribs[i]; i++) {
48503
- name = name.name;
48504
- target.setAttribute(name, from.getAttribute(name));
48505
- }
48506
- }.bind(this),
48507
- doc = new DOMParser().parseFromString(point, "image/svg+xml"),
48508
- node = doc.documentElement,
48509
- clone = browser_doc.createElementNS(namespaces.svg, node.nodeName.toLowerCase());
48510
- clone.id = id;
48511
- clone.style.fill = "inherit";
48512
- clone.style.stroke = "inherit";
48513
- copyAttr(node, clone);
48514
- if ((_node$childNodes = node.childNodes) != null && _node$childNodes.length) {
48515
- const parent = src_select(clone);
48516
- if ("innerHTML" in clone) {
48517
- parent.html(node.innerHTML);
48518
- } else {
48519
- toArray(node.childNodes).forEach(function (v) {
48520
- _newArrowCheck(this, _this7);
48521
- copyAttr(v, parent.append(v.tagName).node());
48522
- }.bind(this));
48523
- }
48524
- }
48525
- $$.$el.defs.node().appendChild(clone);
48526
- },
48527
- pointFromDefs: function pointFromDefs(id) {
48528
- return this.$el.defs.select("#" + id);
48529
- },
48530
48652
  updatePointClass: function updatePointClass(d) {
48531
48653
  const $$ = this,
48532
48654
  circle = $$.$el.circle;
@@ -48543,7 +48665,7 @@ const getTransitionName = function () {
48543
48665
  return pointClass;
48544
48666
  },
48545
48667
  generateGetLinePoints: function generateGetLinePoints(lineIndices, isSub) {
48546
- var _this8 = this;
48668
+ var _this7 = this;
48547
48669
  // partial duplication of generateGetBarPoints
48548
48670
  const $$ = this,
48549
48671
  config = $$.config,
@@ -48552,7 +48674,7 @@ const getTransitionName = function () {
48552
48674
  lineOffset = $$.getShapeOffset($$.isLineType, lineIndices, isSub),
48553
48675
  yScale = $$.getYScaleById.bind($$);
48554
48676
  return function (d, i) {
48555
- _newArrowCheck(this, _this8);
48677
+ _newArrowCheck(this, _this7);
48556
48678
  const y0 = yScale.call($$, d.id, isSub)($$.getShapeYMin(d.id)),
48557
48679
  offset = lineOffset(d, i) || y0,
48558
48680
  posX = x(d); // offset is for stacked area chart
@@ -48570,56 +48692,22 @@ const getTransitionName = function () {
48570
48692
  point, point];
48571
48693
  }.bind(this);
48572
48694
  },
48573
- generatePoint: function generatePoint() {
48574
- const $$ = this,
48575
- config = $$.config,
48576
- datetimeId = $$.state.datetimeId,
48577
- ids = [],
48578
- pattern = notEmpty(config.point_pattern) ? config.point_pattern : [config.point_type];
48579
- return function (method, context) {
48580
- for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
48581
- args[_key - 2] = arguments[_key];
48582
- }
48583
- return function (d) {
48584
- var _d$data;
48585
- const id = $$.getTargetSelectorSuffix(d.id || ((_d$data = d.data) == null ? void 0 : _d$data.id) || d),
48586
- element = src_select(this);
48587
- ids.indexOf(id) < 0 && ids.push(id);
48588
- let point = pattern[ids.indexOf(id) % pattern.length];
48589
- if ($$.hasValidPointType(point)) {
48590
- point = $$[point];
48591
- } else if (!$$.hasValidPointDrawMethods(point)) {
48592
- const pointId = datetimeId + "-point" + id,
48593
- pointFromDefs = $$.pointFromDefs(pointId);
48594
- if (pointFromDefs.size() < 1) {
48595
- $$.insertPointInfoDefs(point, pointId);
48596
- }
48597
- if (method === "create") {
48598
- return $$.custom.create.bind(context).apply(void 0, [element, pointId].concat(args));
48599
- } else if (method === "update") {
48600
- return $$.custom.update.bind(context).apply(void 0, [element].concat(args));
48601
- }
48602
- }
48603
- return point[method].bind(context).apply(void 0, [element].concat(args));
48604
- };
48605
- };
48606
- },
48607
48695
  custom: {
48608
48696
  create: function create(element, id, fillStyleFn) {
48609
48697
  return element.append("use").attr("xlink:href", "#" + id).attr("class", this.updatePointClass.bind(this)).style("fill", fillStyleFn).node();
48610
48698
  },
48611
48699
  update: function update(element, xPosFn, yPosFn, fillStyleFn, withTransition, flow, selectedCircles) {
48612
- var _this9 = this;
48700
+ var _this8 = this;
48613
48701
  const $$ = this,
48614
48702
  _element$node$getBBox = element.node().getBBox(),
48615
48703
  width = _element$node$getBBox.width,
48616
48704
  height = _element$node$getBBox.height,
48617
48705
  xPosFn2 = function (d) {
48618
- _newArrowCheck(this, _this9);
48706
+ _newArrowCheck(this, _this8);
48619
48707
  return isValue(d.value) ? xPosFn(d) - width / 2 : 0;
48620
48708
  }.bind(this),
48621
48709
  yPosFn2 = function (d) {
48622
- _newArrowCheck(this, _this9);
48710
+ _newArrowCheck(this, _this8);
48623
48711
  return isValue(d.value) ? yPosFn(d) - height / 2 : 0;
48624
48712
  }.bind(this);
48625
48713
  let mainCircles = element;
@@ -48657,23 +48745,23 @@ const getTransitionName = function () {
48657
48745
  // 'rectangle' data point
48658
48746
  rectangle: {
48659
48747
  create: function create(element, sizeFn, fillStyleFn) {
48660
- var _this10 = this;
48748
+ var _this9 = this;
48661
48749
  const rectSizeFn = function (d) {
48662
- _newArrowCheck(this, _this10);
48750
+ _newArrowCheck(this, _this9);
48663
48751
  return sizeFn(d) * 2;
48664
48752
  }.bind(this);
48665
48753
  return element.append("rect").attr("class", this.updatePointClass.bind(this)).attr("width", rectSizeFn).attr("height", rectSizeFn).style("fill", fillStyleFn).node();
48666
48754
  },
48667
48755
  update: function update(element, xPosFn, yPosFn, fillStyleFn, withTransition, flow, selectedCircles) {
48668
- var _this11 = this;
48756
+ var _this10 = this;
48669
48757
  const $$ = this,
48670
48758
  r = $$.config.point_r,
48671
48759
  rectXPosFn = function (d) {
48672
- _newArrowCheck(this, _this11);
48760
+ _newArrowCheck(this, _this10);
48673
48761
  return xPosFn(d) - r;
48674
48762
  }.bind(this),
48675
48763
  rectYPosFn = function (d) {
48676
- _newArrowCheck(this, _this11);
48764
+ _newArrowCheck(this, _this10);
48677
48765
  return yPosFn(d) - r;
48678
48766
  }.bind(this);
48679
48767
  let mainCircles = element;
@@ -51349,6 +51437,7 @@ var shape_this = undefined;
51349
51437
 
51350
51438
 
51351
51439
 
51440
+
51352
51441
  // Options
51353
51442
 
51354
51443
 
@@ -51376,9 +51465,9 @@ var shape_this = undefined;
51376
51465
  * @private
51377
51466
  */
51378
51467
  function extendAxis(module, option) {
51379
- util_extend(ChartInternal.prototype, internal.concat(module));
51468
+ util_extend(ChartInternal.prototype, Object.values(internal).concat(module));
51380
51469
  util_extend(Chart.prototype, api);
51381
- Options.setOptions(options.concat(option || []));
51470
+ Options.setOptions(Object.values(options).concat(option || []));
51382
51471
  }
51383
51472
 
51384
51473
  /**
@@ -51388,7 +51477,7 @@ function extendAxis(module, option) {
51388
51477
  * @private
51389
51478
  */
51390
51479
  function extendLine(module, option) {
51391
- extendAxis([point, line].concat(module || []));
51480
+ extendAxis([point_common, point, line].concat(module || []));
51392
51481
  Options.setOptions([common_point, shape_line].concat(option || []));
51393
51482
  }
51394
51483
 
@@ -51399,8 +51488,8 @@ function extendLine(module, option) {
51399
51488
  * @private
51400
51489
  */
51401
51490
  function extendArc(module, option) {
51402
- util_extend(ChartInternal.prototype, [arc].concat(module || []));
51403
- Options.setOptions(option);
51491
+ util_extend(ChartInternal.prototype, [arc, point_common].concat(module || []));
51492
+ Options.setOptions([common_point].concat(option || []));
51404
51493
  }
51405
51494
 
51406
51495
  // Area types
@@ -51503,7 +51592,9 @@ let _area = function area() {
51503
51592
  resolver_shape_radar = function () {
51504
51593
  var _this14 = this;
51505
51594
  _newArrowCheck(this, shape_this);
51506
- return extendArc([point, radar], [common_point, shape_radar]), (resolver_shape_radar = function () {
51595
+ return extendArc([internal.eventrect, point, radar], [common_point, shape_radar, {
51596
+ axis_x_categories: options.optAxis.axis_x_categories
51597
+ }]), (resolver_shape_radar = function () {
51507
51598
  _newArrowCheck(this, _this14);
51508
51599
  return TYPE.RADAR;
51509
51600
  }.bind(this))();
@@ -51511,7 +51602,7 @@ let _area = function area() {
51511
51602
  resolver_shape_bar = function () {
51512
51603
  var _this15 = this;
51513
51604
  _newArrowCheck(this, shape_this);
51514
- return extendAxis([bar], shape_bar), (resolver_shape_bar = function () {
51605
+ return extendAxis([bar, point_common], [shape_bar, common_point]), (resolver_shape_bar = function () {
51515
51606
  _newArrowCheck(this, _this15);
51516
51607
  return TYPE.BAR;
51517
51608
  }.bind(this))();
@@ -51519,7 +51610,7 @@ let _area = function area() {
51519
51610
  resolver_shape_bubble = function () {
51520
51611
  var _this16 = this;
51521
51612
  _newArrowCheck(this, shape_this);
51522
- return extendAxis([point, bubble], [shape_bubble, common_point]), (resolver_shape_bubble = function () {
51613
+ return extendAxis([point_common, point, bubble], [shape_bubble, common_point]), (resolver_shape_bubble = function () {
51523
51614
  _newArrowCheck(this, _this16);
51524
51615
  return TYPE.BUBBLE;
51525
51616
  }.bind(this))();
@@ -51527,7 +51618,7 @@ let _area = function area() {
51527
51618
  resolver_shape_candlestick = function () {
51528
51619
  var _this17 = this;
51529
51620
  _newArrowCheck(this, shape_this);
51530
- return extendAxis([candlestick], [shape_candlestick]), (resolver_shape_candlestick = function () {
51621
+ return extendAxis([candlestick, point_common], [shape_candlestick, common_point]), (resolver_shape_candlestick = function () {
51531
51622
  _newArrowCheck(this, _this17);
51532
51623
  return TYPE.CANDLESTICK;
51533
51624
  }.bind(this))();
@@ -51535,7 +51626,7 @@ let _area = function area() {
51535
51626
  shape_scatter = function () {
51536
51627
  var _this18 = this;
51537
51628
  _newArrowCheck(this, shape_this);
51538
- return extendAxis([point], [common_point, scatter]), (shape_scatter = function () {
51629
+ return extendAxis([point_common, point], [common_point, scatter]), (shape_scatter = function () {
51539
51630
  _newArrowCheck(this, _this18);
51540
51631
  return TYPE.SCATTER;
51541
51632
  }.bind(this))();
@@ -53484,9 +53575,9 @@ function selection_objectSpread(e) { for (var r = 1, t; r < arguments.length; r+
53484
53575
  if (config.zoom_type === "drag" && e && startEvent.clientX === e.clientX && startEvent.clientY === e.clientY) {
53485
53576
  return;
53486
53577
  }
53578
+ state.zooming = !1;
53487
53579
  $$.redrawEventRect();
53488
53580
  $$.updateZoom();
53489
- state.zooming = !1;
53490
53581
 
53491
53582
  // do not call event cb when is .unzoom() is called
53492
53583
  !isUnZoom && (e || state.dragging) && callFn(config.zoom_onzoomend, $$.api, (_$$$state$domain2 = $$.state.domain) != null ? _$$$state$domain2 : $$.zoom.getDomain());
@@ -53623,6 +53714,13 @@ function selection_objectSpread(e) { for (var r = 1, t; r < arguments.length; r+
53623
53714
  $el.zoomResetBtn.style("display", null);
53624
53715
  }
53625
53716
  }
53717
+ },
53718
+ getZoomTransform: function getZoomTransform() {
53719
+ const $$ = this,
53720
+ eventRect = $$.$el.eventRect;
53721
+ return eventRect != null && eventRect.node() ? transform_transform(eventRect.node()) : {
53722
+ k: 1
53723
+ };
53626
53724
  }
53627
53725
  });
53628
53726
  ;// CONCATENATED MODULE: ./src/config/Options/data/selection.ts
@@ -54003,7 +54101,7 @@ let _defaults = {};
54003
54101
 
54004
54102
  /**
54005
54103
  * @namespace bb
54006
- * @version 3.11.0
54104
+ * @version 3.11.2
54007
54105
  */
54008
54106
  const bb = {
54009
54107
  /**
@@ -54013,7 +54111,7 @@ const bb = {
54013
54111
  * bb.version; // "1.0.0"
54014
54112
  * @memberof bb
54015
54113
  */
54016
- version: "3.11.0",
54114
+ version: "3.11.2",
54017
54115
  /**
54018
54116
  * Generate chart
54019
54117
  * - **NOTE:** Bear in mind for the possiblity of ***throwing an error***, during the generation when: