billboard.js 3.10.0-next.5 → 3.10.0
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/README.md +4 -1
- package/dist/billboard.css +1 -1
- package/dist/billboard.js +108 -74
- package/dist/billboard.min.css +1 -1
- package/dist/billboard.min.js +2 -2
- package/dist/billboard.pkgd.js +144 -102
- package/dist/billboard.pkgd.min.js +4 -4
- 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.pkgd.js +36 -28
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.js +36 -28
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.js +36 -28
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.js +36 -28
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.js +36 -28
- 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/theme/modern.css +306 -0
- package/dist/theme/modern.min.css +10 -0
- package/dist-esm/billboard.js +93 -71
- 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 +20 -20
- package/src/ChartInternal/Axis/Axis.ts +35 -18
- package/src/ChartInternal/ChartInternal.ts +1 -1
- package/src/ChartInternal/interactions/eventrect.ts +2 -1
- package/src/ChartInternal/interactions/interaction.ts +5 -2
- package/src/ChartInternal/interactions/zoom.ts +1 -2
- package/src/ChartInternal/internals/clip.ts +4 -4
- package/src/ChartInternal/internals/size.axis.ts +10 -6
- package/src/ChartInternal/internals/size.ts +19 -6
- package/src/ChartInternal/internals/tooltip.ts +13 -8
- package/src/ChartInternal/shape/point.ts +4 -2
- package/src/config/Options/axis/x.ts +1 -1
- package/src/config/Options/axis/y2.ts +0 -13
- package/src/config/Options/data/axis.ts +1 -1
- package/src/config/Store/State.ts +4 -4
- package/src/scss/theme/modern.scss +432 -0
package/README.md
CHANGED
|
@@ -98,7 +98,6 @@ You can download the compressed files for production
|
|
|
98
98
|
- https://naver.github.io/billboard.js/release/latest/dist/theme/datalab.css
|
|
99
99
|
- https://naver.github.io/billboard.js/release/latest/dist/theme/datalab.min.css
|
|
100
100
|
|
|
101
|
-
|
|
102
101
|
#### dark
|
|
103
102
|
- https://naver.github.io/billboard.js/release/latest/dist/theme/dark.css
|
|
104
103
|
- https://naver.github.io/billboard.js/release/latest/dist/theme/dark.min.css
|
|
@@ -111,6 +110,10 @@ You can download the compressed files for production
|
|
|
111
110
|
- https://naver.github.io/billboard.js/release/latest/dist/theme/graph.css
|
|
112
111
|
- https://naver.github.io/billboard.js/release/latest/dist/theme/graph.min.css
|
|
113
112
|
|
|
113
|
+
#### modern
|
|
114
|
+
- https://naver.github.io/billboard.js/release/latest/dist/theme/modern.css
|
|
115
|
+
- https://naver.github.io/billboard.js/release/latest/dist/theme/modern.min.css
|
|
116
|
+
|
|
114
117
|
</details>
|
|
115
118
|
|
|
116
119
|
### Nightly version
|
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
|
|
8
|
+
* @version 3.10.0
|
|
9
9
|
*/
|
|
10
10
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
11
11
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
@@ -1601,19 +1601,22 @@ let State = function () {
|
|
|
1601
1601
|
width: 0,
|
|
1602
1602
|
height: 0,
|
|
1603
1603
|
dataMax: 0,
|
|
1604
|
-
|
|
1604
|
+
maxTickSize: {
|
|
1605
1605
|
x: {
|
|
1606
|
-
|
|
1606
|
+
width: 0,
|
|
1607
|
+
height: 0,
|
|
1607
1608
|
ticks: [],
|
|
1608
1609
|
clipPath: 0,
|
|
1609
1610
|
domain: ""
|
|
1610
1611
|
},
|
|
1611
1612
|
y: {
|
|
1612
|
-
|
|
1613
|
+
width: 0,
|
|
1614
|
+
height: 0,
|
|
1613
1615
|
domain: ""
|
|
1614
1616
|
},
|
|
1615
1617
|
y2: {
|
|
1616
|
-
|
|
1618
|
+
width: 0,
|
|
1619
|
+
height: 0,
|
|
1617
1620
|
domain: ""
|
|
1618
1621
|
}
|
|
1619
1622
|
},
|
|
@@ -5832,7 +5835,8 @@ var external_commonjs_d3_drag_commonjs2_d3_drag_amd_d3_drag_root_d3_ = __webpack
|
|
|
5832
5835
|
treemap = _$$$$el.treemap,
|
|
5833
5836
|
element = (_ref = hasTreemap && eventReceiver.rect || hasRadar && radar.axes.select("." + $AXIS.axis + "-" + index + " text") || eventRect || ($$.getArcElementByIdOrIndex == null ? void 0 : $$.getArcElementByIdOrIndex(index))) == null ? void 0 : _ref.node();
|
|
5834
5837
|
if (element) {
|
|
5835
|
-
const isMultipleX = $$.isMultipleX()
|
|
5838
|
+
const isMultipleX = $$.isMultipleX(),
|
|
5839
|
+
isRotated = config.axis_rotated;
|
|
5836
5840
|
let _element$getBoundingC = element.getBoundingClientRect(),
|
|
5837
5841
|
width = _element$getBoundingC.width,
|
|
5838
5842
|
left = _element$getBoundingC.left,
|
|
@@ -5849,8 +5853,8 @@ var external_commonjs_d3_drag_commonjs2_d3_drag_amd_d3_drag_root_d3_ = __webpack
|
|
|
5849
5853
|
top = 0;
|
|
5850
5854
|
}
|
|
5851
5855
|
}
|
|
5852
|
-
const x = left + (mouse ? mouse[0] : 0) + (isMultipleX ||
|
|
5853
|
-
y = top + (mouse ? mouse[1] : 0);
|
|
5856
|
+
const x = left + (mouse ? mouse[0] : 0) + (isMultipleX || isRotated ? 0 : width / 2),
|
|
5857
|
+
y = top + (mouse ? mouse[1] : 0) + (isRotated ? 4 : 0); // value 4, is to adjust coordinate value set from: scale.ts - updateScales(): $$.getResettedPadding(1)
|
|
5854
5858
|
emulateEvent[/^(mouse|click)/.test(type) ? "mouse" : "touch"](hasTreemap ? treemap.node() : element, type, {
|
|
5855
5859
|
screenX: x,
|
|
5856
5860
|
screenY: y,
|
|
@@ -8659,15 +8663,26 @@ function getGroupedDataPointsFn(d) {
|
|
|
8659
8663
|
const $$ = this,
|
|
8660
8664
|
config = $$.config,
|
|
8661
8665
|
$el = $$.$el,
|
|
8662
|
-
|
|
8663
|
-
|
|
8666
|
+
isRotated = config.axis_rotated,
|
|
8667
|
+
hasLeftAxisRect = isRotated || !isRotated && !config.axis_y_inner,
|
|
8668
|
+
leftAxisClass = isRotated ? $AXIS.axisX : $AXIS.axisY,
|
|
8664
8669
|
leftAxis = $el.main.select("." + leftAxisClass).node(),
|
|
8665
|
-
|
|
8670
|
+
leftLabel = config["axis_" + (isRotated ? "x" : "y") + "_label"];
|
|
8671
|
+
let labelWidth = 0;
|
|
8672
|
+
|
|
8673
|
+
// if axis label position set to inner, exclude from the value
|
|
8674
|
+
if (isString(leftLabel) || isString(leftLabel.text) || /^inner-/.test(leftLabel == null ? void 0 : leftLabel.position)) {
|
|
8675
|
+
const label = $el.main.select("." + leftAxisClass + "-label");
|
|
8676
|
+
if (!label.empty()) {
|
|
8677
|
+
labelWidth = label.node().getBoundingClientRect().left;
|
|
8678
|
+
}
|
|
8679
|
+
}
|
|
8680
|
+
const svgRect = leftAxis && hasLeftAxisRect ? leftAxis.getBoundingClientRect() : {
|
|
8666
8681
|
right: 0
|
|
8667
8682
|
},
|
|
8668
|
-
|
|
8683
|
+
chartRectLeft = $el.chart.node().getBoundingClientRect().left + labelWidth,
|
|
8669
8684
|
hasArc = $$.hasArcType(),
|
|
8670
|
-
svgLeft = svgRect.right -
|
|
8685
|
+
svgLeft = svgRect.right - chartRectLeft - (hasArc ? 0 : $$.getCurrentPaddingByDirection("left", withoutRecompute));
|
|
8671
8686
|
return svgLeft > 0 ? svgLeft : 0;
|
|
8672
8687
|
},
|
|
8673
8688
|
updateDimension: function updateDimension(withoutAxis) {
|
|
@@ -8752,7 +8767,7 @@ function getGroupedDataPointsFn(d) {
|
|
|
8752
8767
|
}
|
|
8753
8768
|
if (type === "right") {
|
|
8754
8769
|
padding += isRotated ? !isFitPadding && isUndefined(paddingOption) ? 10 : 2 : !isAxisShow || isAxisInner ? isFitPadding ? 2 : 1 : 0;
|
|
8755
|
-
} else if (type === "left" && isRotated) {
|
|
8770
|
+
} else if (type === "left" && isRotated && isUndefined(paddingOption)) {
|
|
8756
8771
|
padding = !config.axis_x_show ? 1 : isFitPadding ? axisSize : Math.max(axisSize, 40);
|
|
8757
8772
|
}
|
|
8758
8773
|
} else {
|
|
@@ -9890,34 +9905,38 @@ function getTextXPos(pos, width) {
|
|
|
9890
9905
|
hasGauge = $$.hasType("gauge") && !config.gauge_fullCircle,
|
|
9891
9906
|
hasTreemap = state.hasTreemap,
|
|
9892
9907
|
isRotated = config.axis_rotated,
|
|
9908
|
+
hasArcType = $$.hasArcType(),
|
|
9893
9909
|
svgLeft = $$.getSvgLeft(!0);
|
|
9894
9910
|
let chartRight = svgLeft + current.width - $$.getCurrentPaddingByDirection("right");
|
|
9895
|
-
const
|
|
9896
|
-
size = 20;
|
|
9911
|
+
const size = 20;
|
|
9897
9912
|
let x = currPos.x,
|
|
9898
9913
|
y = currPos.y;
|
|
9899
9914
|
|
|
9900
9915
|
// Determine tooltip position
|
|
9901
|
-
if (
|
|
9916
|
+
if (hasArcType) {
|
|
9902
9917
|
const raw = inputType === "touch" || $$.hasType("radar");
|
|
9903
9918
|
if (!raw) {
|
|
9904
|
-
y += hasGauge ? height : height / 2;
|
|
9905
9919
|
x += (width - (isLegendRight ? $$.getLegendWidth() : 0)) / 2;
|
|
9920
|
+
y += hasGauge ? height : height / 2;
|
|
9906
9921
|
}
|
|
9907
9922
|
} else if (!hasTreemap) {
|
|
9923
|
+
const padding = {
|
|
9924
|
+
top: $$.getCurrentPaddingByDirection("top", !0),
|
|
9925
|
+
left: $$.getCurrentPaddingByDirection("left", !0)
|
|
9926
|
+
};
|
|
9908
9927
|
if (isRotated) {
|
|
9909
|
-
|
|
9910
|
-
|
|
9928
|
+
x += svgLeft + padding.left + size;
|
|
9929
|
+
y = padding.top + currPos.xAxis + size;
|
|
9911
9930
|
chartRight -= svgLeft;
|
|
9912
9931
|
} else {
|
|
9913
|
-
|
|
9914
|
-
|
|
9932
|
+
x = svgLeft + padding.left + size + (scale.zoom ? x : currPos.xAxis);
|
|
9933
|
+
y += padding.top - 5;
|
|
9915
9934
|
}
|
|
9916
9935
|
}
|
|
9917
9936
|
|
|
9918
9937
|
// when tooltip left + tWidth > chart's width
|
|
9919
9938
|
if (x + tWidth + 15 > chartRight) {
|
|
9920
|
-
x -=
|
|
9939
|
+
x -= tWidth + (hasTreemap || hasArcType ? 0 : isRotated ? 40 : 38);
|
|
9921
9940
|
}
|
|
9922
9941
|
if (y + tHeight > current.height) {
|
|
9923
9942
|
const gap = hasTreemap ? 0 : 30;
|
|
@@ -10822,7 +10841,7 @@ let ChartInternal = /*#__PURE__*/function () {
|
|
|
10822
10841
|
if (hasAxis || hasColorPatterns || hasPolar || hasTreemap || config.data_labels_backgroundColors) {
|
|
10823
10842
|
$el.defs = $el.svg.append("defs");
|
|
10824
10843
|
if (hasAxis) {
|
|
10825
|
-
["id", "idXAxis", "idYAxis", "
|
|
10844
|
+
["id", "idXAxis", "idYAxis", "idGrid"].forEach(function (v) {
|
|
10826
10845
|
_newArrowCheck(this, _this3);
|
|
10827
10846
|
$$.appendClip($el.defs, state.clip[v]);
|
|
10828
10847
|
}.bind(this));
|
|
@@ -14625,7 +14644,7 @@ let Axis_Axis = /*#__PURE__*/function () {
|
|
|
14625
14644
|
id === "x" && ($$.scale.zoom || $$.config.subchart_show || $$.state.resizing) ? !0 : noTransition);
|
|
14626
14645
|
}
|
|
14627
14646
|
|
|
14628
|
-
// called from :
|
|
14647
|
+
// called from : getMaxTickSize()
|
|
14629
14648
|
;
|
|
14630
14649
|
_proto.getAxis = function getAxis(id, scale, outerTick, noTransition, noTickTextRotate) {
|
|
14631
14650
|
var _this8 = this;
|
|
@@ -14852,7 +14871,8 @@ let Axis_Axis = /*#__PURE__*/function () {
|
|
|
14852
14871
|
isRotated = config.axis_rotated,
|
|
14853
14872
|
isInner = this.getAxisLabelPosition(id).isInner,
|
|
14854
14873
|
tickRotate = config["axis_" + id + "_tick_rotate"] ? $$.getHorizontalAxisHeight(id) : 0,
|
|
14855
|
-
|
|
14874
|
+
_this$getMaxTickSize = this.getMaxTickSize(id),
|
|
14875
|
+
maxTickWidth = _this$getMaxTickSize.width;
|
|
14856
14876
|
let dy;
|
|
14857
14877
|
if (id === "x") {
|
|
14858
14878
|
const xHeight = config.axis_x_height;
|
|
@@ -14885,8 +14905,16 @@ let Axis_Axis = /*#__PURE__*/function () {
|
|
|
14885
14905
|
}
|
|
14886
14906
|
}
|
|
14887
14907
|
return dy;
|
|
14888
|
-
}
|
|
14889
|
-
|
|
14908
|
+
}
|
|
14909
|
+
|
|
14910
|
+
/**
|
|
14911
|
+
* Get max tick size
|
|
14912
|
+
* @param {string} id axis id string
|
|
14913
|
+
* @param {boolean} withoutRecompute wheather or not to recompute
|
|
14914
|
+
* @returns {object} {width, height}
|
|
14915
|
+
* @private
|
|
14916
|
+
*/;
|
|
14917
|
+
_proto.getMaxTickSize = function getMaxTickSize(id, withoutRecompute) {
|
|
14890
14918
|
var _this11 = this;
|
|
14891
14919
|
const $$ = this.owner,
|
|
14892
14920
|
config = $$.config,
|
|
@@ -14894,10 +14922,13 @@ let Axis_Axis = /*#__PURE__*/function () {
|
|
|
14894
14922
|
_$$$$el2 = $$.$el,
|
|
14895
14923
|
svg = _$$$$el2.svg,
|
|
14896
14924
|
chart = _$$$$el2.chart,
|
|
14897
|
-
currentTickMax = current.
|
|
14898
|
-
|
|
14899
|
-
|
|
14900
|
-
|
|
14925
|
+
currentTickMax = current.maxTickSize[id],
|
|
14926
|
+
max = {
|
|
14927
|
+
width: 0,
|
|
14928
|
+
height: 0
|
|
14929
|
+
};
|
|
14930
|
+
if (withoutRecompute || !config["axis_" + id + "_show"] || currentTickMax.width > 0 && $$.filterTargetsToShow().length === 0) {
|
|
14931
|
+
return currentTickMax;
|
|
14901
14932
|
}
|
|
14902
14933
|
if (svg) {
|
|
14903
14934
|
const isYAxis = /^y2?$/.test(id),
|
|
@@ -14937,19 +14968,26 @@ let Axis_Axis = /*#__PURE__*/function () {
|
|
|
14937
14968
|
const dummy = chart.append("svg").style("visibility", "hidden").style("position", "fixed").style("top", "0").style("left", "0");
|
|
14938
14969
|
axis.create(dummy);
|
|
14939
14970
|
dummy.selectAll("text").each(function (d, i) {
|
|
14940
|
-
const
|
|
14941
|
-
|
|
14971
|
+
const _this$getBoundingClie = this.getBoundingClientRect(),
|
|
14972
|
+
width = _this$getBoundingClie.width,
|
|
14973
|
+
height = _this$getBoundingClie.height;
|
|
14974
|
+
max.width = Math.max(max.width, width);
|
|
14975
|
+
max.height = Math.max(max.height, height);
|
|
14976
|
+
|
|
14942
14977
|
// cache tick text width for getXAxisTickTextY2Overflow()
|
|
14943
14978
|
if (!isYAxis) {
|
|
14944
|
-
currentTickMax.ticks[i] =
|
|
14979
|
+
currentTickMax.ticks[i] = width;
|
|
14945
14980
|
}
|
|
14946
14981
|
});
|
|
14947
14982
|
dummy.remove();
|
|
14948
14983
|
}
|
|
14949
|
-
|
|
14950
|
-
|
|
14951
|
-
|
|
14952
|
-
|
|
14984
|
+
Object.keys(max).forEach(function (key) {
|
|
14985
|
+
_newArrowCheck(this, _this11);
|
|
14986
|
+
if (max[key] > 0) {
|
|
14987
|
+
currentTickMax[key] = max[key];
|
|
14988
|
+
}
|
|
14989
|
+
}.bind(this));
|
|
14990
|
+
return currentTickMax;
|
|
14953
14991
|
};
|
|
14954
14992
|
_proto.getXAxisTickTextY2Overflow = function getXAxisTickTextY2Overflow(defaultPadding) {
|
|
14955
14993
|
const $$ = this.owner,
|
|
@@ -14973,7 +15011,7 @@ let Axis_Axis = /*#__PURE__*/function () {
|
|
|
14973
15011
|
config = $$.config,
|
|
14974
15012
|
state = $$.state,
|
|
14975
15013
|
isTimeSeries = axis.isTimeSeries(),
|
|
14976
|
-
tickTextWidths = state.current.
|
|
15014
|
+
tickTextWidths = state.current.maxTickSize.x.ticks,
|
|
14977
15015
|
tickCount = tickTextWidths.length,
|
|
14978
15016
|
_state$axis$x$padding = state.axis.x.padding,
|
|
14979
15017
|
left = _state$axis$x$padding.left,
|
|
@@ -15242,7 +15280,7 @@ let Axis_Axis = /*#__PURE__*/function () {
|
|
|
15242
15280
|
|
|
15243
15281
|
// set/unset x_axis_tick_clippath
|
|
15244
15282
|
if (type === "x") {
|
|
15245
|
-
const clipPath = current.
|
|
15283
|
+
const clipPath = current.maxTickSize.x.clipPath ? clip.pathXAxisTickTexts : null;
|
|
15246
15284
|
$el.svg.selectAll("." + $AXIS.axisX + " .tick text").attr("clip-path", clipPath);
|
|
15247
15285
|
}
|
|
15248
15286
|
}
|
|
@@ -15804,13 +15842,14 @@ let Axis_Axis = /*#__PURE__*/function () {
|
|
|
15804
15842
|
return;
|
|
15805
15843
|
}
|
|
15806
15844
|
const mouse = getPointer(state.event, this),
|
|
15807
|
-
closest = $$.findClosestFromTargets(targetsToShow, mouse)
|
|
15845
|
+
closest = $$.findClosestFromTargets(targetsToShow, mouse),
|
|
15846
|
+
sensitivity = config.point_sensitivity === "radius" ? closest.r : config.point_sensitivity;
|
|
15808
15847
|
if (!closest) {
|
|
15809
15848
|
return;
|
|
15810
15849
|
}
|
|
15811
15850
|
|
|
15812
15851
|
// select if selection enabled
|
|
15813
|
-
if ($$.isBarType(closest.id) || $$.dist(closest, mouse) <
|
|
15852
|
+
if ($$.isBarType(closest.id) || $$.dist(closest, mouse) < sensitivity) {
|
|
15814
15853
|
$$.$el.main.selectAll("." + $SHAPE.shapes + $$.getTargetSelectorSuffix(closest.id)).selectAll("." + $SHAPE.shape + "-" + closest.index).each(function () {
|
|
15815
15854
|
if (config.data_selection_grouped || $$.isWithinShape(this, closest)) {
|
|
15816
15855
|
$$.toggleShape == null || $$.toggleShape(this, closest, closest.index);
|
|
@@ -16153,13 +16192,13 @@ var external_commonjs_d3_ease_commonjs2_d3_ease_amd_d3_ease_root_d3_ = __webpack
|
|
|
16153
16192
|
setXAxisTickClipWidth: function setXAxisTickClipWidth() {
|
|
16154
16193
|
const $$ = this,
|
|
16155
16194
|
config = $$.config,
|
|
16156
|
-
|
|
16195
|
+
maxTickSize = $$.state.current.maxTickSize,
|
|
16157
16196
|
xAxisTickRotate = $$.getAxisTickRotate("x");
|
|
16158
16197
|
if (!config.axis_x_tick_multiline && xAxisTickRotate) {
|
|
16159
16198
|
const sinRotation = Math.sin(Math.PI / 180 * Math.abs(xAxisTickRotate));
|
|
16160
|
-
|
|
16199
|
+
maxTickSize.x.clipPath = ($$.getHorizontalAxisHeight("x") - 20) / sinRotation;
|
|
16161
16200
|
} else {
|
|
16162
|
-
|
|
16201
|
+
maxTickSize.x.clipPath = null;
|
|
16163
16202
|
}
|
|
16164
16203
|
},
|
|
16165
16204
|
setXAxisTickTextClipPathWidth: function setXAxisTickTextClipPathWidth() {
|
|
@@ -16169,7 +16208,7 @@ var external_commonjs_d3_ease_commonjs2_d3_ease_amd_d3_ease_root_d3_ = __webpack
|
|
|
16169
16208
|
current = _$$$state5.current,
|
|
16170
16209
|
svg = $$.$el.svg;
|
|
16171
16210
|
if (svg) {
|
|
16172
|
-
svg.select("#" + clip.idXAxisTickTexts + " rect").attr("width", current.
|
|
16211
|
+
svg.select("#" + clip.idXAxisTickTexts + " rect").attr("width", current.maxTickSize.x.clipPath).attr("height", 30);
|
|
16173
16212
|
}
|
|
16174
16213
|
}
|
|
16175
16214
|
});
|
|
@@ -16748,7 +16787,8 @@ function smoothLines(el, type) {
|
|
|
16748
16787
|
if ($$.axis) {
|
|
16749
16788
|
var _$$$axis, _$$$config$padding;
|
|
16750
16789
|
const position = (_$$$axis = $$.axis) == null ? void 0 : _$$$axis.getLabelPositionById(id),
|
|
16751
|
-
|
|
16790
|
+
_$$$axis$getMaxTickSi = $$.axis.getMaxTickSize(id, withoutRecompute),
|
|
16791
|
+
width = _$$$axis$getMaxTickSi.width,
|
|
16752
16792
|
gap = width === 0 ? .5 : 0;
|
|
16753
16793
|
return width + (((_$$$config$padding = $$.config.padding) == null ? void 0 : _$$$config$padding.mode) === "fit" ? position.isInner ? 10 + gap : 10 : position.isInner ? 20 + gap : 40);
|
|
16754
16794
|
} else {
|
|
@@ -16782,16 +16822,18 @@ function smoothLines(el, type) {
|
|
|
16782
16822
|
if (id === "y2" && !config.axis_y2_show) {
|
|
16783
16823
|
return isFitPadding ? 0 : rotatedPadding.top;
|
|
16784
16824
|
}
|
|
16785
|
-
const
|
|
16786
|
-
|
|
16825
|
+
const maxtickSize = $$.axis.getMaxTickSize(id),
|
|
16826
|
+
rotate = $$.getAxisTickRotate(id);
|
|
16787
16827
|
// Calculate x/y axis height when tick rotated
|
|
16788
16828
|
if ((id === "x" && !isRotated || /y2?/.test(id) && isRotated) && rotate) {
|
|
16789
|
-
h
|
|
16829
|
+
h += maxtickSize.width * Math.cos(Math.PI * (90 - Math.abs(rotate)) / 180);
|
|
16790
16830
|
if (!config.axis_x_tick_multiline && current.height) {
|
|
16791
16831
|
if (h > current.height / 2) {
|
|
16792
16832
|
h = current.height / 2;
|
|
16793
16833
|
}
|
|
16794
16834
|
}
|
|
16835
|
+
} else if (maxtickSize.height > 13 && config.legend_show) {
|
|
16836
|
+
h += maxtickSize.height - 13;
|
|
16795
16837
|
}
|
|
16796
16838
|
return h + ($$.axis.getLabelPositionById(id).isInner ? 0 : 10) + (id === "y2" && !isRotated ? -10 : 0);
|
|
16797
16839
|
},
|
|
@@ -16820,7 +16862,7 @@ function smoothLines(el, type) {
|
|
|
16820
16862
|
const allowedXAxisTypes = axis.isCategorized() || axis.isTimeSeries();
|
|
16821
16863
|
if (config.axis_x_tick_fit && allowedXAxisTypes) {
|
|
16822
16864
|
const xTickCount = config.axis_x_tick_count,
|
|
16823
|
-
currentXTicksLength = state.current.
|
|
16865
|
+
currentXTicksLength = state.current.maxTickSize.x.ticks.length;
|
|
16824
16866
|
let tickCount = 0;
|
|
16825
16867
|
if (xTickCount) {
|
|
16826
16868
|
tickCount = xTickCount > currentXTicksLength ? currentXTicksLength : xTickCount;
|
|
@@ -16851,9 +16893,10 @@ function smoothLines(el, type) {
|
|
|
16851
16893
|
current = _$$$state.current,
|
|
16852
16894
|
xAxisLength = current.width - $$.getCurrentPaddingByDirection("left") - $$.getCurrentPaddingByDirection("right"),
|
|
16853
16895
|
tickCountWithPadding = axis.x.tickCount + axis.x.padding.left + axis.x.padding.right,
|
|
16854
|
-
|
|
16896
|
+
_$$$axis$getMaxTickSi2 = $$.axis.getMaxTickSize("x"),
|
|
16897
|
+
width = _$$$axis$getMaxTickSi2.width,
|
|
16855
16898
|
tickLength = tickCountWithPadding ? xAxisLength / tickCountWithPadding : 0;
|
|
16856
|
-
return
|
|
16899
|
+
return width > tickLength;
|
|
16857
16900
|
}
|
|
16858
16901
|
});
|
|
16859
16902
|
;// CONCATENATED MODULE: ./src/config/Options/data/axis.ts
|
|
@@ -16903,7 +16946,7 @@ function smoothLines(el, type) {
|
|
|
16903
16946
|
* type: "timeseries"
|
|
16904
16947
|
* }
|
|
16905
16948
|
* }
|
|
16906
|
-
* @see [D3's time specifier](https://
|
|
16949
|
+
* @see [D3's time specifier](https://d3js.org/d3-time-format#locale_format)
|
|
16907
16950
|
*/
|
|
16908
16951
|
data_xFormat: "%Y-%m-%d",
|
|
16909
16952
|
/**
|
|
@@ -17121,7 +17164,7 @@ function smoothLines(el, type) {
|
|
|
17121
17164
|
* @memberof Options
|
|
17122
17165
|
* @type {Function|string}
|
|
17123
17166
|
* @default undefined
|
|
17124
|
-
* @see [D3's time specifier](https://
|
|
17167
|
+
* @see [D3's time specifier](https://d3js.org/d3-time-format#locale_format)
|
|
17125
17168
|
* @example
|
|
17126
17169
|
* axis: {
|
|
17127
17170
|
* x: {
|
|
@@ -18180,18 +18223,6 @@ function smoothLines(el, type) {
|
|
|
18180
18223
|
* y2 Axis config options
|
|
18181
18224
|
*/
|
|
18182
18225
|
/* harmony default export */ var y2 = ({
|
|
18183
|
-
/**
|
|
18184
|
-
* Set clip-path attribute for y2 axis element
|
|
18185
|
-
* - **NOTE**: `clip-path` attribute for y2 Axis is set only when `axis.y2.inner` option is true.
|
|
18186
|
-
* @name axis․y2․clipPath
|
|
18187
|
-
* @memberof Options
|
|
18188
|
-
* @type {boolean}
|
|
18189
|
-
* @default true
|
|
18190
|
-
* @example
|
|
18191
|
-
* // don't set 'clip-path' attribute
|
|
18192
|
-
* clipPath: false
|
|
18193
|
-
*/
|
|
18194
|
-
axis_y2_clipPath: !0,
|
|
18195
18226
|
/**
|
|
18196
18227
|
* Show or hide y2 axis.
|
|
18197
18228
|
* - **NOTE**:
|
|
@@ -21161,9 +21192,12 @@ const getTransitionName = function () {
|
|
|
21161
21192
|
return $$.config.point_focus_only && !$$.hasType("bubble") && !$$.hasType("scatter") && !$$.hasArcType(null, ["radar"]);
|
|
21162
21193
|
},
|
|
21163
21194
|
isWithinCircle: function isWithinCircle(node, r) {
|
|
21164
|
-
const
|
|
21195
|
+
const config = this.config,
|
|
21196
|
+
state = this.state,
|
|
21197
|
+
mouse = getPointer(state.event, node),
|
|
21165
21198
|
element = (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(node),
|
|
21166
|
-
prefix = this.isCirclePoint(node) ? "c" : ""
|
|
21199
|
+
prefix = this.isCirclePoint(node) ? "c" : "",
|
|
21200
|
+
sensitivity = config.point_sensitivity === "radius" ? node.getAttribute("r") : config.point_sensitivity;
|
|
21167
21201
|
let cx = +element.attr(prefix + "x"),
|
|
21168
21202
|
cy = +element.attr(prefix + "y");
|
|
21169
21203
|
// if node don't have cx/y or x/y attribute value
|
|
@@ -21174,7 +21208,7 @@ const getTransitionName = function () {
|
|
|
21174
21208
|
cx = x;
|
|
21175
21209
|
cy = y;
|
|
21176
21210
|
}
|
|
21177
|
-
return Math.sqrt(Math.pow(cx - mouse[0], 2) + Math.pow(cy - mouse[1], 2)) < (r ||
|
|
21211
|
+
return Math.sqrt(Math.pow(cx - mouse[0], 2) + Math.pow(cy - mouse[1], 2)) < (r || sensitivity);
|
|
21178
21212
|
},
|
|
21179
21213
|
/**
|
|
21180
21214
|
* Get data point sensitivity radius
|
|
@@ -25055,7 +25089,7 @@ function selection_objectSpread(e) { for (var r = 1, t; r < arguments.length; r+
|
|
|
25055
25089
|
$$.$el.svg.on("wheel", function () {
|
|
25056
25090
|
_newArrowCheck(this, _this3);
|
|
25057
25091
|
}.bind(this));
|
|
25058
|
-
eventRect.call(behaviour).on("dblclick.zoom", null);
|
|
25092
|
+
eventRect == null || eventRect.call(behaviour).on("dblclick.zoom", null);
|
|
25059
25093
|
},
|
|
25060
25094
|
/**
|
|
25061
25095
|
* Initialize the drag behaviour used for zooming.
|
|
@@ -25508,7 +25542,7 @@ let _defaults = {};
|
|
|
25508
25542
|
|
|
25509
25543
|
/**
|
|
25510
25544
|
* @namespace bb
|
|
25511
|
-
* @version 3.10.0
|
|
25545
|
+
* @version 3.10.0
|
|
25512
25546
|
*/
|
|
25513
25547
|
const bb = {
|
|
25514
25548
|
/**
|
|
@@ -25518,7 +25552,7 @@ const bb = {
|
|
|
25518
25552
|
* bb.version; // "1.0.0"
|
|
25519
25553
|
* @memberof bb
|
|
25520
25554
|
*/
|
|
25521
|
-
version: "3.10.0
|
|
25555
|
+
version: "3.10.0",
|
|
25522
25556
|
/**
|
|
25523
25557
|
* Generate chart
|
|
25524
25558
|
* - **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
|
|
8
|
+
* @version 3.10.0
|
|
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}
|