billboard.js 3.3.1 → 3.3.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 (40) hide show
  1. package/dist/billboard.css +1 -1
  2. package/dist/billboard.js +54 -25
  3. package/dist/billboard.min.css +1 -1
  4. package/dist/billboard.min.js +2 -2
  5. package/dist/billboard.pkgd.js +520 -363
  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 +19 -11
  10. package/dist/plugin/billboardjs-plugin-sparkline.min.js +2 -2
  11. package/dist/plugin/billboardjs-plugin-stanford.js +18 -10
  12. package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
  13. package/dist/plugin/billboardjs-plugin-tableview.js +19 -11
  14. package/dist/plugin/billboardjs-plugin-tableview.min.js +2 -2
  15. package/dist/plugin/billboardjs-plugin-textoverlap.js +19 -11
  16. package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
  17. package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.js +468 -340
  18. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.js +485 -349
  19. package/dist/plugin/pkgd/billboardjs-plugin-stanford.js +486 -350
  20. package/dist/plugin/pkgd/billboardjs-plugin-tableview.js +487 -351
  21. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.js +488 -352
  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 +50 -28
  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 +21 -21
  35. package/src/Chart/api/chart.ts +1 -1
  36. package/src/Chart/api/subchart.ts +8 -8
  37. package/src/ChartInternal/internals/format.ts +9 -4
  38. package/src/ChartInternal/internals/redraw.ts +3 -2
  39. package/src/config/Options/common/tooltip.ts +10 -1
  40. package/src/module/util.ts +16 -9
@@ -5,7 +5,7 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.3.1
8
+ * @version 3.3.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.3.1
8
+ * @version 3.3.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-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-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.3.1
8
+ * @version 3.3.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.3.1
8
+ * @version 3.3.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-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-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.3.1
8
+ * @version 3.3.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.3.1
8
+ * @version 3.3.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-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-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.3.1
8
+ * @version 3.3.2
9
9
  */
10
10
  import { timeParse, utcParse, timeFormat, utcFormat } from 'd3-time-format';
11
11
  import { pointer, select, namespaces, selectAll } from 'd3-selection';
