billboard.js 3.7.0-next.2 → 3.7.0

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 (38) hide show
  1. package/dist/billboard.css +1 -1
  2. package/dist/billboard.js +78 -73
  3. package/dist/billboard.min.css +1 -1
  4. package/dist/billboard.min.js +2 -2
  5. package/dist/billboard.pkgd.js +127 -81
  6. package/dist/billboard.pkgd.min.js +4 -4
  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 +3 -3
  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.js +49 -8
  18. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.js +49 -8
  19. package/dist/plugin/pkgd/billboardjs-plugin-stanford.js +50 -9
  20. package/dist/plugin/pkgd/billboardjs-plugin-tableview.js +49 -8
  21. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.js +49 -8
  22. package/dist/theme/datalab.css +1 -1
  23. package/dist/theme/datalab.min.css +1 -1
  24. package/dist/theme/graph.css +1 -1
  25. package/dist/theme/graph.min.css +1 -1
  26. package/dist/theme/insight.css +1 -1
  27. package/dist/theme/insight.min.css +1 -1
  28. package/dist-esm/billboard.js +60 -64
  29. package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +2 -2
  30. package/dist-esm/plugin/billboardjs-plugin-sparkline.js +2 -2
  31. package/dist-esm/plugin/billboardjs-plugin-stanford.js +4 -4
  32. package/dist-esm/plugin/billboardjs-plugin-tableview.js +2 -2
  33. package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +2 -2
  34. package/package.json +17 -17
  35. package/src/Chart/api/selection.ts +54 -56
  36. package/src/ChartInternal/interactions/interaction.ts +2 -3
  37. package/src/ChartInternal/internals/selection.ts +8 -8
  38. package/src/Plugin/stanford/ColorScale.ts +2 -2
@@ -5,11 +5,11 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.7.0-next.2
8
+ * @version 3.7.0
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.3
12
- * - @types/d3-transition ^3.0.2
11
+ * - @types/d3-selection ^3.0.4
12
+ * - @types/d3-transition ^3.0.3
13
13
  * - d3-axis ^3.0.0
14
14
  * - d3-brush ^3.0.0
15
15
  * - d3-drag ^3.0.0
@@ -1169,10 +1169,10 @@ var store = __webpack_require__(37);
1169
1169
  (module.exports = function (key, value) {
1170
1170
  return store[key] || (store[key] = value !== undefined ? value : {});
1171
1171
  })('versions', []).push({
1172
- version: '3.27.0',
1172
+ version: '3.27.1',
1173
1173
  mode: IS_PURE ? 'pure' : 'global',
1174
1174
  copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
1175
- license: 'https://github.com/zloirock/core-js/blob/v3.27.0/LICENSE',
1175
+ license: 'https://github.com/zloirock/core-js/blob/v3.27.1/LICENSE',
1176
1176
  source: 'https://github.com/zloirock/core-js'
1177
1177
  });
1178
1178
 
@@ -14191,6 +14191,7 @@ __webpack_require__(469);
14191
14191
 
14192
14192
  "use strict";
14193
14193
 
14194
+ var FREEZING = __webpack_require__(234);
14194
14195
  var global = __webpack_require__(4);
14195
14196
  var uncurryThis = __webpack_require__(14);
14196
14197
  var defineBuiltIns = __webpack_require__(198);
@@ -14198,10 +14199,26 @@ var InternalMetadataModule = __webpack_require__(231);
14198
14199
  var collection = __webpack_require__(230);
14199
14200
  var collectionWeak = __webpack_require__(470);
14200
14201
  var isObject = __webpack_require__(20);
14201
- var isExtensible = __webpack_require__(232);
14202
14202
  var enforceInternalState = (__webpack_require__(52).enforce);
14203
+ var fails = __webpack_require__(7);
14203
14204
  var NATIVE_WEAK_MAP = __webpack_require__(53);
14204
14205
 
