billboard.js 3.7.1 → 3.7.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 (42) hide show
  1. package/dist/billboard.css +1 -1
  2. package/dist/billboard.js +33 -21
  3. package/dist/billboard.min.css +1 -1
  4. package/dist/billboard.min.js +2 -2
  5. package/dist/billboard.pkgd.js +1241 -1190
  6. package/dist/billboard.pkgd.min.js +2 -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.js +1159 -1130
  18. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.js +1160 -1131
  19. package/dist/plugin/pkgd/billboardjs-plugin-stanford.js +1204 -1165
  20. package/dist/plugin/pkgd/billboardjs-plugin-tableview.js +1161 -1132
  21. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.js +1161 -1132
  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 +31 -20
  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 +2 -2
  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 +9 -9
  35. package/src/Chart/api/data.ts +2 -2
  36. package/src/Chart/api/grid.x.ts +2 -2
  37. package/src/Chart/api/grid.y.ts +4 -2
  38. package/src/Chart/api/regions.ts +2 -2
  39. package/src/Chart/api/tooltip.ts +2 -2
  40. package/src/ChartInternal/internals/text.ts +14 -4
  41. package/src/ChartInternal/shape/bar.ts +4 -2
  42. package/types/chart.d.ts +13 -3
@@ -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.1
8
+ * @version 3.7.2
9
9
  */
10
10
  /*-- Datalab Theme --*/
11
11
  /*-- Default color pattern --*/