@@ -765,18 +765,27 @@ function isTabVisible() {
765
765
  * @private
766
766
  */
767
767
  function convertInputType(mouse, touch) {
768
- var isMobile = false;
769
- // https://developer.mozilla.org/en-US/docs/Web/HTTP/Browser_detection_using_the_user_agent#Mobile_Tablet_or_Desktop
770
- if (/Mobi/.test(win.navigator.userAgent) && touch) {
768
+ var hasTouch = false;
769
+ if (touch) {
771
770
  // Some Edge desktop return true: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/20417074/
772
- var hasTouchPoints = win.navigator && "maxTouchPoints" in win.navigator && win.navigator.maxTouchPoints > 0;
773
- // Ref: https://github.com/Modernizr/Modernizr/blob/master/feature-detects/touchevents.js
774
- // On IE11 with IE9 emulation mode, ('ontouchstart' in window) is returning true
775
- var hasTouch = ("ontouchmove" in win || (win.DocumentTouch && doc instanceof win.DocumentTouch));
776
- isMobile = hasTouchPoints || hasTouch;
771
+ if (win.navigator && "maxTouchPoints" in win.navigator) {
772
+ hasTouch = win.navigator.maxTouchPoints > 0;
773
+ // Ref: https://github.com/Modernizr/Modernizr/blob/master/feature-detects/touchevents.js
774
+ // On IE11 with IE9 emulation mode, ('ontouchstart' in window) is returning true
775
+ }
776
+ else if ("ontouchmove" in win || (win.DocumentTouch && doc instanceof win.DocumentTouch)) {
777
+ hasTouch = true;
778
+ }
779
+ else {
780
+ // https://developer.mozilla.org/en-US/docs/Web/HTTP/Browser_detection_using_the_user_agent#avoiding_user_agent_detection
781
+ var mQ = win.matchMedia && matchMedia("(pointer:coarse)");
782
+ if (mQ && mQ.media === "(pointer:coarse)") {
783
+ hasTouch = !!mQ.matches;
784
+ }
785
+ }
777
786
  }
778
- var hasMouse = mouse && !isMobile ? ("onmouseover" in win) : false;
779
- return (hasMouse && "mouse") || (isMobile && "touch") || null;
787
+ var hasMouse = mouse && !hasTouch ? ("onmouseover" in win) : false;
788
+ return (hasMouse && "mouse") || (hasTouch && "touch") || null;
780
789
  }
781
790
 
782
791
  /**
@@ -2667,7 +2676,16 @@ var tooltip$2 = {
2667
2676
  * - `element {SVGElement}`: Tooltip event bound element
2668
2677
  * - `pos {object}`: Current position of the tooltip.
2669
2678
  * @property {Function|object} [tooltip.contents] Set custom HTML for the tooltip.<br>
2670
- * Specified function receives data, defaultTitleFormat, defaultValueFormat and color of the data point to show. If tooltip.grouped is true, data includes multiple data points.
2679
+ * If tooltip.grouped is true, data includes multiple data points.<br><br>
2680
+ * Specified function receives `data` array and `defaultTitleFormat`, `defaultValueFormat` and `color` functions of the data point to show.
2681
+ * - **Note:**
2682
+ * - defaultTitleFormat:
2683
+ * - if `axis.x.tick.format` option will be used if set.
2684
+ * - otherwise, will return funciton based on tick format type(category, timeseries).
2685
+ * - defaultValueFormat:
2686
+ * - for Arc type (except gauge, radar), the function will return value from `(ratio * 100).toFixed(1)`.
2687
+ * - for Axis based types, will be used `axis.[y|y2].tick.format` option value if is set.
2688
+ * - otherwise, will parse value and return as number.
2671
2689
  * @property {string|HTMLElement} [tooltip.contents.bindto=undefined] Set CSS selector or element reference to bind tooltip.
2672
2690
  * - **NOTE:** When is specified, will not be updating tooltip's position.
2673
2691
  * @property {string} [tooltip.contents.template=undefined] Set tooltip's template.<br><br>
@@ -5151,10 +5169,12 @@ var format = {
5151
5169
  */
5152
5170
  getDefaultValueFormat: function () {
5153
5171
  var $$ = this;
5154
- var hasArc = $$.hasArcType();
5155
- return hasArc && !$$.hasType("gauge") ?
5156
- $$.defaultArcValueFormat :
5157
- $$.defaultValueFormat;
5172
+ var defaultArcValueFormat = $$.defaultArcValueFormat, yFormat = $$.yFormat, y2Format = $$.y2Format;
5173
+ var hasArc = $$.hasArcType(null, ["gauge", "radar"]);
5174
+ return function (v, ratio, id) {
5175
+ var format = hasArc ? defaultArcValueFormat : ($$.axis && $$.axis.getId(id) === "y2" ? y2Format : yFormat);
5176
+ return format.call($$, v, ratio);
5177
+ };
5158
5178
  },
5159
5179
  defaultValueFormat: function (v) {
5160
5180
  return isValue(v) ? +v : "";
@@ -5991,7 +6011,8 @@ var redraw = {
5991
6011
  redrawWithoutRescale: function () {
5992
6012
  this.redraw({
5993
6013
  withY: false,
5994
- withLegend: true,
6014
+ withDimension: false,
6015
+ withLegend: false,
5995
6016
  withSubchart: false,
5996
6017
  withEventRect: false,
5997
6018
  withTransitionForAxis: false
@@ -8751,7 +8772,7 @@ var apiChart = {
8751
8772
  config.size_width = size ? size.width : null;
8752
8773
  config.size_height = size ? size.height : null;
8753
8774
  state.resizing = true;
8754
- this.flush(false, true);
8775
+ this.flush(false);
8755
8776
  $$.resizeFunction();
8756
8777
  }
8757
8778
  },
@@ -18900,6 +18921,7 @@ var apiSubchart = {
18900
18921
  * chart.subchart.show();
18901
18922
  */
18902
18923
  show: function () {
18924
+ var _a, _b;
18903
18925
  var $$ = this.internal;
18904
18926
  var subchart = $$.$el.subchart, config = $$.config;
18905
18927
  var show = config.subchart_show;
@@ -18913,11 +18935,11 @@ var apiSubchart = {
18913
18935
  if ($$.data.targets.length !== $target.size()) {
18914
18936
  $$.updateSizes();
18915
18937
  $$.updateTargetsForSubchart($$.data.targets);
18916
- $target = subchart.main.selectAll(".".concat($COMMON.target));
18938
+ $target = (_a = subchart.main) === null || _a === void 0 ? void 0 : _a.selectAll(".".concat($COMMON.target));
18917
18939
  }
18918
- $target.style("opacity", null);
18919
- subchart.main.style("display", null);
18920
- this.flush();
18940
+ $target === null || $target === void 0 ? void 0 : $target.style("opacity", null);
18941
+ (_b = subchart.main) === null || _b === void 0 ? void 0 : _b.style("display", null);
18942
+ this.resize();
18921
18943
  }
18922
18944
  },
18923
18945
  /**
@@ -18931,11 +18953,11 @@ var apiSubchart = {
18931
18953
  */
18932
18954
  hide: function () {
18933
18955
  var $$ = this.internal;
18934
- var subchart = $$.$el.subchart, config = $$.config;
18935
- if (config.subchart_show && subchart.main.style("display") !== "none") {
18956
+ var main = $$.$el.subchart.main, config = $$.config;
18957
+ if (config.subchart_show && (main === null || main === void 0 ? void 0 : main.style("display")) !== "none") {
18936
18958
  config.subchart_show = false;
18937
- subchart.main.style("display", "none");
18938
- this.flush();
18959
+ main.style("display", "none");
18960
+ this.resize();
18939
18961
  }
18940
18962
  },
18941
18963
  /**
@@ -20365,7 +20387,7 @@ var zoomModule = function () {
20365
20387
  var defaults = {};
20366
20388
  /**
20367
20389
  * @namespace bb
20368
- * @version 3.3.1
20390
+ * @version 3.3.2
20369
20391
  */
20370
20392
  var bb = {
20371
20393
  /**
@@ -20375,7 +20397,7 @@ var bb = {
20375
20397
  * bb.version; // "1.0.0"
20376
20398
  * @memberof bb
20377
20399
  */
20378
- version: "3.3.1",
20400
+ version: "3.3.2",
20379
20401
  /**
20380
20402
  * Generate chart
20381
20403
  * - **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.3.1
8
+ * @version 3.3.2
9
9
  * @requires billboard.js
10
10
  * @summary billboard.js plugin
11
11
  */
@@ -142,7 +142,7 @@ var Plugin = /*#__PURE__*/function () {
142
142
  return Plugin;
143
143
  }();
144
144
 
145
- Plugin.version = "#3.3.1#";
145
+ Plugin.version = "#3.3.2#";
146
146
 
147
147
  /**
148
148
  * Bubble compare diagram plugin.<br>
@@ -5,7 +5,7 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.3.1
8
+ * @version 3.3.2
9
9
  * @requires billboard.js
10
10
  * @summary billboard.js plugin
11
11
  */
@@ -319,7 +319,7 @@ var Plugin = /*#__PURE__*/function () {
319
319
  return Plugin;
320
320
  }();
321
321
 
322
- Plugin.version = "#3.3.1#";
322
+ Plugin.version = "#3.3.2#";
323
323
 
324
324
  /**
325
325
  * Copyright (c) 2021 ~ present NAVER Corp.
@@ -5,7 +5,7 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.3.1
8
+ * @version 3.3.2
9
9
  * @requires billboard.js
10
10
  * @summary billboard.js plugin
11
11
  */
@@ -519,7 +519,7 @@ var Plugin = /*#__PURE__*/function () {
519
519
  return Plugin;
520
520
  }();
521
521
 
522
- Plugin.version = "#3.3.1#";
522
+ Plugin.version = "#3.3.2#";
523
523
 
524
524
  /**
525
525
  * Copyright (c) 2017 ~ present NAVER Corp.
@@ -5,7 +5,7 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.3.1
8
+ * @version 3.3.2
9
9
  * @requires billboard.js
10
10
  * @summary billboard.js plugin
11
11
  */
@@ -165,7 +165,7 @@ var Plugin = /*#__PURE__*/function () {
165
165
  return Plugin;
166
166
  }();
167
167
 
168
- Plugin.version = "#3.3.1#";
168
+ Plugin.version = "#3.3.2#";
169
169
 
170
170
  /**
171
171
  * Copyright (c) 2021 ~ present NAVER Corp.
@@ -5,7 +5,7 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.3.1
8
+ * @version 3.3.2
9
9
  * @requires billboard.js
10
10
  * @summary billboard.js plugin
11
11
  */
@@ -296,7 +296,7 @@ var Plugin = /*#__PURE__*/function () {
296
296
  return Plugin;
297
297
  }();
298
298
 
299
- Plugin.version = "#3.3.1#";
299
+ Plugin.version = "#3.3.2#";
300
300
 
301
301
  /**
302
302
  * Copyright (c) 2017 ~ present NAVER Corp.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "billboard.js",
3
- "version": "3.3.1",
3
+ "version": "3.3.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",
@@ -95,19 +95,19 @@
95
95
  "d3-zoom": "^3.0.0"
96
96
  },
97
97
  "devDependencies": {
98
- "@babel/core": "^7.16.7",
99
- "@babel/eslint-parser": "^7.16.5",
98
+ "@babel/core": "^7.17.2",
99
+ "@babel/eslint-parser": "^7.17.0",
100
100
  "@babel/plugin-proposal-class-properties": "^7.16.7",
101
101
  "@babel/plugin-proposal-object-rest-spread": "^7.16.7",
102
- "@babel/plugin-transform-runtime": "^7.16.8",
102
+ "@babel/plugin-transform-runtime": "^7.17.0",
103
103
  "@babel/preset-env": "^7.16.8",
104
104
  "@babel/preset-typescript": "^7.16.7",
105
- "@babel/runtime": "^7.16.7",
105
+ "@babel/runtime": "^7.17.2",
106
106
  "@commitlint/cli": "^15.0.0",
107
- "@commitlint/config-conventional": "^16.0.0",
107
+ "@commitlint/config-conventional": "^16.2.1",
108
108
  "@rollup/plugin-babel": "^5.3.0",
109
109
  "@rollup/plugin-node-resolve": "^13.1.3",
110
- "@rollup/plugin-replace": "^3.0.1",
110
+ "@rollup/plugin-replace": "^3.1.0",
111
111
  "@rollup/plugin-typescript": "^8.3.0",
112
112
  "@semantic-release/changelog": "^6.0.1",
113
113
  "@semantic-release/commit-analyzer": "^9.0.2",
@@ -118,9 +118,9 @@
118
118
  "@types/chai": "^4.3.0",
119
119
  "@types/d3": "^7.1.0",
120
120
  "@types/mocha": "^9.0.0",
121
- "@types/sinon": "^10.0.8",
122
- "@typescript-eslint/eslint-plugin": "^5.10.0",
123
- "@typescript-eslint/parser": "^5.10.0",
121
+ "@types/sinon": "^10.0.11",
122
+ "@typescript-eslint/eslint-plugin": "^5.11.0",
123
+ "@typescript-eslint/parser": "^5.11.0",
124
124
  "babel-helper-modules": "^6.0.0",
125
125
  "babel-loader": "^8.2.3",
126
126
  "babel-plugin-add-module-exports": "^1.0.4",
@@ -132,14 +132,14 @@
132
132
  "babel-plugin-transform-inline-consecutive-adds": "^0.4.3",
133
133
  "babel-plugin-transform-merge-sibling-variables": "^6.9.4",
134
134
  "babel-plugin-transform-minify-booleans": "^6.9.4",
135
- "better-docs": "^2.3.2",
135
+ "better-docs": "^2.7.2",
136
136
  "chai": "^4.3.4",
137
137
  "clean-webpack-plugin": "^4.0.0",
138
138
  "cloc": "^2.9.0",
139
- "core-js": "^3.20.3",
139
+ "core-js": "^3.21.0",
140
140
  "coveralls": "^3.1.1",
141
141
  "cross-env": "^7.0.3",
142
- "css-loader": "^6.5.1",
142
+ "css-loader": "^6.6.0",
143
143
  "css-minimizer-webpack-plugin": "^3.3.1",
144
144
  "d3-color": "^3.0.1",
145
145
  "d3-delaunay": "^6.0.2",
@@ -147,10 +147,10 @@
147
147
  "d3-polygon": "^3.0.1",
148
148
  "docdash": "^1.2.0",
149
149
  "dtslint": "^4.2.1",
150
- "eslint": "^8.7.0",
150
+ "eslint": "^8.9.0",
151
151
  "eslint-config-naver": "^2.1.0",
152
152
  "eslint-plugin-import": "^2.25.4",
153
- "eslint-plugin-jsdoc": "^37.6.1",
153
+ "eslint-plugin-jsdoc": "^37.9.1",
154
154
  "eslint-webpack-plugin": "^3.1.1",
155
155
  "exports-loader": "^3.1.0",
156
156
  "hammer-simulator": "0.0.1",
@@ -158,7 +158,7 @@
158
158
  "istanbul-instrumenter-loader": "^3.0.1",
159
159
  "istanbul-lib-instrument": "^5.1.0",
160
160
  "jsdoc": "^3.6.10",
161
- "karma": "^6.3.12",
161
+ "karma": "^6.3.16",
162
162
  "karma-chai": "^0.1.0",
163
163
  "karma-chrome-launcher": "^3.1.0",
164
164
  "karma-coverage-istanbul-reporter": "^3.0.3",
@@ -173,23 +173,23 @@
173
173
  "mocha": "^9.1.4",
174
174
  "node-sass": "^7.0.1",
175
175
  "regenerator-runtime": "^0.13.7",
176
- "rollup": "^2.66.1",
176
+ "rollup": "^2.67.2",
177
177
  "rollup-plugin-delete": "^2.0.0",
178
178
  "sass-loader": "^12.4.0",
179
179
  "semantic-release": "^19.0.2",
180
180
  "simulant": "^0.2.2",
181
- "sinon": "^12.0.1",
181
+ "sinon": "^13.0.1",
182
182
  "string-replace-loader": "^3.1.0",
183
183
  "style-loader": "^3.3.1",
184
- "terser-webpack-plugin": "^5.3.0",
184
+ "terser-webpack-plugin": "^5.3.1",
185
185
  "tslib": "^2.3.1",
186
186
  "typescript": "^4.5.4",
187
- "webpack": "^5.66.0",
187
+ "webpack": "^5.68.0",
188
188
  "webpack-bundle-analyzer": "^4.5.0",
189
189
  "webpack-clean": "^1.2.5",
190
190
  "webpack-cli": "^4.9.1",
191
191
  "webpack-common-shake": "^2.1.0",
192
- "webpack-dev-server": "^4.7.3",
192
+ "webpack-dev-server": "^4.7.4",
193
193
  "webpack-merge": "^5.8.0",
194
194
  "webpackbar": "^5.0.2",
195
195
  "write-file-webpack-plugin": "^4.5.1"
@@ -31,7 +31,7 @@ export default {
31
31
 
32
32
  state.resizing = true;
33
33
 
34
- this.flush(false, true);
34
+ this.flush(false);
35
35
  $$.resizeFunction();
36
36
  }
37
37
  },
@@ -48,13 +48,13 @@ export default {
48
48
  $$.updateSizes();
49
49
  $$.updateTargetsForSubchart($$.data.targets);
50
50
 
51
- $target = subchart.main.selectAll(`.${$COMMON.target}`);
51
+ $target = subchart.main?.selectAll(`.${$COMMON.target}`);
52
52
  }
53
53
 
54
- $target.style("opacity", null);
55
- subchart.main.style("display", null);
54
+ $target?.style("opacity", null);
55
+ subchart.main?.style("display", null);
56
56
 
57
- this.flush();
57
+ this.resize();
58
58
  }
59
59
  },
60
60
 
@@ -69,13 +69,13 @@ export default {
69
69
  */
70
70
  hide(): void {
71
71
  const $$ = this.internal;
72
- const {$el: {subchart}, config} = $$;
72
+ const {$el: {subchart: {main}}, config} = $$;
73
73
 
74
- if (config.subchart_show && subchart.main.style("display") !== "none") {
74
+ if (config.subchart_show && main?.style("display") !== "none") {
75
75
  config.subchart_show = false;
76
- subchart.main.style("display", "none");
76
+ main.style("display", "none");
77
77
 
78
- this.flush();
78
+ this.resize();
79
79
  }
80
80
  },
81
81
 
@@ -38,11 +38,16 @@ export default {
38
38
  */
39
39
  getDefaultValueFormat(): Function {
40
40
  const $$ = this;
41
- const hasArc = $$.hasArcType();
41
+ const {defaultArcValueFormat, yFormat, y2Format} = $$;
42
+ const hasArc = $$.hasArcType(null, ["gauge", "radar"]);
42
43
 
43
- return hasArc && !$$.hasType("gauge") ?
44
- $$.defaultArcValueFormat :
45
- $$.defaultValueFormat;
44
+ return function(v, ratio, id) {
45
+ const format = hasArc ? defaultArcValueFormat : (
46
+ $$.axis && $$.axis.getId(id) === "y2" ? y2Format : yFormat
47
+ );
48
+
49
+ return format.call($$, v, ratio);
50
+ };
46
51
  },
47
52
 
48
53
  defaultValueFormat(v): number|string {
@@ -246,10 +246,11 @@ export default {
246
246
  redrawWithoutRescale() {
247
247
  this.redraw({
248
248
  withY: false,
249
- withLegend: true,
249
+ withDimension: false,
250
+ withLegend: false,
250
251
  withSubchart: false,
251
252
  withEventRect: false,
252
- withTransitionForAxis: false
253
+ withTransitionForAxis: false,
253
254
  });
254
255
  }
255
256
  };
@@ -34,7 +34,16 @@ export default {
34
34
  * - `element {SVGElement}`: Tooltip event bound element
35
35
  * - `pos {object}`: Current position of the tooltip.
36
36
  * @property {Function|object} [tooltip.contents] Set custom HTML for the tooltip.<br>
37
- * Specified function receives data, defaultTitleFormat, defaultValueFormat and color of the data point to show. If tooltip.grouped is true, data includes multiple data points.
37
+ * If tooltip.grouped is true, data includes multiple data points.<br><br>
38
+ * Specified function receives `data` array and `defaultTitleFormat`, `defaultValueFormat` and `color` functions of the data point to show.
39
+ * - **Note:**
40
+ * - defaultTitleFormat:
41
+ * - if `axis.x.tick.format` option will be used if set.
42
+ * - otherwise, will return funciton based on tick format type(category, timeseries).
43
+ * - defaultValueFormat:
44
+ * - for Arc type (except gauge, radar), the function will return value from `(ratio * 100).toFixed(1)`.
45
+ * - for Axis based types, will be used `axis.[y|y2].tick.format` option value if is set.
46
+ * - otherwise, will parse value and return as number.
38
47
  * @property {string|HTMLElement} [tooltip.contents.bindto=undefined] Set CSS selector or element reference to bind tooltip.
39
48
  * - **NOTE:** When is specified, will not be updating tooltip's position.
40
49
  * @property {string} [tooltip.contents.template=undefined] Set tooltip's template.<br><br>
@@ -730,21 +730,28 @@ function isTabVisible(): boolean {
730
730
  * @private
731
731
  */
732
732
  function convertInputType(mouse: boolean, touch: boolean): "mouse" | "touch" | null {
733
- let isMobile = false;
733
+ let hasTouch = false;
734
734
 
735
- // https://developer.mozilla.org/en-US/docs/Web/HTTP/Browser_detection_using_the_user_agent#Mobile_Tablet_or_Desktop
736
- if (/Mobi/.test(window.navigator.userAgent) && touch) {
735
+ if (touch) {
737
736
  // Some Edge desktop return true: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/20417074/
738
- const hasTouchPoints = window.navigator && "maxTouchPoints" in window.navigator && window.navigator.maxTouchPoints > 0;
737
+ if (window.navigator && "maxTouchPoints" in window.navigator) {
738
+ hasTouch = window.navigator.maxTouchPoints > 0;
739
739
 
740
740
  // Ref: https://github.com/Modernizr/Modernizr/blob/master/feature-detects/touchevents.js
741
741
  // On IE11 with IE9 emulation mode, ('ontouchstart' in window) is returning true
742
- const hasTouch = ("ontouchmove" in window || (window.DocumentTouch && document instanceof window.DocumentTouch));
743
-
744
- isMobile = hasTouchPoints || hasTouch;
742
+ } else if ("ontouchmove" in window || (window.DocumentTouch && document instanceof window.DocumentTouch)) {
743
+ hasTouch = true;
744
+ } else {
745
+ // https://developer.mozilla.org/en-US/docs/Web/HTTP/Browser_detection_using_the_user_agent#avoiding_user_agent_detection
746
+ const mQ = window.matchMedia && matchMedia("(pointer:coarse)");
747
+
748
+ if (mQ && mQ.media === "(pointer:coarse)") {
749
+ hasTouch = !!mQ.matches;
750
+ }
751
+ }
745
752
  }
746
753
 
747
- const hasMouse = mouse && !isMobile ? ("onmouseover" in window) : false;
754
+ const hasMouse = mouse && !hasTouch ? ("onmouseover" in window) : false;
748
755
 
749
- return (hasMouse && "mouse") || (isMobile && "touch") || null;
756
+ return (hasMouse && "mouse") || (hasTouch && "touch") || null;
750
757
  }