billboard.js 3.7.2 → 3.7.4
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 +19 -14
- package/dist/billboard.min.css +1 -1
- package/dist/billboard.min.js +2 -2
- package/dist/billboard.pkgd.js +19 -14
- 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 +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.js +2 -2
- 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 +23 -18
- 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 +11 -11
- package/src/ChartInternal/data/data.ts +8 -5
- package/src/ChartInternal/internals/redraw.ts +7 -7
- package/src/ChartInternal/shape/arc.ts +4 -2
- package/src/ChartInternal/shape/bar.ts +5 -2
- package/types/chart.d.ts +3 -13
- package/types/options.d.ts +1 -1
package/dist/billboard.pkgd.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.4
|
|
9
9
|
*
|
|
10
10
|
* All-in-one packaged file for ease use of 'billboard.js' with dependant d3.js modules & polyfills.
|
|
11
11
|
* - @types/d3-selection ^3.0.4
|
|
@@ -26370,11 +26370,12 @@ function getDataKeyForJson(keysParam, config) {
|
|
|
26370
26370
|
}.bind(this))).map(function (v) {
|
|
26371
26371
|
_newArrowCheck(this, _this14);
|
|
26372
26372
|
return v.value;
|
|
26373
|
-
}.bind(this))
|
|
26373
|
+
}.bind(this));
|
|
26374
|
+
total = sum.length ? sum.reduce(function (p, c) {
|
|
26374
26375
|
_newArrowCheck(this, _this14);
|
|
26375
26376
|
return p + c;
|
|
26376
|
-
}.bind(this));
|
|
26377
|
-
$$.cache.add(cacheKey, total
|
|
26377
|
+
}.bind(this)) : 0;
|
|
26378
|
+
$$.cache.add(cacheKey, total);
|
|
26378
26379
|
}
|
|
26379
26380
|
if (subtractHidden) {
|
|
26380
26381
|
total -= $$.getHiddenTotalDataSum();
|
|
@@ -27004,7 +27005,8 @@ function getDataKeyForJson(keysParam, config) {
|
|
|
27004
27005
|
}.bind(this));
|
|
27005
27006
|
}
|
|
27006
27007
|
}
|
|
27007
|
-
|
|
27008
|
+
var divisor = total[d.index];
|
|
27009
|
+
d.ratio = isNumber(d.value) && total && divisor ? d.value / divisor : 0;
|
|
27008
27010
|
ratio = d.ratio;
|
|
27009
27011
|
} else if (type === "radar") {
|
|
27010
27012
|
ratio = parseFloat(Math.max(d.value, 0) + "") / state.current.dataMax * config.radar_size_ratio;
|
|
@@ -29666,14 +29668,14 @@ function getLegendColor(id) {
|
|
|
29666
29668
|
$$.updateCircleY && ($$.circleY = $$.updateCircleY());
|
|
29667
29669
|
}
|
|
29668
29670
|
|
|
29671
|
+
// Data empty label positioning and text.
|
|
29672
|
+
config.data_empty_label_text && main.select("text." + $TEXT.text + "." + $COMMON.empty).attr("x", state.width / 2).attr("y", state.height / 2).text(config.data_empty_label_text).style("display", targetsToShow.length ? "none" : null);
|
|
29673
|
+
|
|
29669
29674
|
// update axis
|
|
29670
29675
|
if (state.hasAxis) {
|
|
29671
29676
|
// @TODO: Make 'init' state to be accessible everywhere not passing as argument.
|
|
29672
29677
|
$$.axis.redrawAxis(targetsToShow, wth, transitions, flow, initializing);
|
|
29673
29678
|
|
|
29674
|
-
// Data empty label positioning and text.
|
|
29675
|
-
config.data_empty_label_text && main.select("text." + $TEXT.text + "." + $COMMON.empty).attr("x", state.width / 2).attr("y", state.height / 2).text(config.data_empty_label_text).style("display", targetsToShow.length ? "none" : null);
|
|
29676
|
-
|
|
29677
29679
|
// grid
|
|
29678
29680
|
$$.hasGrid() && $$.updateGrid();
|
|
29679
29681
|
|
|
@@ -43962,6 +43964,7 @@ function getAttrTweenFn(fn) {
|
|
|
43962
43964
|
state = $$.state,
|
|
43963
43965
|
hasMultiArcGauge = $$.hasMultiArcGauge(),
|
|
43964
43966
|
isFullCircle = config.gauge_fullCircle,
|
|
43967
|
+
showEmptyTextLabel = $$.filterTargetsToShow($$.data.targets).length === 0 && !!config.data_empty_label_text,
|
|
43965
43968
|
startAngle = $$.getStartAngle(),
|
|
43966
43969
|
endAngle = isFullCircle ? startAngle + $$.getArcLength() : startAngle * -1,
|
|
43967
43970
|
backgroundArc = $$.$el.arcs.select((hasMultiArcGauge ? "g" : "") + "." + $ARC.chartArcsBackground);
|
|
@@ -43974,7 +43977,7 @@ function getAttrTweenFn(fn) {
|
|
|
43974
43977
|
}.bind(this)).merge(backgroundArc).style("fill", config.gauge_background || null).attr("d", function (_ref2) {
|
|
43975
43978
|
var id = _ref2.id;
|
|
43976
43979
|
_newArrowCheck(this, _this14);
|
|
43977
|
-
if (state.hiddenTargetIds.indexOf(id) >= 0) {
|
|
43980
|
+
if (showEmptyTextLabel || state.hiddenTargetIds.indexOf(id) >= 0) {
|
|
43978
43981
|
return "M 0 0";
|
|
43979
43982
|
}
|
|
43980
43983
|
var d = {
|
|
@@ -43989,7 +43992,7 @@ function getAttrTweenFn(fn) {
|
|
|
43989
43992
|
}.bind(this));
|
|
43990
43993
|
backgroundArc.exit().remove();
|
|
43991
43994
|
} else {
|
|
43992
|
-
backgroundArc.attr("d", function () {
|
|
43995
|
+
backgroundArc.attr("d", showEmptyTextLabel ? "M 0 0" : function () {
|
|
43993
43996
|
_newArrowCheck(this, _this14);
|
|
43994
43997
|
var d = {
|
|
43995
43998
|
data: [{
|
|
@@ -44593,7 +44596,9 @@ function point_y(p) {
|
|
|
44593
44596
|
var points = getPoints(d, i),
|
|
44594
44597
|
indexX = +isRotated,
|
|
44595
44598
|
indexY = +!indexX,
|
|
44596
|
-
|
|
44599
|
+
isUnderZero = d.value < 0,
|
|
44600
|
+
isInverted = config["axis_" + $$.axis.getId(d.id) + "_inverted"],
|
|
44601
|
+
isNegative = !isInverted && isUnderZero || isInverted && !isUnderZero,
|
|
44597
44602
|
pathRadius = ["", ""]; // switch points if axis is rotated, not applicable for sub chart
|
|
44598
44603
|
var radius = 0;
|
|
44599
44604
|
var isGrouped = $$.isGrouped(d.id),
|
|
@@ -44610,7 +44615,7 @@ function point_y(p) {
|
|
|
44610
44615
|
|
|
44611
44616
|
// path string data shouldn't be containing new line chars
|
|
44612
44617
|
// https://github.com/naver/billboard.js/issues/530
|
|
44613
|
-
var path = isRotated ? "H" + (points[1][indexX]
|
|
44618
|
+
var path = isRotated ? "H" + (points[1][indexX] + (isNegative ? radius : -radius)) + " " + pathRadius[0] + "V" + (points[2][indexY] - radius) + " " + pathRadius[1] + "H" + points[3][indexX] : "V" + (points[1][indexY] + (isNegative ? -radius : radius)) + " " + pathRadius[0] + "H" + (points[2][indexX] - radius) + " " + pathRadius[1] + "V" + points[3][indexY];
|
|
44614
44619
|
return "M" + points[0][indexX] + "," + points[0][indexY] + path + "z";
|
|
44615
44620
|
}.bind(this);
|
|
44616
44621
|
},
|
|
@@ -50892,7 +50897,7 @@ var _defaults = {};
|
|
|
50892
50897
|
|
|
50893
50898
|
/**
|
|
50894
50899
|
* @namespace bb
|
|
50895
|
-
* @version 3.7.
|
|
50900
|
+
* @version 3.7.4
|
|
50896
50901
|
*/
|
|
50897
50902
|
var bb = {
|
|
50898
50903
|
/**
|
|
@@ -50902,7 +50907,7 @@ var bb = {
|
|
|
50902
50907
|
* bb.version; // "1.0.0"
|
|
50903
50908
|
* @memberof bb
|
|
50904
50909
|
*/
|
|
50905
|
-
version: "3.7.
|
|
50910
|
+
version: "3.7.4",
|
|
50906
50911
|
/**
|
|
50907
50912
|
* Generate chart
|
|
50908
50913
|
* - **NOTE:** Bear in mind for the possiblity of ***throwing an error***, during the generation when:
|