billboard.js 3.10.2 → 3.10.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 +80 -65
- package/dist/billboard.min.css +1 -1
- package/dist/billboard.min.js +2 -2
- package/dist/billboard.pkgd.js +192 -338
- 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 +112 -273
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.js +113 -274
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.js +114 -275
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.js +114 -275
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.js +114 -275
- 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 +1 -1
- package/dist/theme/modern.min.css +1 -1
- package/dist-esm/billboard.js +60 -46
- 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 +17 -17
- package/src/ChartInternal/Axis/Axis.ts +7 -4
- package/src/ChartInternal/data/data.ts +15 -9
- package/src/ChartInternal/internals/clip.ts +1 -2
- package/src/ChartInternal/internals/format.ts +15 -4
- package/src/ChartInternal/internals/size.axis.ts +4 -17
- package/src/ChartInternal/internals/size.ts +11 -5
- package/src/ChartInternal/internals/text.ts +3 -3
- package/src/ChartInternal/internals/tooltip.ts +2 -2
- package/src/ChartInternal/internals/transform.ts +1 -1
- package/src/ChartInternal/shape/arc.ts +1 -1
- package/src/ChartInternal/shape/shape.ts +2 -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.
|
|
8
|
+
* @version 3.10.3
|
|
9
9
|
*/
|
|
10
10
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
11
11
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
@@ -5334,6 +5334,7 @@ function getDataKeyForJson(keysParam, config) {
|
|
|
5334
5334
|
return current;
|
|
5335
5335
|
},
|
|
5336
5336
|
getRangedData: function getRangedData(d, key, type) {
|
|
5337
|
+
var _this39 = this;
|
|
5337
5338
|
if (key === void 0) {
|
|
5338
5339
|
key = "";
|
|
5339
5340
|
}
|
|
@@ -5342,13 +5343,20 @@ function getDataKeyForJson(keysParam, config) {
|
|
|
5342
5343
|
}
|
|
5343
5344
|
const value = d == null ? void 0 : d.value;
|
|
5344
5345
|
if (isArray(value)) {
|
|
5345
|
-
|
|
5346
|
-
|
|
5347
|
-
|
|
5348
|
-
|
|
5349
|
-
|
|
5350
|
-
|
|
5351
|
-
|
|
5346
|
+
if (type === "bar") {
|
|
5347
|
+
return value.reduce(function (a, c) {
|
|
5348
|
+
_newArrowCheck(this, _this39);
|
|
5349
|
+
return c - a;
|
|
5350
|
+
}.bind(this));
|
|
5351
|
+
} else {
|
|
5352
|
+
// @ts-ignore
|
|
5353
|
+
const index = {
|
|
5354
|
+
areaRange: ["high", "mid", "low"],
|
|
5355
|
+
candlestick: ["open", "high", "low", "close", "volume"]
|
|
5356
|
+
}[type].indexOf(key);
|
|
5357
|
+
return index >= 0 && value ? value[index] : undefined;
|
|
5358
|
+
}
|
|
5359
|
+
} else if (value && key) {
|
|
5352
5360
|
return value[key];
|
|
5353
5361
|
}
|
|
5354
5362
|
return value;
|
|
@@ -5359,20 +5367,20 @@ function getDataKeyForJson(keysParam, config) {
|
|
|
5359
5367
|
* @private
|
|
5360
5368
|
*/
|
|
5361
5369
|
setRatioForGroupedData: function setRatioForGroupedData(data) {
|
|
5362
|
-
var
|
|
5370
|
+
var _this40 = this;
|
|
5363
5371
|
const $$ = this,
|
|
5364
5372
|
config = $$.config;
|
|
5365
5373
|
// calculate ratio if grouped data exists
|
|
5366
5374
|
if (config.data_groups.length && data.some(function (d) {
|
|
5367
|
-
_newArrowCheck(this,
|
|
5375
|
+
_newArrowCheck(this, _this40);
|
|
5368
5376
|
return $$.isGrouped(d.id);
|
|
5369
5377
|
}.bind(this))) {
|
|
5370
5378
|
const setter = function (d) {
|
|
5371
|
-
_newArrowCheck(this,
|
|
5379
|
+
_newArrowCheck(this, _this40);
|
|
5372
5380
|
return $$.getRatio("index", d, !0);
|
|
5373
5381
|
}.bind(this);
|
|
5374
5382
|
data.forEach(function (v) {
|
|
5375
|
-
_newArrowCheck(this,
|
|
5383
|
+
_newArrowCheck(this, _this40);
|
|
5376
5384
|
"values" in v ? v.values.forEach(setter) : setter(v);
|
|
5377
5385
|
}.bind(this));
|
|
5378
5386
|
}
|
|
@@ -5386,7 +5394,7 @@ function getDataKeyForJson(keysParam, config) {
|
|
|
5386
5394
|
* @private
|
|
5387
5395
|
*/
|
|
5388
5396
|
getRatio: function getRatio(type, d, asPercent) {
|
|
5389
|
-
var
|
|
5397
|
+
var _this41 = this;
|
|
5390
5398
|
if (asPercent === void 0) {
|
|
5391
5399
|
asPercent = !1;
|
|
5392
5400
|
}
|
|
@@ -5415,15 +5423,15 @@ function getDataKeyForJson(keysParam, config) {
|
|
|
5415
5423
|
let hiddenSum = dataValues(state.hiddenTargetIds, !1);
|
|
5416
5424
|
if (hiddenSum.length) {
|
|
5417
5425
|
hiddenSum = hiddenSum.reduce(function (acc, curr) {
|
|
5418
|
-
var
|
|
5419
|
-
_newArrowCheck(this,
|
|
5426
|
+
var _this42 = this;
|
|
5427
|
+
_newArrowCheck(this, _this41);
|
|
5420
5428
|
return acc.map(function (v, i) {
|
|
5421
|
-
_newArrowCheck(this,
|
|
5429
|
+
_newArrowCheck(this, _this42);
|
|
5422
5430
|
return (isNumber(v) ? v : 0) + curr[i];
|
|
5423
5431
|
}.bind(this));
|
|
5424
5432
|
}.bind(this));
|
|
5425
5433
|
total = total.map(function (v, i) {
|
|
5426
|
-
_newArrowCheck(this,
|
|
5434
|
+
_newArrowCheck(this, _this41);
|
|
5427
5435
|
return v - hiddenSum[i];
|
|
5428
5436
|
}.bind(this));
|
|
5429
5437
|
}
|
|
@@ -5436,11 +5444,11 @@ function getDataKeyForJson(keysParam, config) {
|
|
|
5436
5444
|
} else if (type === "bar") {
|
|
5437
5445
|
const yScale = $$.getYScaleById.bind($$)(d.id),
|
|
5438
5446
|
max = yScale.domain().reduce(function (a, c) {
|
|
5439
|
-
_newArrowCheck(this,
|
|
5447
|
+
_newArrowCheck(this, _this41);
|
|
5440
5448
|
return c - a;
|
|
5441
5449
|
}.bind(this));
|
|
5442
5450
|
// when all data are 0, return 0
|
|
5443
|
-
ratio = max === 0 ? 0 : Math.abs(d
|
|
5451
|
+
ratio = max === 0 ? 0 : Math.abs($$.getRangedData(d, null, type) / max);
|
|
5444
5452
|
} else if (type === "treemap") {
|
|
5445
5453
|
ratio /= $$.getTotalDataSum(!0);
|
|
5446
5454
|
}
|
|
@@ -5453,18 +5461,18 @@ function getDataKeyForJson(keysParam, config) {
|
|
|
5453
5461
|
* @private
|
|
5454
5462
|
*/
|
|
5455
5463
|
updateDataIndexByX: function updateDataIndexByX(tickValues) {
|
|
5456
|
-
var
|
|
5464
|
+
var _this43 = this;
|
|
5457
5465
|
const $$ = this,
|
|
5458
5466
|
tickValueMap = tickValues.reduce(function (out, tick, index) {
|
|
5459
|
-
_newArrowCheck(this,
|
|
5467
|
+
_newArrowCheck(this, _this43);
|
|
5460
5468
|
out[+tick.x] = index;
|
|
5461
5469
|
return out;
|
|
5462
5470
|
}.bind(this), {});
|
|
5463
5471
|
$$.data.targets.forEach(function (t) {
|
|
5464
|
-
var
|
|
5465
|
-
_newArrowCheck(this,
|
|
5472
|
+
var _this44 = this;
|
|
5473
|
+
_newArrowCheck(this, _this43);
|
|
5466
5474
|
t.values.forEach(function (value, valueIndex) {
|
|
5467
|
-
_newArrowCheck(this,
|
|
5475
|
+
_newArrowCheck(this, _this44);
|
|
5468
5476
|
let index = tickValueMap[+value.x];
|
|
5469
5477
|
if (index === undefined) {
|
|
5470
5478
|
index = valueIndex;
|
|
@@ -5490,11 +5498,11 @@ function getDataKeyForJson(keysParam, config) {
|
|
|
5490
5498
|
* @private
|
|
5491
5499
|
*/
|
|
5492
5500
|
isBarRangeType: function isBarRangeType(d) {
|
|
5493
|
-
var
|
|
5501
|
+
var _this45 = this;
|
|
5494
5502
|
const $$ = this,
|
|
5495
5503
|
value = d.value;
|
|
5496
5504
|
return $$.isBarType(d) && isArray(value) && value.length >= 2 && value.every(function (v) {
|
|
5497
|
-
_newArrowCheck(this,
|
|
5505
|
+
_newArrowCheck(this, _this45);
|
|
5498
5506
|
return isNumber(v);
|
|
5499
5507
|
}.bind(this));
|
|
5500
5508
|
},
|
|
@@ -6787,7 +6795,7 @@ function getFormat($$, typeValue, v) {
|
|
|
6787
6795
|
};
|
|
6788
6796
|
},
|
|
6789
6797
|
defaultValueFormat: function defaultValueFormat(v) {
|
|
6790
|
-
return isValue(v) ? +v : "";
|
|
6798
|
+
return isArray(v) ? v.join("~") : isValue(v) ? +v : "";
|
|
6791
6799
|
},
|
|
6792
6800
|
defaultArcValueFormat: function defaultArcValueFormat(v, ratio) {
|
|
6793
6801
|
return (ratio * 100).toFixed(1) + "%";
|
|
@@ -6801,7 +6809,14 @@ function getFormat($$, typeValue, v) {
|
|
|
6801
6809
|
dataLabels = $$.config.data_labels,
|
|
6802
6810
|
defaultFormat = function (v) {
|
|
6803
6811
|
_newArrowCheck(this, _this);
|
|
6804
|
-
|
|
6812
|
+
const delimiter = "~";
|
|
6813
|
+
let res = v;
|
|
6814
|
+
if (isArray(v)) {
|
|
6815
|
+
res = v.join(delimiter);
|
|
6816
|
+
} else if (isObject(v)) {
|
|
6817
|
+
res = Object.values(v).join(delimiter);
|
|
6818
|
+
}
|
|
6819
|
+
return res;
|
|
6805
6820
|
}.bind(this);
|
|
6806
6821
|
let format = defaultFormat;
|
|
6807
6822
|
|
|
@@ -8323,6 +8338,8 @@ function getGroupedDataPointsFn(d) {
|
|
|
8323
8338
|
let value = d.value;
|
|
8324
8339
|
if (isNumber(d)) {
|
|
8325
8340
|
value = d;
|
|
8341
|
+
} else if ($$.isAreaRangeType(d)) {
|
|
8342
|
+
value = $$.getBaseValue(d, "mid");
|
|
8326
8343
|
} else if (isStackNormalized) {
|
|
8327
8344
|
value = $$.getRatio("index", d, !0);
|
|
8328
8345
|
} else if ($$.isBubbleZType(d)) {
|
|
@@ -8733,14 +8750,18 @@ function getGroupedDataPointsFn(d) {
|
|
|
8733
8750
|
* Get padding by the direction.
|
|
8734
8751
|
* @param {string} type "top" | "bottom" | "left" | "right"
|
|
8735
8752
|
* @param {boolean} [withoutRecompute=false] If set true, do not recompute the padding value.
|
|
8753
|
+
* @param {boolean} [withXAxisTickTextOverflow=false] If set true, calculate x axis tick text overflow.
|
|
8736
8754
|
* @returns {number} padding value
|
|
8737
8755
|
* @private
|
|
8738
8756
|
*/
|
|
8739
|
-
getCurrentPaddingByDirection: function getCurrentPaddingByDirection(type, withoutRecompute) {
|
|
8757
|
+
getCurrentPaddingByDirection: function getCurrentPaddingByDirection(type, withoutRecompute, withXAxisTickTextOverflow) {
|
|
8740
8758
|
var _config$padding;
|
|
8741
8759
|
if (withoutRecompute === void 0) {
|
|
8742
8760
|
withoutRecompute = !1;
|
|
8743
8761
|
}
|
|
8762
|
+
if (withXAxisTickTextOverflow === void 0) {
|
|
8763
|
+
withXAxisTickTextOverflow = !1;
|
|
8764
|
+
}
|
|
8744
8765
|
const $$ = this,
|
|
8745
8766
|
config = $$.config,
|
|
8746
8767
|
$el = $$.$el,
|
|
@@ -8759,6 +8780,7 @@ function getGroupedDataPointsFn(d) {
|
|
|
8759
8780
|
isAxisShow = axisId && config["axis_" + axisId + "_show"],
|
|
8760
8781
|
axesLen = axisId ? config["axis_" + axisId + "_axes"].length : 0;
|
|
8761
8782
|
let axisSize = axisId ? isLeftRight ? $$.getAxisWidthByAxisId(axisId, withoutRecompute) : $$.getHorizontalAxisHeight(axisId) : 0;
|
|
8783
|
+
const defaultPadding = 20;
|
|
8762
8784
|
let gap = 0;
|
|
8763
8785
|
if (!isFitPadding && isLeftRight) {
|
|
8764
8786
|
axisSize = ceil10(axisSize);
|
|
@@ -8766,10 +8788,11 @@ function getGroupedDataPointsFn(d) {
|
|
|
8766
8788
|
let padding = hasAxis && isLeftRight && (isAxisInner || isUndefined(paddingOption) && !isAxisShow) ? 0 : isFitPadding ? (isAxisShow ? axisSize : 0) + (paddingOption != null ? paddingOption : 0) : isUndefined(paddingOption) ? axisSize : paddingOption;
|
|
8767
8789
|
if (isLeftRight && hasAxis) {
|
|
8768
8790
|
if (axisId && (isFitPadding || isAxisInner) && config["axis_" + axisId + "_label"].text) {
|
|
8769
|
-
padding += $$.axis.getAxisLabelPosition(axisId).isOuter ?
|
|
8791
|
+
padding += $$.axis.getAxisLabelPosition(axisId).isOuter ? defaultPadding : 0;
|
|
8770
8792
|
}
|
|
8771
8793
|
if (type === "right") {
|
|
8772
8794
|
padding += isRotated ? !isFitPadding && isUndefined(paddingOption) ? 10 : 2 : !isAxisShow || isAxisInner ? isFitPadding ? 2 : 1 : 0;
|
|
8795
|
+
padding += withXAxisTickTextOverflow ? $$.axis.getXAxisTickTextY2Overflow(defaultPadding) : 0;
|
|
8773
8796
|
} else if (type === "left" && isRotated && isUndefined(paddingOption)) {
|
|
8774
8797
|
padding = !config.axis_x_show ? 1 : isFitPadding ? axisSize : Math.max(axisSize, 40);
|
|
8775
8798
|
}
|
|
@@ -8785,12 +8808,15 @@ function getGroupedDataPointsFn(d) {
|
|
|
8785
8808
|
}
|
|
8786
8809
|
return padding + axisSize * axesLen - gap;
|
|
8787
8810
|
},
|
|
8788
|
-
getCurrentPadding: function getCurrentPadding() {
|
|
8811
|
+
getCurrentPadding: function getCurrentPadding(withXAxisTickTextOverflow) {
|
|
8789
8812
|
var _this = this;
|
|
8813
|
+
if (withXAxisTickTextOverflow === void 0) {
|
|
8814
|
+
withXAxisTickTextOverflow = !1;
|
|
8815
|
+
}
|
|
8790
8816
|
const $$ = this,
|
|
8791
8817
|
_map = ["top", "bottom", "left", "right"].map(function (v) {
|
|
8792
8818
|
_newArrowCheck(this, _this);
|
|
8793
|
-
return $$.getCurrentPaddingByDirection(v);
|
|
8819
|
+
return $$.getCurrentPaddingByDirection(v, null, withXAxisTickTextOverflow);
|
|
8794
8820
|
}.bind(this)),
|
|
8795
8821
|
top = _map[0],
|
|
8796
8822
|
bottom = _map[1],
|
|
@@ -8850,14 +8876,14 @@ function getGroupedDataPointsFn(d) {
|
|
|
8850
8876
|
$$.updateXAxisTickClip();
|
|
8851
8877
|
}
|
|
8852
8878
|
const legendSize = {
|
|
8853
|
-
right: config.legend_show && state.isLegendRight ? $$.getLegendWidth() + 20 : 0,
|
|
8879
|
+
right: config.legend_show && state.isLegendRight ? $$.getLegendWidth() + (isFitPadding ? 0 : 20) : 0,
|
|
8854
8880
|
bottom: !config.legend_show || state.isLegendRight || state.isLegendInset ? 0 : currLegend.height
|
|
8855
8881
|
},
|
|
8856
8882
|
xAxisHeight = isRotated || isNonAxis ? 0 : $$.getHorizontalAxisHeight("x"),
|
|
8857
8883
|
subchartXAxisHeight = config.subchart_axis_x_show && config.subchart_axis_x_tick_text_show ? xAxisHeight : 30,
|
|
8858
8884
|
subchartHeight = config.subchart_show && !isNonAxis ? config.subchart_size_height + subchartXAxisHeight : 0,
|
|
8859
8885
|
gaugeHeight = $$.hasType("gauge") && config.arc_needle_show && !config.gauge_fullCircle && !config.gauge_label_show ? 10 : 0,
|
|
8860
|
-
padding = $$.getCurrentPadding(); // when needle is shown with legend, it need some bottom space to not overlap with legend text
|
|
8886
|
+
padding = $$.getCurrentPadding(!0); // when needle is shown with legend, it need some bottom space to not overlap with legend text
|
|
8861
8887
|
// for main
|
|
8862
8888
|
state.margin = !isNonAxis && isRotated ? {
|
|
8863
8889
|
top: padding.top,
|
|
@@ -9183,7 +9209,7 @@ function getTextPos(d, type) {
|
|
|
9183
9209
|
* @returns {string|null}
|
|
9184
9210
|
* @private
|
|
9185
9211
|
*/
|
|
9186
|
-
|
|
9212
|
+
updateTextBackgroundColor: function updateTextBackgroundColor(d) {
|
|
9187
9213
|
const $$ = this,
|
|
9188
9214
|
$el = $$.$el,
|
|
9189
9215
|
config = $$.config,
|
|
@@ -9218,7 +9244,7 @@ function getTextPos(d, type) {
|
|
|
9218
9244
|
angle = config.data_labels.rotate,
|
|
9219
9245
|
anchorString = getRotateAnchor(angle),
|
|
9220
9246
|
rotateString = angle ? "rotate(" + angle + ")" : "";
|
|
9221
|
-
$$.$el.text.style("fill", $$.getStylePropValue($$.updateTextColor)).attr("filter", $$.
|
|
9247
|
+
$$.$el.text.style("fill", $$.getStylePropValue($$.updateTextColor)).attr("filter", $$.updateTextBackgroundColor.bind($$)).style("fill-opacity", forFlow ? 0 : $$.opacityForText.bind($$)).each(function (d, i) {
|
|
9222
9248
|
// do not apply transition for newly added text elements
|
|
9223
9249
|
const node = $T(hasTreemap && this.childElementCount ? this.parentNode : this, !!(withTransition && this.getAttribute("x")), t),
|
|
9224
9250
|
isInverted = config["axis_" + (axis == null ? void 0 : axis.getId(d.id)) + "_inverted"];
|
|
@@ -9314,7 +9340,7 @@ function getTextPos(d, type) {
|
|
|
9314
9340
|
if (config.data_labels.centered && (isBarType || isTreemapType)) {
|
|
9315
9341
|
const rect = getBoundingRect(textElement);
|
|
9316
9342
|
if (isBarType) {
|
|
9317
|
-
const isPositive = d
|
|
9343
|
+
const isPositive = $$.getRangedData(d, null, "bar") >= 0;
|
|
9318
9344
|
if (isRotated) {
|
|
9319
9345
|
const w = (isPositive ? points[1][1] - points[0][1] : points[0][1] - points[1][1]) / 2 + rect.width / 2;
|
|
9320
9346
|
return isPositive ? -w - 3 : w + 2;
|
|
@@ -9773,12 +9799,10 @@ function getTextXPos(pos, width) {
|
|
|
9773
9799
|
value = "<b>Open:</b> " + open + " <b>High:</b> " + high + " <b>Low:</b> " + low + " <b>Close:</b> " + close + (volume ? " <b>Volume:</b> " + volume : "");
|
|
9774
9800
|
} else if ($$.isBarRangeType(row)) {
|
|
9775
9801
|
const _row = row,
|
|
9776
|
-
|
|
9777
|
-
start = _row$value[0],
|
|
9778
|
-
end = _row$value[1],
|
|
9802
|
+
rangeValue = _row.value,
|
|
9779
9803
|
id = _row.id,
|
|
9780
9804
|
index = _row.index;
|
|
9781
|
-
value =
|
|
9805
|
+
value = "" + valueFormat(rangeValue, undefined, id, index);
|
|
9782
9806
|
} else {
|
|
9783
9807
|
value = valueFormat.apply(void 0, [getRowValue(row)].concat(param));
|
|
9784
9808
|
}
|
|
@@ -10192,7 +10216,7 @@ function getTextXPos(pos, width) {
|
|
|
10192
10216
|
y = isRotated ? state.height + padding : 0;
|
|
10193
10217
|
} else if (target === "y2") {
|
|
10194
10218
|
x = isRotated ? 0 : state.width + padding;
|
|
10195
|
-
y = isRotated ?
|
|
10219
|
+
y = isRotated ? -padding - 1 : 0;
|
|
10196
10220
|
} else if (target === "subX") {
|
|
10197
10221
|
x = 0;
|
|
10198
10222
|
y = isRotated ? 0 : state.height2;
|
|
@@ -14926,11 +14950,12 @@ let Axis_Axis = /*#__PURE__*/function () {
|
|
|
14926
14950
|
svg = _$$$$el2.svg,
|
|
14927
14951
|
chart = _$$$$el2.chart,
|
|
14928
14952
|
currentTickMax = current.maxTickSize[id],
|
|
14953
|
+
configPrefix = "axis_" + id,
|
|
14929
14954
|
max = {
|
|
14930
14955
|
width: 0,
|
|
14931
14956
|
height: 0
|
|
14932
14957
|
};
|
|
14933
|
-
if (withoutRecompute || !config[
|
|
14958
|
+
if (withoutRecompute || !config[configPrefix + "_show"] || currentTickMax.width > 0 && $$.filterTargetsToShow().length === 0) {
|
|
14934
14959
|
return currentTickMax;
|
|
14935
14960
|
}
|
|
14936
14961
|
if (svg) {
|
|
@@ -14958,8 +14983,9 @@ let Axis_Axis = /*#__PURE__*/function () {
|
|
|
14958
14983
|
currentTickMax.ticks.splice(0);
|
|
14959
14984
|
}
|
|
14960
14985
|
const axis = this.getAxis(id, scale, !1, !1, !0),
|
|
14961
|
-
|
|
14962
|
-
|
|
14986
|
+
tickRotate = config[configPrefix + "_tick_rotate"],
|
|
14987
|
+
tickCount = config[configPrefix + "_tick_count"],
|
|
14988
|
+
tickValues = config[configPrefix + "_tick_values"];
|
|
14963
14989
|
// Make to generate the final tick text to be rendered
|
|
14964
14990
|
// https://github.com/naver/billboard.js/issues/920
|
|
14965
14991
|
// Do not generate if 'tick values' option is given
|
|
@@ -14970,7 +14996,7 @@ let Axis_Axis = /*#__PURE__*/function () {
|
|
|
14970
14996
|
isYAxis || this.updateXAxisTickValues(targetsToShow, axis);
|
|
14971
14997
|
const dummy = chart.append("svg").style("visibility", "hidden").style("position", "fixed").style("top", "0").style("left", "0");
|
|
14972
14998
|
axis.create(dummy);
|
|
14973
|
-
dummy.selectAll("text").each(function (d, i) {
|
|
14999
|
+
dummy.selectAll("text").attr("transform", isNumber(tickRotate) ? "rotate(" + tickRotate + ")" : null).each(function (d, i) {
|
|
14974
15000
|
const _this$getBoundingClie = this.getBoundingClientRect(),
|
|
14975
15001
|
width = _this$getBoundingClie.width,
|
|
14976
15002
|
height = _this$getBoundingClie.height;
|
|
@@ -14998,7 +15024,7 @@ let Axis_Axis = /*#__PURE__*/function () {
|
|
|
14998
15024
|
config = $$.config,
|
|
14999
15025
|
state = $$.state,
|
|
15000
15026
|
xAxisTickRotate = $$.getAxisTickRotate("x");
|
|
15001
|
-
if ((axis.isCategorized() || axis.isTimeSeries()) && config.axis_x_tick_fit && !config.axis_x_tick_culling && !config.axis_x_tick_multiline && xAxisTickRotate > 0 && xAxisTickRotate < 90) {
|
|
15027
|
+
if ((axis.isCategorized() || axis.isTimeSeries()) && config.axis_x_tick_fit && (!config.axis_x_tick_culling || isEmpty(config.axis_x_tick_culling)) && !config.axis_x_tick_multiline && xAxisTickRotate > 0 && xAxisTickRotate < 90) {
|
|
15002
15028
|
const widthWithoutCurrentPaddingLeft = state.current.width - $$.getCurrentPaddingByDirection("left"),
|
|
15003
15029
|
maxOverflow = this.getXAxisTickMaxOverflow(xAxisTickRotate, widthWithoutCurrentPaddingLeft - defaultPadding),
|
|
15004
15030
|
xAxisTickTextY2Overflow = Math.max(0, maxOverflow) + defaultPadding;
|
|
@@ -16156,7 +16182,6 @@ var external_commonjs_d3_ease_commonjs2_d3_ease_amd_d3_ease_root_d3_ = __webpack
|
|
|
16156
16182
|
* @private
|
|
16157
16183
|
*/
|
|
16158
16184
|
setYAxisClipPath: function setYAxisClipPath(node) {
|
|
16159
|
-
var _config$padding;
|
|
16160
16185
|
const $$ = this,
|
|
16161
16186
|
config = $$.config,
|
|
16162
16187
|
_$$$state3 = $$.state,
|
|
@@ -16169,7 +16194,7 @@ var external_commonjs_d3_ease_commonjs2_d3_ease_amd_d3_ease_root_d3_ = __webpack
|
|
|
16169
16194
|
x = isInner && !isRotated ? config.axis_y_label.text ? -20 : -1 : isRotated ? -(1 + left) : -(left - 1),
|
|
16170
16195
|
y = -(isRotated ? 20 : margin.top),
|
|
16171
16196
|
w = (isRotated ? width + 15 + left : margin.left + 20) + (isInner ? 20 : 0),
|
|
16172
|
-
h = (isRotated ? margin.bottom +
|
|
16197
|
+
h = (isRotated ? margin.bottom + 10 : margin.top + height) + 10;
|
|
16173
16198
|
node.attr("x", x).attr("y", y).attr("width", w).attr("height", h);
|
|
16174
16199
|
},
|
|
16175
16200
|
updateXAxisTickClip: function updateXAxisTickClip() {
|
|
@@ -16804,7 +16829,6 @@ function smoothLines(el, type) {
|
|
|
16804
16829
|
config = $$.config,
|
|
16805
16830
|
state = $$.state,
|
|
16806
16831
|
_state = state,
|
|
16807
|
-
current = _state.current,
|
|
16808
16832
|
rotatedPadding = _state.rotatedPadding,
|
|
16809
16833
|
isLegendRight = _state.isLegendRight,
|
|
16810
16834
|
isLegendInset = _state.isLegendInset,
|
|
@@ -16825,17 +16849,8 @@ function smoothLines(el, type) {
|
|
|
16825
16849
|
if (id === "y2" && !config.axis_y2_show) {
|
|
16826
16850
|
return isFitPadding ? 0 : rotatedPadding.top;
|
|
16827
16851
|
}
|
|
16828
|
-
const maxtickSize = $$.axis.getMaxTickSize(id)
|
|
16829
|
-
|
|
16830
|
-
// Calculate x/y axis height when tick rotated
|
|
16831
|
-
if ((id === "x" && !isRotated || /y2?/.test(id) && isRotated) && rotate) {
|
|
16832
|
-
h += maxtickSize.width * Math.cos(Math.PI * (90 - Math.abs(rotate)) / 180);
|
|
16833
|
-
if (!config.axis_x_tick_multiline && current.height) {
|
|
16834
|
-
if (h > current.height / 2) {
|
|
16835
|
-
h = current.height / 2;
|
|
16836
|
-
}
|
|
16837
|
-
}
|
|
16838
|
-
} else if (maxtickSize.height > 13 && config.legend_show) {
|
|
16852
|
+
const maxtickSize = $$.axis.getMaxTickSize(id);
|
|
16853
|
+
if (maxtickSize.height > 13) {
|
|
16839
16854
|
h += maxtickSize.height - 13;
|
|
16840
16855
|
}
|
|
16841
16856
|
return h + ($$.axis.getLabelPositionById(id).isInner ? 0 : 10) + (id === "y2" && !isRotated ? -10 : 0);
|
|
@@ -16878,7 +16893,7 @@ function smoothLines(el, type) {
|
|
|
16878
16893
|
}
|
|
16879
16894
|
state.axis.x.tickCount = tickCount;
|
|
16880
16895
|
}
|
|
16881
|
-
if ($el.svg && config.
|
|
16896
|
+
if ($el.svg && config.axis_x_tick_autorotate && config.axis_x_tick_fit && !config.axis_x_tick_multiline && !config.axis_x_tick_culling && allowedXAxisTypes) {
|
|
16882
16897
|
rotate = $$.needToRotateXAxisTickTexts() ? config.axis_x_tick_rotate : 0;
|
|
16883
16898
|
}
|
|
16884
16899
|
}
|
|
@@ -19203,7 +19218,7 @@ function getAttrTweenFn(fn) {
|
|
|
19203
19218
|
const $$ = this,
|
|
19204
19219
|
hasGauge = $$.hasType("gauge");
|
|
19205
19220
|
if ($$.shouldShowArcLabel()) {
|
|
19206
|
-
selection.style("fill", $$.updateTextColor.bind($$)).attr("filter", $$.
|
|
19221
|
+
selection.style("fill", $$.updateTextColor.bind($$)).attr("filter", $$.updateTextBackgroundColor.bind($$)).each(function (d) {
|
|
19207
19222
|
var _filter;
|
|
19208
19223
|
const node = (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(this),
|
|
19209
19224
|
updated = $$.updateAngle(d),
|
|
@@ -25545,7 +25560,7 @@ let _defaults = {};
|
|
|
25545
25560
|
|
|
25546
25561
|
/**
|
|
25547
25562
|
* @namespace bb
|
|
25548
|
-
* @version 3.10.
|
|
25563
|
+
* @version 3.10.3
|
|
25549
25564
|
*/
|
|
25550
25565
|
const bb = {
|
|
25551
25566
|
/**
|
|
@@ -25555,7 +25570,7 @@ const bb = {
|
|
|
25555
25570
|
* bb.version; // "1.0.0"
|
|
25556
25571
|
* @memberof bb
|
|
25557
25572
|
*/
|
|
25558
|
-
version: "3.10.
|
|
25573
|
+
version: "3.10.3",
|
|
25559
25574
|
/**
|
|
25560
25575
|
* Generate chart
|
|
25561
25576
|
* - **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.
|
|
8
|
+
* @version 3.10.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}
|