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,7 +5,7 @@
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
  /*-- 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.7.0-next.2
8
+ * @version 3.7.0
9
9
  */
10
10
  (function webpackUniversalModuleDefinition(root, factory) {
11
11
  if(typeof exports === 'object' && typeof module === 'object')
@@ -5484,7 +5484,9 @@ var external_commonjs_d3_drag_commonjs2_d3_drag_amd_d3_drag_root_d3_ = __webpack
5484
5484
  var _this = this,
5485
5485
  $$ = this,
5486
5486
  config = $$.config,
5487
- main = $$.$el.main,
5487
+ _$$$$el = $$.$el,
5488
+ main = _$$$$el.main,
5489
+ circle = _$$$$el.circle,
5488
5490
  isSelectionEnabled = config.data_selection_enabled,
5489
5491
  isSelectionGrouped = config.data_selection_grouped,
5490
5492
  isSelectable = config.data_selection_isselectable,
@@ -5499,7 +5501,7 @@ var external_commonjs_d3_drag_commonjs2_d3_drag_amd_d3_drag_root_d3_ = __webpack
5499
5501
  }
5500
5502
 
5501
5503
  // remove possible previous focused state
5502
- main.selectAll("." + $COMMON.EXPANDED + ":not(." + $SHAPE.shape + "-" + index + ")").classed($COMMON.EXPANDED, !1);
5504
+ circle || main.selectAll("." + $COMMON.EXPANDED + ":not(." + $SHAPE.shape + "-" + index + ")").classed($COMMON.EXPANDED, !1);
5503
5505
  var shapeAtIndex = main.selectAll("." + $SHAPE.shape + "-" + index).classed($COMMON.EXPANDED, !0).style("cursor", isSelectable ? "pointer" : null).filter(function (d) {
5504
5506
  return $$.isWithinShape(this, d);
5505
5507
  });
@@ -5683,11 +5685,11 @@ var external_commonjs_d3_drag_commonjs2_d3_drag_amd_d3_drag_root_d3_ = __webpack
5683
5685
  hasAxis = _$$$state2.hasAxis,
5684
5686
  hasRadar = _$$$state2.hasRadar,
5685
5687
  hasTreemap = _$$$state2.hasTreemap,
5686
- _$$$$el = $$.$el,
5687
- eventRect = _$$$$el.eventRect,
5688
- arcs = _$$$$el.arcs,
5689
- radar = _$$$$el.radar,
5690
- treemap = _$$$$el.treemap,
5688
+ _$$$$el2 = $$.$el,
5689
+ eventRect = _$$$$el2.eventRect,
5690
+ arcs = _$$$$el2.arcs,
5691
+ radar = _$$$$el2.radar,
5692
+ treemap = _$$$$el2.treemap,
5691
5693
  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) {
5692
5694
  _newArrowCheck(this, _this7);
5693
5695
  return i === index;
@@ -5723,9 +5725,9 @@ var external_commonjs_d3_drag_commonjs2_d3_drag_amd_d3_drag_root_d3_ = __webpack
5723
5725
  */
5724
5726
  unbindZoomEvent: function unbindZoomEvent() {
5725
5727
  var $$ = this,
5726
- _$$$$el2 = $$.$el,
5727
- eventRect = _$$$$el2.eventRect,
5728
- zoomResetBtn = _$$$$el2.zoomResetBtn;
5728
+ _$$$$el3 = $$.$el,
5729
+ eventRect = _$$$$el3.eventRect,
5730
+ zoomResetBtn = _$$$$el3.zoomResetBtn;
5729
5731
  eventRect == null ? void 0 : eventRect.on(".zoom wheel.zoom .drag", null);
5730
5732
  zoomResetBtn == null ? void 0 : zoomResetBtn.on("click", null).style("display", "none");
5731
5733
  },
@@ -5736,13 +5738,13 @@ var external_commonjs_d3_drag_commonjs2_d3_drag_amd_d3_drag_root_d3_ = __webpack
5736
5738
  unbindAllEvents: function unbindAllEvents() {
5737
5739
  var _this8 = this,
5738
5740
  $$ = this,
5739
- _$$$$el3 = $$.$el,
5740
- arcs = _$$$$el3.arcs,
5741
- eventRect = _$$$$el3.eventRect,
5742
- legend = _$$$$el3.legend,
5743
- region = _$$$$el3.region,
5744
- svg = _$$$$el3.svg,
5745
- treemap = _$$$$el3.treemap,
5741
+ _$$$$el4 = $$.$el,
5742
+ arcs = _$$$$el4.arcs,
5743
+ eventRect = _$$$$el4.eventRect,
5744
+ legend = _$$$$el4.legend,
5745
+ region = _$$$$el4.region,
5746
+ svg = _$$$$el4.svg,
5747
+ treemap = _$$$$el4.treemap,
5746
5748
  brush = $$.brush;
5747
5749
  // detach all possible event types
5748
5750
  [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) {
@@ -22699,6 +22701,52 @@ var _area = function area() {
22699
22701
 
22700
22702
 
22701
22703
 
22704
+ /**
22705
+ * Toggler function to select or unselect
22706
+ * @param {boolean} isSelection Weather select or unselect
22707
+ * @param {Array} ids Target ids
22708
+ * @param {Array} indices Indices number
22709
+ * @param {boolean} resetOther Weather reset other selected points (only for selection)
22710
+ * @private
22711
+ */
22712
+ function setSelection(isSelection, ids, indices, resetOther) {
22713
+ if (isSelection === void 0) {
22714
+ isSelection = !1;
22715
+ }
22716
+ var $$ = this,
22717
+ config = $$.config,
22718
+ main = $$.$el.main,
22719
+ selectionGrouped = config.data_selection_grouped,
22720
+ isSelectable = config.data_selection_isselectable.bind($$.api);
22721
+ if (!config.data_selection_enabled) {
22722
+ return;
22723
+ }
22724
+ main.selectAll("." + $SHAPE.shapes).selectAll("." + $SHAPE.shape).each(function (d) {
22725
+ var shape = (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(this),
22726
+ _ref = d.data ? d.data : d,
22727
+ id = _ref.id,
22728
+ index = _ref.index,
22729
+ toggle = $$.getToggle(this, d).bind($$),
22730
+ isTargetId = selectionGrouped || !ids || ids.indexOf(id) >= 0,
22731
+ isTargetIndex = !indices || indices.indexOf(index) >= 0,
22732
+ isSelected = shape.classed($SELECT.SELECTED);
22733
+ // line/area selection not supported yet
22734
+ if (shape.classed($LINE.line) || shape.classed($AREA.area)) {
22735
+ return;
22736
+ }
22737
+ if (isSelection) {
22738
+ if (isTargetId && isTargetIndex && isSelectable(d) && !isSelected) {
22739
+ toggle(!0, shape.classed($SELECT.SELECTED, !0), d, index);
22740
+ } else if (isDefined(resetOther) && resetOther && isSelected) {
22741
+ toggle(!1, shape.classed($SELECT.SELECTED, !1), d, index);
22742
+ }
22743
+ } else {
22744
+ if (isTargetId && isTargetIndex && isSelectable(d) && isSelected) {
22745
+ toggle(!1, shape.classed($SELECT.SELECTED, !1), d, index);
22746
+ }
22747
+ }
22748
+ });
22749
+ }
22702
22750
  /* harmony default export */ var selection = ({
22703
22751
  /**
22704
22752
  * Get selected data points.<br><br>
@@ -22753,31 +22801,8 @@ var _area = function area() {
22753
22801
  * chart.select("data1", [0, 3, 5]);
22754
22802
  */
22755
22803
  select: function select(ids, indices, resetOther) {
22756
- var $$ = this.internal,
22757
- config = $$.config,
22758
- $el = $$.$el;
22759
- if (!config.data_selection_enabled) {
22760
- return;
22761
- }
22762
- $el.main.selectAll("." + $SHAPE.shapes).selectAll("." + $SHAPE.shape).each(function (d, i) {
22763
- var shape = (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(this),
22764
- id = d.data ? d.data.id : d.id,
22765
- toggle = $$.getToggle(this, d).bind($$),
22766
- isTargetId = config.data_selection_grouped || !ids || ids.indexOf(id) >= 0,
22767
- isTargetIndex = !indices || indices.indexOf(i) >= 0,
22768
- isSelected = shape.classed($SELECT.SELECTED);
22769
- // line/area selection not supported yet
22770
- if (shape.classed($LINE.line) || shape.classed($AREA.area)) {
22771
- return;
22772
- }
22773
- if (isTargetId && isTargetIndex) {
22774
- if (config.data_selection_isselectable.bind($$.api)(d) && !isSelected) {
22775
- toggle(!0, shape.classed($SELECT.SELECTED, !0), d, i);
22776
- }
22777
- } else if (isDefined(resetOther) && resetOther && isSelected) {
22778
- toggle(!1, shape.classed($SELECT.SELECTED, !1), d, i);
22779
- }
22780
- });
22804
+ var $$ = this.internal;
22805
+ setSelection.bind($$)(!0, ids, indices, resetOther);
22781
22806
  },
22782
22807
  /**
22783
22808
  * Set data points to be un-selected.
@@ -22797,27 +22822,8 @@ var _area = function area() {
22797
22822
  * chart.unselect("data1", [2]);
22798
22823
  */
22799
22824
  unselect: function unselect(ids, indices) {
22800
- var $$ = this.internal,
22801
- config = $$.config,
22802
- $el = $$.$el;
22803
- if (!config.data_selection_enabled) {
22804
- return;
22805
- }
22806
- $el.main.selectAll("." + $SHAPE.shapes).selectAll("." + $SHAPE.shape).each(function (d, i) {
22807
- var shape = (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(this),
22808
- id = d.data ? d.data.id : d.id,
22809
- toggle = $$.getToggle(this, d).bind($$),
22810
- isTargetId = config.data_selection_grouped || !ids || ids.indexOf(id) >= 0,
22811
- isTargetIndex = !indices || indices.indexOf(i) >= 0,
22812
- isSelected = shape.classed($SELECT.SELECTED);
22813
- // line/area selection not supported yet
22814
- if (shape.classed($LINE.line) || shape.classed($AREA.area)) {
22815
- return;
22816
- }
22817
- if (isTargetId && isTargetIndex && config.data_selection_isselectable.bind($$.api)(d) && isSelected) {
22818
- toggle(!1, shape.classed($SELECT.SELECTED, !1), d, i);
22819
- }
22820
- });
22825
+ var $$ = this.internal;
22826
+ setSelection.bind($$)(!1, ids, indices);
22821
22827
  }
22822
22828
  });
22823
22829
  ;// CONCATENATED MODULE: ./src/Chart/api/subchart.ts
@@ -23321,7 +23327,7 @@ function selection_objectSpread(target) { for (var i = 1, source; i < arguments.
23321
23327
  config = $$.config,
23322
23328
  main = $$.$el.main,
23323
23329
  $T = $$.$T;
23324
- callFn(config.data_onunselected, $$.api, d, target.node());
23330
+ callFn(config.data_onunselected, $$.api, d, target == null ? void 0 : target.node());
23325
23331
 
23326
23332
  // remove selected-circle from low layer g
23327
23333
  $T(main.select("." + $SELECT.selectedCircles + $$.getTargetSelectorSuffix(d.id)).selectAll("." + $SELECT.selectedCircle + "-" + i)).attr("r", 0).remove();
@@ -23410,16 +23416,15 @@ function selection_objectSpread(target) { for (var i = 1, source; i < arguments.
23410
23416
  toggle = $$.getToggle(that, d).bind($$);
23411
23417
  var toggledShape;
23412
23418
  if (!config.data_selection_multiple) {
23413
- var selector = "." + $SHAPE.shapes;
23419
+ var focusOnly = config.point_focus_only;
23420
+ var selector = "." + (focusOnly ? $SELECT.selectedCircles : $SHAPE.shapes);
23414
23421
  if (config.data_selection_grouped) {
23415
23422
  selector += $$.getTargetSelectorSuffix(d.id);
23416
23423
  }
23417
- main.selectAll(selector).selectAll("." + $SHAPE.shape).each(function (d, i) {
23424
+ main.selectAll(selector).selectAll(focusOnly ? "." + $SELECT.selectedCircle : "." + $SHAPE.shape + "." + $SELECT.SELECTED).classed($SELECT.SELECTED, !1).each(function (d) {
23418
23425
  var shape = (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(this);
23419
- if (shape.classed($SELECT.SELECTED)) {
23420
- toggledShape = shape;
23421
- toggle(!1, shape.classed($SELECT.SELECTED, !1), d, i);
23422
- }
23426
+ toggledShape = shape;
23427
+ toggle(!1, shape, d, d.index);
23423
23428
  });
23424
23429
  }
23425
23430
  if (!toggledShape || toggledShape.node() !== shape.node()) {
@@ -24485,7 +24490,7 @@ var _defaults = {};
24485
24490
 
24486
24491
  /**
24487
24492
  * @namespace bb
24488
- * @version 3.7.0-next.2
24493
+ * @version 3.7.0
24489
24494
  */
24490
24495
  var bb = {
24491
24496
  /**
@@ -24495,7 +24500,7 @@ var bb = {
24495
24500
  * bb.version; // "1.0.0"
24496
24501
  * @memberof bb
24497
24502
  */
24498
- version: "3.7.0-next.2",
24503
+ version: "3.7.0",
24499
24504
  /**
24500
24505
  * Generate chart
24501
24506
  * - **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.7.0-next.2
8
+ * @version 3.7.0
9
9
  */.bb svg{-webkit-tap-highlight-color:rgba(0,0,0,0);font:10px sans-serif}.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-bars path,.bb-event-rect,.bb-legend-item-tile,.bb-xgrid-focus,.bb-ygrid,.bb-ygrid-focus{shape-rendering:crispEdges}.bb-chart-arc .bb-gauge-value{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,.bb-zoom-brush{fill-opacity:.1}.bb-legend-item{font-size:12px;user-select:none}.bb-legend-item-hidden{opacity:.15}.bb-legend-background{fill:#fff;stroke:#d3d3d3;stroke-width:1;opacity:.75}.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;-webkit-box-shadow:7px 7px 12px -9px #777;-moz-box-shadow:7px 7px 12px -9px #777;box-shadow:7px 7px 12px -9px #777;empty-cells:show;opacity:.9}.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}