billboard.js 3.7.0 → 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.
- package/dist/billboard.css +1 -1
- package/dist/billboard.js +48 -37
- package/dist/billboard.min.css +1 -1
- package/dist/billboard.min.js +2 -2
- package/dist/billboard.pkgd.js +1256 -1206
- package/dist/billboard.pkgd.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-bubblecompare.js +2 -2
- package/dist/plugin/billboardjs-plugin-bubblecompare.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-sparkline.js +2 -2
- package/dist/plugin/billboardjs-plugin-sparkline.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-stanford.js +2 -2
- package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-tableview.js +2 -2
- package/dist/plugin/billboardjs-plugin-tableview.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-textoverlap.js +2 -2
- package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.js +1159 -1130
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.js +1160 -1131
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.js +1204 -1165
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.js +1161 -1132
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.js +1161 -1132
- 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 +46 -37
- package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-sparkline.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-stanford.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-tableview.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +2 -2
- package/package.json +9 -9
- package/src/Chart/api/data.ts +2 -2
- package/src/Chart/api/grid.x.ts +2 -2
- package/src/Chart/api/grid.y.ts +4 -2
- package/src/Chart/api/regions.ts +2 -2
- package/src/Chart/api/tooltip.ts +2 -2
- package/src/ChartInternal/ChartInternal.ts +2 -2
- package/src/ChartInternal/internals/clip.ts +12 -14
- package/src/ChartInternal/internals/text.ts +14 -4
- package/src/ChartInternal/shape/bar.ts +4 -2
- package/src/ChartInternal/shape/treemap.ts +7 -4
- package/types/chart.d.ts +13 -3
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.7.
|
|
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}
|
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.7.
|
|
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}
|
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.7.
|
|
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}
|
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.7.
|
|
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
|
-
|
|
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;
|
|
@@ -9058,8 +9067,8 @@ var ChartInternal = /** @class */ (function () {
|
|
|
9058
9067
|
if ($$.hasPointType()) {
|
|
9059
9068
|
$$.point = $$.generatePoint();
|
|
9060
9069
|
}
|
|
9061
|
-
$$.initClip();
|
|
9062
9070
|
if (state.hasAxis) {
|
|
9071
|
+
$$.initClip();
|
|
9063
9072
|
format.extraLineClasses = $$.generateExtraLineClass();
|
|
9064
9073
|
format.dataTime = config.data_xLocaltime ? timeParse : utcParse;
|
|
9065
9074
|
format.axisTime = config.axis_x_localtime ? timeFormat : utcFormat;
|
|
@@ -9747,14 +9756,14 @@ var apiColor = {
|
|
|
9747
9756
|
* // Get all data
|
|
9748
9757
|
* chart.data();
|
|
9749
9758
|
*/
|
|
9750
|
-
function
|
|
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
|
-
(
|
|
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
|
|
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
|
|
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
|
|
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>
|
|
@@ -13775,19 +13784,17 @@ var flow = {
|
|
|
13775
13784
|
var clip = {
|
|
13776
13785
|
initClip: function () {
|
|
13777
13786
|
var $$ = this;
|
|
13778
|
-
var _a = $$.state, clip = _a.clip,
|
|
13787
|
+
var _a = $$.state, clip = _a.clip, datetimeId = _a.datetimeId;
|
|
13779
13788
|
// MEMO: clipId needs to be unique because it conflicts when multiple charts exist
|
|
13780
|
-
clip.id = "".concat(
|
|
13781
|
-
|
|
13782
|
-
|
|
13783
|
-
|
|
13784
|
-
|
|
13785
|
-
|
|
13786
|
-
|
|
13787
|
-
|
|
13788
|
-
|
|
13789
|
-
clip.pathGrid = $$.getClipPath(clip.idGrid);
|
|
13790
|
-
}
|
|
13789
|
+
clip.id = "".concat(datetimeId, "-clip");
|
|
13790
|
+
clip.idXAxis = "".concat(clip.id, "-xaxis");
|
|
13791
|
+
clip.idYAxis = "".concat(clip.id, "-yaxis");
|
|
13792
|
+
clip.idGrid = "".concat(clip.id, "-grid");
|
|
13793
|
+
// Define 'clip-path' attribute values
|
|
13794
|
+
clip.path = $$.getClipPath(clip.id);
|
|
13795
|
+
clip.pathXAxis = $$.getClipPath(clip.idXAxis);
|
|
13796
|
+
clip.pathYAxis = $$.getClipPath(clip.idYAxis);
|
|
13797
|
+
clip.pathGrid = $$.getClipPath(clip.idGrid);
|
|
13791
13798
|
},
|
|
13792
13799
|
getClipPath: function (id) {
|
|
13793
13800
|
var $$ = this;
|
|
@@ -17524,14 +17531,16 @@ var shapeBar = {
|
|
|
17524
17531
|
var barOffset = $$.getShapeOffset($$.isBarType, barIndices, !!isSub);
|
|
17525
17532
|
var yScale = $$.getYScaleById.bind($$);
|
|
17526
17533
|
return function (d, i) {
|
|
17527
|
-
var
|
|
17534
|
+
var id = d.id;
|
|
17535
|
+
var y0 = yScale.call($$, id, isSub)($$.getShapeYMin(id));
|
|
17528
17536
|
var offset = barOffset(d, i) || y0; // offset is for stacked bar chart
|
|
17529
17537
|
var width = isNumber(barW) ? barW : barW[d.id] || barW._$width;
|
|
17538
|
+
var isInverted = config["axis_".concat($$.axis.getId(id), "_inverted")];
|
|
17530
17539
|
var value = d.value;
|
|
17531
17540
|
var posX = barX(d);
|
|
17532
17541
|
var posY = barY(d);
|
|
17533
17542
|
// fix posY not to overflow opposite quadrant
|
|
17534
|
-
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))) {
|
|
17535
17544
|
posY = y0;
|
|
17536
17545
|
}
|
|
17537
17546
|
if (!$$.isBarRangeType(d)) {
|
|
@@ -19122,8 +19131,8 @@ function convertDataToTreemapData(data) {
|
|
|
19122
19131
|
var shapeTreemap = {
|
|
19123
19132
|
initTreemap: function () {
|
|
19124
19133
|
var $$ = this;
|
|
19125
|
-
var $el = $$.$el, _a = $$.state, _b = _a.current, width = _b.width, height = _b.height, clip = _a.clip;
|
|
19126
|
-
|
|
19134
|
+
var $el = $$.$el, _a = $$.state, _b = _a.current, width = _b.width, height = _b.height, clip = _a.clip, datetimeId = _a.datetimeId;
|
|
19135
|
+
clip.id = "".concat(datetimeId, "-clip");
|
|
19127
19136
|
$$.treemap = treemap$1()
|
|
19128
19137
|
.tile($$.getTreemapTile());
|
|
19129
19138
|
$$.treemapFn = function (data) {
|
|
@@ -19133,12 +19142,12 @@ var shapeTreemap = {
|
|
|
19133
19142
|
};
|
|
19134
19143
|
$el.defs
|
|
19135
19144
|
.append("clipPath")
|
|
19136
|
-
.attr("id",
|
|
19145
|
+
.attr("id", clip.id)
|
|
19137
19146
|
.append("rect")
|
|
19138
19147
|
.attr("width", width)
|
|
19139
19148
|
.attr("height", height);
|
|
19140
19149
|
$el.treemap = $el.main.select(".".concat($COMMON.chart))
|
|
19141
|
-
.attr("clip-path", "url(#".concat(
|
|
19150
|
+
.attr("clip-path", "url(#".concat(clip.id, ")"))
|
|
19142
19151
|
.append("g")
|
|
19143
19152
|
.classed($TREEMAP.chartTreemaps, true);
|
|
19144
19153
|
$$.bindTreemapEvent();
|
|
@@ -22102,7 +22111,7 @@ var zoomModule = function () {
|
|
|
22102
22111
|
var defaults = {};
|
|
22103
22112
|
/**
|
|
22104
22113
|
* @namespace bb
|
|
22105
|
-
* @version 3.7.
|
|
22114
|
+
* @version 3.7.2
|
|
22106
22115
|
*/
|
|
22107
22116
|
var bb = {
|
|
22108
22117
|
/**
|
|
@@ -22112,7 +22121,7 @@ var bb = {
|
|
|
22112
22121
|
* bb.version; // "1.0.0"
|
|
22113
22122
|
* @memberof bb
|
|
22114
22123
|
*/
|
|
22115
|
-
version: "3.7.
|
|
22124
|
+
version: "3.7.2",
|
|
22116
22125
|
/**
|
|
22117
22126
|
* Generate chart
|
|
22118
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
113
|
-
"@commitlint/config-conventional": "^17.4.
|
|
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.
|
|
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.
|
|
129
|
-
"@typescript-eslint/parser": "^5.48.
|
|
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.
|
|
156
|
+
"eslint": "^8.32.0",
|
|
157
157
|
"eslint-config-naver": "^2.1.0",
|
|
158
|
-
"eslint-plugin-import": "^2.
|
|
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.
|
|
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",
|
package/src/Chart/api/data.ts
CHANGED
|
@@ -24,7 +24,7 @@ import type {IDataRow} from "../../ChartInternal/data/IData";
|
|
|
24
24
|
* // Get all data
|
|
25
25
|
* chart.data();
|
|
26
26
|
*/
|
|
27
|
-
|
|
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
|
/**
|
package/src/Chart/api/grid.x.ts
CHANGED
|
@@ -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
|
-
|
|
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
|
/**
|
package/src/Chart/api/grid.y.ts
CHANGED
|
@@ -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
|
-
|
|
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
|
/**
|
package/src/Chart/api/regions.ts
CHANGED
|
@@ -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
|
-
|
|
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
|
/**
|
package/src/Chart/api/tooltip.ts
CHANGED
|
@@ -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
|
|
|
@@ -285,9 +285,9 @@ export default class ChartInternal {
|
|
|
285
285
|
$$.point = $$.generatePoint();
|
|
286
286
|
}
|
|
287
287
|
|
|
288
|
-
$$.initClip();
|
|
289
|
-
|
|
290
288
|
if (state.hasAxis) {
|
|
289
|
+
$$.initClip();
|
|
290
|
+
|
|
291
291
|
format.extraLineClasses = $$.generateExtraLineClass();
|
|
292
292
|
format.dataTime = config.data_xLocaltime ? d3TimeParse : d3UtcParse;
|
|
293
293
|
format.axisTime = config.axis_x_localtime ? d3TimeFormat : d3UtcFormat;
|
|
@@ -7,22 +7,20 @@ import {document, window} from "../../module/browser";
|
|
|
7
7
|
export default {
|
|
8
8
|
initClip(): void {
|
|
9
9
|
const $$ = this;
|
|
10
|
-
const {clip,
|
|
10
|
+
const {clip, datetimeId} = $$.state;
|
|
11
11
|
|
|
12
12
|
// MEMO: clipId needs to be unique because it conflicts when multiple charts exist
|
|
13
|
-
clip.id = `${
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
clip.pathGrid = $$.getClipPath(clip.idGrid);
|
|
25
|
-
}
|
|
13
|
+
clip.id = `${datetimeId}-clip`;
|
|
14
|
+
|
|
15
|
+
clip.idXAxis = `${clip.id}-xaxis`;
|
|
16
|
+
clip.idYAxis = `${clip.id}-yaxis`;
|
|
17
|
+
clip.idGrid = `${clip.id}-grid`;
|
|
18
|
+
|
|
19
|
+
// Define 'clip-path' attribute values
|
|
20
|
+
clip.path = $$.getClipPath(clip.id);
|
|
21
|
+
clip.pathXAxis = $$.getClipPath(clip.idXAxis);
|
|
22
|
+
clip.pathYAxis = $$.getClipPath(clip.idYAxis);
|
|
23
|
+
clip.pathGrid = $$.getClipPath(clip.idGrid);
|
|
26
24
|
},
|
|
27
25
|
|
|
28
26
|
getClipPath(id: string): string | null {
|
|
@@ -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
|
-
|
|
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
|
}
|