billboard.js 3.4.1 → 3.5.0-next.1
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.
- package/dist/billboard.css +1 -1
- package/dist/billboard.js +3283 -1110
- package/dist/billboard.min.css +1 -1
- package/dist/billboard.min.js +2 -2
- package/dist/billboard.pkgd.js +7416 -4949
- package/dist/billboard.pkgd.min.js +3 -2
- package/dist/plugin/billboardjs-plugin-bubblecompare.js +29 -13
- package/dist/plugin/billboardjs-plugin-bubblecompare.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-sparkline.js +259 -89
- package/dist/plugin/billboardjs-plugin-sparkline.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-stanford.js +329 -106
- package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-tableview.js +223 -71
- package/dist/plugin/billboardjs-plugin-tableview.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-textoverlap.js +219 -72
- package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.js +3940 -3793
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.js +4219 -3882
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.js +4392 -3930
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.js +4187 -3868
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.js +4195 -3872
- package/dist/theme/datalab.css +1 -1
- package/dist/theme/datalab.min.css +1 -1
- package/dist/theme/graph.css +1 -1
- package/dist/theme/graph.min.css +1 -1
- package/dist/theme/insight.css +1 -1
- package/dist/theme/insight.min.css +1 -1
- package/dist-esm/billboard.js +206 -41
- package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +47 -75
- package/dist-esm/plugin/billboardjs-plugin-sparkline.js +66 -85
- package/dist-esm/plugin/billboardjs-plugin-stanford.js +50 -76
- package/dist-esm/plugin/billboardjs-plugin-tableview.js +47 -75
- package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +47 -75
- package/package.json +34 -34
- package/src/Chart/api/data.ts +2 -2
- package/src/ChartInternal/Axis/AxisRenderer.ts +29 -3
- package/src/ChartInternal/ChartInternal.ts +8 -1
- package/src/ChartInternal/interactions/zoom.ts +17 -4
- package/src/ChartInternal/internals/color.ts +3 -2
- package/src/ChartInternal/internals/grid.ts +5 -3
- package/src/ChartInternal/internals/redraw.ts +5 -2
- package/src/ChartInternal/internals/scale.ts +3 -1
- package/src/ChartInternal/internals/size.axis.ts +5 -2
- package/src/ChartInternal/internals/text.ts +115 -15
- package/src/ChartInternal/shape/bar.ts +12 -5
- package/src/Plugin/sparkline/index.ts +22 -11
- package/src/Plugin/stanford/index.ts +10 -7
- package/src/config/Options/common/main.ts +15 -1
- package/src/config/Options/common/tooltip.ts +1 -1
- package/src/config/Options/data/data.ts +11 -3
- package/src/module/generator.ts +12 -5
- package/types/chart.d.ts +2 -2
- package/types/options.d.ts +21 -8
package/dist/theme/datalab.css
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 3.
|
|
8
|
+
* @version 3.5.0-next.1
|
|
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-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}
|
package/dist/theme/graph.css
CHANGED
package/dist/theme/graph.min.css
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 3.
|
|
8
|
+
* @version 3.5.0-next.1
|
|
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-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}
|
package/dist/theme/insight.css
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 3.
|
|
8
|
+
* @version 3.5.0-next.1
|
|
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-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}
|
package/dist-esm/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.
|
|
8
|
+
* @version 3.5.0-next.1
|
|
9
9
|
*/
|
|
10
10
|
import { timeParse, utcParse, timeFormat, utcFormat } from 'd3-time-format';
|
|
11
11
|
import { pointer, select, namespaces, selectAll } from 'd3-selection';
|
|
@@ -130,7 +130,7 @@ var TYPE_BY_CATEGORY = {
|
|
|
130
130
|
]
|
|
131
131
|
};
|
|
132
132
|
|
|
133
|
-
|
|
133
|
+
/******************************************************************************
|
|
134
134
|
Copyright (c) Microsoft Corporation.
|
|
135
135
|
|
|
136
136
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -1369,12 +1369,26 @@ var main = {
|
|
|
1369
1369
|
* @type {object}
|
|
1370
1370
|
* @property {object} [resize] resize object
|
|
1371
1371
|
* @property {boolean} [resize.auto=true] Set chart resize automatically on viewport changes.
|
|
1372
|
+
* @property {boolean|number} [resize.timer=true] Set resize timer option.
|
|
1373
|
+
* - **NOTE:**
|
|
1374
|
+
* - The resize function will be called using: true - `setTimeout()`, false - `requestIdleCallback()`.
|
|
1375
|
+
* - Given number(delay in ms) value, resize function will be triggered using `setTimer()` with given delay.
|
|
1372
1376
|
* @example
|
|
1373
1377
|
* resize: {
|
|
1374
|
-
* auto: false
|
|
1378
|
+
* auto: false,
|
|
1379
|
+
*
|
|
1380
|
+
* // set resize function will be triggered using `setTimer()`
|
|
1381
|
+
* timer: true,
|
|
1382
|
+
*
|
|
1383
|
+
* // set resize function will be triggered using `requestIdleCallback()`
|
|
1384
|
+
* timer: false,
|
|
1385
|
+
*
|
|
1386
|
+
* // set resize function will be triggered using `setTimer()` with a delay of `100ms`.
|
|
1387
|
+
* timer: 100
|
|
1375
1388
|
* }
|
|
1376
1389
|
*/
|
|
1377
1390
|
resize_auto: true,
|
|
1391
|
+
resize_timer: true,
|
|
1378
1392
|
/**
|
|
1379
1393
|
* Set a callback to execute when the chart is clicked.
|
|
1380
1394
|
* @name onclick
|
|
@@ -1627,6 +1641,7 @@ var data$2 = {
|
|
|
1627
1641
|
data_idConverter: function (id) { return id; },
|
|
1628
1642
|
/**
|
|
1629
1643
|
* Set custom data name.
|
|
1644
|
+
* If a name is set to `null`, the series is omitted from the legend.
|
|
1630
1645
|
* @name data․names
|
|
1631
1646
|
* @memberof Options
|
|
1632
1647
|
* @type {object}
|
|
@@ -1885,6 +1900,8 @@ var data$2 = {
|
|
|
1885
1900
|
* @property {object} [data.labels.position] Set each dataset position, relative the original.
|
|
1886
1901
|
* @property {number} [data.labels.position.x=0] x coordinate position, relative the original.
|
|
1887
1902
|
* @property {number} [data.labels.position.y=0] y coordinate position, relative the original.
|
|
1903
|
+
* @property {object} [data.labels.rotate] Rotate label text. Specify degree value in a range of `0 ~ 360`.
|
|
1904
|
+
* - **NOTE:** Depend on rotate value, text position need to be adjusted manually(using `data.labels.position` option) to be shown nicely.
|
|
1888
1905
|
* @memberof Options
|
|
1889
1906
|
* @type {object}
|
|
1890
1907
|
* @default {}
|
|
@@ -1894,6 +1911,7 @@ var data$2 = {
|
|
|
1894
1911
|
* @see [Demo: label multiline](https://naver.github.io/billboard.js/demo/#Data.DataLabelMultiline)
|
|
1895
1912
|
* @see [Demo: label overlap](https://naver.github.io/billboard.js/demo/#Data.DataLabelOverlap)
|
|
1896
1913
|
* @see [Demo: label position](https://naver.github.io/billboard.js/demo/#Data.DataLabelPosition)
|
|
1914
|
+
* @see [Demo: label rotate](https://naver.github.io/billboard.js/demo/#Data.DataLabelRotate)
|
|
1897
1915
|
* @example
|
|
1898
1916
|
* data: {
|
|
1899
1917
|
* labels: true,
|
|
@@ -1952,7 +1970,10 @@ var data$2 = {
|
|
|
1952
1970
|
* position: {
|
|
1953
1971
|
* data1: {x: 5, y: 5},
|
|
1954
1972
|
* data2: {x: 10, y: -20}
|
|
1955
|
-
* }
|
|
1973
|
+
* },
|
|
1974
|
+
*
|
|
1975
|
+
* // rotate degree for label text
|
|
1976
|
+
* rotate: 90
|
|
1956
1977
|
* }
|
|
1957
1978
|
* }
|
|
1958
1979
|
*/
|
|
@@ -2723,7 +2744,7 @@ var tooltip$2 = {
|
|
|
2723
2744
|
* - **Note:**
|
|
2724
2745
|
* - defaultTitleFormat:
|
|
2725
2746
|
* - if `axis.x.tick.format` option will be used if set.
|
|
2726
|
-
* - otherwise, will return
|
|
2747
|
+
* - otherwise, will return function based on tick format type(category, timeseries).
|
|
2727
2748
|
* - defaultValueFormat:
|
|
2728
2749
|
* - for Arc type (except gauge, radar), the function will return value from `(ratio * 100).toFixed(1)`.
|
|
2729
2750
|
* - for Axis based types, will be used `axis.[y|y2].tick.format` option value if is set.
|
|
@@ -3026,18 +3047,26 @@ var Cache = /** @class */ (function () {
|
|
|
3026
3047
|
var setTimeout$1 = win.setTimeout, clearTimeout$1 = win.clearTimeout;
|
|
3027
3048
|
/**
|
|
3028
3049
|
* Generate resize queue function
|
|
3050
|
+
* @param {boolean|number} option Resize option
|
|
3029
3051
|
* @returns {Fucntion}
|
|
3030
3052
|
* @private
|
|
3031
3053
|
*/
|
|
3032
|
-
function generateResize() {
|
|
3054
|
+
function generateResize(option) {
|
|
3033
3055
|
var fn = [];
|
|
3034
3056
|
var timeout;
|
|
3035
3057
|
var callResizeFn = function () {
|
|
3036
3058
|
// Delay all resize functions call, to prevent unintended excessive call from resize event
|
|
3037
3059
|
callResizeFn.clear();
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3060
|
+
if (option === false && win.requestIdleCallback) {
|
|
3061
|
+
requestIdleCallback(function () {
|
|
3062
|
+
fn.forEach(function (f) { return f(); });
|
|
3063
|
+
}, { timeout: 200 });
|
|
3064
|
+
}
|
|
3065
|
+
else {
|
|
3066
|
+
timeout = setTimeout$1(function () {
|
|
3067
|
+
fn.forEach(function (f) { return f(); });
|
|
3068
|
+
}, isNumber(option) ? option : 200);
|
|
3069
|
+
}
|
|
3041
3070
|
};
|
|
3042
3071
|
callResizeFn.clear = function () {
|
|
3043
3072
|
if (timeout) {
|
|
@@ -6061,6 +6090,10 @@ var redraw = {
|
|
|
6061
6090
|
// Draw with new sizes & scales
|
|
6062
6091
|
$$.redraw(options, transitions);
|
|
6063
6092
|
},
|
|
6093
|
+
/**
|
|
6094
|
+
* Redraw without rescale
|
|
6095
|
+
* @private
|
|
6096
|
+
*/
|
|
6064
6097
|
redrawWithoutRescale: function () {
|
|
6065
6098
|
this.redraw({
|
|
6066
6099
|
withY: false,
|
|
@@ -6209,7 +6242,10 @@ var scale = {
|
|
|
6209
6242
|
var xDomain = updateXDomain && ((_a = scale.x) === null || _a === void 0 ? void 0 : _a.orgDomain());
|
|
6210
6243
|
var xSubDomain = updateXDomain && org.xDomain;
|
|
6211
6244
|
scale.x = $$.getXScale(min.x, max.x, xDomain, function () { return axis.x.tickOffset(); });
|
|
6212
|
-
scale.subX = $$.getXScale(min.x, max.x, xSubDomain, function (d) {
|
|
6245
|
+
scale.subX = $$.getXScale(min.x, max.x, xSubDomain, function (d) {
|
|
6246
|
+
var _a;
|
|
6247
|
+
return (d % 1 ? 0 : ((_a = axis.subX) !== null && _a !== void 0 ? _a : axis.x).tickOffset());
|
|
6248
|
+
});
|
|
6213
6249
|
format.xAxisTick = axis.getXAxisTickFormat();
|
|
6214
6250
|
format.subXAxisTick = axis.getXAxisTickFormat(true);
|
|
6215
6251
|
axis.setAxis("x", scale.x, config.axis_x_tick_outer, isInit);
|
|
@@ -6972,6 +7008,75 @@ var size = {
|
|
|
6972
7008
|
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
6973
7009
|
* billboard.js project is licensed under the MIT license
|
|
6974
7010
|
*/
|
|
7011
|
+
/**
|
|
7012
|
+
* Get text-anchor according text.labels.rotate angle
|
|
7013
|
+
* @param {number} angle Angle value
|
|
7014
|
+
* @returns {string} Anchor string value
|
|
7015
|
+
* @private
|
|
7016
|
+
*/
|
|
7017
|
+
function getRotateAnchor(angle) {
|
|
7018
|
+
var anchor = "middle";
|
|
7019
|
+
if (angle > 0 && angle <= 170) {
|
|
7020
|
+
anchor = "end";
|
|
7021
|
+
}
|
|
7022
|
+
else if (angle > 190 && angle <= 360) {
|
|
7023
|
+
anchor = "start";
|
|
7024
|
+
}
|
|
7025
|
+
return anchor;
|
|
7026
|
+
}
|
|
7027
|
+
/**
|
|
7028
|
+
* Set rotated position coordinate according text.labels.rotate angle
|
|
7029
|
+
* @param {object} d Data object
|
|
7030
|
+
* @param {object} pos Position object
|
|
7031
|
+
* @param {object} pos.x x coordinate
|
|
7032
|
+
* @param {object} pos.y y coordinate
|
|
7033
|
+
* @param {string} anchor string value
|
|
7034
|
+
* @param {boolean} isRotated If axis is rotated
|
|
7035
|
+
* @param {boolean} isInverted If axis is inverted
|
|
7036
|
+
* @returns {object} x, y coordinate
|
|
7037
|
+
* @private
|
|
7038
|
+
*/
|
|
7039
|
+
function setRotatePos(d, pos, anchor, isRotated, isInverted) {
|
|
7040
|
+
var _a;
|
|
7041
|
+
var $$ = this;
|
|
7042
|
+
var value = d.value;
|
|
7043
|
+
var isCandlestickType = $$.isCandlestickType(d);
|
|
7044
|
+
var isNegative = value < 0 || (isCandlestickType && !((_a = $$.getCandlestickData(d)) === null || _a === void 0 ? void 0 : _a._isUp));
|
|
7045
|
+
var x = pos.x, y = pos.y;
|
|
7046
|
+
var gap = 4;
|
|
7047
|
+
var doubleGap = gap * 2;
|
|
7048
|
+
if (isRotated) {
|
|
7049
|
+
if (anchor === "start") {
|
|
7050
|
+
x += isNegative ? 0 : doubleGap;
|
|
7051
|
+
y += gap;
|
|
7052
|
+
}
|
|
7053
|
+
else if (anchor === "middle") {
|
|
7054
|
+
x += doubleGap;
|
|
7055
|
+
y -= doubleGap;
|
|
7056
|
+
}
|
|
7057
|
+
else if (anchor === "end") {
|
|
7058
|
+
isNegative && (x -= doubleGap);
|
|
7059
|
+
y += gap;
|
|
7060
|
+
}
|
|
7061
|
+
}
|
|
7062
|
+
else {
|
|
7063
|
+
if (anchor === "start") {
|
|
7064
|
+
x += gap;
|
|
7065
|
+
isNegative && (y += doubleGap * 2);
|
|
7066
|
+
}
|
|
7067
|
+
else if (anchor === "middle") {
|
|
7068
|
+
y -= doubleGap;
|
|
7069
|
+
}
|
|
7070
|
+
else if (anchor === "end") {
|
|
7071
|
+
x -= gap;
|
|
7072
|
+
isNegative && (y += doubleGap * 2);
|
|
7073
|
+
}
|
|
7074
|
+
if (isInverted) {
|
|
7075
|
+
y += isNegative ? -17 : (isCandlestickType ? 13 : 7);
|
|
7076
|
+
}
|
|
7077
|
+
}
|
|
7078
|
+
return { x: x, y: y };
|
|
7079
|
+
}
|
|
6975
7080
|
var text = {
|
|
6976
7081
|
opacityForText: function (d) {
|
|
6977
7082
|
var $$ = this;
|
|
@@ -7103,17 +7208,21 @@ var text = {
|
|
|
7103
7208
|
},
|
|
7104
7209
|
/**
|
|
7105
7210
|
* Redraw chartText
|
|
7106
|
-
* @param {Function}
|
|
7107
|
-
* @param {Function}
|
|
7211
|
+
* @param {Function} getX Positioning function for x
|
|
7212
|
+
* @param {Function} getY Positioning function for y
|
|
7108
7213
|
* @param {boolean} forFlow Weather is flow
|
|
7109
7214
|
* @param {boolean} withTransition transition is enabled
|
|
7110
7215
|
* @returns {Array}
|
|
7111
7216
|
* @private
|
|
7112
7217
|
*/
|
|
7113
|
-
redrawText: function (
|
|
7218
|
+
redrawText: function (getX, getY, forFlow, withTransition) {
|
|
7114
7219
|
var $$ = this;
|
|
7115
|
-
var $T = $$.$T;
|
|
7220
|
+
var $T = $$.$T, axis = $$.axis, config = $$.config;
|
|
7116
7221
|
var t = getRandom(true);
|
|
7222
|
+
var isRotated = config.axis_rotated;
|
|
7223
|
+
var angle = config.data_labels.rotate;
|
|
7224
|
+
var anchorString = getRotateAnchor(angle);
|
|
7225
|
+
var rotateString = angle ? "rotate(".concat(angle, ")") : "";
|
|
7117
7226
|
$$.$el.text
|
|
7118
7227
|
.style("fill", $$.updateTextColor.bind($$))
|
|
7119
7228
|
.attr("filter", $$.updateTextBacgroundColor.bind($$))
|
|
@@ -7121,14 +7230,21 @@ var text = {
|
|
|
7121
7230
|
.each(function (d, i) {
|
|
7122
7231
|
// do not apply transition for newly added text elements
|
|
7123
7232
|
var node = $T(this, !!(withTransition && this.getAttribute("x")), t);
|
|
7124
|
-
var
|
|
7125
|
-
var
|
|
7233
|
+
var isInverted = config["axis_".concat(axis === null || axis === void 0 ? void 0 : axis.getId(d.id), "_inverted")];
|
|
7234
|
+
var pos = {
|
|
7235
|
+
x: getX.bind(this)(d, i),
|
|
7236
|
+
y: getY.bind(this)(d, i)
|
|
7237
|
+
};
|
|
7238
|
+
if (angle) {
|
|
7239
|
+
pos = setRotatePos.bind($$)(d, pos, anchorString, isRotated, isInverted);
|
|
7240
|
+
node.attr("text-anchor", anchorString);
|
|
7241
|
+
}
|
|
7126
7242
|
// when is multiline
|
|
7127
|
-
if (this.childElementCount) {
|
|
7128
|
-
node.attr("transform", "translate(".concat(
|
|
7243
|
+
if (this.childElementCount || angle) {
|
|
7244
|
+
node.attr("transform", "translate(".concat(pos.x, " ").concat(pos.y, ") ").concat(rotateString));
|
|
7129
7245
|
}
|
|
7130
7246
|
else {
|
|
7131
|
-
node.attr("x",
|
|
7247
|
+
node.attr("x", pos.x).attr("y", pos.y);
|
|
7132
7248
|
}
|
|
7133
7249
|
});
|
|
7134
7250
|
// need to return 'true' as of being pushed to the redraw list
|
|
@@ -7287,8 +7403,10 @@ var text = {
|
|
|
7287
7403
|
*/
|
|
7288
7404
|
getYForText: function (points, d, textElement) {
|
|
7289
7405
|
var $$ = this;
|
|
7290
|
-
var config = $$.config, state = $$.state;
|
|
7406
|
+
var axis = $$.axis, config = $$.config, state = $$.state;
|
|
7291
7407
|
var isRotated = config.axis_rotated;
|
|
7408
|
+
var isInverted = config["axis_".concat(axis === null || axis === void 0 ? void 0 : axis.getId(d.id), "_inverted")];
|
|
7409
|
+
var isBarType = $$.isBarType(d);
|
|
7292
7410
|
var r = config.point_r;
|
|
7293
7411
|
var rect = getBoundingRect(textElement);
|
|
7294
7412
|
var value = d.value;
|
|
@@ -7304,6 +7422,9 @@ var text = {
|
|
|
7304
7422
|
yPos = value && value._isUp ?
|
|
7305
7423
|
points[2][2] - baseY :
|
|
7306
7424
|
points[2][1] + (baseY * 4);
|
|
7425
|
+
if (isInverted) {
|
|
7426
|
+
yPos += 15 * (value._isUp ? 1 : -1);
|
|
7427
|
+
}
|
|
7307
7428
|
}
|
|
7308
7429
|
}
|
|
7309
7430
|
else {
|
|
@@ -7316,16 +7437,19 @@ var text = {
|
|
|
7316
7437
|
baseY += config.point_r / 2.3;
|
|
7317
7438
|
}
|
|
7318
7439
|
if (value < 0 || (value === 0 && !state.hasPositiveValue && state.hasNegativeValue)) {
|
|
7319
|
-
yPos += rect.height + (
|
|
7440
|
+
yPos += isInverted ? (isBarType ? -3 : -5) : (rect.height + (isBarType ? -baseY : baseY));
|
|
7320
7441
|
}
|
|
7321
7442
|
else {
|
|
7322
7443
|
var diff = -baseY * 2;
|
|
7323
|
-
if (
|
|
7444
|
+
if (isBarType) {
|
|
7324
7445
|
diff = -baseY;
|
|
7325
7446
|
}
|
|
7326
7447
|
else if ($$.isBubbleType(d)) {
|
|
7327
7448
|
diff = baseY;
|
|
7328
7449
|
}
|
|
7450
|
+
if (isInverted) {
|
|
7451
|
+
diff = isBarType ? 10 : 15;
|
|
7452
|
+
}
|
|
7329
7453
|
yPos += diff;
|
|
7330
7454
|
}
|
|
7331
7455
|
}
|
|
@@ -8729,12 +8853,17 @@ var ChartInternal = /** @class */ (function () {
|
|
|
8729
8853
|
ChartInternal.prototype.bindResize = function () {
|
|
8730
8854
|
var $$ = this;
|
|
8731
8855
|
var config = $$.config, state = $$.state;
|
|
8732
|
-
var resizeFunction = generateResize();
|
|
8856
|
+
var resizeFunction = generateResize(config.resize_timer);
|
|
8733
8857
|
var list = [];
|
|
8734
8858
|
list.push(function () { return callFn(config.onresize, $$, $$.api); });
|
|
8735
8859
|
if (config.resize_auto) {
|
|
8736
8860
|
list.push(function () {
|
|
8737
8861
|
state.resizing = true;
|
|
8862
|
+
// https://github.com/naver/billboard.js/issues/2650
|
|
8863
|
+
if (config.legend_show) {
|
|
8864
|
+
$$.updateSizes();
|
|
8865
|
+
$$.updateLegend();
|
|
8866
|
+
}
|
|
8738
8867
|
$$.api.flush(false);
|
|
8739
8868
|
});
|
|
8740
8869
|
}
|
|
@@ -9091,7 +9220,7 @@ extend(data, {
|
|
|
9091
9220
|
* @function data․names
|
|
9092
9221
|
* @instance
|
|
9093
9222
|
* @memberof Chart
|
|
9094
|
-
* @param {object} names If this argument is given, the names of data will be updated. If not given, the current names will be returned. The format of this argument is the same as
|
|
9223
|
+
* @param {object} names If this argument is given, the names of data will be updated. If not given, the current names will be returned. The format of this argument is the same as [data.names](./Options.html#.data%25E2%2580%25A4names).
|
|
9095
9224
|
* @returns {object} Corresponding names according its key value, if specified names values.
|
|
9096
9225
|
* @example
|
|
9097
9226
|
* // Get current names
|
|
@@ -11049,10 +11178,10 @@ var AxisRenderer = /** @class */ (function () {
|
|
|
11049
11178
|
*/
|
|
11050
11179
|
AxisRenderer.prototype.create = function (g) {
|
|
11051
11180
|
var ctx = this;
|
|
11052
|
-
var
|
|
11181
|
+
var config = ctx.config, helper = ctx.helper, params = ctx.params;
|
|
11053
11182
|
var scale = helper.scale;
|
|
11054
11183
|
var orient = config.orient;
|
|
11055
|
-
var splitTickText = this.splitTickText.bind(
|
|
11184
|
+
var splitTickText = this.splitTickText.bind(ctx);
|
|
11056
11185
|
var isLeftRight = /^(left|right)$/.test(orient);
|
|
11057
11186
|
var isTopBottom = /^(top|bottom)$/.test(orient);
|
|
11058
11187
|
// line/text enter and path update
|
|
@@ -11101,6 +11230,8 @@ var AxisRenderer = /** @class */ (function () {
|
|
|
11101
11230
|
if (tickShow.tick || tickShow.text) {
|
|
11102
11231
|
// count of tick data in array
|
|
11103
11232
|
var ticks_1 = config.tickValues || helper.generateTicks(scale1, isLeftRight);
|
|
11233
|
+
// set generated ticks
|
|
11234
|
+
ctx.generatedTicks = ticks_1;
|
|
11104
11235
|
// update selection
|
|
11105
11236
|
var tick = g.selectAll(".tick")
|
|
11106
11237
|
.data(ticks_1, scale1);
|
|
@@ -11189,6 +11320,24 @@ var AxisRenderer = /** @class */ (function () {
|
|
|
11189
11320
|
});
|
|
11190
11321
|
this.g = $g;
|
|
11191
11322
|
};
|
|
11323
|
+
/**
|
|
11324
|
+
* Get generated ticks
|
|
11325
|
+
* @param {number} count Count of ticks
|
|
11326
|
+
* @returns {Array} Generated ticks
|
|
11327
|
+
* @private
|
|
11328
|
+
*/
|
|
11329
|
+
AxisRenderer.prototype.getGeneratedTicks = function (count) {
|
|
11330
|
+
var len = this.generatedTicks.length - 1;
|
|
11331
|
+
var res = this.generatedTicks;
|
|
11332
|
+
if (len > count) {
|
|
11333
|
+
var interval_1 = Math.round((len / count) - 0.1);
|
|
11334
|
+
res = this.generatedTicks
|
|
11335
|
+
.map(function (v, i) { return (i % interval_1 === 0 ? v : null); })
|
|
11336
|
+
.filter(function (v) { return v !== null; })
|
|
11337
|
+
.splice(0, count);
|
|
11338
|
+
}
|
|
11339
|
+
return res;
|
|
11340
|
+
};
|
|
11192
11341
|
/**
|
|
11193
11342
|
* Get tick x/y coordinate
|
|
11194
11343
|
* @returns {{x: number, y: number}}
|
|
@@ -13091,10 +13240,10 @@ var grid = {
|
|
|
13091
13240
|
},
|
|
13092
13241
|
updateYGrid: function () {
|
|
13093
13242
|
var $$ = this;
|
|
13094
|
-
var config = $$.config, state = $$.state, _a = $$.$el, grid = _a.grid, main = _a.main;
|
|
13243
|
+
var axis = $$.axis, config = $$.config, scale = $$.scale, state = $$.state, _a = $$.$el, grid = _a.grid, main = _a.main;
|
|
13095
13244
|
var isRotated = config.axis_rotated;
|
|
13096
|
-
var
|
|
13097
|
-
var
|
|
13245
|
+
var pos = function (d) { return Math.ceil(scale.y(d)); };
|
|
13246
|
+
var gridValues = axis.y.getGeneratedTicks(config.grid_y_ticks) || $$.scale.y.ticks(config.grid_y_ticks);
|
|
13098
13247
|
grid.y = main.select(".".concat($GRID.ygrids))
|
|
13099
13248
|
.selectAll(".".concat($GRID.ygrid))
|
|
13100
13249
|
.data(gridValues);
|
|
@@ -13533,8 +13682,9 @@ var sizeAxis = {
|
|
|
13533
13682
|
var $$ = this;
|
|
13534
13683
|
if ($$.axis) {
|
|
13535
13684
|
var position = (_a = $$.axis) === null || _a === void 0 ? void 0 : _a.getLabelPositionById(id);
|
|
13536
|
-
|
|
13537
|
-
|
|
13685
|
+
var width = $$.axis.getMaxTickWidth(id, withoutRecompute);
|
|
13686
|
+
var gap = width === 0 ? 0.5 : 0;
|
|
13687
|
+
return width + (position.isInner ? (20 + gap) : 40);
|
|
13538
13688
|
}
|
|
13539
13689
|
else {
|
|
13540
13690
|
return 40;
|
|
@@ -16445,7 +16595,7 @@ var shapeBar = {
|
|
|
16445
16595
|
return [
|
|
16446
16596
|
$$.$T(bar, withTransition, getRandom())
|
|
16447
16597
|
.attr("d", function (d) { return (isNumber(d.value) || $$.isBarRangeType(d)) && drawFn(d); })
|
|
16448
|
-
.style("fill",
|
|
16598
|
+
.style("fill", $$.color)
|
|
16449
16599
|
.style("opacity", null)
|
|
16450
16600
|
];
|
|
16451
16601
|
},
|
|
@@ -16489,9 +16639,9 @@ var shapeBar = {
|
|
|
16489
16639
|
var pathRadius = ["", ""];
|
|
16490
16640
|
var radius = 0;
|
|
16491
16641
|
var isGrouped = $$.isGrouped(d.id);
|
|
16492
|
-
|
|
16493
|
-
var isRadiusData =
|
|
16494
|
-
if (
|
|
16642
|
+
// const hasRadius = d.value !== 0 && getRadius;
|
|
16643
|
+
var isRadiusData = getRadius && isGrouped ? $$.isStackingRadiusData(d) : false;
|
|
16644
|
+
if (getRadius && (!isGrouped || isRadiusData)) {
|
|
16495
16645
|
var index = isRotated ? indexY : indexX;
|
|
16496
16646
|
var barW = points[2][index] - points[0][index];
|
|
16497
16647
|
radius = getRadius(barW);
|
|
@@ -16515,8 +16665,13 @@ var shapeBar = {
|
|
|
16515
16665
|
*/
|
|
16516
16666
|
isStackingRadiusData: function (d) {
|
|
16517
16667
|
var $$ = this;
|
|
16518
|
-
var config = $$.config, data = $$.data;
|
|
16668
|
+
var $el = $$.$el, config = $$.config, data = $$.data, state = $$.state;
|
|
16519
16669
|
var id = d.id, index = d.index, value = d.value;
|
|
16670
|
+
// when the data is hidden, check if has rounded edges
|
|
16671
|
+
if (state.hiddenTargetIds.indexOf(id) > -1) {
|
|
16672
|
+
var target = $el.bar.filter(function (d) { return d.id === id && d.value === value; });
|
|
16673
|
+
return !target.empty() && /a\d+/i.test(target.attr("d"));
|
|
16674
|
+
}
|
|
16520
16675
|
// Find same grouped ids
|
|
16521
16676
|
var keys = config.data_groups.find(function (v) { return v.indexOf(id) > -1; });
|
|
16522
16677
|
// Get sorted list
|
|
@@ -20175,18 +20330,28 @@ var zoom = {
|
|
|
20175
20330
|
/**
|
|
20176
20331
|
* Update scale according zoom transform value
|
|
20177
20332
|
* @param {object} transform transform object
|
|
20333
|
+
* @param {boolean} correctTransform if the d3 transform should be updated after rescaling
|
|
20178
20334
|
* @private
|
|
20179
20335
|
*/
|
|
20180
20336
|
// @ts-ignore
|
|
20181
|
-
zoom.updateTransformScale = function (transform) {
|
|
20337
|
+
zoom.updateTransformScale = function (transform, correctTransform) {
|
|
20182
20338
|
var _a;
|
|
20339
|
+
var isRotated = config.axis_rotated;
|
|
20183
20340
|
// in case of resize, update range of orgXScale
|
|
20184
20341
|
(_a = org.xScale) === null || _a === void 0 ? void 0 : _a.range(scale.x.range());
|
|
20185
20342
|
// rescale from the original scale
|
|
20186
|
-
var newScale = transform[
|
|
20343
|
+
var newScale = transform[isRotated ? "rescaleY" : "rescaleX"](org.xScale || scale.x);
|
|
20187
20344
|
var domain = $$.trimXDomain(newScale.domain());
|
|
20188
20345
|
var rescale = config.zoom_rescale;
|
|
20189
20346
|
newScale.domain(domain, org.xDomain);
|
|
20347
|
+
// prevent chart from panning off the edge and feeling "stuck"
|
|
20348
|
+
// https://github.com/naver/billboard.js/issues/2588
|
|
20349
|
+
if (correctTransform) {
|
|
20350
|
+
var t = newScale(scale.x.domain()[0]);
|
|
20351
|
+
var tX = isRotated ? transform.x : t;
|
|
20352
|
+
var tY = isRotated ? t : transform.y;
|
|
20353
|
+
$$.$el.eventRect.property("__zoom", zoomIdentity.translate(tX, tY).scale(transform.k));
|
|
20354
|
+
}
|
|
20190
20355
|
if (!$$.state.xTickOffset) {
|
|
20191
20356
|
$$.state.xTickOffset = $$.axis.x.tickOffset();
|
|
20192
20357
|
}
|
|
@@ -20252,7 +20417,7 @@ var zoom = {
|
|
|
20252
20417
|
if (!isMousemove && isZoomOut && scale.x.domain().every(function (v, i) { return v !== org.xDomain[i]; })) {
|
|
20253
20418
|
scale.x.domain(org.xDomain);
|
|
20254
20419
|
}
|
|
20255
|
-
$$.zoom.updateTransformScale(transform);
|
|
20420
|
+
$$.zoom.updateTransformScale(transform, config.zoom_type === "wheel" && sourceEvent);
|
|
20256
20421
|
// do zoom transiton when:
|
|
20257
20422
|
// - zoom type 'drag'
|
|
20258
20423
|
// - when .unzoom() is called (event.transform === d3ZoomIdentity)
|
|
@@ -20738,7 +20903,7 @@ var zoomModule = function () {
|
|
|
20738
20903
|
var defaults = {};
|
|
20739
20904
|
/**
|
|
20740
20905
|
* @namespace bb
|
|
20741
|
-
* @version 3.
|
|
20906
|
+
* @version 3.5.0-next.1
|
|
20742
20907
|
*/
|
|
20743
20908
|
var bb = {
|
|
20744
20909
|
/**
|
|
@@ -20748,7 +20913,7 @@ var bb = {
|
|
|
20748
20913
|
* bb.version; // "1.0.0"
|
|
20749
20914
|
* @memberof bb
|
|
20750
20915
|
*/
|
|
20751
|
-
version: "3.
|
|
20916
|
+
version: "3.5.0-next.1",
|
|
20752
20917
|
/**
|
|
20753
20918
|
* Generate chart
|
|
20754
20919
|
* - **NOTE:** Bear in mind for the possiblity of ***throwing an error***, during the generation when:
|