billboard.js 3.4.0-next.1 → 3.4.1
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 +7 -3
- package/dist/billboard.css +1 -1
- package/dist/billboard.js +167 -58
- package/dist/billboard.min.css +1 -1
- package/dist/billboard.min.js +2 -2
- package/dist/billboard.pkgd.js +237 -81
- 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 +12 -7
- package/dist/plugin/billboardjs-plugin-sparkline.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-stanford.js +12 -7
- package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-tableview.js +12 -7
- package/dist/plugin/billboardjs-plugin-tableview.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-textoverlap.js +12 -7
- 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 +58 -21
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.js +80 -28
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.js +58 -21
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.js +58 -21
- 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 +142 -52
- 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 +7 -4
- 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/Chart/api/axis.ts +90 -25
- package/src/ChartInternal/ChartInternal.ts +25 -11
- package/src/ChartInternal/interactions/flow.ts +1 -1
- package/src/ChartInternal/shape/arc.ts +1 -1
- package/src/ChartInternal/shape/bar.ts +1 -1
- package/src/ChartInternal/shape/point.ts +8 -3
- package/src/config/Options/common/main.ts +19 -2
- package/src/module/generator.ts +19 -5
- package/src/module/util.ts +6 -3
- package/types/chart.d.ts +8 -8
- package/types/options.d.ts +7 -2
- package/types/types.d.ts +2 -0
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.4.
|
|
8
|
+
* @version 3.4.1
|
|
9
9
|
*
|
|
10
10
|
* All-in-one packaged file for ease use of 'billboard.js' with dependant d3.js modules & polyfills.
|
|
11
11
|
* - d3-axis ^3.0.0
|
|
@@ -18624,15 +18624,15 @@ var _brighter = 1 / _darker;
|
|
|
18624
18624
|
|
|
18625
18625
|
|
|
18626
18626
|
var reI = "\\s*([+-]?\\d+)\\s*",
|
|
18627
|
-
reN = "\\s*([+-]?\\d
|
|
18628
|
-
reP = "\\s*([+-]?\\d
|
|
18627
|
+
reN = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",
|
|
18628
|
+
reP = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",
|
|
18629
18629
|
reHex = /^#([0-9a-f]{3,8})$/,
|
|
18630
18630
|
reRgbInteger = new RegExp("^rgb\\(\\s*([+-]?\\d+)\\s*,\\s*([+-]?\\d+)\\s*,\\s*([+-]?\\d+)\\s*\\)$"),
|
|
18631
|
-
reRgbPercent = new RegExp("^rgb\\(\\s*([+-]?\\d
|
|
18632
|
-
reRgbaInteger = new RegExp("^rgba\\(\\s*([+-]?\\d+)\\s*,\\s*([+-]?\\d+)\\s*,\\s*([+-]?\\d+)\\s*,\\s*([+-]?\\d
|
|
18633
|
-
reRgbaPercent = new RegExp("^rgba\\(\\s*([+-]?\\d
|
|
18634
|
-
reHslPercent = new RegExp("^hsl\\(\\s*([+-]?\\d
|
|
18635
|
-
reHslaPercent = new RegExp("^hsla\\(\\s*([+-]?\\d
|
|
18631
|
+
reRgbPercent = new RegExp("^rgb\\(\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*,\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*,\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*\\)$"),
|
|
18632
|
+
reRgbaInteger = new RegExp("^rgba\\(\\s*([+-]?\\d+)\\s*,\\s*([+-]?\\d+)\\s*,\\s*([+-]?\\d+)\\s*,\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*\\)$"),
|
|
18633
|
+
reRgbaPercent = new RegExp("^rgba\\(\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*,\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*,\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*,\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*\\)$"),
|
|
18634
|
+
reHslPercent = new RegExp("^hsl\\(\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*,\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*,\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*\\)$"),
|
|
18635
|
+
reHslaPercent = new RegExp("^hsla\\(\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*,\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*,\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*,\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*\\)$"),
|
|
18636
18636
|
named = {
|
|
18637
18637
|
aliceblue: 0xf0f8ff,
|
|
18638
18638
|
antiquewhite: 0xfaebd7,
|
|
@@ -18793,6 +18793,7 @@ src_define(Color, color, {
|
|
|
18793
18793
|
hex: color_formatHex,
|
|
18794
18794
|
// Deprecated! Use color.formatHex.
|
|
18795
18795
|
formatHex: color_formatHex,
|
|
18796
|
+
formatHex8: color_formatHex8,
|
|
18796
18797
|
formatHsl: color_formatHsl,
|
|
18797
18798
|
formatRgb: color_formatRgb,
|
|
18798
18799
|
toString: color_formatRgb
|
|
@@ -18802,6 +18803,10 @@ function color_formatHex() {
|
|
|
18802
18803
|
return this.rgb().formatHex();
|
|
18803
18804
|
}
|
|
18804
18805
|
|
|
18806
|
+
function color_formatHex8() {
|
|
18807
|
+
return this.rgb().formatHex8();
|
|
18808
|
+
}
|
|
18809
|
+
|
|
18805
18810
|
function color_formatHsl() {
|
|
18806
18811
|
return hslConvert(this).formatHsl();
|
|
18807
18812
|
}
|
|
@@ -18864,12 +18869,16 @@ src_define(Rgb, color_rgb, extend(Color, {
|
|
|
18864
18869
|
rgb: function () {
|
|
18865
18870
|
return this;
|
|
18866
18871
|
},
|
|
18872
|
+
clamp: function clamp() {
|
|
18873
|
+
return new Rgb(clampi(this.r), clampi(this.g), clampi(this.b), clampa(this.opacity));
|
|
18874
|
+
},
|
|
18867
18875
|
displayable: function displayable() {
|
|
18868
18876
|
return -.5 <= this.r && this.r < 255.5 && -.5 <= this.g && this.g < 255.5 && -.5 <= this.b && this.b < 255.5 && 0 <= this.opacity && this.opacity <= 1;
|
|
18869
18877
|
},
|
|
18870
18878
|
hex: rgb_formatHex,
|
|
18871
18879
|
// Deprecated! Use color.formatHex.
|
|
18872
18880
|
formatHex: rgb_formatHex,
|
|
18881
|
+
formatHex8: rgb_formatHex8,
|
|
18873
18882
|
formatRgb: rgb_formatRgb,
|
|
18874
18883
|
toString: rgb_formatRgb
|
|
18875
18884
|
}));
|
|
@@ -18878,14 +18887,25 @@ function rgb_formatHex() {
|
|
|
18878
18887
|
return "#" + hex(this.r) + hex(this.g) + hex(this.b);
|
|
18879
18888
|
}
|
|
18880
18889
|
|
|
18890
|
+
function rgb_formatHex8() {
|
|
18891
|
+
return "#" + hex(this.r) + hex(this.g) + hex(this.b) + hex((isNaN(this.opacity) ? 1 : this.opacity) * 255);
|
|
18892
|
+
}
|
|
18893
|
+
|
|
18881
18894
|
function rgb_formatRgb() {
|
|
18882
|
-
var a = this.opacity;
|
|
18883
|
-
|
|
18884
|
-
|
|
18895
|
+
var a = clampa(this.opacity);
|
|
18896
|
+
return "" + (a === 1 ? "rgb(" : "rgba(") + clampi(this.r) + ", " + clampi(this.g) + ", " + clampi(this.b) + (a === 1 ? ")" : ", " + a + ")");
|
|
18897
|
+
}
|
|
18898
|
+
|
|
18899
|
+
function clampa(opacity) {
|
|
18900
|
+
return isNaN(opacity) ? 1 : Math.max(0, Math.min(1, opacity));
|
|
18901
|
+
}
|
|
18902
|
+
|
|
18903
|
+
function clampi(value) {
|
|
18904
|
+
return Math.max(0, Math.min(255, Math.round(value) || 0));
|
|
18885
18905
|
}
|
|
18886
18906
|
|
|
18887
18907
|
function hex(value) {
|
|
18888
|
-
value =
|
|
18908
|
+
value = clampi(value);
|
|
18889
18909
|
return (value < 16 ? "0" : "") + value.toString(16);
|
|
18890
18910
|
}
|
|
18891
18911
|
|
|
@@ -18947,17 +18967,29 @@ src_define(Hsl, hsl, extend(Color, {
|
|
|
18947
18967
|
m1 = 2 * l - m2;
|
|
18948
18968
|
return new Rgb(hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2), hsl2rgb(h, m1, m2), hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2), this.opacity);
|
|
18949
18969
|
},
|
|
18970
|
+
clamp: function clamp() {
|
|
18971
|
+
return new Hsl(clamph(this.h), clampt(this.s), clampt(this.l), clampa(this.opacity));
|
|
18972
|
+
},
|
|
18950
18973
|
displayable: function displayable() {
|
|
18951
18974
|
return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && 0 <= this.l && this.l <= 1 && 0 <= this.opacity && this.opacity <= 1;
|
|
18952
18975
|
},
|
|
18953
18976
|
formatHsl: function formatHsl() {
|
|
18954
|
-
var a = this.opacity;
|
|
18955
|
-
|
|
18956
|
-
return (a === 1 ? "hsl(" : "hsla(") + (this.h || 0) + ", " + (this.s || 0) * 100 + "%, " + (this.l || 0) * 100 + "%" + (a === 1 ? ")" : ", " + a + ")");
|
|
18977
|
+
var a = clampa(this.opacity);
|
|
18978
|
+
return "" + (a === 1 ? "hsl(" : "hsla(") + clamph(this.h) + ", " + clampt(this.s) * 100 + "%, " + clampt(this.l) * 100 + "%" + (a === 1 ? ")" : ", " + a + ")");
|
|
18957
18979
|
}
|
|
18958
18980
|
}));
|
|
18981
|
+
|
|
18982
|
+
function clamph(value) {
|
|
18983
|
+
value = (value || 0) % 360;
|
|
18984
|
+
return value < 0 ? value + 360 : value;
|
|
18985
|
+
}
|
|
18986
|
+
|
|
18987
|
+
function clampt(value) {
|
|
18988
|
+
return Math.max(0, Math.min(1, value || 0));
|
|
18989
|
+
}
|
|
18959
18990
|
/* From FvD 13.37, CSS Color Module Level 3 */
|
|
18960
18991
|
|
|
18992
|
+
|
|
18961
18993
|
function hsl2rgb(h, m1, m2) {
|
|
18962
18994
|
return (h < 60 ? m1 + (m2 - m1) * h / 60 : h < 180 ? m2 : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60 : m1) * 255;
|
|
18963
18995
|
}
|
|
@@ -21891,9 +21923,13 @@ function parseDate(date) {
|
|
|
21891
21923
|
if (date instanceof Date) {
|
|
21892
21924
|
parsedDate = date;
|
|
21893
21925
|
} else if (isString(date)) {
|
|
21894
|
-
var
|
|
21926
|
+
var _format$dataTime,
|
|
21927
|
+
config = this.config,
|
|
21895
21928
|
format = this.format;
|
|
21896
|
-
|
|
21929
|
+
|
|
21930
|
+
// if fails to parse, try by new Date()
|
|
21931
|
+
// https://github.com/naver/billboard.js/issues/1714
|
|
21932
|
+
parsedDate = (_format$dataTime = format.dataTime(config.data_xFormat)(date)) != null ? _format$dataTime : new Date(date);
|
|
21897
21933
|
} else if (isNumber(date) && !isNaN(date)) {
|
|
21898
21934
|
parsedDate = new Date(+date);
|
|
21899
21935
|
}
|
|
@@ -21912,7 +21948,7 @@ function parseDate(date) {
|
|
|
21912
21948
|
|
|
21913
21949
|
|
|
21914
21950
|
function isTabVisible() {
|
|
21915
|
-
return !browser_doc.
|
|
21951
|
+
return (browser_doc == null ? void 0 : browser_doc.hidden) === !1 || (browser_doc == null ? void 0 : browser_doc.visibilityState) === "visible";
|
|
21916
21952
|
}
|
|
21917
21953
|
/**
|
|
21918
21954
|
* Get the current input type
|
|
@@ -21953,8 +21989,9 @@ function convertInputType(mouse, touch) {
|
|
|
21953
21989
|
|
|
21954
21990
|
var hasMouse = mouse && ["any-hover:hover", "any-pointer:fine"].some(function (v) {
|
|
21955
21991
|
return matchMedia == null ? void 0 : matchMedia("(" + v + ")").matches;
|
|
21956
|
-
});
|
|
21957
|
-
|
|
21992
|
+
}); // fallback to 'mouse' if no input type is detected.
|
|
21993
|
+
|
|
21994
|
+
return hasMouse && "mouse" || hasTouch && "touch" || "mouse";
|
|
21958
21995
|
}
|
|
21959
21996
|
;// CONCATENATED MODULE: ./src/module/error.ts
|
|
21960
21997
|
|
|
@@ -22610,6 +22647,21 @@ var Store = /*#__PURE__*/function () {
|
|
|
22610
22647
|
*/
|
|
22611
22648
|
resize_auto: !0,
|
|
22612
22649
|
|
|
22650
|
+
/**
|
|
22651
|
+
* Set a callback to execute when the chart is clicked.
|
|
22652
|
+
* @name onclick
|
|
22653
|
+
* @memberof Options
|
|
22654
|
+
* @type {Function}
|
|
22655
|
+
* @default undefined
|
|
22656
|
+
* @example
|
|
22657
|
+
* onclick: function(event) {
|
|
22658
|
+
* this; // chart instance itself
|
|
22659
|
+
* event; // native event object
|
|
22660
|
+
* ...
|
|
22661
|
+
* }
|
|
22662
|
+
*/
|
|
22663
|
+
onclick: undefined,
|
|
22664
|
+
|
|
22613
22665
|
/**
|
|
22614
22666
|
* Set a callback to execute when mouse/touch enters the chart.
|
|
22615
22667
|
* @name onover
|
|
@@ -22617,8 +22669,9 @@ var Store = /*#__PURE__*/function () {
|
|
|
22617
22669
|
* @type {Function}
|
|
22618
22670
|
* @default undefined
|
|
22619
22671
|
* @example
|
|
22620
|
-
* onover: function() {
|
|
22672
|
+
* onover: function(event) {
|
|
22621
22673
|
* this; // chart instance itself
|
|
22674
|
+
* event; // native event object
|
|
22622
22675
|
* ...
|
|
22623
22676
|
* }
|
|
22624
22677
|
*/
|
|
@@ -22631,8 +22684,9 @@ var Store = /*#__PURE__*/function () {
|
|
|
22631
22684
|
* @type {Function}
|
|
22632
22685
|
* @default undefined
|
|
22633
22686
|
* @example
|
|
22634
|
-
* onout: function() {
|
|
22687
|
+
* onout: function(event) {
|
|
22635
22688
|
* this; // chart instance itself
|
|
22689
|
+
* event; // native event object
|
|
22636
22690
|
* ...
|
|
22637
22691
|
* }
|
|
22638
22692
|
*/
|
|
@@ -24395,28 +24449,38 @@ function generateResize() {
|
|
|
24395
24449
|
|
|
24396
24450
|
return callResizeFn;
|
|
24397
24451
|
}
|
|
24452
|
+
|
|
24398
24453
|
/**
|
|
24399
24454
|
* Generate transition queue function
|
|
24400
24455
|
* @returns {Function}
|
|
24401
24456
|
* @private
|
|
24402
24457
|
*/
|
|
24403
|
-
|
|
24404
24458
|
function generateWait() {
|
|
24405
24459
|
var transitionsToWait = [],
|
|
24406
|
-
f = function (
|
|
24407
|
-
var timer;
|
|
24460
|
+
f = function (selection, callback) {
|
|
24461
|
+
var timer;
|
|
24462
|
+
/**
|
|
24463
|
+
* Check if transition is complete
|
|
24464
|
+
* @private
|
|
24465
|
+
*/
|
|
24408
24466
|
|
|
24409
24467
|
function loop() {
|
|
24410
24468
|
var done = 0;
|
|
24411
24469
|
|
|
24412
|
-
for (var i = 0,
|
|
24413
|
-
if (
|
|
24470
|
+
for (var i = 0, t; t = transitionsToWait[i]; i++) {
|
|
24471
|
+
if (t === !0 || t.empty != null && t.empty()) {
|
|
24414
24472
|
done++;
|
|
24415
24473
|
continue;
|
|
24474
|
+
} // when tab isn't visible exit loop
|
|
24475
|
+
|
|
24476
|
+
|
|
24477
|
+
if (isTabVisible() === !1) {
|
|
24478
|
+
done = transitionsToWait.length;
|
|
24479
|
+
break;
|
|
24416
24480
|
}
|
|
24417
24481
|
|
|
24418
24482
|
try {
|
|
24419
|
-
|
|
24483
|
+
t.transition();
|
|
24420
24484
|
} catch (e) {
|
|
24421
24485
|
done++;
|
|
24422
24486
|
}
|
|
@@ -24432,7 +24496,8 @@ function generateWait() {
|
|
|
24432
24496
|
}
|
|
24433
24497
|
|
|
24434
24498
|
loop();
|
|
24435
|
-
};
|
|
24499
|
+
}; // 'f' is called as selection.call(f, ...);
|
|
24500
|
+
|
|
24436
24501
|
|
|
24437
24502
|
f.add = function (t) {
|
|
24438
24503
|
isArray(t) ? transitionsToWait = transitionsToWait.concat(t) : transitionsToWait.push(t);
|
|
@@ -28761,23 +28826,34 @@ function tickStep(start, stop, count) {
|
|
|
28761
28826
|
function ascending_ascending(a, b) {
|
|
28762
28827
|
return a == null || b == null ? NaN : a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;
|
|
28763
28828
|
}
|
|
28829
|
+
;// CONCATENATED MODULE: ./node_modules/d3-array/src/descending.js
|
|
28830
|
+
function descending(a, b) {
|
|
28831
|
+
return a == null || b == null ? NaN : b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN;
|
|
28832
|
+
}
|
|
28764
28833
|
;// CONCATENATED MODULE: ./node_modules/d3-array/src/bisector.js
|
|
28765
28834
|
|
|
28835
|
+
|
|
28766
28836
|
function bisector(f) {
|
|
28767
|
-
var delta
|
|
28768
|
-
|
|
28769
|
-
|
|
28837
|
+
var compare1, compare2, delta; // If an accessor is specified, promote it to a comparator. In this case we
|
|
28838
|
+
// can test whether the search value is (self-) comparable. We can’t do this
|
|
28839
|
+
// for a comparator (except for specific, known comparators) because we can’t
|
|
28840
|
+
// tell if the comparator is symmetric, and an asymmetric comparator can’t be
|
|
28841
|
+
// used to test whether a single value is comparable.
|
|
28770
28842
|
|
|
28771
28843
|
if (f.length !== 2) {
|
|
28772
|
-
delta = function (d, x) {
|
|
28773
|
-
return f(d) - x;
|
|
28774
|
-
};
|
|
28775
|
-
|
|
28776
28844
|
compare1 = ascending_ascending;
|
|
28777
28845
|
|
|
28778
28846
|
compare2 = function (d, x) {
|
|
28779
28847
|
return ascending_ascending(f(d), x);
|
|
28780
28848
|
};
|
|
28849
|
+
|
|
28850
|
+
delta = function (d, x) {
|
|
28851
|
+
return f(d) - x;
|
|
28852
|
+
};
|
|
28853
|
+
} else {
|
|
28854
|
+
compare1 = f === ascending_ascending || f === descending ? f : bisector_zero;
|
|
28855
|
+
compare2 = f;
|
|
28856
|
+
delta = f;
|
|
28781
28857
|
}
|
|
28782
28858
|
|
|
28783
28859
|
function left(a, x, lo, hi) {
|
|
@@ -28841,6 +28917,10 @@ function bisector(f) {
|
|
|
28841
28917
|
right: right
|
|
28842
28918
|
};
|
|
28843
28919
|
}
|
|
28920
|
+
|
|
28921
|
+
function bisector_zero() {
|
|
28922
|
+
return 0;
|
|
28923
|
+
}
|
|
28844
28924
|
;// CONCATENATED MODULE: ./node_modules/d3-array/src/number.js
|
|
28845
28925
|
|
|
28846
28926
|
|
|
@@ -33783,10 +33863,9 @@ var ChartInternal = /*#__PURE__*/function () {
|
|
|
33783
33863
|
|
|
33784
33864
|
_proto.initParams = function initParams() {
|
|
33785
33865
|
var $$ = this,
|
|
33786
|
-
|
|
33787
|
-
|
|
33788
|
-
|
|
33789
|
-
state = _ref.state,
|
|
33866
|
+
config = $$.config,
|
|
33867
|
+
format = $$.format,
|
|
33868
|
+
state = $$.state,
|
|
33790
33869
|
isRotated = config.axis_rotated;
|
|
33791
33870
|
// datetime to be used for uniqueness
|
|
33792
33871
|
state.datetimeId = "bb-" + +new Date() * getRandom();
|
|
@@ -33890,12 +33969,16 @@ var ChartInternal = /*#__PURE__*/function () {
|
|
|
33890
33969
|
$el.svg = $el.chart.append("svg").style("overflow", "hidden").style("display", "block");
|
|
33891
33970
|
|
|
33892
33971
|
if (hasInteraction && state.inputType) {
|
|
33893
|
-
var
|
|
33894
|
-
|
|
33895
|
-
|
|
33896
|
-
|
|
33897
|
-
|
|
33898
|
-
|
|
33972
|
+
var _onclick,
|
|
33973
|
+
_onover,
|
|
33974
|
+
_onout,
|
|
33975
|
+
isTouch = state.inputType === "touch",
|
|
33976
|
+
_config = config,
|
|
33977
|
+
onclick = _config.onclick,
|
|
33978
|
+
onover = _config.onover,
|
|
33979
|
+
onout = _config.onout;
|
|
33980
|
+
|
|
33981
|
+
$el.svg.on("click", ((_onclick = onclick) == null ? void 0 : _onclick.bind($$.api)) || null).on(isTouch ? "touchstart" : "mouseenter", ((_onover = onover) == null ? void 0 : _onover.bind($$.api)) || null).on(isTouch ? "touchend" : "mouseleave", ((_onout = onout) == null ? void 0 : _onout.bind($$.api)) || null);
|
|
33899
33982
|
}
|
|
33900
33983
|
|
|
33901
33984
|
config.svg_classname && $el.svg.attr("class", config.svg_classname); // Define defs
|
|
@@ -34143,27 +34226,40 @@ var ChartInternal = /*#__PURE__*/function () {
|
|
|
34143
34226
|
}
|
|
34144
34227
|
|
|
34145
34228
|
helper(_type);
|
|
34146
|
-
} //
|
|
34229
|
+
} // Point types
|
|
34230
|
+
|
|
34147
34231
|
|
|
34232
|
+
var hasPointType = $$.hasType("bubble") || $$.hasType("scatter");
|
|
34148
34233
|
|
|
34149
|
-
if (
|
|
34234
|
+
if (hasPointType) {
|
|
34150
34235
|
$$.updateTargetForCircle == null ? void 0 : $$.updateTargetForCircle();
|
|
34151
34236
|
} // Fade-in each chart
|
|
34152
34237
|
|
|
34153
34238
|
|
|
34154
|
-
$$.
|
|
34239
|
+
$$.filterTargetsToShowAtInit(hasPointType);
|
|
34155
34240
|
}
|
|
34156
34241
|
/**
|
|
34157
|
-
* Display targeted elements
|
|
34242
|
+
* Display targeted elements at initialization
|
|
34243
|
+
* @param {boolean} hasPointType whether has point type(bubble, scatter) or not
|
|
34158
34244
|
* @private
|
|
34159
34245
|
*/
|
|
34160
34246
|
;
|
|
34161
34247
|
|
|
34162
|
-
_proto.
|
|
34248
|
+
_proto.filterTargetsToShowAtInit = function filterTargetsToShowAtInit(hasPointType) {
|
|
34249
|
+
if (hasPointType === void 0) {
|
|
34250
|
+
hasPointType = !1;
|
|
34251
|
+
}
|
|
34252
|
+
|
|
34163
34253
|
var $$ = this,
|
|
34164
34254
|
svg = $$.$el.svg,
|
|
34165
|
-
$T = $$.$T
|
|
34166
|
-
|
|
34255
|
+
$T = $$.$T,
|
|
34256
|
+
selector = "." + $COMMON.target;
|
|
34257
|
+
|
|
34258
|
+
if (hasPointType) {
|
|
34259
|
+
selector += ", ." + $CIRCLE.chartCircles + " > ." + $CIRCLE.circles;
|
|
34260
|
+
}
|
|
34261
|
+
|
|
34262
|
+
$T(svg.selectAll(selector).filter(function (d) {
|
|
34167
34263
|
return $$.isTargetToShow(d.id);
|
|
34168
34264
|
})).style("opacity", null);
|
|
34169
34265
|
};
|
|
@@ -34198,8 +34294,9 @@ var ChartInternal = /*#__PURE__*/function () {
|
|
|
34198
34294
|
|
|
34199
34295
|
_proto.initialOpacity = function initialOpacity(d) {
|
|
34200
34296
|
var $$ = this,
|
|
34201
|
-
withoutFadeIn = $$.state.withoutFadeIn
|
|
34202
|
-
|
|
34297
|
+
withoutFadeIn = $$.state.withoutFadeIn,
|
|
34298
|
+
r = $$.getBaseValue(d) !== null && withoutFadeIn[d.id] ? null : "0";
|
|
34299
|
+
return r;
|
|
34203
34300
|
};
|
|
34204
34301
|
|
|
34205
34302
|
_proto.bindResize = function bindResize() {
|
|
@@ -35647,6 +35744,7 @@ util_extend(Chart.prototype, [chart, api_color, api_data, api_export, api_focus,
|
|
|
35647
35744
|
* billboard.js project is licensed under the MIT license
|
|
35648
35745
|
*/
|
|
35649
35746
|
|
|
35747
|
+
|
|
35650
35748
|
/**
|
|
35651
35749
|
* Set the min/max value
|
|
35652
35750
|
* @param {Chart} $$ Chart instance
|
|
@@ -35654,20 +35752,26 @@ util_extend(Chart.prototype, [chart, api_color, api_data, api_export, api_focus,
|
|
|
35654
35752
|
* @param {object} value Value to be set
|
|
35655
35753
|
* @private
|
|
35656
35754
|
*/
|
|
35657
|
-
|
|
35658
35755
|
function setMinMax($$, type, value) {
|
|
35659
35756
|
var config = $$.config,
|
|
35660
|
-
|
|
35661
|
-
|
|
35757
|
+
helper = function (key, value) {
|
|
35758
|
+
var v = isNumber(value) ? value : value === !1 ? undefined : null;
|
|
35759
|
+
|
|
35760
|
+
if (v !== null) {
|
|
35761
|
+
config["axis_" + key + "_" + type] = v;
|
|
35762
|
+
}
|
|
35763
|
+
};
|
|
35662
35764
|
|
|
35663
35765
|
if (isDefined(value)) {
|
|
35664
35766
|
if (isObjectType(value)) {
|
|
35665
|
-
|
|
35666
|
-
|
|
35667
|
-
|
|
35668
|
-
} else {
|
|
35669
|
-
|
|
35670
|
-
|
|
35767
|
+
Object.keys(value).forEach(function (key) {
|
|
35768
|
+
helper(key, value[key]);
|
|
35769
|
+
});
|
|
35770
|
+
} else if (isNumber(value) || value === !1) {
|
|
35771
|
+
// shorthand values affects only y and y2.
|
|
35772
|
+
["y", "y2"].forEach(function (key) {
|
|
35773
|
+
helper(key, value);
|
|
35774
|
+
});
|
|
35671
35775
|
}
|
|
35672
35776
|
|
|
35673
35777
|
$$.redraw({
|
|
@@ -35753,8 +35857,9 @@ var axis = {
|
|
|
35753
35857
|
* @instance
|
|
35754
35858
|
* @memberof Chart
|
|
35755
35859
|
* @param {object} min If min is given, specified axis' min value will be updated.<br>
|
|
35756
|
-
*
|
|
35757
|
-
*
|
|
35860
|
+
* If no argument is given, the min values set on generating option for each axis will be returned.
|
|
35861
|
+
* If not set any min values on generation, it will return `undefined`.<br>
|
|
35862
|
+
* To unset specific axis max, set `false` to each of them.
|
|
35758
35863
|
* @returns {object|undefined}
|
|
35759
35864
|
* @example
|
|
35760
35865
|
* // Update axis' min
|
|
@@ -35763,10 +35868,21 @@ var axis = {
|
|
|
35763
35868
|
* y: 1000,
|
|
35764
35869
|
* y2: 100
|
|
35765
35870
|
* });
|
|
35871
|
+
*
|
|
35872
|
+
* // To unset specific axis min, set false to each of them.
|
|
35873
|
+
* chart.axis.min({
|
|
35874
|
+
* x: false,
|
|
35875
|
+
* y: false,
|
|
35876
|
+
* y2: false
|
|
35877
|
+
* });
|
|
35878
|
+
*
|
|
35879
|
+
* // shorthand (only affects y and y2 axis)
|
|
35880
|
+
* chart.axis.min(-50);
|
|
35881
|
+
* chart.axis.min(false);
|
|
35766
35882
|
*/
|
|
35767
35883
|
min: function min(_min) {
|
|
35768
35884
|
var $$ = this.internal;
|
|
35769
|
-
return isValue(_min) ? setMinMax($$, "min", _min) : axis_getMinMax($$, "min");
|
|
35885
|
+
return isValue(_min) || _min === !1 ? setMinMax($$, "min", _min) : axis_getMinMax($$, "min");
|
|
35770
35886
|
},
|
|
35771
35887
|
|
|
35772
35888
|
/**
|
|
@@ -35775,8 +35891,9 @@ var axis = {
|
|
|
35775
35891
|
* @instance
|
|
35776
35892
|
* @memberof Chart
|
|
35777
35893
|
* @param {object} max If max is given, specified axis' max value will be updated.<br>
|
|
35778
|
-
*
|
|
35779
|
-
*
|
|
35894
|
+
* If no argument is given, the max values set on generating option for each axis will be returned.
|
|
35895
|
+
* If not set any max values on generation, it will return `undefined`.<br>
|
|
35896
|
+
* To unset specific axis max, set `false` to each of them.
|
|
35780
35897
|
* @returns {object|undefined}
|
|
35781
35898
|
* @example
|
|
35782
35899
|
* // Update axis' label
|
|
@@ -35785,10 +35902,21 @@ var axis = {
|
|
|
35785
35902
|
* y: 1000,
|
|
35786
35903
|
* y2: 10000
|
|
35787
35904
|
* });
|
|
35905
|
+
*
|
|
35906
|
+
* // To unset specific axis max, set false to each of them.
|
|
35907
|
+
* chart.axis.max({
|
|
35908
|
+
* x: false,
|
|
35909
|
+
* y: false,
|
|
35910
|
+
* y2: false
|
|
35911
|
+
* });
|
|
35912
|
+
*
|
|
35913
|
+
* // shorthand (only affects y and y2 axis)
|
|
35914
|
+
* chart.axis.max(10);
|
|
35915
|
+
* chart.axis.max(false);
|
|
35788
35916
|
*/
|
|
35789
35917
|
max: function max(_max) {
|
|
35790
35918
|
var $$ = this.internal;
|
|
35791
|
-
return
|
|
35919
|
+
return isValue(_max) || _max === !1 ? setMinMax($$, "max", _max) : axis_getMinMax($$, "max");
|
|
35792
35920
|
},
|
|
35793
35921
|
|
|
35794
35922
|
/**
|
|
@@ -35796,7 +35924,9 @@ var axis = {
|
|
|
35796
35924
|
* @function axis․range
|
|
35797
35925
|
* @instance
|
|
35798
35926
|
* @memberof Chart
|
|
35799
|
-
* @param {object} range If range is given, specified axis' min and max value will be updated.
|
|
35927
|
+
* @param {object} range If range is given, specified axis' min and max value will be updated.
|
|
35928
|
+
* If no argument is given, the current min and max values for each axis will be returned.<br>
|
|
35929
|
+
* To unset specific axis max, set `false` to each of them.
|
|
35800
35930
|
* @returns {object|undefined}
|
|
35801
35931
|
* @example
|
|
35802
35932
|
* // Update axis' label
|
|
@@ -35812,13 +35942,33 @@ var axis = {
|
|
|
35812
35942
|
* y2: 10000
|
|
35813
35943
|
* },
|
|
35814
35944
|
* });
|
|
35945
|
+
*
|
|
35946
|
+
* // To unset specific axis max, set false to each of them.
|
|
35947
|
+
* chart.axis.range({
|
|
35948
|
+
* min: {
|
|
35949
|
+
* x: false,
|
|
35950
|
+
* y: false,
|
|
35951
|
+
* y2: false
|
|
35952
|
+
* },
|
|
35953
|
+
* max: {
|
|
35954
|
+
* x: false,
|
|
35955
|
+
* y: false,
|
|
35956
|
+
* y2: false
|
|
35957
|
+
* },
|
|
35958
|
+
* });
|
|
35959
|
+
*
|
|
35960
|
+
* // shorthand (only affects y and y2 axis)
|
|
35961
|
+
* chart.axis.range({ min: -50, max: 1000 });
|
|
35962
|
+
* chart.axis.range({ min: false, max: false });
|
|
35815
35963
|
*/
|
|
35816
35964
|
range: function range(_range) {
|
|
35817
35965
|
var axis = this.axis;
|
|
35818
35966
|
|
|
35819
35967
|
if (arguments.length) {
|
|
35820
|
-
|
|
35821
|
-
|
|
35968
|
+
var min = _range.min,
|
|
35969
|
+
max = _range.max;
|
|
35970
|
+
isDefined(max) && axis.max(max);
|
|
35971
|
+
isDefined(min) && axis.min(min);
|
|
35822
35972
|
} else {
|
|
35823
35973
|
return {
|
|
35824
35974
|
max: axis.max(),
|
|
@@ -38945,7 +39095,9 @@ var src_linear_linear = function (t) {
|
|
|
38945
39095
|
} else if (orgDataCount === 1 || ((_flowStart = flowStart) == null ? void 0 : _flowStart.x) === ((_flowEnd = flowEnd) == null ? void 0 : _flowEnd.x)) {
|
|
38946
39096
|
translateX = x(orgDomain[0]) - x(domain[0]);
|
|
38947
39097
|
} else {
|
|
38948
|
-
|
|
39098
|
+
var _flowStart2;
|
|
39099
|
+
|
|
39100
|
+
translateX = $$.axis.isTimeSeries() ? x(orgDomain[0]) - x(domain[0]) : x(((_flowStart2 = flowStart) == null ? void 0 : _flowStart2.x) || 0) - x(flowEnd.x);
|
|
38949
39101
|
}
|
|
38950
39102
|
|
|
38951
39103
|
var scaleX = diffDomain(orgDomain) / diffDomain(domain);
|
|
@@ -41713,7 +41865,7 @@ var slice = Array.prototype.slice;
|
|
|
41713
41865
|
};
|
|
41714
41866
|
}
|
|
41715
41867
|
;// CONCATENATED MODULE: ./node_modules/d3-shape/src/descending.js
|
|
41716
|
-
/* harmony default export */ function
|
|
41868
|
+
/* harmony default export */ function src_descending(a, b) {
|
|
41717
41869
|
return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN;
|
|
41718
41870
|
}
|
|
41719
41871
|
;// CONCATENATED MODULE: ./node_modules/d3-shape/src/identity.js
|
|
@@ -41728,7 +41880,7 @@ var slice = Array.prototype.slice;
|
|
|
41728
41880
|
|
|
41729
41881
|
/* harmony default export */ function pie() {
|
|
41730
41882
|
var value = d3_shape_src_identity,
|
|
41731
|
-
sortValues =
|
|
41883
|
+
sortValues = src_descending,
|
|
41732
41884
|
sort = null,
|
|
41733
41885
|
startAngle = d3_shape_src_constant(0),
|
|
41734
41886
|
endAngle = d3_shape_src_constant(tau),
|
|
@@ -42390,7 +42542,7 @@ function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {
|
|
|
42390
42542
|
|
|
42391
42543
|
/**
|
|
42392
42544
|
* Set transform attributes to arc label text
|
|
42393
|
-
* @param {
|
|
42545
|
+
* @param {object} d Data object
|
|
42394
42546
|
* @returns {string} Translate attribute string
|
|
42395
42547
|
* @private
|
|
42396
42548
|
*/
|
|
@@ -43384,7 +43536,7 @@ function point_y(p) {
|
|
|
43384
43536
|
|
|
43385
43537
|
/**
|
|
43386
43538
|
* Determine if given stacking bar data is radius type
|
|
43387
|
-
* @param {
|
|
43539
|
+
* @param {object} d Data row
|
|
43388
43540
|
* @returns {boolean}
|
|
43389
43541
|
*/
|
|
43390
43542
|
isStackingRadiusData: function isStackingRadiusData(d) {
|
|
@@ -44243,7 +44395,7 @@ var getTransitionName = function () {
|
|
|
44243
44395
|
targets = data.targets.filter(function (d) {
|
|
44244
44396
|
return _this.isScatterType(d) || _this.isBubbleType(d);
|
|
44245
44397
|
});
|
|
44246
|
-
var mainCircle = $el.main.select("." + $CIRCLE.chartCircles).style("pointer-events", "none").selectAll("." + $CIRCLE.circles).data(targets)
|
|
44398
|
+
var mainCircle = $el.main.select("." + $CIRCLE.chartCircles).style("pointer-events", "none").selectAll("." + $CIRCLE.circles).data(targets);
|
|
44247
44399
|
mainCircle.exit().remove();
|
|
44248
44400
|
enterNode = mainCircle.enter();
|
|
44249
44401
|
} // Circles for each data point on lines
|
|
@@ -44254,6 +44406,10 @@ var getTransitionName = function () {
|
|
|
44254
44406
|
});
|
|
44255
44407
|
enterNode.append("g").attr("class", classCircles).style("cursor", function (d) {
|
|
44256
44408
|
return isFunction(isSelectable) && isSelectable(d) ? "pointer" : null;
|
|
44409
|
+
}).style("opacity", function () {
|
|
44410
|
+
var parent = src_select(this.parentNode); // if the parent node is .bb-chart-circles (bubble, scatter), initialize <g bb-circles> with opacity "0"
|
|
44411
|
+
|
|
44412
|
+
return parent.attr("class").indexOf($CIRCLE.chartCircles) > -1 ? "0" : null;
|
|
44257
44413
|
}); // Update date for selected circles
|
|
44258
44414
|
|
|
44259
44415
|
selectionEnabled && targets.forEach(function (t) {
|
|
@@ -48754,7 +48910,7 @@ var _defaults = {},
|
|
|
48754
48910
|
* bb.version; // "1.0.0"
|
|
48755
48911
|
* @memberof bb
|
|
48756
48912
|
*/
|
|
48757
|
-
version: "3.4.
|
|
48913
|
+
version: "3.4.1",
|
|
48758
48914
|
|
|
48759
48915
|
/**
|
|
48760
48916
|
* Generate chart
|
|
@@ -48889,7 +49045,7 @@ var _defaults = {},
|
|
|
48889
49045
|
};
|
|
48890
49046
|
/**
|
|
48891
49047
|
* @namespace bb
|
|
48892
|
-
* @version 3.4.
|
|
49048
|
+
* @version 3.4.1
|
|
48893
49049
|
*/
|
|
48894
49050
|
;// CONCATENATED MODULE: ./src/index.ts
|
|
48895
49051
|
/**
|