billboard.js 3.10.0-next.2 → 3.10.0-next.3
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 +125 -118
- package/dist/billboard.min.css +1 -1
- package/dist/billboard.min.js +2 -2
- package/dist/billboard.pkgd.js +125 -118
- 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 +8 -5
- package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-tableview.js +16 -5
- 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.pkgd.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.js +8 -5
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.js +16 -5
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.min.js +2 -2
- package/dist/theme/dark.css +1 -1
- package/dist/theme/dark.min.css +1 -1
- 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 +115 -119
- 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 +9 -4
- package/dist-esm/plugin/billboardjs-plugin-tableview.js +16 -5
- package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +2 -2
- package/package.json +14 -14
- package/src/ChartInternal/Axis/Axis.ts +2 -2
- package/src/ChartInternal/ChartInternal.ts +1 -1
- package/src/ChartInternal/internals/clip.ts +4 -2
- package/src/ChartInternal/internals/domain.ts +6 -2
- package/src/ChartInternal/internals/legend.ts +4 -4
- package/src/ChartInternal/internals/size.axis.ts +3 -2
- package/src/ChartInternal/internals/size.ts +91 -121
- package/src/ChartInternal/internals/tooltip.ts +2 -2
- package/src/ChartInternal/internals/transform.ts +1 -1
- package/src/Plugin/stanford/index.ts +10 -6
- package/src/Plugin/tableview/Options.ts +12 -1
- package/src/Plugin/tableview/index.ts +3 -2
- package/src/config/Options/axis/y2.ts +13 -0
- package/src/config/Options/common/main.ts +1 -0
- package/types/plugin/tableview/options.d.ts +5 -0
package/dist/billboard.css
CHANGED
package/dist/billboard.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 3.10.0-next.
|
|
8
|
+
* @version 3.10.0-next.3
|
|
9
9
|
*/
|
|
10
10
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
11
11
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
@@ -1859,6 +1859,7 @@ let Store = /*#__PURE__*/function () {
|
|
|
1859
1859
|
size_height: undefined,
|
|
1860
1860
|
/**
|
|
1861
1861
|
* The padding of the chart element.
|
|
1862
|
+
* - **NOTE:** for more information, see the "[`Understanding padding`](https://github.com/naver/billboard.js/wiki/Understanding-padding)"" wiki documentaion.
|
|
1862
1863
|
* @name padding
|
|
1863
1864
|
* @memberof Options
|
|
1864
1865
|
* @type {object}
|
|
@@ -6584,13 +6585,19 @@ const schemeCategory10 = ["#1f77b4", "#ff7f0e", "#2ca02c", "#d62728", "#9467bd",
|
|
|
6584
6585
|
var _$$$brush;
|
|
6585
6586
|
x.domain(domain || sortValue($$.getXDomain(targets), !config.axis_x_inverted));
|
|
6586
6587
|
org.xDomain = x.domain();
|
|
6587
|
-
|
|
6588
|
+
|
|
6589
|
+
// zoomEnabled && $$.zoom.updateScaleExtent();
|
|
6590
|
+
|
|
6588
6591
|
subX.domain(x.domain());
|
|
6589
6592
|
(_$$$brush = $$.brush) == null || _$$$brush.scale(subX);
|
|
6590
6593
|
}
|
|
6591
6594
|
if (withUpdateXDomain) {
|
|
6592
6595
|
const domainValue = domain || !$$.brush || brushEmpty($$) ? org.xDomain : getBrushSelection($$).map(subX.invert);
|
|
6593
6596
|
x.domain(domainValue);
|
|
6597
|
+
// zoomEnabled && $$.zoom.updateScaleExtent();
|
|
6598
|
+
}
|
|
6599
|
+
|
|
6600
|
+
if (withUpdateOrgXDomain || withUpdateXDomain) {
|
|
6594
6601
|
zoomEnabled && $$.zoom.updateScaleExtent();
|
|
6595
6602
|
}
|
|
6596
6603
|
|
|
@@ -6612,8 +6619,8 @@ const schemeCategory10 = ["#1f77b4", "#ff7f0e", "#2ca02c", "#d62728", "#9467bd",
|
|
|
6612
6619
|
min = _zoomDomain[0],
|
|
6613
6620
|
max = _zoomDomain[1];
|
|
6614
6621
|
if (isInverted ? domain[0] >= min : domain[0] <= min) {
|
|
6615
|
-
domain[0] = min;
|
|
6616
6622
|
domain[1] = +domain[1] + (min - domain[0]);
|
|
6623
|
+
domain[0] = min;
|
|
6617
6624
|
}
|
|
6618
6625
|
if (isInverted ? domain[1] <= max : domain[1] >= max) {
|
|
6619
6626
|
domain[0] = +domain[0] - (domain[1] - max);
|
|
@@ -6925,8 +6932,8 @@ function getLegendColor(id) {
|
|
|
6925
6932
|
width = size.width,
|
|
6926
6933
|
height = size.height,
|
|
6927
6934
|
insetLegendPosition = {
|
|
6928
|
-
top: isLegendTop ? $$.
|
|
6929
|
-
left: isLegendLeft ? $$.
|
|
6935
|
+
top: isLegendTop ? $$.getCurrentPaddingByDirection("top") + config.legend_inset_y + 5.5 : current.height - height - $$.getCurrentPaddingByDirection("bottom") - config.legend_inset_y,
|
|
6936
|
+
left: isLegendLeft ? $$.getCurrentPaddingByDirection("left") + config.legend_inset_x + .5 : current.width - width - $$.getCurrentPaddingByDirection("right") - config.legend_inset_x + .5
|
|
6930
6937
|
};
|
|
6931
6938
|
$$.state.margin3 = {
|
|
6932
6939
|
top: isLegendRight ? 0 : isLegendInset ? insetLegendPosition.top : current.height - height,
|
|
@@ -8584,88 +8591,6 @@ function getGroupedDataPointsFn(d) {
|
|
|
8584
8591
|
h = config.size_height || $$.getParentHeight();
|
|
8585
8592
|
return h > 0 ? h : 320 / ($$.hasType("gauge") && !config.gauge_fullCircle ? 2 : 1);
|
|
8586
8593
|
},
|
|
8587
|
-
getCurrentPaddingTop: function getCurrentPaddingTop() {
|
|
8588
|
-
const $$ = this,
|
|
8589
|
-
config = $$.config,
|
|
8590
|
-
hasAxis = $$.state.hasAxis,
|
|
8591
|
-
$el = $$.$el,
|
|
8592
|
-
axesLen = hasAxis ? config.axis_y2_axes.length : 0;
|
|
8593
|
-
let padding = isValue(config.padding_top) ? config.padding_top : 0;
|
|
8594
|
-
if ($el.title && $el.title.node()) {
|
|
8595
|
-
padding += $$.getTitlePadding();
|
|
8596
|
-
}
|
|
8597
|
-
if (axesLen && config.axis_rotated) {
|
|
8598
|
-
padding += $$.getHorizontalAxisHeight("y2") * axesLen;
|
|
8599
|
-
}
|
|
8600
|
-
return padding;
|
|
8601
|
-
},
|
|
8602
|
-
getCurrentPaddingBottom: function getCurrentPaddingBottom() {
|
|
8603
|
-
const $$ = this,
|
|
8604
|
-
config = $$.config,
|
|
8605
|
-
hasAxis = $$.state.hasAxis,
|
|
8606
|
-
axisId = config.axis_rotated ? "y" : "x",
|
|
8607
|
-
axesLen = hasAxis ? config["axis_" + axisId + "_axes"].length : 0,
|
|
8608
|
-
padding = isValue(config.padding_bottom) ? config.padding_bottom : 0;
|
|
8609
|
-
return padding + (axesLen ? $$.getHorizontalAxisHeight(axisId) * axesLen : 0);
|
|
8610
|
-
},
|
|
8611
|
-
getCurrentPaddingLeft: function getCurrentPaddingLeft(withoutRecompute) {
|
|
8612
|
-
var _config$padding;
|
|
8613
|
-
const $$ = this,
|
|
8614
|
-
config = $$.config,
|
|
8615
|
-
hasAxis = $$.state.hasAxis,
|
|
8616
|
-
isRotated = config.axis_rotated,
|
|
8617
|
-
isFitPadding = ((_config$padding = config.padding) == null ? void 0 : _config$padding.mode) === "fit",
|
|
8618
|
-
axisId = isRotated ? "x" : "y",
|
|
8619
|
-
axesLen = hasAxis ? config["axis_" + axisId + "_axes"].length : 0;
|
|
8620
|
-
let axisWidth = hasAxis ? $$.getAxisWidthByAxisId(axisId, withoutRecompute) : 0;
|
|
8621
|
-
if (!isFitPadding) {
|
|
8622
|
-
axisWidth = ceil10(axisWidth);
|
|
8623
|
-
}
|
|
8624
|
-
let padding = config["axis_" + axisId + "_inner"] || !config["axis_" + axisId + "_show"] ? 0 : axisWidth;
|
|
8625
|
-
if (isValue(config.padding_left)) {
|
|
8626
|
-
padding = config.padding_left + (isFitPadding && isRotated ? axisWidth : 0);
|
|
8627
|
-
} else if (hasAxis && isRotated) {
|
|
8628
|
-
padding = !config.axis_x_show ? 1 : isFitPadding ? axisWidth : Math.max(axisWidth, 40);
|
|
8629
|
-
}
|
|
8630
|
-
if (hasAxis && (isFitPadding || config["axis_" + axisId + "_inner"]) && config["axis_" + axisId + "_label"].text) {
|
|
8631
|
-
padding += $$.axis.getAxisLabelPosition("y").isOuter ? 20 : 0;
|
|
8632
|
-
}
|
|
8633
|
-
return padding + axisWidth * axesLen;
|
|
8634
|
-
},
|
|
8635
|
-
getCurrentPaddingRight: function getCurrentPaddingRight(withXAxisTickTextOverflow) {
|
|
8636
|
-
var _config$padding2, _$$$axis;
|
|
8637
|
-
if (withXAxisTickTextOverflow === void 0) {
|
|
8638
|
-
withXAxisTickTextOverflow = !1;
|
|
8639
|
-
}
|
|
8640
|
-
const $$ = this,
|
|
8641
|
-
config = $$.config,
|
|
8642
|
-
hasAxis = $$.state.hasAxis,
|
|
8643
|
-
isRotated = config.axis_rotated,
|
|
8644
|
-
isFitPadding = ((_config$padding2 = config.padding) == null ? void 0 : _config$padding2.mode) === "fit",
|
|
8645
|
-
defaultPadding = isFitPadding ? 2 : 10,
|
|
8646
|
-
legendWidthOnRight = $$.state.isLegendRight ? $$.getLegendWidth() + 20 : 0,
|
|
8647
|
-
axesLen = hasAxis ? config.axis_y2_axes.length : 0,
|
|
8648
|
-
axisLabelWidth = (_$$$axis = $$.axis) != null && _$$$axis.getAxisLabelPosition("y2").isOuter ? 20 : 0,
|
|
8649
|
-
xAxisTickTextOverflow = withXAxisTickTextOverflow ? $$.axis.getXAxisTickTextY2Overflow(defaultPadding) : 0;
|
|
8650
|
-
let axisWidth = hasAxis && !config.axis_y2_inner ? $$.getAxisWidthByAxisId("y2") : 1;
|
|
8651
|
-
if (!isFitPadding) {
|
|
8652
|
-
axisWidth = ceil10(axisWidth);
|
|
8653
|
-
}
|
|
8654
|
-
let padding = isRotated ? 0 : Math.max(axisWidth + legendWidthOnRight, xAxisTickTextOverflow);
|
|
8655
|
-
if (isValue(config.padding_right)) {
|
|
8656
|
-
// padding = config.padding_right + (hasAxis ? 1 : 0); // 1 is needed not to hide tick line
|
|
8657
|
-
|
|
8658
|
-
padding = config.padding_right + (isFitPadding && (isRotated || !config.axis_y2_show ? defaultPadding : padding)) + (hasAxis && !isFitPadding ? 1 : 0); // 1 is needed not to hide tick line
|
|
8659
|
-
} else if ($$.axis && isRotated) {
|
|
8660
|
-
padding = defaultPadding + legendWidthOnRight;
|
|
8661
|
-
} else if ($$.axis && (!config.axis_y2_show || config.axis_y2_inner)) {
|
|
8662
|
-
padding = Math.max((isFitPadding && !config.axis_y2_show ? 2 : 1) + legendWidthOnRight + axisLabelWidth, xAxisTickTextOverflow);
|
|
8663
|
-
}
|
|
8664
|
-
if (hasAxis && !isRotated && isFitPadding && config.axis_y2_show && !config.axis_y2_inner && config.axis_y2_label.text) {
|
|
8665
|
-
padding += axisLabelWidth;
|
|
8666
|
-
}
|
|
8667
|
-
return padding + axisWidth * axesLen;
|
|
8668
|
-
},
|
|
8669
8594
|
/**
|
|
8670
8595
|
* Get the parent rect element's size
|
|
8671
8596
|
* @param {string} key property/attribute name
|
|
@@ -8718,7 +8643,7 @@ function getGroupedDataPointsFn(d) {
|
|
|
8718
8643
|
},
|
|
8719
8644
|
chartRect = $el.chart.node().getBoundingClientRect(),
|
|
8720
8645
|
hasArc = $$.hasArcType(),
|
|
8721
|
-
svgLeft = svgRect.right - chartRect.left - (hasArc ? 0 : $$.
|
|
8646
|
+
svgLeft = svgRect.right - chartRect.left - (hasArc ? 0 : $$.getCurrentPaddingByDirection("left", withoutRecompute));
|
|
8722
8647
|
return svgLeft > 0 ? svgLeft : 0;
|
|
8723
8648
|
},
|
|
8724
8649
|
updateDimension: function updateDimension(withoutAxis) {
|
|
@@ -8762,13 +8687,78 @@ function getGroupedDataPointsFn(d) {
|
|
|
8762
8687
|
clip.idSubchart && svg.select("#" + clip.idSubchart).select("rect").attr("width", width).attr("height", brushSize.height);
|
|
8763
8688
|
}
|
|
8764
8689
|
},
|
|
8690
|
+
/**
|
|
8691
|
+
* Get padding by the direction.
|
|
8692
|
+
* @param {string} type "top" | "bottom" | "left" | "right"
|
|
8693
|
+
* @param {boolean} [withoutRecompute=false] If set true, do not recompute the padding value.
|
|
8694
|
+
* @returns {number} padding value
|
|
8695
|
+
* @private
|
|
8696
|
+
*/
|
|
8697
|
+
getCurrentPaddingByDirection: function getCurrentPaddingByDirection(type, withoutRecompute) {
|
|
8698
|
+
var _config$padding;
|
|
8699
|
+
if (withoutRecompute === void 0) {
|
|
8700
|
+
withoutRecompute = !1;
|
|
8701
|
+
}
|
|
8702
|
+
const $$ = this,
|
|
8703
|
+
config = $$.config,
|
|
8704
|
+
$el = $$.$el,
|
|
8705
|
+
hasAxis = $$.state.hasAxis,
|
|
8706
|
+
isRotated = config.axis_rotated,
|
|
8707
|
+
isFitPadding = ((_config$padding = config.padding) == null ? void 0 : _config$padding.mode) === "fit",
|
|
8708
|
+
paddingOption = isNumber(config["padding_" + type]) ? config["padding_" + type] : undefined,
|
|
8709
|
+
axisId = hasAxis ? {
|
|
8710
|
+
top: isRotated ? "y2" : null,
|
|
8711
|
+
bottom: isRotated ? "y" : "x",
|
|
8712
|
+
left: isRotated ? "x" : "y",
|
|
8713
|
+
right: isRotated ? null : "y2"
|
|
8714
|
+
}[type] : null,
|
|
8715
|
+
isLeftRight = /^(left|right)$/.test(type),
|
|
8716
|
+
isAxisInner = axisId && config["axis_" + axisId + "_inner"],
|
|
8717
|
+
isAxisShow = axisId && config["axis_" + axisId + "_show"],
|
|
8718
|
+
axesLen = axisId ? config["axis_" + axisId + "_axes"].length : 0;
|
|
8719
|
+
let axisSize = axisId ? isLeftRight ? $$.getAxisWidthByAxisId(axisId, withoutRecompute) : $$.getHorizontalAxisHeight(axisId) : 0;
|
|
8720
|
+
let gap = 0;
|
|
8721
|
+
if (!isFitPadding && isLeftRight) {
|
|
8722
|
+
axisSize = ceil10(axisSize);
|
|
8723
|
+
}
|
|
8724
|
+
let padding = hasAxis && isLeftRight && (isAxisInner || isUndefined(paddingOption) && !isAxisShow) ? 0 : isFitPadding ? (isAxisShow ? axisSize : 0) + (paddingOption != null ? paddingOption : 0) : isUndefined(paddingOption) ? axisSize : paddingOption;
|
|
8725
|
+
if (isLeftRight && hasAxis) {
|
|
8726
|
+
if (axisId && (isFitPadding || isAxisInner) && config["axis_" + axisId + "_label"].text) {
|
|
8727
|
+
padding += $$.axis.getAxisLabelPosition(axisId).isOuter ? 20 : 0;
|
|
8728
|
+
}
|
|
8729
|
+
if (type === "right") {
|
|
8730
|
+
padding += isRotated ? !isFitPadding && isUndefined(paddingOption) ? 10 : 2 : !isAxisShow || isAxisInner ? isFitPadding ? 2 : 1 : 0;
|
|
8731
|
+
} else if (type === "left" && isRotated) {
|
|
8732
|
+
padding = !config.axis_x_show ? 1 : isFitPadding ? axisSize : Math.max(axisSize, 40);
|
|
8733
|
+
}
|
|
8734
|
+
} else {
|
|
8735
|
+
if (type === "top") {
|
|
8736
|
+
if ($el.title && $el.title.node()) {
|
|
8737
|
+
padding += $$.getTitlePadding();
|
|
8738
|
+
}
|
|
8739
|
+
gap = isRotated && !isAxisInner ? axesLen : 0;
|
|
8740
|
+
} else if (type === "bottom" && hasAxis && isRotated && !isAxisShow) {
|
|
8741
|
+
padding += 1;
|
|
8742
|
+
}
|
|
8743
|
+
}
|
|
8744
|
+
return padding + axisSize * axesLen - gap;
|
|
8745
|
+
},
|
|
8765
8746
|
getCurrentPadding: function getCurrentPadding() {
|
|
8766
|
-
|
|
8747
|
+
var _this = this;
|
|
8748
|
+
const $$ = this,
|
|
8749
|
+
_map = ["top", "bottom", "left", "right"].map(function (v) {
|
|
8750
|
+
_newArrowCheck(this, _this);
|
|
8751
|
+
return $$.getCurrentPaddingByDirection(v);
|
|
8752
|
+
}.bind(this)),
|
|
8753
|
+
top = _map[0],
|
|
8754
|
+
bottom = _map[1],
|
|
8755
|
+
left = _map[2],
|
|
8756
|
+
right = _map[3];
|
|
8767
8757
|
return {
|
|
8768
|
-
top:
|
|
8769
|
-
bottom:
|
|
8770
|
-
left:
|
|
8771
|
-
right:
|
|
8758
|
+
top: top,
|
|
8759
|
+
bottom: bottom,
|
|
8760
|
+
left: left,
|
|
8761
|
+
right: right
|
|
8772
8762
|
};
|
|
8773
8763
|
},
|
|
8774
8764
|
/**
|
|
@@ -8779,14 +8769,14 @@ function getGroupedDataPointsFn(d) {
|
|
|
8779
8769
|
* @private
|
|
8780
8770
|
*/
|
|
8781
8771
|
getResettedPadding: function getResettedPadding(v) {
|
|
8782
|
-
var
|
|
8772
|
+
var _this2 = this;
|
|
8783
8773
|
const $$ = this,
|
|
8784
8774
|
config = $$.config,
|
|
8785
8775
|
isNum = isNumber(v);
|
|
8786
8776
|
let p = isNum ? 0 : {};
|
|
8787
8777
|
if (config.padding === !1) {
|
|
8788
8778
|
isNum || Object.keys(v).forEach(function (key) {
|
|
8789
|
-
_newArrowCheck(this,
|
|
8779
|
+
_newArrowCheck(this, _this2);
|
|
8790
8780
|
// when data.lables=true, do not reset top padding
|
|
8791
8781
|
p[key] = !isEmpty(config.data_labels) && config.data_labels !== !1 && key === "top" ? v[key] : 0;
|
|
8792
8782
|
}.bind(this));
|
|
@@ -8801,14 +8791,14 @@ function getGroupedDataPointsFn(d) {
|
|
|
8801
8791
|
* @private
|
|
8802
8792
|
*/
|
|
8803
8793
|
updateSizes: function updateSizes(isInit) {
|
|
8804
|
-
var _config$
|
|
8794
|
+
var _config$padding2;
|
|
8805
8795
|
const $$ = this,
|
|
8806
8796
|
config = $$.config,
|
|
8807
8797
|
state = $$.state,
|
|
8808
8798
|
legend = $$.$el.legend,
|
|
8809
8799
|
isRotated = config.axis_rotated,
|
|
8810
8800
|
isNonAxis = $$.hasArcType() || state.hasTreemap,
|
|
8811
|
-
isFitPadding = ((_config$
|
|
8801
|
+
isFitPadding = ((_config$padding2 = config.padding) == null ? void 0 : _config$padding2.mode) === "fit";
|
|
8812
8802
|
isInit || $$.setContainerSize();
|
|
8813
8803
|
const currLegend = {
|
|
8814
8804
|
width: legend ? $$.getLegendWidth() : 0,
|
|
@@ -8817,7 +8807,10 @@ function getGroupedDataPointsFn(d) {
|
|
|
8817
8807
|
if (!isNonAxis && config.axis_x_show && config.axis_x_tick_autorotate) {
|
|
8818
8808
|
$$.updateXAxisTickClip();
|
|
8819
8809
|
}
|
|
8820
|
-
const
|
|
8810
|
+
const legendSize = {
|
|
8811
|
+
right: config.legend_show && state.isLegendRight ? $$.getLegendWidth() + 20 : 0,
|
|
8812
|
+
bottom: !config.legend_show || state.isLegendRight || state.isLegendInset ? 0 : currLegend.height
|
|
8813
|
+
},
|
|
8821
8814
|
xAxisHeight = isRotated || isNonAxis ? 0 : $$.getHorizontalAxisHeight("x"),
|
|
8822
8815
|
subchartXAxisHeight = config.subchart_axis_x_show && config.subchart_axis_x_tick_text_show ? xAxisHeight : 30,
|
|
8823
8816
|
subchartHeight = config.subchart_show && !isNonAxis ? config.subchart_size_height + subchartXAxisHeight : 0,
|
|
@@ -8825,15 +8818,15 @@ function getGroupedDataPointsFn(d) {
|
|
|
8825
8818
|
padding = $$.getCurrentPadding(); // when needle is shown with legend, it need some bottom space to not overlap with legend text
|
|
8826
8819
|
// for main
|
|
8827
8820
|
state.margin = !isNonAxis && isRotated ? {
|
|
8828
|
-
top:
|
|
8829
|
-
right: isNonAxis ? 0 :
|
|
8830
|
-
bottom:
|
|
8821
|
+
top: padding.top,
|
|
8822
|
+
right: isNonAxis ? 0 : padding.right + legendSize.right,
|
|
8823
|
+
bottom: legendSize.bottom + padding.bottom,
|
|
8831
8824
|
left: subchartHeight + (isNonAxis ? 0 : padding.left)
|
|
8832
8825
|
} : {
|
|
8833
8826
|
top: (isFitPadding ? 0 : 4) + padding.top,
|
|
8834
8827
|
// for top tick text
|
|
8835
|
-
right: isNonAxis ? 0 :
|
|
8836
|
-
bottom: gaugeHeight +
|
|
8828
|
+
right: isNonAxis ? 0 : padding.right + legendSize.right,
|
|
8829
|
+
bottom: gaugeHeight + subchartHeight + legendSize.bottom + padding.bottom,
|
|
8837
8830
|
left: isNonAxis ? 0 : padding.left
|
|
8838
8831
|
};
|
|
8839
8832
|
state.margin = $$.getResettedPadding(state.margin);
|
|
@@ -8842,12 +8835,12 @@ function getGroupedDataPointsFn(d) {
|
|
|
8842
8835
|
state.margin2 = isRotated ? {
|
|
8843
8836
|
top: state.margin.top,
|
|
8844
8837
|
right: NaN,
|
|
8845
|
-
bottom: 20 +
|
|
8838
|
+
bottom: 20 + legendSize.bottom,
|
|
8846
8839
|
left: $$.state.rotatedPadding.left
|
|
8847
8840
|
} : {
|
|
8848
|
-
top: state.current.height - subchartHeight -
|
|
8841
|
+
top: state.current.height - subchartHeight - legendSize.bottom,
|
|
8849
8842
|
right: NaN,
|
|
8850
|
-
bottom: subchartXAxisHeight +
|
|
8843
|
+
bottom: subchartXAxisHeight + legendSize.bottom,
|
|
8851
8844
|
left: state.margin.left
|
|
8852
8845
|
};
|
|
8853
8846
|
|
|
@@ -9851,8 +9844,8 @@ function getTextXPos(pos, width) {
|
|
|
9851
9844
|
hasTreemap = state.hasTreemap,
|
|
9852
9845
|
isRotated = config.axis_rotated,
|
|
9853
9846
|
svgLeft = $$.getSvgLeft(!0);
|
|
9854
|
-
let chartRight = svgLeft + current.width - $$.
|
|
9855
|
-
const chartLeft = $$.
|
|
9847
|
+
let chartRight = svgLeft + current.width - $$.getCurrentPaddingByDirection("right");
|
|
9848
|
+
const chartLeft = $$.getCurrentPaddingByDirection("left", !0),
|
|
9856
9849
|
size = 20;
|
|
9857
9850
|
let x = currPos.x,
|
|
9858
9851
|
y = currPos.y;
|
|
@@ -10130,7 +10123,7 @@ function getTextXPos(pos, width) {
|
|
|
10130
10123
|
y = isRotated ? state.height + padding : 0;
|
|
10131
10124
|
} else if (target === "y2") {
|
|
10132
10125
|
x = isRotated ? 0 : state.width + padding;
|
|
10133
|
-
y = isRotated
|
|
10126
|
+
y = isRotated ? 1 - padding : 0;
|
|
10134
10127
|
} else if (target === "subX") {
|
|
10135
10128
|
x = 0;
|
|
10136
10129
|
y = isRotated ? 0 : state.height2;
|
|
@@ -10782,7 +10775,7 @@ let ChartInternal = /*#__PURE__*/function () {
|
|
|
10782
10775
|
if (hasAxis || hasColorPatterns || hasPolar || hasTreemap || config.data_labels_backgroundColors) {
|
|
10783
10776
|
$el.defs = $el.svg.append("defs");
|
|
10784
10777
|
if (hasAxis) {
|
|
10785
|
-
["id", "idXAxis", "idYAxis", "idGrid"].forEach(function (v) {
|
|
10778
|
+
["id", "idXAxis", "idYAxis", "idY2Axis", "idGrid"].forEach(function (v) {
|
|
10786
10779
|
_newArrowCheck(this, _this3);
|
|
10787
10780
|
$$.appendClip($el.defs, state.clip[v]);
|
|
10788
10781
|
}.bind(this));
|
|
@@ -14453,7 +14446,7 @@ let Axis_Axis = /*#__PURE__*/function () {
|
|
|
14453
14446
|
if (v === "x") {
|
|
14454
14447
|
res = clip.pathXAxis;
|
|
14455
14448
|
} else if (v === "y") {
|
|
14456
|
-
//
|
|
14449
|
+
// || v === "y2") {
|
|
14457
14450
|
res = clip.pathYAxis;
|
|
14458
14451
|
}
|
|
14459
14452
|
return res;
|
|
@@ -14918,7 +14911,7 @@ let Axis_Axis = /*#__PURE__*/function () {
|
|
|
14918
14911
|
state = $$.state,
|
|
14919
14912
|
xAxisTickRotate = $$.getAxisTickRotate("x");
|
|
14920
14913
|
if ((axis.isCategorized() || axis.isTimeSeries()) && config.axis_x_tick_fit && !config.axis_x_tick_culling && !config.axis_x_tick_multiline && xAxisTickRotate > 0 && xAxisTickRotate < 90) {
|
|
14921
|
-
const widthWithoutCurrentPaddingLeft = state.current.width - $$.
|
|
14914
|
+
const widthWithoutCurrentPaddingLeft = state.current.width - $$.getCurrentPaddingByDirection("left"),
|
|
14922
14915
|
maxOverflow = this.getXAxisTickMaxOverflow(xAxisTickRotate, widthWithoutCurrentPaddingLeft - defaultPadding),
|
|
14923
14916
|
xAxisTickTextY2Overflow = Math.max(0, maxOverflow) + defaultPadding;
|
|
14924
14917
|
// for display inconsistencies between browsers
|
|
@@ -16064,11 +16057,13 @@ var external_commonjs_d3_ease_commonjs2_d3_ease_amd_d3_ease_root_d3_ = __webpack
|
|
|
16064
16057
|
|
|
16065
16058
|
// less than 20 is not enough to show the axis label 'outer' without legend
|
|
16066
16059
|
|
|
16067
|
-
|
|
16060
|
+
// -Math.max(15, margin.top);
|
|
16061
|
+
|
|
16062
|
+
node.attr("x", x).attr("y", -15).attr("width", w).attr("height", h);
|
|
16068
16063
|
},
|
|
16069
16064
|
/**
|
|
16070
16065
|
* Set y Axis clipPath dimension
|
|
16071
|
-
* @param {
|
|
16066
|
+
* @param {d3Selection} node clipPath <rect> selection
|
|
16072
16067
|
* @private
|
|
16073
16068
|
*/
|
|
16074
16069
|
setYAxisClipPath: function setYAxisClipPath(node) {
|
|
@@ -16731,7 +16726,7 @@ function smoothLines(el, type) {
|
|
|
16731
16726
|
if (id === "x" && !config.axis_x_show) {
|
|
16732
16727
|
return 8;
|
|
16733
16728
|
}
|
|
16734
|
-
if (id === "x" && config.axis_x_height) {
|
|
16729
|
+
if (id === "x" && isNumber(config.axis_x_height)) {
|
|
16735
16730
|
return config.axis_x_height;
|
|
16736
16731
|
}
|
|
16737
16732
|
if (id === "y" && !config.axis_y_show) {
|
|
@@ -16807,7 +16802,7 @@ function smoothLines(el, type) {
|
|
|
16807
16802
|
_$$$state = $$.state,
|
|
16808
16803
|
axis = _$$$state.axis,
|
|
16809
16804
|
current = _$$$state.current,
|
|
16810
|
-
xAxisLength = current.width - $$.
|
|
16805
|
+
xAxisLength = current.width - $$.getCurrentPaddingByDirection("left") - $$.getCurrentPaddingByDirection("right"),
|
|
16811
16806
|
tickCountWithPadding = axis.x.tickCount + axis.x.padding.left + axis.x.padding.right,
|
|
16812
16807
|
maxTickWidth = $$.axis.getMaxTickWidth("x"),
|
|
16813
16808
|
tickLength = tickCountWithPadding ? xAxisLength / tickCountWithPadding : 0;
|
|
@@ -18138,6 +18133,18 @@ function smoothLines(el, type) {
|
|
|
18138
18133
|
* y2 Axis config options
|
|
18139
18134
|
*/
|
|
18140
18135
|
/* harmony default export */ var y2 = ({
|
|
18136
|
+
/**
|
|
18137
|
+
* Set clip-path attribute for y2 axis element
|
|
18138
|
+
* - **NOTE**: `clip-path` attribute for y2 Axis is set only when `axis.y2.inner` option is true.
|
|
18139
|
+
* @name axis․y2․clipPath
|
|
18140
|
+
* @memberof Options
|
|
18141
|
+
* @type {boolean}
|
|
18142
|
+
* @default true
|
|
18143
|
+
* @example
|
|
18144
|
+
* // don't set 'clip-path' attribute
|
|
18145
|
+
* clipPath: false
|
|
18146
|
+
*/
|
|
18147
|
+
axis_y2_clipPath: !0,
|
|
18141
18148
|
/**
|
|
18142
18149
|
* Show or hide y2 axis.
|
|
18143
18150
|
* - **NOTE**:
|
|
@@ -25453,7 +25460,7 @@ let _defaults = {};
|
|
|
25453
25460
|
|
|
25454
25461
|
/**
|
|
25455
25462
|
* @namespace bb
|
|
25456
|
-
* @version 3.10.0-next.
|
|
25463
|
+
* @version 3.10.0-next.3
|
|
25457
25464
|
*/
|
|
25458
25465
|
const bb = {
|
|
25459
25466
|
/**
|
|
@@ -25463,7 +25470,7 @@ const bb = {
|
|
|
25463
25470
|
* bb.version; // "1.0.0"
|
|
25464
25471
|
* @memberof bb
|
|
25465
25472
|
*/
|
|
25466
|
-
version: "3.10.0-next.
|
|
25473
|
+
version: "3.10.0-next.3",
|
|
25467
25474
|
/**
|
|
25468
25475
|
* Generate chart
|
|
25469
25476
|
* - **NOTE:** Bear in mind for the possiblity of ***throwing an error***, during the generation when:
|
package/dist/billboard.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.10.0-next.
|
|
8
|
+
* @version 3.10.0-next.3
|
|
9
9
|
*/.bb svg{-webkit-tap-highlight-color:rgba(0,0,0,0);font:10px sans-serif}.bb line,.bb path{fill:none;stroke:#000}.bb .bb-button,.bb text{-webkit-user-select:none;-moz-user-select:none;user-select:none}.bb-legend-item-tile,.bb-xgrid-focus,.bb-ygrid,.bb-ygrid-focus{shape-rendering:crispEdges}.bb-chart-arc .bb-gauge-value,.bb-chart-arcs .bb-needle{fill:#000}.bb-chart-arc path{stroke:#fff}.bb-chart-arc rect{stroke:#fff;stroke-width:1}.bb-chart-arc text{fill:#fff;font-size:13px}.bb-axis{shape-rendering:crispEdges}.bb-grid{pointer-events:none}.bb-grid line{stroke:#aaa}.bb-grid text{fill:#aaa}.bb-xgrid,.bb-ygrid{stroke-dasharray:3 3}.bb-text.bb-empty{fill:grey;font-size:2em}.bb-line{stroke-width:1px}.bb-circle._expanded_{stroke-width:1px;stroke:#fff}.bb-selected-circle{fill:#fff;stroke-width:2px}.bb-bar{stroke-width:0}.bb-bar._expanded_{fill-opacity:.75}.bb-candlestick{stroke-width:1px}.bb-candlestick._expanded_{fill-opacity:.75}.bb-circles.bb-focused,.bb-target.bb-focused{opacity:1}.bb-circles.bb-focused path.bb-line,.bb-circles.bb-focused path.bb-step,.bb-target.bb-focused path.bb-line,.bb-target.bb-focused path.bb-step{stroke-width:2px}.bb-circles.bb-defocused,.bb-target.bb-defocused{opacity:.3!important}.bb-circles.bb-defocused .text-overlapping,.bb-target.bb-defocused .text-overlapping{opacity:.05!important}.bb-region rect{fill:#4682b4;fill-opacity:.1}.bb-brush .extent,.bb-zoom-brush{fill-opacity:.1}.bb-legend-item{font-size:12px;user-select:none}.bb-legend-item-hidden{opacity:.15}.bb-legend-background{fill:#fff;stroke:#d3d3d3;stroke-width:1;opacity:.75}.bb-title{font:14px sans-serif}.bb-chart-treemaps rect{stroke:#fff;stroke-width:1px}.bb-tooltip-container{user-select:none;z-index:10}.bb-tooltip{background-color:#fff;border-collapse:collapse;border-spacing:0;box-shadow:7px 7px 12px -9px #777;empty-cells:show;opacity:.9;white-space:nowrap}.bb-tooltip tr{border:1px solid #ccc}.bb-tooltip th{background-color:#aaa;color:#fff;font-size:14px;padding:2px 5px;text-align:left}.bb-tooltip td{background-color:#fff;border-left:1px dotted #999;font-size:13px;padding:3px 6px}.bb-tooltip td>span,.bb-tooltip td>svg{display:inline-block;height:10px;margin-right:6px;width:10px}.bb-tooltip.value{text-align:right}.bb-area{stroke-width:0;opacity:.2}.bb-chart-arcs-title{dominant-baseline:middle;font-size:1.3em}text.bb-chart-arcs-gauge-title{dominant-baseline:middle;font-size:2.7em}.bb-chart-arcs .bb-chart-arcs-background{fill:#e0e0e0;stroke:#fff}.bb-chart-arcs .bb-chart-arcs-gauge-unit{fill:#000;font-size:16px}.bb-chart-arcs .bb-chart-arcs-gauge-max,.bb-chart-arcs .bb-chart-arcs-gauge-min{fill:#777}.bb-chart-arcs .bb-levels circle{fill:none;stroke:#848282;stroke-width:.5px}.bb-chart-arcs .bb-levels text{fill:#848282}.bb-chart-radars .bb-levels polygon{fill:none;stroke:#848282;stroke-width:.5px}.bb-chart-radars .bb-levels text{fill:#848282}.bb-chart-radars .bb-axis line{stroke:#848282;stroke-width:.5px}.bb-chart-radars .bb-axis text{cursor:default;font-size:1.15em}.bb-chart-radars .bb-shapes polygon{fill-opacity:.2;stroke-width:1px}.bb-button{position:absolute;right:10px;top:10px}.bb-button .bb-zoom-reset{background-color:#fff;border:1px solid #ccc;border-radius:5px;cursor:pointer;font-size:11px;padding:5px}
|