14206
+ var $Object = Object;
14207
+ // eslint-disable-next-line es/no-array-isarray -- safe
14208
+ var isArray = Array.isArray;
14209
+ // eslint-disable-next-line es/no-object-isextensible -- safe
14210
+ var isExtensible = $Object.isExtensible;
14211
+ // eslint-disable-next-line es/no-object-isfrozen -- safe
14212
+ var isFrozen = $Object.isFrozen;
14213
+ // eslint-disable-next-line es/no-object-issealed -- safe
14214
+ var isSealed = $Object.isSealed;
14215
+ // eslint-disable-next-line es/no-object-freeze -- safe
14216
+ var freeze = $Object.freeze;
14217
+ // eslint-disable-next-line es/no-object-seal -- safe
14218
+ var seal = $Object.seal;
14219
+
14220
+ var FROZEN = {};
14221
+ var SEALED = {};
14205
14222
  var IS_IE11 = !global.ActiveXObject && 'ActiveXObject' in global;
14206
14223
  var InternalWeakMap;
14207
14224
 
@@ -14214,18 +14231,27 @@ var wrapper = function (init) {
14214
14231
  // `WeakMap` constructor
14215
14232
  // https://tc39.es/ecma262/#sec-weakmap-constructor
14216
14233
  var $WeakMap = collection('WeakMap', wrapper, collectionWeak);
14234
+ var WeakMapPrototype = $WeakMap.prototype;
14235
+ var nativeSet = uncurryThis(WeakMapPrototype.set);
14236
+
14237
+ // Chakra Edge bug: adding frozen arrays to WeakMap unfreeze them
14238
+ var hasMSEdgeFreezingBug = function () {
14239
+ return FREEZING && fails(function () {
14240
+ var frozenArray = freeze([]);
14241
+ nativeSet(new $WeakMap(), frozenArray, 1);
14242
+ return !isFrozen(frozenArray);
14243
+ });
14244
+ };
14217
14245
 
14218
14246
  // IE11 WeakMap frozen keys fix
14219
14247
  // We can't use feature detection because it crash some old IE builds
14220
14248
  // https://github.com/zloirock/core-js/issues/485
14221
- if (NATIVE_WEAK_MAP && IS_IE11) {
14249
+ if (NATIVE_WEAK_MAP) if (IS_IE11) {
14222
14250
  InternalWeakMap = collectionWeak.getConstructor(wrapper, 'WeakMap', true);
14223
14251
  InternalMetadataModule.enable();
14224
- var WeakMapPrototype = $WeakMap.prototype;
14225
14252
  var nativeDelete = uncurryThis(WeakMapPrototype['delete']);
14226
14253
  var nativeHas = uncurryThis(WeakMapPrototype.has);
14227
14254
  var nativeGet = uncurryThis(WeakMapPrototype.get);
14228
- var nativeSet = uncurryThis(WeakMapPrototype.set);
14229
14255
  defineBuiltIns(WeakMapPrototype, {
14230
14256
  'delete': function (key) {
14231
14257
  if (isObject(key) && !isExtensible(key)) {
@@ -14257,6 +14283,21 @@ if (NATIVE_WEAK_MAP && IS_IE11) {
14257
14283
  return this;
14258
14284
  }
14259
14285
  });
14286
+ // Chakra Edge frozen keys fix
14287
+ } else if (hasMSEdgeFreezingBug()) {
14288
+ defineBuiltIns(WeakMapPrototype, {
14289
+ set: function set(key, value) {
14290
+ var arrayIntegrityLevel;
14291
+ if (isArray(key)) {
14292
+ if (isFrozen(key)) arrayIntegrityLevel = FROZEN;
14293
+ else if (isSealed(key)) arrayIntegrityLevel = SEALED;
14294
+ }
14295
+ nativeSet(this, key, value);
14296
+ if (arrayIntegrityLevel == FROZEN) freeze(key);
14297
+ if (arrayIntegrityLevel == SEALED) seal(key);
14298
+ return this;
14299
+ }
14300
+ });
14260
14301
  }
14261
14302
 
14262
14303
 
@@ -27424,7 +27465,9 @@ function drag_defaultTouchable() {
27424
27465
  var _this = this,
27425
27466
  $$ = this,
27426
27467
  config = $$.config,
27427
- main = $$.$el.main,
27468
+ _$$$$el = $$.$el,
27469
+ main = _$$$$el.main,
27470
+ circle = _$$$$el.circle,
27428
27471
  isSelectionEnabled = config.data_selection_enabled,
27429
27472
  isSelectionGrouped = config.data_selection_grouped,
27430
27473
  isSelectable = config.data_selection_isselectable,
@@ -27439,7 +27482,7 @@ function drag_defaultTouchable() {
27439
27482
  }
27440
27483
 
27441
27484
  // remove possible previous focused state
27442
- main.selectAll("." + $COMMON.EXPANDED + ":not(." + $SHAPE.shape + "-" + index + ")").classed($COMMON.EXPANDED, !1);
27485
+ circle || main.selectAll("." + $COMMON.EXPANDED + ":not(." + $SHAPE.shape + "-" + index + ")").classed($COMMON.EXPANDED, !1);
27443
27486
  var shapeAtIndex = main.selectAll("." + $SHAPE.shape + "-" + index).classed($COMMON.EXPANDED, !0).style("cursor", isSelectable ? "pointer" : null).filter(function (d) {
27444
27487
  return $$.isWithinShape(this, d);
27445
27488
  });
@@ -27623,11 +27666,11 @@ function drag_defaultTouchable() {
27623
27666
  hasAxis = _$$$state2.hasAxis,
27624
27667
  hasRadar = _$$$state2.hasRadar,
27625
27668
  hasTreemap = _$$$state2.hasTreemap,
27626
- _$$$$el = $$.$el,
27627
- eventRect = _$$$$el.eventRect,
27628
- arcs = _$$$$el.arcs,
27629
- radar = _$$$$el.radar,
27630
- treemap = _$$$$el.treemap,
27669
+ _$$$$el2 = $$.$el,
27670
+ eventRect = _$$$$el2.eventRect,
27671
+ arcs = _$$$$el2.arcs,
27672
+ radar = _$$$$el2.radar,
27673
+ treemap = _$$$$el2.treemap,
27631
27674
  element = (_ref = hasTreemap && eventReceiver.rect || hasRadar && radar.axes.select("." + $AXIS.axis + "-" + index + " text") || eventRect || (arcs == null ? void 0 : arcs.selectAll("." + $COMMON.target + " path").filter(function (d, i) {
27632
27675
  _newArrowCheck(this, _this7);
27633
27676
  return i === index;
@@ -27663,9 +27706,9 @@ function drag_defaultTouchable() {
27663
27706
  */
27664
27707
  unbindZoomEvent: function unbindZoomEvent() {
27665
27708
  var $$ = this,
27666
- _$$$$el2 = $$.$el,
27667
- eventRect = _$$$$el2.eventRect,
27668
- zoomResetBtn = _$$$$el2.zoomResetBtn;
27709
+ _$$$$el3 = $$.$el,
27710
+ eventRect = _$$$$el3.eventRect,
27711
+ zoomResetBtn = _$$$$el3.zoomResetBtn;
27669
27712
  eventRect == null ? void 0 : eventRect.on(".zoom wheel.zoom .drag", null);
27670
27713
  zoomResetBtn == null ? void 0 : zoomResetBtn.on("click", null).style("display", "none");
27671
27714
  },
@@ -27676,13 +27719,13 @@ function drag_defaultTouchable() {
27676
27719
  unbindAllEvents: function unbindAllEvents() {
27677
27720
  var _this8 = this,
27678
27721
  $$ = this,
27679
- _$$$$el3 = $$.$el,
27680
- arcs = _$$$$el3.arcs,
27681
- eventRect = _$$$$el3.eventRect,
27682
- legend = _$$$$el3.legend,
27683
- region = _$$$$el3.region,
27684
- svg = _$$$$el3.svg,
27685
- treemap = _$$$$el3.treemap,
27722
+ _$$$$el4 = $$.$el,
27723
+ arcs = _$$$$el4.arcs,
27724
+ eventRect = _$$$$el4.eventRect,
27725
+ legend = _$$$$el4.legend,
27726
+ region = _$$$$el4.region,
27727
+ svg = _$$$$el4.svg,
27728
+ treemap = _$$$$el4.treemap,
27686
27729
  brush = $$.brush;
27687
27730
  // detach all possible event types
27688
27731
  [svg, eventRect, region == null ? void 0 : region.list, brush == null ? void 0 : brush.getSelection(), arcs == null ? void 0 : arcs.selectAll("path"), legend == null ? void 0 : legend.selectAll("g"), treemap].forEach(function (v) {
@@ -48447,6 +48490,52 @@ var _area = function area() {
48447
48490
 
48448
48491
 
48449
48492
 
48493
+ /**
48494
+ * Toggler function to select or unselect
48495
+ * @param {boolean} isSelection Weather select or unselect
48496
+ * @param {Array} ids Target ids
48497
+ * @param {Array} indices Indices number
48498
+ * @param {boolean} resetOther Weather reset other selected points (only for selection)
48499
+ * @private
48500
+ */
48501
+ function setSelection(isSelection, ids, indices, resetOther) {
48502
+ if (isSelection === void 0) {
48503
+ isSelection = !1;
48504
+ }
48505
+ var $$ = this,
48506
+ config = $$.config,
48507
+ main = $$.$el.main,
48508
+ selectionGrouped = config.data_selection_grouped,
48509
+ isSelectable = config.data_selection_isselectable.bind($$.api);
48510
+ if (!config.data_selection_enabled) {
48511
+ return;
48512
+ }
48513
+ main.selectAll("." + $SHAPE.shapes).selectAll("." + $SHAPE.shape).each(function (d) {
48514
+ var shape = src_select(this),
48515
+ _ref = d.data ? d.data : d,
48516
+ id = _ref.id,
48517
+ index = _ref.index,
48518
+ toggle = $$.getToggle(this, d).bind($$),
48519
+ isTargetId = selectionGrouped || !ids || ids.indexOf(id) >= 0,
48520
+ isTargetIndex = !indices || indices.indexOf(index) >= 0,
48521
+ isSelected = shape.classed($SELECT.SELECTED);
48522
+ // line/area selection not supported yet
48523
+ if (shape.classed($LINE.line) || shape.classed($AREA.area)) {
48524
+ return;
48525
+ }
48526
+ if (isSelection) {
48527
+ if (isTargetId && isTargetIndex && isSelectable(d) && !isSelected) {
48528
+ toggle(!0, shape.classed($SELECT.SELECTED, !0), d, index);
48529
+ } else if (isDefined(resetOther) && resetOther && isSelected) {
48530
+ toggle(!1, shape.classed($SELECT.SELECTED, !1), d, index);
48531
+ }
48532
+ } else {
48533
+ if (isTargetId && isTargetIndex && isSelectable(d) && isSelected) {
48534
+ toggle(!1, shape.classed($SELECT.SELECTED, !1), d, index);
48535
+ }
48536
+ }
48537
+ });
48538
+ }
48450
48539
  /* harmony default export */ var api_selection = ({
48451
48540
  /**
48452
48541
  * Get selected data points.<br><br>
@@ -48501,31 +48590,8 @@ var _area = function area() {
48501
48590
  * chart.select("data1", [0, 3, 5]);
48502
48591
  */
48503
48592
  select: function select(ids, indices, resetOther) {
48504
- var $$ = this.internal,
48505
- config = $$.config,
48506
- $el = $$.$el;
48507
- if (!config.data_selection_enabled) {
48508
- return;
48509
- }
48510
- $el.main.selectAll("." + $SHAPE.shapes).selectAll("." + $SHAPE.shape).each(function (d, i) {
48511
- var shape = src_select(this),
48512
- id = d.data ? d.data.id : d.id,
48513
- toggle = $$.getToggle(this, d).bind($$),
48514
- isTargetId = config.data_selection_grouped || !ids || ids.indexOf(id) >= 0,
48515
- isTargetIndex = !indices || indices.indexOf(i) >= 0,
48516
- isSelected = shape.classed($SELECT.SELECTED);
48517
- // line/area selection not supported yet
48518
- if (shape.classed($LINE.line) || shape.classed($AREA.area)) {
48519
- return;
48520
- }
48521
- if (isTargetId && isTargetIndex) {
48522
- if (config.data_selection_isselectable.bind($$.api)(d) && !isSelected) {
48523
- toggle(!0, shape.classed($SELECT.SELECTED, !0), d, i);
48524
- }
48525
- } else if (isDefined(resetOther) && resetOther && isSelected) {
48526
- toggle(!1, shape.classed($SELECT.SELECTED, !1), d, i);
48527
- }
48528
- });
48593
+ var $$ = this.internal;
48594
+ setSelection.bind($$)(!0, ids, indices, resetOther);
48529
48595
  },
48530
48596
  /**
48531
48597
  * Set data points to be un-selected.
@@ -48545,27 +48611,8 @@ var _area = function area() {
48545
48611
  * chart.unselect("data1", [2]);
48546
48612
  */
48547
48613
  unselect: function unselect(ids, indices) {
48548
- var $$ = this.internal,
48549
- config = $$.config,
48550
- $el = $$.$el;
48551
- if (!config.data_selection_enabled) {
48552
- return;
48553
- }
48554
- $el.main.selectAll("." + $SHAPE.shapes).selectAll("." + $SHAPE.shape).each(function (d, i) {
48555
- var shape = src_select(this),
48556
- id = d.data ? d.data.id : d.id,
48557
- toggle = $$.getToggle(this, d).bind($$),
48558
- isTargetId = config.data_selection_grouped || !ids || ids.indexOf(id) >= 0,
48559
- isTargetIndex = !indices || indices.indexOf(i) >= 0,
48560
- isSelected = shape.classed($SELECT.SELECTED);
48561
- // line/area selection not supported yet
48562
- if (shape.classed($LINE.line) || shape.classed($AREA.area)) {
48563
- return;
48564
- }
48565
- if (isTargetId && isTargetIndex && config.data_selection_isselectable.bind($$.api)(d) && isSelected) {
48566
- toggle(!1, shape.classed($SELECT.SELECTED, !1), d, i);
48567
- }
48568
- });
48614
+ var $$ = this.internal;
48615
+ setSelection.bind($$)(!1, ids, indices);
48569
48616
  }
48570
48617
  });
48571
48618
  ;// CONCATENATED MODULE: ./src/Chart/api/subchart.ts
@@ -49632,7 +49679,7 @@ function selection_objectSpread(target) { for (var i = 1, source; i < arguments.
49632
49679
  config = $$.config,
49633
49680
  main = $$.$el.main,
49634
49681
  $T = $$.$T;
49635
- callFn(config.data_onunselected, $$.api, d, target.node());
49682
+ callFn(config.data_onunselected, $$.api, d, target == null ? void 0 : target.node());
49636
49683
 
49637
49684
  // remove selected-circle from low layer g
49638
49685
  $T(main.select("." + $SELECT.selectedCircles + $$.getTargetSelectorSuffix(d.id)).selectAll("." + $SELECT.selectedCircle + "-" + i)).attr("r", 0).remove();
@@ -49721,16 +49768,15 @@ function selection_objectSpread(target) { for (var i = 1, source; i < arguments.
49721
49768
  toggle = $$.getToggle(that, d).bind($$);
49722
49769
  var toggledShape;
49723
49770
  if (!config.data_selection_multiple) {
49724
- var selector = "." + $SHAPE.shapes;
49771
+ var focusOnly = config.point_focus_only;
49772
+ var selector = "." + (focusOnly ? $SELECT.selectedCircles : $SHAPE.shapes);
49725
49773
  if (config.data_selection_grouped) {
49726
49774
  selector += $$.getTargetSelectorSuffix(d.id);
49727
49775
  }
49728
- main.selectAll(selector).selectAll("." + $SHAPE.shape).each(function (d, i) {
49776
+ main.selectAll(selector).selectAll(focusOnly ? "." + $SELECT.selectedCircle : "." + $SHAPE.shape + "." + $SELECT.SELECTED).classed($SELECT.SELECTED, !1).each(function (d) {
49729
49777
  var shape = src_select(this);
49730
- if (shape.classed($SELECT.SELECTED)) {
49731
- toggledShape = shape;
49732
- toggle(!1, shape.classed($SELECT.SELECTED, !1), d, i);
49733
- }
49778
+ toggledShape = shape;
49779
+ toggle(!1, shape, d, d.index);
49734
49780
  });
49735
49781
  }
49736
49782
  if (!toggledShape || toggledShape.node() !== shape.node()) {
@@ -50796,7 +50842,7 @@ var _defaults = {};
50796
50842
 
50797
50843
  /**
50798
50844
  * @namespace bb
50799
- * @version 3.7.0-next.2
50845
+ * @version 3.7.0
50800
50846
  */
50801
50847
  var bb = {
50802
50848
  /**
@@ -50806,7 +50852,7 @@ var bb = {
50806
50852
  * bb.version; // "1.0.0"
50807
50853
  * @memberof bb
50808
50854
  */
50809
- version: "3.7.0-next.2",
50855
+ version: "3.7.0",
50810
50856
  /**
50811
50857
  * Generate chart
50812
50858
  * - **NOTE:** Bear in mind for the possiblity of ***throwing an error***, during the generation when: