billboard.js 3.3.3 → 3.4.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/dist/billboard.css +19 -14
- package/dist/billboard.js +504 -112
- package/dist/billboard.min.css +2 -2
- package/dist/billboard.min.js +2 -2
- package/dist/billboard.pkgd.js +550 -126
- 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 +34 -18
- package/dist/plugin/billboardjs-plugin-sparkline.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-stanford.js +34 -18
- package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-tableview.js +29 -15
- package/dist/plugin/billboardjs-plugin-tableview.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-textoverlap.js +29 -15
- 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 +80 -32
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.js +80 -32
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.js +75 -29
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.js +75 -29
- package/dist/theme/datalab.css +24 -20
- package/dist/theme/datalab.min.css +2 -2
- package/dist/theme/graph.css +24 -20
- package/dist/theme/graph.min.css +2 -2
- package/dist/theme/insight.css +24 -20
- package/dist/theme/insight.min.css +2 -2
- package/dist-esm/billboard.js +446 -99
- package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-sparkline.js +3 -5
- package/dist-esm/plugin/billboardjs-plugin-stanford.js +8 -7
- package/dist-esm/plugin/billboardjs-plugin-tableview.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +2 -2
- package/package.json +21 -21
- package/src/Chart/api/axis.ts +90 -25
- package/src/Chart/api/focus.ts +3 -2
- package/src/ChartInternal/Axis/Axis.ts +8 -6
- package/src/ChartInternal/ChartInternal.ts +48 -23
- package/src/ChartInternal/data/data.ts +1 -1
- package/src/ChartInternal/interactions/flow.ts +1 -1
- package/src/ChartInternal/internals/color.ts +4 -3
- package/src/ChartInternal/internals/format.ts +5 -1
- package/src/ChartInternal/internals/redraw.ts +3 -0
- package/src/ChartInternal/internals/text.ts +1 -1
- package/src/ChartInternal/internals/transform.ts +4 -1
- package/src/ChartInternal/internals/type.ts +5 -0
- package/src/ChartInternal/shape/arc.ts +41 -17
- package/src/ChartInternal/shape/bar.ts +1 -1
- package/src/ChartInternal/shape/point.ts +6 -3
- package/src/ChartInternal/shape/polar.ts +132 -0
- package/src/ChartInternal/shape/radar.ts +4 -4
- package/src/config/Options/common/main.ts +19 -2
- package/src/config/Options/data/data.ts +3 -0
- package/src/config/Options/shape/polar.ts +81 -0
- package/src/config/classes.ts +6 -3
- package/src/config/const.ts +3 -0
- package/src/config/resolver/shape.ts +4 -0
- package/src/core.ts +1 -0
- package/src/index.esm.ts +1 -0
- package/src/module/generator.ts +19 -5
- package/src/module/util.ts +22 -9
- package/src/scss/billboard.scss +13 -0
- package/src/scss/theme/datalab.scss +13 -0
- package/src/scss/theme/graph.scss +13 -0
- package/src/scss/theme/insight.scss +13 -0
- package/types/bb.d.ts +1 -0
- package/types/chart.d.ts +8 -8
- package/types/options.d.ts +79 -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.
|
|
8
|
+
* @version 3.4.0
|
|
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
|
|
@@ -16311,6 +16311,7 @@ __webpack_require__.d(resolver_shape_namespaceObject, {
|
|
|
16311
16311
|
"gauge": function() { return resolver_shape_gauge; },
|
|
16312
16312
|
"line": function() { return resolver_shape_line; },
|
|
16313
16313
|
"pie": function() { return resolver_shape_pie; },
|
|
16314
|
+
"polar": function() { return resolver_shape_polar; },
|
|
16314
16315
|
"radar": function() { return resolver_shape_radar; },
|
|
16315
16316
|
"scatter": function() { return shape_scatter; },
|
|
16316
16317
|
"spline": function() { return shape_spline; },
|
|
@@ -18345,6 +18346,7 @@ var TYPE = {
|
|
|
18345
18346
|
GAUGE: "gauge",
|
|
18346
18347
|
LINE: "line",
|
|
18347
18348
|
PIE: "pie",
|
|
18349
|
+
POLAR: "polar",
|
|
18348
18350
|
RADAR: "radar",
|
|
18349
18351
|
SCATTER: "scatter",
|
|
18350
18352
|
SPLINE: "spline",
|
|
@@ -18368,6 +18370,7 @@ var TYPE_METHOD_NEEDED = {
|
|
|
18368
18370
|
GAUGE: "initArc",
|
|
18369
18371
|
LINE: "initLine",
|
|
18370
18372
|
PIE: "initArc",
|
|
18373
|
+
POLAR: "initPolar",
|
|
18371
18374
|
RADAR: "initCircle",
|
|
18372
18375
|
SCATTER: "initCircle",
|
|
18373
18376
|
SPLINE: "initLine",
|
|
@@ -18381,7 +18384,7 @@ var TYPE_METHOD_NEEDED = {
|
|
|
18381
18384
|
var TYPE_BY_CATEGORY = {
|
|
18382
18385
|
Area: [TYPE.AREA, TYPE.AREA_SPLINE, TYPE.AREA_SPLINE_RANGE, TYPE.AREA_LINE_RANGE, TYPE.AREA_STEP],
|
|
18383
18386
|
AreaRange: [TYPE.AREA_SPLINE_RANGE, TYPE.AREA_LINE_RANGE],
|
|
18384
|
-
Arc: [TYPE.PIE, TYPE.DONUT, TYPE.GAUGE, TYPE.RADAR],
|
|
18387
|
+
Arc: [TYPE.PIE, TYPE.DONUT, TYPE.GAUGE, TYPE.POLAR, TYPE.RADAR],
|
|
18385
18388
|
Line: [TYPE.LINE, TYPE.SPLINE, TYPE.AREA, TYPE.AREA_SPLINE, TYPE.AREA_SPLINE_RANGE, TYPE.AREA_LINE_RANGE, TYPE.STEP, TYPE.AREA_STEP],
|
|
18386
18389
|
Step: [TYPE.STEP, TYPE.AREA_STEP],
|
|
18387
18390
|
Spline: [TYPE.SPLINE, TYPE.AREA_SPLINE, TYPE.AREA_SPLINE_RANGE]
|
|
@@ -18621,15 +18624,15 @@ var _brighter = 1 / _darker;
|
|
|
18621
18624
|
|
|
18622
18625
|
|
|
18623
18626
|
var reI = "\\s*([+-]?\\d+)\\s*",
|
|
18624
|
-
reN = "\\s*([+-]?\\d
|
|
18625
|
-
reP = "\\s*([+-]?\\d
|
|
18627
|
+
reN = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",
|
|
18628
|
+
reP = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",
|
|
18626
18629
|
reHex = /^#([0-9a-f]{3,8})$/,
|
|
18627
18630
|
reRgbInteger = new RegExp("^rgb\\(\\s*([+-]?\\d+)\\s*,\\s*([+-]?\\d+)\\s*,\\s*([+-]?\\d+)\\s*\\)$"),
|
|
18628
|
-
reRgbPercent = new RegExp("^rgb\\(\\s*([+-]?\\d
|
|
18629
|
-
reRgbaInteger = new RegExp("^rgba\\(\\s*([+-]?\\d+)\\s*,\\s*([+-]?\\d+)\\s*,\\s*([+-]?\\d+)\\s*,\\s*([+-]?\\d
|
|
18630
|
-
reRgbaPercent = new RegExp("^rgba\\(\\s*([+-]?\\d
|
|
18631
|
-
reHslPercent = new RegExp("^hsl\\(\\s*([+-]?\\d
|
|
18632
|
-
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*\\)$"),
|
|
18633
18636
|
named = {
|
|
18634
18637
|
aliceblue: 0xf0f8ff,
|
|
18635
18638
|
antiquewhite: 0xfaebd7,
|
|
@@ -18790,6 +18793,7 @@ src_define(Color, color, {
|
|
|
18790
18793
|
hex: color_formatHex,
|
|
18791
18794
|
// Deprecated! Use color.formatHex.
|
|
18792
18795
|
formatHex: color_formatHex,
|
|
18796
|
+
formatHex8: color_formatHex8,
|
|
18793
18797
|
formatHsl: color_formatHsl,
|
|
18794
18798
|
formatRgb: color_formatRgb,
|
|
18795
18799
|
toString: color_formatRgb
|
|
@@ -18799,6 +18803,10 @@ function color_formatHex() {
|
|
|
18799
18803
|
return this.rgb().formatHex();
|
|
18800
18804
|
}
|
|
18801
18805
|
|
|
18806
|
+
function color_formatHex8() {
|
|
18807
|
+
return this.rgb().formatHex8();
|
|
18808
|
+
}
|
|
18809
|
+
|
|
18802
18810
|
function color_formatHsl() {
|
|
18803
18811
|
return hslConvert(this).formatHsl();
|
|
18804
18812
|
}
|
|
@@ -18861,12 +18869,16 @@ src_define(Rgb, color_rgb, extend(Color, {
|
|
|
18861
18869
|
rgb: function () {
|
|
18862
18870
|
return this;
|
|
18863
18871
|
},
|
|
18872
|
+
clamp: function clamp() {
|
|
18873
|
+
return new Rgb(clampi(this.r), clampi(this.g), clampi(this.b), clampa(this.opacity));
|
|
18874
|
+
},
|
|
18864
18875
|
displayable: function displayable() {
|
|
18865
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;
|
|
18866
18877
|
},
|
|
18867
18878
|
hex: rgb_formatHex,
|
|
18868
18879
|
// Deprecated! Use color.formatHex.
|
|
18869
18880
|
formatHex: rgb_formatHex,
|
|
18881
|
+
formatHex8: rgb_formatHex8,
|
|
18870
18882
|
formatRgb: rgb_formatRgb,
|
|
18871
18883
|
toString: rgb_formatRgb
|
|
18872
18884
|
}));
|
|
@@ -18875,14 +18887,25 @@ function rgb_formatHex() {
|
|
|
18875
18887
|
return "#" + hex(this.r) + hex(this.g) + hex(this.b);
|
|
18876
18888
|
}
|
|
18877
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
|
+
|
|
18878
18894
|
function rgb_formatRgb() {
|
|
18879
|
-
var a = this.opacity;
|
|
18880
|
-
|
|
18881
|
-
|
|
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));
|
|
18882
18905
|
}
|
|
18883
18906
|
|
|
18884
18907
|
function hex(value) {
|
|
18885
|
-
value =
|
|
18908
|
+
value = clampi(value);
|
|
18886
18909
|
return (value < 16 ? "0" : "") + value.toString(16);
|
|
18887
18910
|
}
|
|
18888
18911
|
|
|
@@ -18944,17 +18967,29 @@ src_define(Hsl, hsl, extend(Color, {
|
|
|
18944
18967
|
m1 = 2 * l - m2;
|
|
18945
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);
|
|
18946
18969
|
},
|
|
18970
|
+
clamp: function clamp() {
|
|
18971
|
+
return new Hsl(clamph(this.h), clampt(this.s), clampt(this.l), clampa(this.opacity));
|
|
18972
|
+
},
|
|
18947
18973
|
displayable: function displayable() {
|
|
18948
18974
|
return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && 0 <= this.l && this.l <= 1 && 0 <= this.opacity && this.opacity <= 1;
|
|
18949
18975
|
},
|
|
18950
18976
|
formatHsl: function formatHsl() {
|
|
18951
|
-
var a = this.opacity;
|
|
18952
|
-
|
|
18953
|
-
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 + ")");
|
|
18954
18979
|
}
|
|
18955
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
|
+
}
|
|
18956
18990
|
/* From FvD 13.37, CSS Color Module Level 3 */
|
|
18957
18991
|
|
|
18992
|
+
|
|
18958
18993
|
function hsl2rgb(h, m1, m2) {
|
|
18959
18994
|
return (h < 60 ? m1 + (m2 - m1) * h / 60 : h < 180 ? m2 : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60 : m1) * 255;
|
|
18960
18995
|
}
|
|
@@ -21888,9 +21923,13 @@ function parseDate(date) {
|
|
|
21888
21923
|
if (date instanceof Date) {
|
|
21889
21924
|
parsedDate = date;
|
|
21890
21925
|
} else if (isString(date)) {
|
|
21891
|
-
var
|
|
21926
|
+
var _format$dataTime,
|
|
21927
|
+
config = this.config,
|
|
21892
21928
|
format = this.format;
|
|
21893
|
-
|
|
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);
|
|
21894
21933
|
} else if (isNumber(date) && !isNaN(date)) {
|
|
21895
21934
|
parsedDate = new Date(+date);
|
|
21896
21935
|
}
|
|
@@ -21909,7 +21948,7 @@ function parseDate(date) {
|
|
|
21909
21948
|
|
|
21910
21949
|
|
|
21911
21950
|
function isTabVisible() {
|
|
21912
|
-
return !browser_doc.
|
|
21951
|
+
return (browser_doc == null ? void 0 : browser_doc.hidden) === !1 || (browser_doc == null ? void 0 : browser_doc.visibilityState) === "visible";
|
|
21913
21952
|
}
|
|
21914
21953
|
/**
|
|
21915
21954
|
* Get the current input type
|
|
@@ -21921,26 +21960,36 @@ function isTabVisible() {
|
|
|
21921
21960
|
|
|
21922
21961
|
|
|
21923
21962
|
function convertInputType(mouse, touch) {
|
|
21924
|
-
var
|
|
21963
|
+
var DocumentTouch = win.DocumentTouch,
|
|
21964
|
+
matchMedia = win.matchMedia,
|
|
21965
|
+
navigator = win.navigator,
|
|
21966
|
+
hasTouch = !1;
|
|
21925
21967
|
|
|
21926
21968
|
if (touch) {
|
|
21927
21969
|
// Some Edge desktop return true: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/20417074/
|
|
21928
|
-
if (
|
|
21929
|
-
hasTouch =
|
|
21970
|
+
if (navigator && "maxTouchPoints" in navigator) {
|
|
21971
|
+
hasTouch = navigator.maxTouchPoints > 0; // Ref: https://github.com/Modernizr/Modernizr/blob/master/feature-detects/touchevents.js
|
|
21930
21972
|
// On IE11 with IE9 emulation mode, ('ontouchstart' in window) is returning true
|
|
21931
|
-
} else if ("ontouchmove" in win ||
|
|
21973
|
+
} else if ("ontouchmove" in win || DocumentTouch && browser_doc instanceof DocumentTouch) {
|
|
21932
21974
|
hasTouch = !0;
|
|
21933
21975
|
} else {
|
|
21934
21976
|
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Browser_detection_using_the_user_agent#avoiding_user_agent_detection
|
|
21935
|
-
|
|
21936
|
-
|
|
21937
|
-
|
|
21938
|
-
|
|
21977
|
+
if (matchMedia != null && matchMedia("(pointer:coarse)").matches) {
|
|
21978
|
+
hasTouch = !0;
|
|
21979
|
+
} else {
|
|
21980
|
+
// Only as a last resort, fall back to user agent sniffing
|
|
21981
|
+
var UA = navigator.userAgent;
|
|
21982
|
+
hasTouch = /\b(BlackBerry|webOS|iPhone|IEMobile)\b/i.test(UA) || /\b(Android|Windows Phone|iPad|iPod)\b/i.test(UA);
|
|
21939
21983
|
}
|
|
21940
21984
|
}
|
|
21941
|
-
}
|
|
21985
|
+
} // Check if agent has mouse using any-hover, touch devices (e.g iPad) with external mouse will return true as long as mouse is connected
|
|
21986
|
+
// https://css-tricks.com/interaction-media-features-and-their-potential-for-incorrect-assumptions/#aa-testing-the-capabilities-of-all-inputs
|
|
21987
|
+
// Demo: https://patrickhlauke.github.io/touch/pointer-hover-any-pointer-any-hover/
|
|
21942
21988
|
|
|
21943
|
-
|
|
21989
|
+
|
|
21990
|
+
var hasMouse = mouse && ["any-hover:hover", "any-pointer:fine"].some(function (v) {
|
|
21991
|
+
return matchMedia == null ? void 0 : matchMedia("(" + v + ")").matches;
|
|
21992
|
+
});
|
|
21944
21993
|
return hasMouse && "mouse" || hasTouch && "touch" || null;
|
|
21945
21994
|
}
|
|
21946
21995
|
;// CONCATENATED MODULE: ./src/module/error.ts
|
|
@@ -22121,12 +22170,14 @@ var $GRID = {
|
|
|
22121
22170
|
ygridLines: "bb-ygrid-lines",
|
|
22122
22171
|
ygrids: "bb-ygrids"
|
|
22123
22172
|
};
|
|
22124
|
-
var $
|
|
22125
|
-
chartRadar: "bb-chart-radar",
|
|
22126
|
-
chartRadars: "bb-chart-radars",
|
|
22173
|
+
var $LEVEL = {
|
|
22127
22174
|
level: "bb-level",
|
|
22128
22175
|
levels: "bb-levels"
|
|
22129
22176
|
};
|
|
22177
|
+
var $RADAR = {
|
|
22178
|
+
chartRadar: "bb-chart-radar",
|
|
22179
|
+
chartRadars: "bb-chart-radars"
|
|
22180
|
+
};
|
|
22130
22181
|
var $REGION = {
|
|
22131
22182
|
region: "bb-region",
|
|
22132
22183
|
regions: "bb-regions"
|
|
@@ -22595,6 +22646,21 @@ var Store = /*#__PURE__*/function () {
|
|
|
22595
22646
|
*/
|
|
22596
22647
|
resize_auto: !0,
|
|
22597
22648
|
|
|
22649
|
+
/**
|
|
22650
|
+
* Set a callback to execute when the chart is clicked.
|
|
22651
|
+
* @name onclick
|
|
22652
|
+
* @memberof Options
|
|
22653
|
+
* @type {Function}
|
|
22654
|
+
* @default undefined
|
|
22655
|
+
* @example
|
|
22656
|
+
* onclick: function(event) {
|
|
22657
|
+
* this; // chart instance itself
|
|
22658
|
+
* event; // native event object
|
|
22659
|
+
* ...
|
|
22660
|
+
* }
|
|
22661
|
+
*/
|
|
22662
|
+
onclick: undefined,
|
|
22663
|
+
|
|
22598
22664
|
/**
|
|
22599
22665
|
* Set a callback to execute when mouse/touch enters the chart.
|
|
22600
22666
|
* @name onover
|
|
@@ -22602,8 +22668,9 @@ var Store = /*#__PURE__*/function () {
|
|
|
22602
22668
|
* @type {Function}
|
|
22603
22669
|
* @default undefined
|
|
22604
22670
|
* @example
|
|
22605
|
-
* onover: function() {
|
|
22671
|
+
* onover: function(event) {
|
|
22606
22672
|
* this; // chart instance itself
|
|
22673
|
+
* event; // native event object
|
|
22607
22674
|
* ...
|
|
22608
22675
|
* }
|
|
22609
22676
|
*/
|
|
@@ -22616,8 +22683,9 @@ var Store = /*#__PURE__*/function () {
|
|
|
22616
22683
|
* @type {Function}
|
|
22617
22684
|
* @default undefined
|
|
22618
22685
|
* @example
|
|
22619
|
-
* onout: function() {
|
|
22686
|
+
* onout: function(event) {
|
|
22620
22687
|
* this; // chart instance itself
|
|
22688
|
+
* event; // native event object
|
|
22621
22689
|
* ...
|
|
22622
22690
|
* }
|
|
22623
22691
|
*/
|
|
@@ -22899,6 +22967,7 @@ var Store = /*#__PURE__*/function () {
|
|
|
22899
22967
|
* - gauge
|
|
22900
22968
|
* - line
|
|
22901
22969
|
* - pie
|
|
22970
|
+
* - polar
|
|
22902
22971
|
* - radar
|
|
22903
22972
|
* - scatter
|
|
22904
22973
|
* - spline
|
|
@@ -22927,6 +22996,7 @@ var Store = /*#__PURE__*/function () {
|
|
|
22927
22996
|
* gauge,
|
|
22928
22997
|
* line,
|
|
22929
22998
|
* pie,
|
|
22999
|
+
* polar,
|
|
22930
23000
|
* radar,
|
|
22931
23001
|
* scatter,
|
|
22932
23002
|
* spline,
|
|
@@ -22973,6 +23043,7 @@ var Store = /*#__PURE__*/function () {
|
|
|
22973
23043
|
* gauge,
|
|
22974
23044
|
* line,
|
|
22975
23045
|
* pie,
|
|
23046
|
+
* polar,
|
|
22976
23047
|
* radar,
|
|
22977
23048
|
* scatter,
|
|
22978
23049
|
* spline,
|
|
@@ -24377,28 +24448,38 @@ function generateResize() {
|
|
|
24377
24448
|
|
|
24378
24449
|
return callResizeFn;
|
|
24379
24450
|
}
|
|
24451
|
+
|
|
24380
24452
|
/**
|
|
24381
24453
|
* Generate transition queue function
|
|
24382
24454
|
* @returns {Function}
|
|
24383
24455
|
* @private
|
|
24384
24456
|
*/
|
|
24385
|
-
|
|
24386
24457
|
function generateWait() {
|
|
24387
24458
|
var transitionsToWait = [],
|
|
24388
|
-
f = function (
|
|
24389
|
-
var timer;
|
|
24459
|
+
f = function (selection, callback) {
|
|
24460
|
+
var timer;
|
|
24461
|
+
/**
|
|
24462
|
+
* Check if transition is complete
|
|
24463
|
+
* @private
|
|
24464
|
+
*/
|
|
24390
24465
|
|
|
24391
24466
|
function loop() {
|
|
24392
24467
|
var done = 0;
|
|
24393
24468
|
|
|
24394
|
-
for (var i = 0,
|
|
24395
|
-
if (
|
|
24469
|
+
for (var i = 0, t; t = transitionsToWait[i]; i++) {
|
|
24470
|
+
if (t === !0 || t.empty != null && t.empty()) {
|
|
24396
24471
|
done++;
|
|
24397
24472
|
continue;
|
|
24473
|
+
} // when tab isn't visible exit loop
|
|
24474
|
+
|
|
24475
|
+
|
|
24476
|
+
if (isTabVisible() === !1) {
|
|
24477
|
+
done = transitionsToWait.length;
|
|
24478
|
+
break;
|
|
24398
24479
|
}
|
|
24399
24480
|
|
|
24400
24481
|
try {
|
|
24401
|
-
|
|
24482
|
+
t.transition();
|
|
24402
24483
|
} catch (e) {
|
|
24403
24484
|
done++;
|
|
24404
24485
|
}
|
|
@@ -24414,7 +24495,8 @@ function generateWait() {
|
|
|
24414
24495
|
}
|
|
24415
24496
|
|
|
24416
24497
|
loop();
|
|
24417
|
-
};
|
|
24498
|
+
}; // 'f' is called as selection.call(f, ...);
|
|
24499
|
+
|
|
24418
24500
|
|
|
24419
24501
|
f.add = function (t) {
|
|
24420
24502
|
isArray(t) ? transitionsToWait = transitionsToWait.concat(t) : transitionsToWait.push(t);
|
|
@@ -27230,14 +27312,15 @@ var colorizePattern = function (pattern, color, id) {
|
|
|
27230
27312
|
|
|
27231
27313
|
/**
|
|
27232
27314
|
* Append data backgound color filter definition
|
|
27315
|
+
* @param {string} color Color string
|
|
27233
27316
|
* @private
|
|
27234
27317
|
*/
|
|
27235
|
-
generateDataLabelBackgroundColorFilter: function generateDataLabelBackgroundColorFilter() {
|
|
27318
|
+
generateDataLabelBackgroundColorFilter: function generateDataLabelBackgroundColorFilter(color) {
|
|
27236
27319
|
var $$ = this,
|
|
27237
27320
|
$el = $$.$el,
|
|
27238
27321
|
config = $$.config,
|
|
27239
27322
|
state = $$.state,
|
|
27240
|
-
backgroundColors = config.data_labels_backgroundColors;
|
|
27323
|
+
backgroundColors = color || config.data_labels_backgroundColors;
|
|
27241
27324
|
|
|
27242
27325
|
if (backgroundColors) {
|
|
27243
27326
|
var ids = [];
|
|
@@ -27249,7 +27332,7 @@ var colorizePattern = function (pattern, color, id) {
|
|
|
27249
27332
|
}
|
|
27250
27333
|
|
|
27251
27334
|
ids.forEach(function (v) {
|
|
27252
|
-
var id = state.datetimeId + "-labels-bg" + $$.getTargetSelectorSuffix(v);
|
|
27335
|
+
var id = state.datetimeId + "-labels-bg" + $$.getTargetSelectorSuffix(v) + (color ? $$.getTargetSelectorSuffix(color) : "");
|
|
27253
27336
|
$el.defs.append("filter").attr("x", "0").attr("y", "0").attr("width", "1").attr("height", "1").attr("id", id).html("<feFlood flood-color=\"" + (v === "" ? backgroundColors : backgroundColors[v]) + "\" /><feComposite in=\"SourceGraphic\"/>");
|
|
27254
27337
|
});
|
|
27255
27338
|
}
|
|
@@ -27739,7 +27822,7 @@ function getFormat($$, typeValue, v) {
|
|
|
27739
27822
|
defaultArcValueFormat = $$.defaultArcValueFormat,
|
|
27740
27823
|
yFormat = $$.yFormat,
|
|
27741
27824
|
y2Format = $$.y2Format,
|
|
27742
|
-
hasArc = $$.hasArcType(null, ["gauge", "radar"]);
|
|
27825
|
+
hasArc = $$.hasArcType(null, ["gauge", "polar", "radar"]);
|
|
27743
27826
|
return function (v, ratio, id) {
|
|
27744
27827
|
var format = hasArc ? defaultArcValueFormat : $$.axis && $$.axis.getId(id) === "y2" ? y2Format : yFormat;
|
|
27745
27828
|
return format.call($$, v, ratio);
|
|
@@ -27751,6 +27834,9 @@ function getFormat($$, typeValue, v) {
|
|
|
27751
27834
|
defaultArcValueFormat: function defaultArcValueFormat(v, ratio) {
|
|
27752
27835
|
return (ratio * 100).toFixed(1) + "%";
|
|
27753
27836
|
},
|
|
27837
|
+
defaultPolarValueFormat: function defaultPolarValueFormat(v) {
|
|
27838
|
+
return "" + v;
|
|
27839
|
+
},
|
|
27754
27840
|
dataLabelFormat: function dataLabelFormat(targetId) {
|
|
27755
27841
|
var $$ = this,
|
|
27756
27842
|
dataLabels = $$.config.data_labels,
|
|
@@ -28513,7 +28599,9 @@ function getFormat($$, typeValue, v) {
|
|
|
28513
28599
|
// arc
|
|
28514
28600
|
$el.arcs && $$.redrawArc(duration, durationForExit, wth.Transform); // radar
|
|
28515
28601
|
|
|
28516
|
-
$el.radar && $$.redrawRadar();
|
|
28602
|
+
$el.radar && $$.redrawRadar(); // polar
|
|
28603
|
+
|
|
28604
|
+
$el.polar && $$.redrawPolar();
|
|
28517
28605
|
} // @TODO: Axis & Radar type
|
|
28518
28606
|
|
|
28519
28607
|
|
|
@@ -33254,6 +33342,9 @@ function getTextPos(pos, width) {
|
|
|
33254
33342
|
} else if (target === "arc") {
|
|
33255
33343
|
x = state.arcWidth / 2;
|
|
33256
33344
|
y = state.arcHeight / 2;
|
|
33345
|
+
} else if (target === "polar") {
|
|
33346
|
+
x = state.arcWidth / 2;
|
|
33347
|
+
y = state.arcHeight / 2;
|
|
33257
33348
|
} else if (target === "radar") {
|
|
33258
33349
|
var _$$$getRadarSize = $$.getRadarSize(),
|
|
33259
33350
|
width = _$$$getRadarSize[0];
|
|
@@ -33469,11 +33560,14 @@ function getTextPos(pos, width) {
|
|
|
33469
33560
|
isDonutType: function isDonutType(d) {
|
|
33470
33561
|
return this.isTypeOf(d, "donut");
|
|
33471
33562
|
},
|
|
33563
|
+
isPolarType: function isPolarType(d) {
|
|
33564
|
+
return this.isTypeOf(d, "polar");
|
|
33565
|
+
},
|
|
33472
33566
|
isRadarType: function isRadarType(d) {
|
|
33473
33567
|
return this.isTypeOf(d, "radar");
|
|
33474
33568
|
},
|
|
33475
33569
|
isArcType: function isArcType(d) {
|
|
33476
|
-
return this.isPieType(d) || this.isDonutType(d) || this.isGaugeType(d) || this.isRadarType(d);
|
|
33570
|
+
return this.isPieType(d) || this.isDonutType(d) || this.isGaugeType(d) || this.isPolarType(d) || this.isRadarType(d);
|
|
33477
33571
|
},
|
|
33478
33572
|
// determine if is 'circle' data point
|
|
33479
33573
|
isCirclePoint: function isCirclePoint(node) {
|
|
@@ -33753,10 +33847,9 @@ var ChartInternal = /*#__PURE__*/function () {
|
|
|
33753
33847
|
|
|
33754
33848
|
_proto.initParams = function initParams() {
|
|
33755
33849
|
var $$ = this,
|
|
33756
|
-
|
|
33757
|
-
|
|
33758
|
-
|
|
33759
|
-
state = _ref.state,
|
|
33850
|
+
config = $$.config,
|
|
33851
|
+
format = $$.format,
|
|
33852
|
+
state = $$.state,
|
|
33760
33853
|
isRotated = config.axis_rotated;
|
|
33761
33854
|
// datetime to be used for uniqueness
|
|
33762
33855
|
state.datetimeId = "bb-" + +new Date() * getRandom();
|
|
@@ -33801,7 +33894,8 @@ var ChartInternal = /*#__PURE__*/function () {
|
|
|
33801
33894
|
$el = $$.$el,
|
|
33802
33895
|
org = $$.org,
|
|
33803
33896
|
hasAxis = state.hasAxis,
|
|
33804
|
-
hasInteraction = config.interaction_enabled
|
|
33897
|
+
hasInteraction = config.interaction_enabled,
|
|
33898
|
+
hasPolar = $$.hasType("polar");
|
|
33805
33899
|
|
|
33806
33900
|
// for arc type, set axes to not be shown
|
|
33807
33901
|
// $$.hasArcType() && ["x", "y", "y2"].forEach(id => (config[`axis_${id}_show`] = false));
|
|
@@ -33859,26 +33953,30 @@ var ChartInternal = /*#__PURE__*/function () {
|
|
|
33859
33953
|
$el.svg = $el.chart.append("svg").style("overflow", "hidden").style("display", "block");
|
|
33860
33954
|
|
|
33861
33955
|
if (hasInteraction && state.inputType) {
|
|
33862
|
-
var
|
|
33863
|
-
|
|
33864
|
-
|
|
33865
|
-
|
|
33866
|
-
|
|
33867
|
-
|
|
33956
|
+
var _onclick,
|
|
33957
|
+
_onover,
|
|
33958
|
+
_onout,
|
|
33959
|
+
isTouch = state.inputType === "touch",
|
|
33960
|
+
_config = config,
|
|
33961
|
+
onclick = _config.onclick,
|
|
33962
|
+
onover = _config.onover,
|
|
33963
|
+
onout = _config.onout;
|
|
33964
|
+
|
|
33965
|
+
$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);
|
|
33868
33966
|
}
|
|
33869
33967
|
|
|
33870
33968
|
config.svg_classname && $el.svg.attr("class", config.svg_classname); // Define defs
|
|
33871
33969
|
|
|
33872
33970
|
var hasColorPatterns = isFunction(config.color_tiles) && $$.patterns;
|
|
33873
33971
|
|
|
33874
|
-
if (hasAxis || hasColorPatterns || config.data_labels_backgroundColors) {
|
|
33972
|
+
if (hasAxis || hasColorPatterns || config.data_labels_backgroundColors || hasPolar) {
|
|
33875
33973
|
$el.defs = $el.svg.append("defs");
|
|
33876
33974
|
|
|
33877
33975
|
if (hasAxis) {
|
|
33878
33976
|
["id", "idXAxis", "idYAxis", "idGrid"].forEach(function (v) {
|
|
33879
33977
|
$$.appendClip($el.defs, state.clip[v]);
|
|
33880
33978
|
});
|
|
33881
|
-
} // Append data
|
|
33979
|
+
} // Append data background color filter definition
|
|
33882
33980
|
|
|
33883
33981
|
|
|
33884
33982
|
$$.generateDataLabelBackgroundColorFilter(); // set color patterns
|
|
@@ -33981,6 +34079,8 @@ var ChartInternal = /*#__PURE__*/function () {
|
|
|
33981
34079
|
}
|
|
33982
34080
|
});
|
|
33983
34081
|
} else {
|
|
34082
|
+
var hasPolar = $$.hasType("polar");
|
|
34083
|
+
|
|
33984
34084
|
if (!hasRadar) {
|
|
33985
34085
|
types.push("Arc", "Pie");
|
|
33986
34086
|
}
|
|
@@ -33989,6 +34089,8 @@ var ChartInternal = /*#__PURE__*/function () {
|
|
|
33989
34089
|
types.push("Gauge");
|
|
33990
34090
|
} else if (hasRadar) {
|
|
33991
34091
|
types.push("Radar");
|
|
34092
|
+
} else if (hasPolar) {
|
|
34093
|
+
types.push("Polar");
|
|
33992
34094
|
}
|
|
33993
34095
|
}
|
|
33994
34096
|
|
|
@@ -34080,7 +34182,11 @@ var ChartInternal = /*#__PURE__*/function () {
|
|
|
34080
34182
|
var $$ = this,
|
|
34081
34183
|
_$$$state2 = $$.state,
|
|
34082
34184
|
hasAxis = _$$$state2.hasAxis,
|
|
34083
|
-
hasRadar = _$$$state2.hasRadar
|
|
34185
|
+
hasRadar = _$$$state2.hasRadar,
|
|
34186
|
+
helper = function (type) {
|
|
34187
|
+
return $$["updateTargetsFor" + type](targets.filter($$["is" + type + "Type"].bind($$)));
|
|
34188
|
+
};
|
|
34189
|
+
|
|
34084
34190
|
// Text
|
|
34085
34191
|
$$.updateTargetsForText(targets);
|
|
34086
34192
|
|
|
@@ -34089,35 +34195,55 @@ var ChartInternal = /*#__PURE__*/function () {
|
|
|
34089
34195
|
var name = capitalize(v);
|
|
34090
34196
|
|
|
34091
34197
|
if (v === "line" && $$.hasTypeOf(name) || $$.hasType(v)) {
|
|
34092
|
-
|
|
34198
|
+
helper(name);
|
|
34093
34199
|
}
|
|
34094
34200
|
}); // Sub Chart
|
|
34095
34201
|
|
|
34096
|
-
$$.updateTargetsForSubchart && $$.updateTargetsForSubchart(targets);
|
|
34097
|
-
} else {
|
|
34098
|
-
|
|
34099
|
-
|
|
34100
|
-
|
|
34202
|
+
$$.updateTargetsForSubchart && $$.updateTargetsForSubchart(targets); // Arc, Polar, Radar
|
|
34203
|
+
} else if ($$.hasArcType(targets)) {
|
|
34204
|
+
var _type = "Arc";
|
|
34205
|
+
|
|
34206
|
+
if (hasRadar) {
|
|
34207
|
+
_type = "Radar";
|
|
34208
|
+
} else if ($$.hasType("polar")) {
|
|
34209
|
+
_type = "Polar";
|
|
34210
|
+
}
|
|
34211
|
+
|
|
34212
|
+
helper(_type);
|
|
34213
|
+
} // Point types
|
|
34101
34214
|
|
|
34102
34215
|
|
|
34103
|
-
|
|
34216
|
+
var hasPointType = $$.hasType("bubble") || $$.hasType("scatter");
|
|
34217
|
+
|
|
34218
|
+
if (hasPointType) {
|
|
34104
34219
|
$$.updateTargetForCircle == null ? void 0 : $$.updateTargetForCircle();
|
|
34105
34220
|
} // Fade-in each chart
|
|
34106
34221
|
|
|
34107
34222
|
|
|
34108
|
-
$$.
|
|
34223
|
+
$$.filterTargetsToShowAtInit(hasPointType);
|
|
34109
34224
|
}
|
|
34110
34225
|
/**
|
|
34111
|
-
* Display targeted elements
|
|
34226
|
+
* Display targeted elements at initialization
|
|
34227
|
+
* @param {boolean} hasPointType whether has point type(bubble, scatter) or not
|
|
34112
34228
|
* @private
|
|
34113
34229
|
*/
|
|
34114
34230
|
;
|
|
34115
34231
|
|
|
34116
|
-
_proto.
|
|
34232
|
+
_proto.filterTargetsToShowAtInit = function filterTargetsToShowAtInit(hasPointType) {
|
|
34233
|
+
if (hasPointType === void 0) {
|
|
34234
|
+
hasPointType = !1;
|
|
34235
|
+
}
|
|
34236
|
+
|
|
34117
34237
|
var $$ = this,
|
|
34118
34238
|
svg = $$.$el.svg,
|
|
34119
|
-
$T = $$.$T
|
|
34120
|
-
|
|
34239
|
+
$T = $$.$T,
|
|
34240
|
+
selector = "." + $COMMON.target;
|
|
34241
|
+
|
|
34242
|
+
if (hasPointType) {
|
|
34243
|
+
selector += ", ." + $CIRCLE.chartCircles + " > ." + $CIRCLE.circles;
|
|
34244
|
+
}
|
|
34245
|
+
|
|
34246
|
+
$T(svg.selectAll(selector).filter(function (d) {
|
|
34121
34247
|
return $$.isTargetToShow(d.id);
|
|
34122
34248
|
})).style("opacity", null);
|
|
34123
34249
|
};
|
|
@@ -34152,8 +34278,9 @@ var ChartInternal = /*#__PURE__*/function () {
|
|
|
34152
34278
|
|
|
34153
34279
|
_proto.initialOpacity = function initialOpacity(d) {
|
|
34154
34280
|
var $$ = this,
|
|
34155
|
-
withoutFadeIn = $$.state.withoutFadeIn
|
|
34156
|
-
|
|
34281
|
+
withoutFadeIn = $$.state.withoutFadeIn,
|
|
34282
|
+
r = $$.getBaseValue(d) !== null && withoutFadeIn[d.id] ? null : "0";
|
|
34283
|
+
return r;
|
|
34157
34284
|
};
|
|
34158
34285
|
|
|
34159
34286
|
_proto.bindResize = function bindResize() {
|
|
@@ -34859,7 +34986,7 @@ function nodeToSvgDataUrl(node, option, orgSize) {
|
|
|
34859
34986
|
candidates = $$.$el.svg.selectAll($$.selectorTargets(targetIds.filter($$.isTargetToShow, $$)));
|
|
34860
34987
|
candidates.classed($FOCUS.focused, !1).classed($FOCUS.defocused, !0);
|
|
34861
34988
|
|
|
34862
|
-
if ($$.hasArcType()) {
|
|
34989
|
+
if ($$.hasArcType(null, ["polar"])) {
|
|
34863
34990
|
$$.unexpandArc(targetIds);
|
|
34864
34991
|
$$.hasType("gauge") && $$.undoMarkOverlapped($$, "." + $GAUGE.gaugeValue);
|
|
34865
34992
|
}
|
|
@@ -34897,7 +35024,7 @@ function nodeToSvgDataUrl(node, option, orgSize) {
|
|
|
34897
35024
|
candidates = $el.svg.selectAll($$.selectorTargets(targetIds));
|
|
34898
35025
|
// should be for all targets
|
|
34899
35026
|
candidates.classed($FOCUS.focused, !1).classed($FOCUS.defocused, !1);
|
|
34900
|
-
$$.hasArcType() && $$.unexpandArc(targetIds);
|
|
35027
|
+
$$.hasArcType(null, ["polar"]) && $$.unexpandArc(targetIds);
|
|
34901
35028
|
|
|
34902
35029
|
if (config.legend_show) {
|
|
34903
35030
|
$$.showLegend(targetIds.filter($$.isLegendToShow.bind($$)));
|
|
@@ -35601,6 +35728,7 @@ util_extend(Chart.prototype, [chart, api_color, api_data, api_export, api_focus,
|
|
|
35601
35728
|
* billboard.js project is licensed under the MIT license
|
|
35602
35729
|
*/
|
|
35603
35730
|
|
|
35731
|
+
|
|
35604
35732
|
/**
|
|
35605
35733
|
* Set the min/max value
|
|
35606
35734
|
* @param {Chart} $$ Chart instance
|
|
@@ -35608,20 +35736,26 @@ util_extend(Chart.prototype, [chart, api_color, api_data, api_export, api_focus,
|
|
|
35608
35736
|
* @param {object} value Value to be set
|
|
35609
35737
|
* @private
|
|
35610
35738
|
*/
|
|
35611
|
-
|
|
35612
35739
|
function setMinMax($$, type, value) {
|
|
35613
35740
|
var config = $$.config,
|
|
35614
|
-
|
|
35615
|
-
|
|
35741
|
+
helper = function (key, value) {
|
|
35742
|
+
var v = isNumber(value) ? value : value === !1 ? undefined : null;
|
|
35743
|
+
|
|
35744
|
+
if (v !== null) {
|
|
35745
|
+
config["axis_" + key + "_" + type] = v;
|
|
35746
|
+
}
|
|
35747
|
+
};
|
|
35616
35748
|
|
|
35617
35749
|
if (isDefined(value)) {
|
|
35618
35750
|
if (isObjectType(value)) {
|
|
35619
|
-
|
|
35620
|
-
|
|
35621
|
-
|
|
35622
|
-
} else {
|
|
35623
|
-
|
|
35624
|
-
|
|
35751
|
+
Object.keys(value).forEach(function (key) {
|
|
35752
|
+
helper(key, value[key]);
|
|
35753
|
+
});
|
|
35754
|
+
} else if (isNumber(value) || value === !1) {
|
|
35755
|
+
// shorthand values affects only y and y2.
|
|
35756
|
+
["y", "y2"].forEach(function (key) {
|
|
35757
|
+
helper(key, value);
|
|
35758
|
+
});
|
|
35625
35759
|
}
|
|
35626
35760
|
|
|
35627
35761
|
$$.redraw({
|
|
@@ -35707,8 +35841,9 @@ var axis = {
|
|
|
35707
35841
|
* @instance
|
|
35708
35842
|
* @memberof Chart
|
|
35709
35843
|
* @param {object} min If min is given, specified axis' min value will be updated.<br>
|
|
35710
|
-
*
|
|
35711
|
-
*
|
|
35844
|
+
* If no argument is given, the min values set on generating option for each axis will be returned.
|
|
35845
|
+
* If not set any min values on generation, it will return `undefined`.<br>
|
|
35846
|
+
* To unset specific axis max, set `false` to each of them.
|
|
35712
35847
|
* @returns {object|undefined}
|
|
35713
35848
|
* @example
|
|
35714
35849
|
* // Update axis' min
|
|
@@ -35717,10 +35852,21 @@ var axis = {
|
|
|
35717
35852
|
* y: 1000,
|
|
35718
35853
|
* y2: 100
|
|
35719
35854
|
* });
|
|
35855
|
+
*
|
|
35856
|
+
* // To unset specific axis min, set false to each of them.
|
|
35857
|
+
* chart.axis.min({
|
|
35858
|
+
* x: false,
|
|
35859
|
+
* y: false,
|
|
35860
|
+
* y2: false
|
|
35861
|
+
* });
|
|
35862
|
+
*
|
|
35863
|
+
* // shorthand (only affects y and y2 axis)
|
|
35864
|
+
* chart.axis.min(-50);
|
|
35865
|
+
* chart.axis.min(false);
|
|
35720
35866
|
*/
|
|
35721
35867
|
min: function min(_min) {
|
|
35722
35868
|
var $$ = this.internal;
|
|
35723
|
-
return isValue(_min) ? setMinMax($$, "min", _min) : axis_getMinMax($$, "min");
|
|
35869
|
+
return isValue(_min) || _min === !1 ? setMinMax($$, "min", _min) : axis_getMinMax($$, "min");
|
|
35724
35870
|
},
|
|
35725
35871
|
|
|
35726
35872
|
/**
|
|
@@ -35729,8 +35875,9 @@ var axis = {
|
|
|
35729
35875
|
* @instance
|
|
35730
35876
|
* @memberof Chart
|
|
35731
35877
|
* @param {object} max If max is given, specified axis' max value will be updated.<br>
|
|
35732
|
-
*
|
|
35733
|
-
*
|
|
35878
|
+
* If no argument is given, the max values set on generating option for each axis will be returned.
|
|
35879
|
+
* If not set any max values on generation, it will return `undefined`.<br>
|
|
35880
|
+
* To unset specific axis max, set `false` to each of them.
|
|
35734
35881
|
* @returns {object|undefined}
|
|
35735
35882
|
* @example
|
|
35736
35883
|
* // Update axis' label
|
|
@@ -35739,10 +35886,21 @@ var axis = {
|
|
|
35739
35886
|
* y: 1000,
|
|
35740
35887
|
* y2: 10000
|
|
35741
35888
|
* });
|
|
35889
|
+
*
|
|
35890
|
+
* // To unset specific axis max, set false to each of them.
|
|
35891
|
+
* chart.axis.max({
|
|
35892
|
+
* x: false,
|
|
35893
|
+
* y: false,
|
|
35894
|
+
* y2: false
|
|
35895
|
+
* });
|
|
35896
|
+
*
|
|
35897
|
+
* // shorthand (only affects y and y2 axis)
|
|
35898
|
+
* chart.axis.max(10);
|
|
35899
|
+
* chart.axis.max(false);
|
|
35742
35900
|
*/
|
|
35743
35901
|
max: function max(_max) {
|
|
35744
35902
|
var $$ = this.internal;
|
|
35745
|
-
return
|
|
35903
|
+
return isValue(_max) || _max === !1 ? setMinMax($$, "max", _max) : axis_getMinMax($$, "max");
|
|
35746
35904
|
},
|
|
35747
35905
|
|
|
35748
35906
|
/**
|
|
@@ -35750,7 +35908,9 @@ var axis = {
|
|
|
35750
35908
|
* @function axis․range
|
|
35751
35909
|
* @instance
|
|
35752
35910
|
* @memberof Chart
|
|
35753
|
-
* @param {object} range If range is given, specified axis' min and max value will be updated.
|
|
35911
|
+
* @param {object} range If range is given, specified axis' min and max value will be updated.
|
|
35912
|
+
* If no argument is given, the current min and max values for each axis will be returned.<br>
|
|
35913
|
+
* To unset specific axis max, set `false` to each of them.
|
|
35754
35914
|
* @returns {object|undefined}
|
|
35755
35915
|
* @example
|
|
35756
35916
|
* // Update axis' label
|
|
@@ -35766,13 +35926,33 @@ var axis = {
|
|
|
35766
35926
|
* y2: 10000
|
|
35767
35927
|
* },
|
|
35768
35928
|
* });
|
|
35929
|
+
*
|
|
35930
|
+
* // To unset specific axis max, set false to each of them.
|
|
35931
|
+
* chart.axis.range({
|
|
35932
|
+
* min: {
|
|
35933
|
+
* x: false,
|
|
35934
|
+
* y: false,
|
|
35935
|
+
* y2: false
|
|
35936
|
+
* },
|
|
35937
|
+
* max: {
|
|
35938
|
+
* x: false,
|
|
35939
|
+
* y: false,
|
|
35940
|
+
* y2: false
|
|
35941
|
+
* },
|
|
35942
|
+
* });
|
|
35943
|
+
*
|
|
35944
|
+
* // shorthand (only affects y and y2 axis)
|
|
35945
|
+
* chart.axis.range({ min: -50, max: 1000 });
|
|
35946
|
+
* chart.axis.range({ min: false, max: false });
|
|
35769
35947
|
*/
|
|
35770
35948
|
range: function range(_range) {
|
|
35771
35949
|
var axis = this.axis;
|
|
35772
35950
|
|
|
35773
35951
|
if (arguments.length) {
|
|
35774
|
-
|
|
35775
|
-
|
|
35952
|
+
var min = _range.min,
|
|
35953
|
+
max = _range.max;
|
|
35954
|
+
isDefined(max) && axis.max(max);
|
|
35955
|
+
isDefined(min) && axis.min(min);
|
|
35776
35956
|
} else {
|
|
35777
35957
|
return {
|
|
35778
35958
|
max: axis.max(),
|
|
@@ -38090,7 +38270,7 @@ var Axis_Axis = /*#__PURE__*/function () {
|
|
|
38090
38270
|
var prefix = "axis_" + key + "_",
|
|
38091
38271
|
axisScale = scale[key];
|
|
38092
38272
|
|
|
38093
|
-
if (
|
|
38273
|
+
if (axisScale) {
|
|
38094
38274
|
var tickValues = config[prefix + "tick_values"],
|
|
38095
38275
|
tickCount = config[prefix + "tick_count"];
|
|
38096
38276
|
axisScale.domain($$.getYDomain(targetsToShow, key, xDomainForZoom));
|
|
@@ -38158,9 +38338,10 @@ var Axis_Axis = /*#__PURE__*/function () {
|
|
|
38158
38338
|
}
|
|
38159
38339
|
|
|
38160
38340
|
tickNodes.each(function (d) {
|
|
38161
|
-
|
|
38162
|
-
|
|
38163
|
-
|
|
38341
|
+
var node = lines ? this.querySelector("text") : this;
|
|
38342
|
+
|
|
38343
|
+
if (node) {
|
|
38344
|
+
node.style.display = tickValues.indexOf(d) % intervalForCulling ? "none" : null;
|
|
38164
38345
|
}
|
|
38165
38346
|
});
|
|
38166
38347
|
} else {
|
|
@@ -38898,7 +39079,9 @@ var src_linear_linear = function (t) {
|
|
|
38898
39079
|
} else if (orgDataCount === 1 || ((_flowStart = flowStart) == null ? void 0 : _flowStart.x) === ((_flowEnd = flowEnd) == null ? void 0 : _flowEnd.x)) {
|
|
38899
39080
|
translateX = x(orgDomain[0]) - x(domain[0]);
|
|
38900
39081
|
} else {
|
|
38901
|
-
|
|
39082
|
+
var _flowStart2;
|
|
39083
|
+
|
|
39084
|
+
translateX = $$.axis.isTimeSeries() ? x(orgDomain[0]) - x(domain[0]) : x(((_flowStart2 = flowStart) == null ? void 0 : _flowStart2.x) || 0) - x(flowEnd.x);
|
|
38902
39085
|
}
|
|
38903
39086
|
|
|
38904
39087
|
var scaleX = diffDomain(orgDomain) / diffDomain(domain);
|
|
@@ -42116,9 +42299,9 @@ function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {
|
|
|
42116
42299
|
var $$ = this,
|
|
42117
42300
|
config = $$.config,
|
|
42118
42301
|
dataType = config.data_type,
|
|
42119
|
-
padding = config
|
|
42302
|
+
padding = config[dataType + "_padding"],
|
|
42120
42303
|
startingAngle = config[dataType + "_startingAngle"] || 0,
|
|
42121
|
-
padAngle = (
|
|
42304
|
+
padAngle = (padding ? padding * .01 : config[dataType + "_padAngle"]) || 0;
|
|
42122
42305
|
$$.pie = pie().startAngle(startingAngle).endAngle(startingAngle + 2 * Math.PI).padAngle(padAngle).value(function (d) {
|
|
42123
42306
|
return d.values.reduce(function (a, b) {
|
|
42124
42307
|
return a + b.value;
|
|
@@ -42129,7 +42312,8 @@ function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {
|
|
|
42129
42312
|
var $$ = this,
|
|
42130
42313
|
config = $$.config,
|
|
42131
42314
|
state = $$.state,
|
|
42132
|
-
|
|
42315
|
+
dataType = config.data_type,
|
|
42316
|
+
padding = config[dataType + "_padding"],
|
|
42133
42317
|
w = config.gauge_width || config.donut_width,
|
|
42134
42318
|
gaugeArcWidth = $$.filterTargetsToShow($$.data.targets).length * config.gauge_arcs_minWidth;
|
|
42135
42319
|
// determine radius
|
|
@@ -42264,6 +42448,7 @@ function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {
|
|
|
42264
42448
|
state = $$.state,
|
|
42265
42449
|
singleArcWidth = state.gaugeArcWidth / $$.filterTargetsToShow($$.data.targets).length,
|
|
42266
42450
|
hasMultiArcGauge = $$.hasMultiArcGauge(),
|
|
42451
|
+
hasPolar = $$.hasType("polar"),
|
|
42267
42452
|
arc = src_arc().innerRadius(function (d) {
|
|
42268
42453
|
var _$$$getRadius = $$.getRadius(d),
|
|
42269
42454
|
innerRadius = _$$$getRadius.innerRadius;
|
|
@@ -42271,9 +42456,16 @@ function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {
|
|
|
42271
42456
|
return hasMultiArcGauge ? state.radius - singleArcWidth * (d.index + 1) : isNumber(innerRadius) ? innerRadius : 0;
|
|
42272
42457
|
}).outerRadius(function (d) {
|
|
42273
42458
|
var _$$$getRadius2 = $$.getRadius(d),
|
|
42274
|
-
outerRadius = _$$$getRadius2.outerRadius
|
|
42459
|
+
outerRadius = _$$$getRadius2.outerRadius,
|
|
42460
|
+
radius = outerRadius;
|
|
42461
|
+
|
|
42462
|
+
if (hasMultiArcGauge) {
|
|
42463
|
+
radius = state.radius - singleArcWidth * d.index;
|
|
42464
|
+
} else if (hasPolar) {
|
|
42465
|
+
radius = $$.getPolarOuterRadius(d, outerRadius);
|
|
42466
|
+
}
|
|
42275
42467
|
|
|
42276
|
-
return
|
|
42468
|
+
return radius;
|
|
42277
42469
|
}),
|
|
42278
42470
|
newArc = function (d, withoutUpdate) {
|
|
42279
42471
|
var path = "M 0 0";
|
|
@@ -42331,6 +42523,13 @@ function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {
|
|
|
42331
42523
|
getArc: function getArc(d, withoutUpdate, force) {
|
|
42332
42524
|
return force || this.isArcType(d.data) ? this.svgArc(d, withoutUpdate) : "M 0 0";
|
|
42333
42525
|
},
|
|
42526
|
+
|
|
42527
|
+
/**
|
|
42528
|
+
* Set transform attributes to arc label text
|
|
42529
|
+
* @param {object} d Data object
|
|
42530
|
+
* @returns {string} Translate attribute string
|
|
42531
|
+
* @private
|
|
42532
|
+
*/
|
|
42334
42533
|
transformForArcLabel: function transformForArcLabel(d) {
|
|
42335
42534
|
var $$ = this,
|
|
42336
42535
|
config = $$.config,
|
|
@@ -42345,16 +42544,24 @@ function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {
|
|
|
42345
42544
|
y = y1 * (radiusExpanded + 15 - Math.abs(y1 * 10)) + 3;
|
|
42346
42545
|
translate = "translate(" + x + "," + y + ")";
|
|
42347
42546
|
} else if (!$$.hasType("gauge") || $$.data.targets.length > 1) {
|
|
42348
|
-
var
|
|
42349
|
-
|
|
42350
|
-
|
|
42547
|
+
var _filter$map,
|
|
42548
|
+
_$$$getRadius4 = $$.getRadius(d),
|
|
42549
|
+
outerRadius = _$$$getRadius4.outerRadius;
|
|
42550
|
+
|
|
42551
|
+
if ($$.hasType("polar")) {
|
|
42552
|
+
outerRadius = $$.getPolarOuterRadius(d, outerRadius);
|
|
42553
|
+
}
|
|
42554
|
+
|
|
42555
|
+
var c = this.svgArc.centroid(updated),
|
|
42351
42556
|
_c$map = c.map(function (v) {
|
|
42352
42557
|
return isNaN(v) ? 0 : v;
|
|
42353
42558
|
}),
|
|
42354
42559
|
x = _c$map[0],
|
|
42355
42560
|
y = _c$map[1],
|
|
42356
42561
|
h = Math.sqrt(x * x + y * y),
|
|
42357
|
-
ratio =
|
|
42562
|
+
ratio = (_filter$map = ["donut", "pie", "polar"].filter($$.hasType.bind($$)).map(function (v) {
|
|
42563
|
+
return config[v + "_label_ratio"];
|
|
42564
|
+
})) == null ? void 0 : _filter$map[0];
|
|
42358
42565
|
|
|
42359
42566
|
if (ratio) {
|
|
42360
42567
|
ratio = isFunction(ratio) ? ratio.bind($$.api)(d, outerRadius, h) : ratio;
|
|
@@ -42382,10 +42589,11 @@ function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {
|
|
|
42382
42589
|
|
|
42383
42590
|
if ($$.shouldShowArcLabel()) {
|
|
42384
42591
|
selection.style("fill", $$.updateTextColor.bind($$)).attr("filter", $$.updateTextBacgroundColor.bind($$)).each(function (d) {
|
|
42385
|
-
var
|
|
42592
|
+
var _filter,
|
|
42593
|
+
node = src_select(this),
|
|
42386
42594
|
updated = $$.updateAngle(d),
|
|
42387
42595
|
ratio = $$.getRatio("arc", updated),
|
|
42388
|
-
isUnderThreshold = $$.meetsLabelThreshold(ratio,
|
|
42596
|
+
isUnderThreshold = $$.meetsLabelThreshold(ratio, (_filter = ["donut", "gauge", "pie", "polar"].filter($$.hasType.bind($$))) == null ? void 0 : _filter[0]);
|
|
42389
42597
|
|
|
42390
42598
|
if (isUnderThreshold) {
|
|
42391
42599
|
var value = (updated || d).value,
|
|
@@ -42473,21 +42681,20 @@ function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {
|
|
|
42473
42681
|
shouldShowArcLabel: function shouldShowArcLabel() {
|
|
42474
42682
|
var $$ = this,
|
|
42475
42683
|
config = $$.config;
|
|
42476
|
-
return ["
|
|
42684
|
+
return ["donut", "gauge", "pie", "polar"].some(function (v) {
|
|
42477
42685
|
return $$.hasType(v) && config[v + "_label_show"];
|
|
42478
42686
|
});
|
|
42479
42687
|
},
|
|
42480
42688
|
getArcLabelFormat: function getArcLabelFormat() {
|
|
42481
42689
|
var $$ = this,
|
|
42482
42690
|
config = $$.config,
|
|
42483
|
-
format =
|
|
42484
|
-
|
|
42485
|
-
|
|
42486
|
-
format = config.gauge_label_format;
|
|
42487
|
-
} else if ($$.hasType("donut")) {
|
|
42488
|
-
format = config.donut_label_format;
|
|
42489
|
-
}
|
|
42691
|
+
format = function (v) {
|
|
42692
|
+
return v;
|
|
42693
|
+
};
|
|
42490
42694
|
|
|
42695
|
+
["donut", "gauge", "pie", "polar"].filter($$.hasType.bind($$)).forEach(function (v) {
|
|
42696
|
+
format = config[v + "_label_format"];
|
|
42697
|
+
});
|
|
42491
42698
|
return isFunction(format) ? format.bind($$.api) : format;
|
|
42492
42699
|
},
|
|
42493
42700
|
getArcTitle: function getArcTitle() {
|
|
@@ -42619,6 +42826,7 @@ function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {
|
|
|
42619
42826
|
}); // bind arc events
|
|
42620
42827
|
|
|
42621
42828
|
hasInteraction && $$.bindArcEvent(mainArc);
|
|
42829
|
+
$$.hasType("polar") && $$.redrawPolar();
|
|
42622
42830
|
$$.hasType("gauge") && $$.redrawBackgroundArcs();
|
|
42623
42831
|
$$.redrawArcText(duration);
|
|
42624
42832
|
},
|
|
@@ -43312,7 +43520,7 @@ function point_y(p) {
|
|
|
43312
43520
|
|
|
43313
43521
|
/**
|
|
43314
43522
|
* Determine if given stacking bar data is radius type
|
|
43315
|
-
* @param {
|
|
43523
|
+
* @param {object} d Data row
|
|
43316
43524
|
* @returns {boolean}
|
|
43317
43525
|
*/
|
|
43318
43526
|
isStackingRadiusData: function isStackingRadiusData(d) {
|
|
@@ -44171,7 +44379,7 @@ var getTransitionName = function () {
|
|
|
44171
44379
|
targets = data.targets.filter(function (d) {
|
|
44172
44380
|
return _this.isScatterType(d) || _this.isBubbleType(d);
|
|
44173
44381
|
});
|
|
44174
|
-
var mainCircle = $el.main.select("." + $CIRCLE.chartCircles).style("pointer-events", "none").selectAll("." + $CIRCLE.circles).data(targets)
|
|
44382
|
+
var mainCircle = $el.main.select("." + $CIRCLE.chartCircles).style("pointer-events", "none").selectAll("." + $CIRCLE.circles).data(targets);
|
|
44175
44383
|
mainCircle.exit().remove();
|
|
44176
44384
|
enterNode = mainCircle.enter();
|
|
44177
44385
|
} // Circles for each data point on lines
|
|
@@ -44182,6 +44390,11 @@ var getTransitionName = function () {
|
|
|
44182
44390
|
});
|
|
44183
44391
|
enterNode.append("g").attr("class", classCircles).style("cursor", function (d) {
|
|
44184
44392
|
return isFunction(isSelectable) && isSelectable(d) ? "pointer" : null;
|
|
44393
|
+
}).style("opacity", function () {
|
|
44394
|
+
var _this$parentNode;
|
|
44395
|
+
|
|
44396
|
+
// if the parent node is .bb-chart-circles (bubble, scatter), initialize <g bb-circles> with opacity "0"
|
|
44397
|
+
return (_this$parentNode = this.parentNode) != null && _this$parentNode.classList.contains("bb-chart-circles") ? "0" : null;
|
|
44185
44398
|
}); // Update date for selected circles
|
|
44186
44399
|
|
|
44187
44400
|
selectionEnabled && targets.forEach(function (t) {
|
|
@@ -44599,6 +44812,124 @@ var getTransitionName = function () {
|
|
|
44599
44812
|
}
|
|
44600
44813
|
}
|
|
44601
44814
|
});
|
|
44815
|
+
;// CONCATENATED MODULE: ./src/ChartInternal/shape/polar.ts
|
|
44816
|
+
/**
|
|
44817
|
+
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
44818
|
+
* billboard.js project is licensed under the MIT license
|
|
44819
|
+
*/
|
|
44820
|
+
|
|
44821
|
+
|
|
44822
|
+
|
|
44823
|
+
/**
|
|
44824
|
+
* Get data max value
|
|
44825
|
+
* @param {object} $$ ChartInternal instance
|
|
44826
|
+
* @returns {number} max value
|
|
44827
|
+
* @private
|
|
44828
|
+
*/
|
|
44829
|
+
function getDataMax($$) {
|
|
44830
|
+
var levelMax = $$.config.polar_level_max,
|
|
44831
|
+
dataMax = $$.getMinMaxData().max[0].value;
|
|
44832
|
+
|
|
44833
|
+
// Apply level max only when is greater than the data max value
|
|
44834
|
+
if (levelMax && levelMax > dataMax) {
|
|
44835
|
+
dataMax = levelMax;
|
|
44836
|
+
}
|
|
44837
|
+
|
|
44838
|
+
return dataMax;
|
|
44839
|
+
}
|
|
44840
|
+
|
|
44841
|
+
/* harmony default export */ var polar = ({
|
|
44842
|
+
/**
|
|
44843
|
+
* Initialize polar
|
|
44844
|
+
* @private
|
|
44845
|
+
*/
|
|
44846
|
+
initPolar: function initPolar() {
|
|
44847
|
+
var $$ = this,
|
|
44848
|
+
arcs = $$.$el.arcs,
|
|
44849
|
+
config = $$.config,
|
|
44850
|
+
levelTextShow = config.polar_level_text_show,
|
|
44851
|
+
levelTextBgColor = config.polar_level_text_backgroundColor;
|
|
44852
|
+
// append <g> for level
|
|
44853
|
+
arcs.levels = arcs.append("g").attr("class", $LEVEL.levels); // set level text background color
|
|
44854
|
+
|
|
44855
|
+
if (levelTextShow && levelTextBgColor) {
|
|
44856
|
+
$$.generateDataLabelBackgroundColorFilter(levelTextBgColor);
|
|
44857
|
+
}
|
|
44858
|
+
},
|
|
44859
|
+
|
|
44860
|
+
/**
|
|
44861
|
+
* Get polar outer radius according to the data value
|
|
44862
|
+
* @param {object} d Data object
|
|
44863
|
+
* @param {numbet} outerRadius Outer radius
|
|
44864
|
+
* @returns {number} outer radius
|
|
44865
|
+
* @private
|
|
44866
|
+
*/
|
|
44867
|
+
getPolarOuterRadius: function getPolarOuterRadius(d, outerRadius) {
|
|
44868
|
+
var dataMax = getDataMax(this);
|
|
44869
|
+
return (d == null ? void 0 : d.data.values[0].value) / dataMax * outerRadius;
|
|
44870
|
+
},
|
|
44871
|
+
|
|
44872
|
+
/**
|
|
44873
|
+
* Update polar based on given data array
|
|
44874
|
+
* @param {object} targets Data object
|
|
44875
|
+
* @private
|
|
44876
|
+
*/
|
|
44877
|
+
updateTargetsForPolar: function updateTargetsForPolar(targets) {
|
|
44878
|
+
// borrow from Arc
|
|
44879
|
+
this.updateTargetsForArc(targets);
|
|
44880
|
+
},
|
|
44881
|
+
|
|
44882
|
+
/**
|
|
44883
|
+
* Called whenever redraw happens
|
|
44884
|
+
* @private
|
|
44885
|
+
*/
|
|
44886
|
+
redrawPolar: function redrawPolar() {
|
|
44887
|
+
var $$ = this,
|
|
44888
|
+
config = $$.config;
|
|
44889
|
+
config.polar_level_show && $$.updatePolarLevel();
|
|
44890
|
+
},
|
|
44891
|
+
|
|
44892
|
+
/**
|
|
44893
|
+
* Update polar level circle
|
|
44894
|
+
* @private
|
|
44895
|
+
*/
|
|
44896
|
+
updatePolarLevel: function updatePolarLevel() {
|
|
44897
|
+
var $$ = this,
|
|
44898
|
+
config = $$.config,
|
|
44899
|
+
state = $$.state,
|
|
44900
|
+
levels = $$.$el.arcs.levels,
|
|
44901
|
+
depth = config.polar_level_depth,
|
|
44902
|
+
dataMax = getDataMax($$),
|
|
44903
|
+
levelData = getRange(0, depth),
|
|
44904
|
+
outerRadius = state.radius,
|
|
44905
|
+
levelRatio = levelData.map(function (l) {
|
|
44906
|
+
return outerRadius * ((l + 1) / depth);
|
|
44907
|
+
}),
|
|
44908
|
+
levelTextFormat = (config.polar_level_text_format || function () {}).bind($$.api),
|
|
44909
|
+
level = levels.selectAll("." + $LEVEL.level).data(levelData);
|
|
44910
|
+
|
|
44911
|
+
level.exit().remove();
|
|
44912
|
+
var levelEnter = level.enter().append("g").attr("class", function (d, i) {
|
|
44913
|
+
return $LEVEL.level + " " + $LEVEL.level + "-" + i;
|
|
44914
|
+
}); // cx, cy, translate: Set center as origin (0,0) so that it can share same center with arcs
|
|
44915
|
+
|
|
44916
|
+
levelEnter.append("circle");
|
|
44917
|
+
levelEnter.merge(level).selectAll("circle").style("visibility", config.polar_level_show ? null : "hidden").attr("cx", 0).attr("cy", 0).attr("r", function (d) {
|
|
44918
|
+
return levelRatio[d];
|
|
44919
|
+
});
|
|
44920
|
+
|
|
44921
|
+
if (config.polar_level_text_show) {
|
|
44922
|
+
var levelTextBackgroundColor = config.polar_level_text_backgroundColor,
|
|
44923
|
+
defsId = "#" + state.datetimeId + "-labels-bg" + $$.getTargetSelectorSuffix(levelTextBackgroundColor);
|
|
44924
|
+
levelEnter.append("text").style("text-anchor", "middle");
|
|
44925
|
+
levelEnter.merge(level).selectAll("text").attr("dy", function (d) {
|
|
44926
|
+
return -levelRatio[d] + 5;
|
|
44927
|
+
}).attr("filter", levelTextBackgroundColor ? "url(" + defsId + ")" : null).text(function (d) {
|
|
44928
|
+
return levelTextFormat(dataMax / levelData.length * (d + 1));
|
|
44929
|
+
});
|
|
44930
|
+
}
|
|
44931
|
+
}
|
|
44932
|
+
});
|
|
44602
44933
|
;// CONCATENATED MODULE: ./src/ChartInternal/shape/radar.ts
|
|
44603
44934
|
/**
|
|
44604
44935
|
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
@@ -44639,7 +44970,7 @@ var cacheKey = KEY.radarPoints;
|
|
|
44639
44970
|
if ($$.hasType("radar")) {
|
|
44640
44971
|
$el.radar = $el.main.select("." + $COMMON.chart).append("g").attr("class", $RADAR.chartRadars); // level
|
|
44641
44972
|
|
|
44642
|
-
$el.radar.levels = $el.radar.append("g").attr("class", $
|
|
44973
|
+
$el.radar.levels = $el.radar.append("g").attr("class", $LEVEL.levels); // axis
|
|
44643
44974
|
|
|
44644
44975
|
$el.radar.axes = $el.radar.append("g").attr("class", $AXIS.axis); // shapes
|
|
44645
44976
|
|
|
@@ -44760,11 +45091,11 @@ var cacheKey = KEY.radarPoints;
|
|
|
44760
45091
|
});
|
|
44761
45092
|
return pos.join(" ");
|
|
44762
45093
|
}),
|
|
44763
|
-
level = radarLevels.selectAll("." + $
|
|
45094
|
+
level = radarLevels.selectAll("." + $LEVEL.level).data(levelData);
|
|
44764
45095
|
|
|
44765
45096
|
level.exit().remove();
|
|
44766
45097
|
var levelEnter = level.enter().append("g").attr("class", function (d, i) {
|
|
44767
|
-
return $
|
|
45098
|
+
return $LEVEL.level + " " + $LEVEL.level + "-" + i;
|
|
44768
45099
|
});
|
|
44769
45100
|
levelEnter.append("polygon").style("visibility", config.radar_level_show ? null : "hidden");
|
|
44770
45101
|
|
|
@@ -45770,6 +46101,91 @@ var cacheKey = KEY.radarPoints;
|
|
|
45770
46101
|
pie_padding: 0,
|
|
45771
46102
|
pie_startingAngle: 0
|
|
45772
46103
|
});
|
|
46104
|
+
;// CONCATENATED MODULE: ./src/config/Options/shape/polar.ts
|
|
46105
|
+
/**
|
|
46106
|
+
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
46107
|
+
* billboard.js project is licensed under the MIT license
|
|
46108
|
+
*/
|
|
46109
|
+
|
|
46110
|
+
/**
|
|
46111
|
+
* x Axis config options
|
|
46112
|
+
*/
|
|
46113
|
+
/* harmony default export */ var shape_polar = ({
|
|
46114
|
+
/**
|
|
46115
|
+
* Set polar options
|
|
46116
|
+
* @name polar
|
|
46117
|
+
* @memberof Options
|
|
46118
|
+
* @type {object}
|
|
46119
|
+
* @property {object} polar Polar object
|
|
46120
|
+
* @property {boolean} [polar.label.show=true] Show or hide label on each polar piece.
|
|
46121
|
+
* @property {Function} [polar.label.format] Set formatter for the label on each polar piece.
|
|
46122
|
+
* @property {number} [polar.label.threshold=0.05] Set threshold ratio to show/hide labels.
|
|
46123
|
+
* @property {number|Function} [polar.label.ratio=undefined] Set ratio of labels position.
|
|
46124
|
+
* @property {number} [polar.level.depth=3] Set the level depth.
|
|
46125
|
+
* @property {boolean} [polar.level.show=true] Show or hide level.
|
|
46126
|
+
* @property {string} [polar.level.text.backgroundColor="#fff"] Set label text's background color.
|
|
46127
|
+
* @property {Function} [polar.level.text.format] Set format function for the level value.<br>- Default value: `(x) => x % 1 === 0 ? x : x.toFixed(2)`
|
|
46128
|
+
* @property {boolean} [polar.level.text.show=true] Show or hide level text.
|
|
46129
|
+
* @property {number} [polar.padAngle=0] Set padding between data.
|
|
46130
|
+
* @property {number} [polar.padding=0] Sets the gap between pie arcs.
|
|
46131
|
+
* @property {number} [polar.startingAngle=0] Set starting angle where data draws.
|
|
46132
|
+
* @see [Demo](https://naver.github.io/billboard.js/demo/#Chart.PolarChart)
|
|
46133
|
+
* @example
|
|
46134
|
+
* polar: {
|
|
46135
|
+
* label: {
|
|
46136
|
+
* show: false,
|
|
46137
|
+
* format: function(value, ratio, id) {
|
|
46138
|
+
* return d3.format("$")(value);
|
|
46139
|
+
*
|
|
46140
|
+
* // to multiline, return with '\n' character
|
|
46141
|
+
* // return value +"%\nLine1\n2Line2";
|
|
46142
|
+
* },
|
|
46143
|
+
*
|
|
46144
|
+
* // 0.1(10%) ratio value means, the minimum ratio to show text label relative to the total value.
|
|
46145
|
+
* // if data value is below than 0.1, text label will be hidden.
|
|
46146
|
+
* threshold: 0.1,
|
|
46147
|
+
*
|
|
46148
|
+
* // set ratio callback. Should return ratio value
|
|
46149
|
+
* ratio: function(d, radius, h) {
|
|
46150
|
+
* ...
|
|
46151
|
+
* return ratio;
|
|
46152
|
+
* },
|
|
46153
|
+
* // or set ratio number
|
|
46154
|
+
* ratio: 0.5
|
|
46155
|
+
* },
|
|
46156
|
+
* level: {
|
|
46157
|
+
* depth: 3,
|
|
46158
|
+
* max: 500,
|
|
46159
|
+
* show: true,
|
|
46160
|
+
* text: {
|
|
46161
|
+
* format: function(x) {
|
|
46162
|
+
* return x + "%";
|
|
46163
|
+
* },
|
|
46164
|
+
* show: true,
|
|
46165
|
+
* backgroundColor: "red"
|
|
46166
|
+
* }
|
|
46167
|
+
* },
|
|
46168
|
+
* padAngle: 0.1,
|
|
46169
|
+
* padding: 0,
|
|
46170
|
+
* startingAngle: 1
|
|
46171
|
+
* }
|
|
46172
|
+
*/
|
|
46173
|
+
polar_label_show: !0,
|
|
46174
|
+
polar_label_format: undefined,
|
|
46175
|
+
polar_label_threshold: .05,
|
|
46176
|
+
polar_label_ratio: undefined,
|
|
46177
|
+
polar_level_depth: 3,
|
|
46178
|
+
polar_level_max: undefined,
|
|
46179
|
+
polar_level_show: !0,
|
|
46180
|
+
polar_level_text_backgroundColor: "#fff",
|
|
46181
|
+
polar_level_text_format: function polar_level_text_format(x) {
|
|
46182
|
+
return x % 1 === 0 ? x : x.toFixed(2);
|
|
46183
|
+
},
|
|
46184
|
+
polar_level_text_show: !0,
|
|
46185
|
+
polar_padAngle: 0,
|
|
46186
|
+
polar_padding: 0,
|
|
46187
|
+
polar_startingAngle: 0
|
|
46188
|
+
});
|
|
45773
46189
|
;// CONCATENATED MODULE: ./src/config/Options/shape/radar.ts
|
|
45774
46190
|
/**
|
|
45775
46191
|
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
@@ -45870,6 +46286,7 @@ var cacheKey = KEY.radarPoints;
|
|
|
45870
46286
|
|
|
45871
46287
|
|
|
45872
46288
|
|
|
46289
|
+
|
|
45873
46290
|
// Options
|
|
45874
46291
|
|
|
45875
46292
|
|
|
@@ -45886,6 +46303,7 @@ var cacheKey = KEY.radarPoints;
|
|
|
45886
46303
|
|
|
45887
46304
|
|
|
45888
46305
|
|
|
46306
|
+
|
|
45889
46307
|
/**
|
|
45890
46308
|
* Extend Axis
|
|
45891
46309
|
* @param {Array} module Module to be extended
|
|
@@ -45978,6 +46396,11 @@ var _area = function area() {
|
|
|
45978
46396
|
return extendArc(undefined, [shape_pie]), (resolver_shape_pie = function () {
|
|
45979
46397
|
return TYPE.PIE;
|
|
45980
46398
|
})();
|
|
46399
|
+
},
|
|
46400
|
+
resolver_shape_polar = function () {
|
|
46401
|
+
return extendArc([polar], [shape_polar]), (resolver_shape_polar = function () {
|
|
46402
|
+
return TYPE.POLAR;
|
|
46403
|
+
})();
|
|
45981
46404
|
},
|
|
45982
46405
|
resolver_shape_radar = function () {
|
|
45983
46406
|
return extendArc([point, radar], [common_point, shape_radar]), (resolver_shape_radar = function () {
|
|
@@ -48472,7 +48895,7 @@ var _defaults = {},
|
|
|
48472
48895
|
* bb.version; // "1.0.0"
|
|
48473
48896
|
* @memberof bb
|
|
48474
48897
|
*/
|
|
48475
|
-
version: "3.
|
|
48898
|
+
version: "3.4.0",
|
|
48476
48899
|
|
|
48477
48900
|
/**
|
|
48478
48901
|
* Generate chart
|
|
@@ -48520,6 +48943,7 @@ var _defaults = {},
|
|
|
48520
48943
|
* gauge,
|
|
48521
48944
|
* line,
|
|
48522
48945
|
* pie,
|
|
48946
|
+
* polar,
|
|
48523
48947
|
* radar,
|
|
48524
48948
|
* scatter,
|
|
48525
48949
|
* spline,
|
|
@@ -48606,7 +49030,7 @@ var _defaults = {},
|
|
|
48606
49030
|
};
|
|
48607
49031
|
/**
|
|
48608
49032
|
* @namespace bb
|
|
48609
|
-
* @version 3.
|
|
49033
|
+
* @version 3.4.0
|
|
48610
49034
|
*/
|
|
48611
49035
|
;// CONCATENATED MODULE: ./src/index.ts
|
|
48612
49036
|
/**
|