@@ -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.1
8
+ * @version 3.7.2
9
9
  */.bb-color-pattern{background-image:url(#2ac4b3;#feaf29;#ff617b;#73a2ef;#b180d0;#3064cf;#d0a45f;#8aaec7;#ef65a2;#8aaec7;)}.bb svg{font-family:Sans Pro,Arial,sans-serif,nanumgothic,Dotum;font-size:11px;line-height:1}.bb line,.bb path{fill:none;stroke:#000}.bb .bb-button,.bb text{-webkit-font-smoothing:antialiased;fill:#555;font-size:11px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.bb-axis{stroke-width:.7px}.bb-axis-y text,.bb-axis-y2 text{fill:#737373}.bb-event-rects{fill-opacity:1!important}.bb-event-rects .bb-event-rect{fill:transparent}.bb-event-rects .bb-event-rect._active_{fill:rgba(39,201,3,.05)}.tick._active_ text{fill:#00c83c!important}.bb-grid{pointer-events:none}.bb-grid line{stroke:#f1f1f1}.bb-xgrid-focus line,.bb-ygrid-focus line{stroke:#ddd}.bb-text.bb-empty{fill:#767676}.bb-line{stroke-width:.7px}.bb-circle{fill:#fff!important}.bb-circle._expanded_{stroke-width:2px}.bb-selected-circle{fill:#fff;stroke-width:2px}.bb-bar{stroke-width:1px}.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;fill-opacity:.1}.bb-region.selected rect{fill:#27c903}.bb-brush .extent,.bb-zoom-brush{fill-opacity:.1}.bb-legend-item{user-select:none}.bb-legend-item line.bb-legend-item-tile{stroke-linecap:round;stroke-width:8px;stroke-dasharray:1 20;transform:translate(7px,1px)}.bb-legend-item-hidden{opacity:.15}.bb-legend-background{fill:#fff;stroke:#d3d3d3;stroke-width:1;opacity:.75}.bb-title{font-size:14px}.bb-chart-treemaps rect{stroke:#000;stroke-width:1px}.bb-tooltip-container{font-family:Sans Pro,Arial,sans-serif,nanumgothic,Dotum;user-select:none;z-index:10}.bb-tooltip{-webkit-font-smoothing:antialiased;background-color:#fff;border:1px solid #999;border-collapse:separate;border-radius:2px;border-spacing:0;empty-cells:show;font-size:11px;text-align:left}.bb-tooltip th{background-color:#0b00b1;border-bottom:2px solid #ff2d2d;color:#fffdfd;font-size:13px;padding:2px 8px;text-align:left}.bb-tooltip td{padding:4px 6px}.bb-tooltip td:first-child{padding-left:8px}.bb-tooltip td:last-child{padding-right:8px}.bb-tooltip td>span,.bb-tooltip td>svg{border:1px solid #000;border-radius:3px;display:inline-block;height:8px;margin-right:6px;vertical-align:middle;width:8px}.bb-tooltip td.value{border-left:1px solid transparent;text-align:right}.bb-tooltip .bb-tooltip-title{color:#aaa;display:inline-block;line-height:20px}.bb-tooltip .bb-tooltip-detail table{border-collapse:collapse;border-spacing:0}.bb-tooltip .bb-tooltip-detail .bb-tooltip-name,.bb-tooltip .bb-tooltip-detail .bb-tooltip-value{color:#444;font-size:11px;font-weight:400;line-height:13px;padding:4px 0 3px;text-align:left}.bb-tooltip .bb-tooltip-detail .bb-tooltip-value{font-size:11px;font-weight:800;padding-left:5px}.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:none}.bb-chart-arcs .bb-chart-arcs-gauge-unit{fill:#000;font-size:18px}.bb-chart-arcs .bb-chart-arcs-gauge-max,.bb-chart-arcs .bb-chart-arcs-gauge-min{fill:#777}.bb-chart-arcs .bb-chart-arcs-title{fill:#000;font-size:18px!important;font-weight:600}.bb-chart-arcs path.empty{fill:#eaeaea;stroke-width:0}.bb-chart-arcs .bb-levels circle{fill:none;stroke:#848282;stroke-width:.5px}.bb-chart-arcs .bb-levels text{fill:#848282}.bb-chart-arc .bb-gauge-value{fill:#3b6969}.bb-chart-arc path{stroke:#000;stroke-width:.5px}.bb-chart-arc rect{stroke:#fff;stroke-width:1}.bb-chart-arc text{fill:#fff;font-size:14px}.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:.7px}.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;padding:5px}
@@ -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.1
8
+ * @version 3.7.2
9
9
  */
10
10
  /*-- Graph Theme --*/
11
11
  /*-- Default color pattern --*/
@@ -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.1
8
+ * @version 3.7.2
9
9
  */.bb-color-pattern{background-image:url(#65CFC2;#D0A45F;#64A4F5;#EF65A2;#A377FE;#8AAEC7;#FF7E5A;#898EFE;#FFAC35;#70B0FF;)}.bb svg{font-family:Helvetica,Apple SD Gothic Neo,Arial,sans-serif,nanumgothic,Dotum;font-size:12px;line-height:1}.bb line,.bb path{fill:none;stroke:#8c8c8c}.bb .bb-button,.bb text{fill:#555;font-size:12px;letter-spacing:-.3px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.bb-axis,.bb-bars path,.bb-event-rect,.bb-legend-item-title,.bb-xgrid-focus,.bb-ygrid,.bb-ygrid-focus{shape-rendering:crispEdges}.bb-axis-y text,.bb-axis-y2 text{fill:#8c8c8c}.bb-event-rects{fill-opacity:1!important}.bb-event-rects .bb-event-rect{fill:transparent}.bb-event-rects .bb-event-rect._active_{fill:rgba(39,201,3,.05)}.tick._active_ text{fill:#00c83c!important}.bb-grid{pointer-events:none}.bb-grid line{stroke:#f1f1f1}.bb-xgrid-focus line,.bb-ygrid-focus line{stroke:#ffb6b6;stroke-dasharray:3px}.bb-text.bb-empty{fill:#767676}.bb-line{stroke-width:1px}.bb-circle._expanded_,rect.bb-circle._expanded_,use.bb-circle._expanded_{stroke-width:2px}.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;fill-opacity:.1}.bb-region.selected rect{fill:#27c903}.bb-brush .extent,.bb-zoom-brush{fill-opacity:.1}.bb-legend-item{user-select:none}.bb-legend-item-hidden{opacity:.15}.bb-legend-background{fill:#fff;stroke:#d3d3d3;stroke-width:1px;opacity:.75}.bb-legend-item line{stroke-dasharray:1px}.bb-title{font-size:14px}.bb-chart-treemaps rect{stroke:#fff;stroke-width:1px}.bb-tooltip-container{font-family:Helvetica,Apple SD Gothic Neo,Arial,sans-serif,nanumgothic,Dotum;user-select:none;z-index:10}.bb-tooltip{background-color:#fff;border:1px solid #999;border-collapse:separate;border-radius:2px;border-spacing:0;box-shadow:.5px .5px 1px #999;empty-cells:show;font-size:12px;text-align:left;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.bb-tooltip th{background-color:#efefef;border-bottom:1px dotted #000;color:#000;font-size:12px;padding:4px 8px;text-align:center}.bb-tooltip tr:last-child td{border-bottom:none}.bb-tooltip td{background-color:#fff;border-bottom:1px solid #eee;padding:3px 6px}.bb-tooltip td:first-child{border-right:1px solid #eee;padding-left:5px}.bb-tooltip td:last-child{padding-right:5px}.bb-tooltip td>span,.bb-tooltip td>svg{display:inline-block;height:12px;margin-right:6px;vertical-align:middle;width:5px}.bb-tooltip td.value{border-left:1px solid transparent;text-align:right}.bb-tooltip .bb-tooltip-title{color:#aaa;display:inline-block;line-height:20px}.bb-tooltip .bb-tooltip-detail table{border-collapse:collapse;border-spacing:1px;font-size:12px}.bb-tooltip .bb-tooltip-detail .bb-tooltip-name,.bb-tooltip .bb-tooltip-detail .bb-tooltip-value{color:#444;font-weight:400;line-height:13px;padding:4px 0 3px;text-align:left}.bb-tooltip .bb-tooltip-detail .bb-tooltip-value{font-weight:800;padding-left:5px}.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-chart-arcs-title{fill:#8c8c8c;font-size:16px!important;font-style:italic}.bb-chart-arcs path.empty{fill:#eaeaea;stroke-width:0}.bb-chart-arcs .bb-levels circle{fill:none;stroke:#848282;stroke-width:.5px}.bb-chart-arcs .bb-levels text{fill:#848282}.bb-chart-arc .bb-gauge-value{fill:#8c8c8c;font-style:italic}.bb-chart-arc path{stroke:#fff}.bb-chart-arc rect{stroke:#fff;stroke-width:1}.bb-chart-arc text{fill:#fff;font-size:13px;font-weight:700}.bb-chart-radars .bb-levels polygon{fill:none;stroke:#8c8c8c;stroke-width:.5px}.bb-chart-radars .bb-levels text{fill:#8c8c8c}.bb-chart-radars .bb-axis line{stroke:#8c8c8c;stroke-width:.5px}.bb-chart-radars .bb-axis text{cursor:default;font-size:1.15em;font-weight:700}.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;box-shadow:1px 1px 2px #ccc;cursor:pointer;opacity:.8;padding:5px}
@@ -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.1
8
+ * @version 3.7.2
9
9
  */
10
10
  /*-- Insight Theme --*/
11
11
  /*-- Default color pattern --*/
@@ -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.1
8
+ * @version 3.7.2
9
9
  */.bb-color-pattern{background-image:url(#00c73c;#fa7171;#2ad0ff;#7294ce;#e3e448;#cc7e6e;#fb6ccf;#c98dff;#4aea99;#bbbbbb;)}.bb svg{font-family:sans-serif,Arial,nanumgothic,Dotum;font-size:12px;line-height:1}.bb line,.bb path{fill:none;stroke:#c4c4c4}.bb .bb-button,.bb text{fill:#555;font-size:11px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.bb-axis,.bb-bars path,.bb-event-rect,.bb-legend-item-title,.bb-xgrid-focus,.bb-ygrid,.bb-ygrid-focus{shape-rendering:crispEdges}.bb-axis-y text,.bb-axis-y2 text{fill:#737373}.bb-event-rects{fill-opacity:1!important}.bb-event-rects .bb-event-rect{fill:transparent}.bb-event-rects .bb-event-rect._active_{fill:rgba(39,201,3,.05)}.tick._active_ text{fill:#00c83c!important}.bb-grid{pointer-events:none}.bb-grid line{stroke:#f1f1f1}.bb-xgrid-focus line,.bb-ygrid-focus line{stroke:#ddd}.bb-text.bb-empty{fill:#767676}.bb-line{stroke-width:1px}.bb-circle._expanded_{fill:#fff!important;stroke-width:2px;stroke:red}rect.bb-circle._expanded_,use.bb-circle._expanded_{stroke-width:1px}.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;fill-opacity:.1}.bb-region.selected rect{fill:#27c903}.bb-brush .extent,.bb-zoom-brush{fill-opacity:.1}.bb-legend-item{user-select:none}.bb-legend-item-hidden{opacity:.15}.bb-legend-background{fill:#fff;stroke:#d3d3d3;stroke-width:1;opacity:.75}.bb-title{font-size:14px}.bb-chart-treemaps rect{stroke:#fff;stroke-width:1px}.bb-tooltip-container{font-family:sans-serif,Arial,nanumgothic,Dotum;user-select:none;z-index:10}.bb-tooltip{background-color:#fff;border:1px solid #999;border-collapse:separate;border-spacing:0;empty-cells:show;font-size:11px;text-align:left}.bb-tooltip th{border-bottom:1px solid #eee;font-size:12px;padding:4px 8px;text-align:left}.bb-tooltip td{background-color:#fff;padding:4px 6px}.bb-tooltip td:first-child{padding-left:8px}.bb-tooltip td:last-child{padding-right:8px}.bb-tooltip td>span,.bb-tooltip td>svg{border-radius:5px;display:inline-block;height:10px;margin-right:6px;vertical-align:middle;width:10px}.bb-tooltip td.value{border-left:1px solid transparent}.bb-tooltip .bb-tooltip-title{color:#aaa;display:inline-block;line-height:20px}.bb-tooltip .bb-tooltip-detail table{border-collapse:collapse;border-spacing:0}.bb-tooltip .bb-tooltip-detail .bb-tooltip-name,.bb-tooltip .bb-tooltip-detail .bb-tooltip-value{color:#444;font-size:11px;font-weight:400;line-height:13px;padding:4px 0 3px;text-align:left}.bb-tooltip .bb-tooltip-detail .bb-tooltip-value{font-size:12px;font-weight:800;padding-left:5px}.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:none}.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-chart-arcs-title{fill:#000;font-size:16px!important;font-weight:600}.bb-chart-arcs path.empty{fill:#eaeaea;stroke-width:0}.bb-chart-arcs .bb-levels circle{fill:none;stroke:#848282;stroke-width:.5px}.bb-chart-arcs .bb-levels text{fill:#848282}.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-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;padding:5px}
@@ -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.1
8
+ * @version 3.7.2
9
9
  */
10
10
  import { timeParse, utcParse, timeFormat, utcFormat } from 'd3-time-format';
11
11
  import { pointer, select, namespaces, selectAll } from 'd3-selection';
@@ -7618,7 +7618,7 @@ var text = {
7618
7618
  */
7619
7619
  updateText: function () {
7620
7620
  var $$ = this;
7621
- var $el = $$.$el, $T = $$.$T, config = $$.config;
7621
+ var $el = $$.$el, $T = $$.$T, config = $$.config, axis = $$.axis;
7622
7622
  var classText = $$.getClass("text", "index");
7623
7623
  var labelsCentered = config.data_labels.centered;
7624
7624
  var text = $el.main.selectAll(".".concat($TEXT.texts))
@@ -7632,8 +7632,9 @@ var text = {
7632
7632
  .merge(text)
7633
7633
  .attr("class", classText)
7634
7634
  .attr("text-anchor", function (d) {
7635
+ var isInverted = config["axis_".concat(axis === null || axis === void 0 ? void 0 : axis.getId(d.id), "_inverted")];
7635
7636
  // when value is negative or
7636
- var isEndAnchor = d.value < 0;
7637
+ var isEndAnchor = isInverted ? d.value > 0 : d.value < 0;
7637
7638
  if ($$.isCandlestickType(d)) {
7638
7639
  var data = $$.getCandlestickData(d);
7639
7640
  isEndAnchor = !(data === null || data === void 0 ? void 0 : data._isUp);
@@ -7896,8 +7897,16 @@ var text = {
7896
7897
  }
7897
7898
  else {
7898
7899
  if (isRotated) {
7900
+ var isInverted = config["axis_".concat($$.axis.getId(d.id), "_inverted")];
7899
7901
  var padding = $$.isBarType(d) ? 4 : 6;
7900
- xPos = points[2][1] + padding * (d.value < 0 ? -1 : 1);
7902
+ var value = d.value;
7903
+ xPos = points[2][1];
7904
+ if (isInverted) {
7905
+ xPos -= padding * (value > 0 ? 1 : -1);
7906
+ }
7907
+ else {
7908
+ xPos += padding * (value < 0 ? -1 : 1);
7909
+ }
7901
7910
  }
7902
7911
  else {
7903
7912
  xPos = $$.hasType("bar") ? (points[2][0] + points[0][0]) / 2 : xPos;
@@ -9747,14 +9756,14 @@ var apiColor = {
9747
9756
  * // Get all data
9748
9757
  * chart.data();
9749
9758
  */
9750
- function data(targetIds) {
9759
+ var data = function (targetIds) {
9751
9760
  var targets = this.internal.data.targets;
9752
9761
  if (!isUndefined(targetIds)) {
9753
9762
  var ids_1 = isArray(targetIds) ? targetIds : [targetIds];
9754
9763
  return targets.filter(function (t) { return ids_1.some(function (v) { return v === t.id; }); });
9755
9764
  }
9756
9765
  return targets;
9757
- }
9766
+ };
9758
9767
  extend(data, {
9759
9768
  /**
9760
9769
  * Get data shown in the chart.
@@ -10761,7 +10770,7 @@ var tooltip = {
10761
10770
  * @memberof Chart
10762
10771
  */
10763
10772
  hide: function () {
10764
- var _a;
10773
+ var _a, _b, _c;
10765
10774
  var $$ = this.internal;
10766
10775
  var inputType = $$.state.inputType, tooltip = $$.$el.tooltip;
10767
10776
  var data = tooltip === null || tooltip === void 0 ? void 0 : tooltip.datum();
@@ -10776,9 +10785,9 @@ var tooltip = {
10776
10785
  // reset last touch point index
10777
10786
  inputType === "touch" && $$.callOverOutForTouch();
10778
10787
  $$.hideTooltip(true);
10779
- $$.hideGridFocus();
10780
- (_a = $$.unexpandCircles) === null || _a === void 0 ? void 0 : _a.call($$);
10781
- $$.expandBarTypeShapes(false);
10788
+ (_a = $$.hideGridFocus) === null || _a === void 0 ? void 0 : _a.call($$);
10789
+ (_b = $$.unexpandCircles) === null || _b === void 0 ? void 0 : _b.call($$);
10790
+ (_c = $$.expandBarTypeShapes) === null || _c === void 0 ? void 0 : _c.call($$, false);
10782
10791
  }
10783
10792
  };
10784
10793
  var apiTooltip = { tooltip: tooltip };
@@ -11187,7 +11196,7 @@ var apiCategory = {
11187
11196
  * ]);
11188
11197
  * // --> Returns: [{value: 1, text: "Label 1"}, {value: 4, text: "Label 4"}]
11189
11198
  */
11190
- function xgrids(grids) {
11199
+ var xgrids = function (grids) {
11191
11200
  var $$ = this.internal;
11192
11201
  var config = $$.config;
11193
11202
  if (!grids) {
@@ -11196,7 +11205,7 @@ function xgrids(grids) {
11196
11205
  config.grid_x_lines = grids;
11197
11206
  $$.redrawWithoutRescale();
11198
11207
  return config.grid_x_lines;
11199
- }
11208
+ };
11200
11209
  extend(xgrids, {
11201
11210
  /**
11202
11211
  * Add x grid lines.<br>
@@ -11266,7 +11275,7 @@ var apiXGrid = { xgrids: xgrids };
11266
11275
  * ]);
11267
11276
  * // --> Returns: [{value: 100, text: "Label 1"}, {value: 400, text: "Label 4"}]
11268
11277
  */
11269
- function ygrids(grids) {
11278
+ var ygrids = function (grids) {
11270
11279
  var $$ = this.internal;
11271
11280
  var config = $$.config;
11272
11281
  if (!grids) {
@@ -11275,7 +11284,7 @@ function ygrids(grids) {
11275
11284
  config.grid_y_lines = grids;
11276
11285
  $$.redrawWithoutRescale();
11277
11286
  return config.grid_y_lines;
11278
- }
11287
+ };
11279
11288
  extend(ygrids, {
11280
11289
  /**
11281
11290
  * Add y grid lines.<br>
@@ -11376,7 +11385,7 @@ var apiGroup = {
11376
11385
  * {axis: "y", end: 50, class: "regionY"}
11377
11386
  * ]);
11378
11387
  */
11379
- function regions(regions) {
11388
+ var regions = function (regions) {
11380
11389
  var $$ = this.internal;
11381
11390
  var config = $$.config;
11382
11391
  if (!regions) {
@@ -11385,7 +11394,7 @@ function regions(regions) {
11385
11394
  config.regions = regions;
11386
11395
  $$.redrawWithoutRescale();
11387
11396
  return regions;
11388
- }
11397
+ };
11389
11398
  extend(regions, {
11390
11399
  /**
11391
11400
  * Add new region.<br><br>
@@ -17522,14 +17531,16 @@ var shapeBar = {
17522
17531
  var barOffset = $$.getShapeOffset($$.isBarType, barIndices, !!isSub);
17523
17532
  var yScale = $$.getYScaleById.bind($$);
17524
17533
  return function (d, i) {
17525
- var y0 = yScale.call($$, d.id, isSub)($$.getShapeYMin(d.id));
17534
+ var id = d.id;
17535
+ var y0 = yScale.call($$, id, isSub)($$.getShapeYMin(id));
17526
17536
  var offset = barOffset(d, i) || y0; // offset is for stacked bar chart
17527
17537
  var width = isNumber(barW) ? barW : barW[d.id] || barW._$width;
17538
+ var isInverted = config["axis_".concat($$.axis.getId(id), "_inverted")];
17528
17539
  var value = d.value;
17529
17540
  var posX = barX(d);
17530
17541
  var posY = barY(d);
17531
17542
  // fix posY not to overflow opposite quadrant
17532
- if (config.axis_rotated && ((value > 0 && posY < y0) || (value < 0 && y0 < posY))) {
17543
+ if (config.axis_rotated && !isInverted && ((value > 0 && posY < y0) || (value < 0 && y0 < posY))) {
17533
17544
  posY = y0;
17534
17545
  }
17535
17546
  if (!$$.isBarRangeType(d)) {
@@ -22100,7 +22111,7 @@ var zoomModule = function () {
22100
22111
  var defaults = {};
22101
22112
  /**
22102
22113
  * @namespace bb
22103
- * @version 3.7.1
22114
+ * @version 3.7.2
22104
22115
  */
22105
22116
  var bb = {
22106
22117
  /**
@@ -22110,7 +22121,7 @@ var bb = {
22110
22121
  * bb.version; // "1.0.0"
22111
22122
  * @memberof bb
22112
22123
  */
22113
- version: "3.7.1",
22124
+ version: "3.7.2",
22114
22125
  /**
22115
22126
  * Generate chart
22116
22127
  * - **NOTE:** Bear in mind for the possiblity of ***throwing an error***, during the generation when:
@@ -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.1
8
+ * @version 3.7.2
9
9
  * @requires billboard.js
10
10
  * @summary billboard.js plugin
11
11
  */
@@ -104,7 +104,7 @@ var Plugin = /** @class */ (function () {
104
104
  delete _this[key];
105
105
  });
106
106
  };
107
- Plugin.version = "3.7.1";
107
+ Plugin.version = "3.7.2";
108
108
  return Plugin;
109
109
  }());
110
110
  var Plugin$1 = Plugin;
@@ -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.1
8
+ * @version 3.7.2
9
9
  * @requires billboard.js
10
10
  * @summary billboard.js plugin
11
11
  */
@@ -278,7 +278,7 @@ var Plugin = /** @class */ (function () {
278
278
  delete _this[key];
279
279
  });
280
280
  };
281
- Plugin.version = "3.7.1";
281
+ Plugin.version = "3.7.2";
282
282
  return Plugin;
283
283
  }());
284
284
  var Plugin$1 = Plugin;
@@ -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.1
8
+ * @version 3.7.2
9
9
  * @requires billboard.js
10
10
  * @summary billboard.js plugin
11
11
  */
@@ -486,7 +486,7 @@ var Plugin = /** @class */ (function () {
486
486
  delete _this[key];
487
487
  });
488
488
  };
489
- Plugin.version = "3.7.1";
489
+ Plugin.version = "3.7.2";
490
490
  return Plugin;
491
491
  }());
492
492
  var Plugin$1 = Plugin;
@@ -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.1
8
+ * @version 3.7.2
9
9
  * @requires billboard.js
10
10
  * @summary billboard.js plugin
11
11
  */
@@ -121,7 +121,7 @@ var Plugin = /** @class */ (function () {
121
121
  delete _this[key];
122
122
  });
123
123
  };
124
- Plugin.version = "3.7.1";
124
+ Plugin.version = "3.7.2";
125
125
  return Plugin;
126
126
  }());
127
127
  var Plugin$1 = Plugin;
@@ -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.1
8
+ * @version 3.7.2
9
9
  * @requires billboard.js
10
10
  * @summary billboard.js plugin
11
11
  */
@@ -263,7 +263,7 @@ var Plugin = /** @class */ (function () {
263
263
  delete _this[key];
264
264
  });
265
265
  };
266
- Plugin.version = "3.7.1";
266
+ Plugin.version = "3.7.2";
267
267
  return Plugin;
268
268
  }());
269
269
  var Plugin$1 = Plugin;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "billboard.js",
3
- "version": "3.7.1",
3
+ "version": "3.7.2",
4
4
  "description": "Re-usable easy interface JavaScript chart library, based on D3 v4+",
5
5
  "homepage": "https://naver.github.io/billboard.js/",
6
6
  "main": "dist/billboard.js",
@@ -109,8 +109,8 @@
109
109
  "@babel/preset-env": "^7.20.2",
110
110
  "@babel/preset-typescript": "^7.18.6",
111
111
  "@babel/runtime": "^7.20.7",
112
- "@commitlint/cli": "17.4.1",
113
- "@commitlint/config-conventional": "^17.4.0",
112
+ "@commitlint/cli": "17.4.2",
113
+ "@commitlint/config-conventional": "^17.4.2",
114
114
  "@rollup/plugin-babel": "^6.0.3",
115
115
  "@rollup/plugin-node-resolve": "^15.0.0",
116
116
  "@rollup/plugin-replace": "^5.0.2",
@@ -119,14 +119,14 @@
119
119
  "@semantic-release/commit-analyzer": "^9.0.2",
120
120
  "@semantic-release/exec": "^6.0.3",
121
121
  "@semantic-release/git": "^10.0.1",
122
- "@semantic-release/npm": "^9.0.1",
122
+ "@semantic-release/npm": "^9.0.2",
123
123
  "@semantic-release/release-notes-generator": "^10.0.3",
124
124
  "@types/chai": "^4.3.4",
125
125
  "@types/d3": "^7.4.0",
126
126
  "@types/mocha": "^10.0.1",
127
127
  "@types/sinon": "^10.0.13",
128
- "@typescript-eslint/eslint-plugin": "^5.48.1",
129
- "@typescript-eslint/parser": "^5.48.1",
128
+ "@typescript-eslint/eslint-plugin": "^5.48.2",
129
+ "@typescript-eslint/parser": "^5.48.2",
130
130
  "babel-helper-modules": "^6.0.0",
131
131
  "babel-loader": "^9.1.2",
132
132
  "babel-plugin-add-module-exports": "^1.0.4",
@@ -153,9 +153,9 @@
153
153
  "d3-polygon": "^3.0.1",
154
154
  "docdash": "^2.0.1",
155
155
  "dtslint": "^4.2.1",
156
- "eslint": "^8.31.0",
156
+ "eslint": "^8.32.0",
157
157
  "eslint-config-naver": "^2.1.0",
158
- "eslint-plugin-import": "^2.26.0",
158
+ "eslint-plugin-import": "^2.27.5",
159
159
  "eslint-plugin-jsdoc": "^39.6.4",
160
160
  "eslint-webpack-plugin": "^3.2.0",
161
161
  "exports-loader": "^4.0.0",
@@ -180,7 +180,7 @@
180
180
  "mocha": "^10.2.0",
181
181
  "node-sass": "^8.0.0",
182
182
  "regenerator-runtime": "^0.13.11",
183
- "rollup": "^3.9.1",
183
+ "rollup": "^3.10.0",
184
184
  "rollup-plugin-delete": "^2.0.0",
185
185
  "sass-loader": "^13.2.0",
186
186
  "semantic-release": "^20.0.2",
@@ -24,7 +24,7 @@ import type {IDataRow} from "../../ChartInternal/data/IData";
24
24
  * // Get all data
25
25
  * chart.data();
26
26
  */
27
- function data(targetIds: string|string[]): DataItem[] {
27
+ const data = function(targetIds: string|string[]): DataItem[] {
28
28
  const {targets} = this.internal.data;
29
29
 
30
30
  if (!isUndefined(targetIds)) {
@@ -34,7 +34,7 @@ function data(targetIds: string|string[]): DataItem[] {
34
34
  }
35
35
 
36
36
  return targets;
37
- }
37
+ };
38
38
 
39
39
  extend(data, {
40
40
  /**
@@ -21,7 +21,7 @@ type GridsParam = {value?: number, class?: string, text?: string}[];
21
21
  * ]);
22
22
  * // --> Returns: [{value: 1, text: "Label 1"}, {value: 4, text: "Label 4"}]
23
23
  */
24
- function xgrids(grids: GridsParam): GridsParam {
24
+ const xgrids = function(grids: GridsParam): GridsParam {
25
25
  const $$ = this.internal;
26
26
  const {config} = $$;
27
27
 
@@ -33,7 +33,7 @@ function xgrids(grids: GridsParam): GridsParam {
33
33
  $$.redrawWithoutRescale();
34
34
 
35
35
  return config.grid_x_lines;
36
- }
36
+ };
37
37
 
38
38
  extend(xgrids, {
39
39
  /**
@@ -19,7 +19,9 @@ import {extend} from "../../module/util";
19
19
  * ]);
20
20
  * // --> Returns: [{value: 100, text: "Label 1"}, {value: 400, text: "Label 4"}]
21
21
  */
22
- function ygrids(grids: {value?: number, text?: string}[]): {value?: number, text?: string}[] {
22
+ const ygrids = function(grids: {value?: number, text?: string}[]): {
23
+ value?: number, text?: string
24
+ }[] {
23
25
  const $$ = this.internal;
24
26
  const {config} = $$;
25
27
 
@@ -31,7 +33,7 @@ function ygrids(grids: {value?: number, text?: string}[]): {value?: number, text
31
33
  $$.redrawWithoutRescale();
32
34
 
33
35
  return config.grid_y_lines;
34
- }
36
+ };
35
37
 
36
38
  extend(ygrids, {
37
39
  /**
@@ -21,7 +21,7 @@ type RegionsParam = {axis?: string, class?: string, start?: number, end?: number
21
21
  * {axis: "y", end: 50, class: "regionY"}
22
22
  * ]);
23
23
  */
24
- function regions(regions: RegionsParam): RegionsParam {
24
+ const regions = function(regions: RegionsParam): RegionsParam {
25
25
  const $$ = this.internal;
26
26
  const {config} = $$;
27
27
 
@@ -33,7 +33,7 @@ function regions(regions: RegionsParam): RegionsParam {
33
33
  $$.redrawWithoutRescale();
34
34
 
35
35
  return regions;
36
- }
36
+ };
37
37
 
38
38
  extend(regions, {
39
39
  /**
@@ -133,10 +133,10 @@ const tooltip = {
133
133
  inputType === "touch" && $$.callOverOutForTouch();
134
134
 
135
135
  $$.hideTooltip(true);
136
- $$.hideGridFocus();
136
+ $$.hideGridFocus?.();
137
137
 
138
138
  $$.unexpandCircles?.();
139
- $$.expandBarTypeShapes(false);
139
+ $$.expandBarTypeShapes?.(false);
140
140
  }
141
141
  };
142
142
 
@@ -141,7 +141,7 @@ export default {
141
141
  */
142
142
  updateText(): void {
143
143
  const $$ = this;
144
- const {$el, $T, config} = $$;
144
+ const {$el, $T, config, axis} = $$;
145
145
  const classText = $$.getClass("text", "index");
146
146
  const labelsCentered = config.data_labels.centered;
147
147
 
@@ -158,8 +158,10 @@ export default {
158
158
  .merge(text)
159
159
  .attr("class", classText)
160
160
  .attr("text-anchor", d => {
161
+ const isInverted = config[`axis_${axis?.getId(d.id)}_inverted`];
162
+
161
163
  // when value is negative or
162
- let isEndAnchor = d.value < 0;
164
+ let isEndAnchor = isInverted ? d.value > 0 : d.value < 0;
163
165
 
164
166
  if ($$.isCandlestickType(d)) {
165
167
  const data = $$.getCandlestickData(d);
@@ -443,7 +445,7 @@ export default {
443
445
  * @returns {number} x coordinate
444
446
  * @private
445
447
  */
446
- getXForText(points, d, textElement): number {
448
+ getXForText(points, d: IDataRow, textElement): number {
447
449
  const $$ = this;
448
450
  const {config, state} = $$;
449
451
  const isRotated = config.axis_rotated;
@@ -461,9 +463,17 @@ export default {
461
463
  xPos += config.data_labels.centered ? 0 : 5;
462
464
  } else {
463
465
  if (isRotated) {
466
+ const isInverted = config[`axis_${$$.axis.getId(d.id)}_inverted`];
464
467
  const padding = $$.isBarType(d) ? 4 : 6;
468
+ const value = d.value as number;
469
+
470
+ xPos = points[2][1];
465
471
 
466
- xPos = points[2][1] + padding * (d.value < 0 ? -1 : 1);
472
+ if (isInverted) {
473
+ xPos -= padding * (value > 0 ? 1 : -1);
474
+ } else {
475
+ xPos += padding * (value < 0 ? -1 : 1);
476
+ }
467
477
  } else {
468
478
  xPos = $$.hasType("bar") ? (points[2][0] + points[0][0]) / 2 : xPos;
469
479
  }
@@ -262,15 +262,17 @@ export default {
262
262
  const yScale = $$.getYScaleById.bind($$);
263
263
 
264
264
  return (d: IDataRow, i: number) => {
265
- const y0 = yScale.call($$, d.id, isSub)($$.getShapeYMin(d.id));
265
+ const {id} = d;
266
+ const y0 = yScale.call($$, id, isSub)($$.getShapeYMin(id));
266
267
  const offset = barOffset(d, i) || y0; // offset is for stacked bar chart
267
268
  const width = isNumber(barW) ? barW : barW[d.id] || barW._$width;
269
+ const isInverted = config[`axis_${$$.axis.getId(id)}_inverted`];
268
270
  const value = d.value as number;
269
271
  const posX = barX(d);
270
272
  let posY = barY(d);
271
273
 
272
274
  // fix posY not to overflow opposite quadrant
273
- if (config.axis_rotated && (
275
+ if (config.axis_rotated && !isInverted && (
274
276
  (value > 0 && posY < y0) || (value < 0 && y0 < posY)
275
277
  )) {
276
278
  posY = y0;
package/types/chart.d.ts CHANGED
@@ -102,20 +102,30 @@ export interface Chart {
102
102
  * Update regions.
103
103
  * @param regions Regions will be replaced with this argument. The format of this argument is the same as regions.
104
104
  */
105
- (regions: any[]): void;
105
+ (regions: Array<{
106
+ axis: "x" | "y" | "y2",
107
+ start?: number | Date,
108
+ end?: number | Date,
109
+ class?: string
110
+ }>): void;
106
111
 
107
112
  /**
108
113
  * Add new region. This API adds new region instead of replacing like regions.
109
114
  * @param grids New region will be added. The format of this argument is the same as regions and it's possible to give an Object if only one region will be added.
110
115
  */
111
- add(regions: any[] | {}): void;
116
+ add<T = {
117
+ axis: "x" | "y" | "y2",
118
+ start?: number | Date,
119
+ end?: number | Date,
120
+ class?: string
121
+ }>(regions: T | T[]): void;
112
122
 
113
123
  /**
114
124
  * Remove regions. This API removes regions.
115
125
  * @param args This argument should include classes. If classes is given, the regions that have one of the specified classes will be removed. If args is not given, all of regions will be
116
126
  * removed.
117
127
  */
118
- remove(args?: { value?: number | string; class?: string }): void;
128
+ remove(args?: { classes: string[] }): void;
119
129
  };
120
130
 
121
131
  data: {