billboard.js 3.10.1 → 3.10.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/billboard.css +1 -1
- package/dist/billboard.js +91 -74
- package/dist/billboard.min.css +1 -1
- package/dist/billboard.min.js +2 -2
- package/dist/billboard.pkgd.js +203 -347
- package/dist/billboard.pkgd.min.js +4 -4
- package/dist/plugin/billboardjs-plugin-bubblecompare.js +2 -2
- package/dist/plugin/billboardjs-plugin-bubblecompare.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-sparkline.js +13 -11
- package/dist/plugin/billboardjs-plugin-sparkline.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-stanford.js +13 -11
- package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-tableview.js +13 -11
- package/dist/plugin/billboardjs-plugin-tableview.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-textoverlap.js +13 -11
- package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.js +112 -273
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.js +124 -283
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.js +125 -284
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.js +125 -284
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.js +125 -284
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.min.js +2 -2
- package/dist/theme/dark.css +1 -1
- package/dist/theme/dark.min.css +1 -1
- package/dist/theme/datalab.css +1 -1
- package/dist/theme/datalab.min.css +1 -1
- package/dist/theme/graph.css +1 -1
- package/dist/theme/graph.min.css +1 -1
- package/dist/theme/insight.css +1 -1
- package/dist/theme/insight.min.css +1 -1
- package/dist/theme/modern.css +1 -1
- package/dist/theme/modern.min.css +1 -1
- package/dist-esm/billboard.js +69 -53
- package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-sparkline.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-stanford.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-tableview.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +2 -2
- package/package.json +17 -17
- package/src/ChartInternal/Axis/Axis.ts +7 -4
- package/src/ChartInternal/data/data.ts +15 -9
- package/src/ChartInternal/internals/clip.ts +1 -2
- package/src/ChartInternal/internals/format.ts +15 -4
- package/src/ChartInternal/internals/size.axis.ts +4 -17
- package/src/ChartInternal/internals/size.ts +11 -5
- package/src/ChartInternal/internals/text.ts +3 -3
- package/src/ChartInternal/internals/tooltip.ts +2 -2
- package/src/ChartInternal/internals/transform.ts +1 -1
- package/src/ChartInternal/shape/arc.ts +1 -1
- package/src/ChartInternal/shape/shape.ts +2 -0
- package/src/module/browser.ts +8 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "billboard.js",
|
|
3
|
-
"version": "3.10.
|
|
3
|
+
"version": "3.10.3",
|
|
4
4
|
"description": "Re-usable easy interface JavaScript chart library, based on D3 v4+",
|
|
5
5
|
"homepage": "https://naver.github.io/billboard.js/",
|
|
6
6
|
"main": "dist/billboard.js",
|
|
@@ -85,8 +85,8 @@
|
|
|
85
85
|
"license": "MIT",
|
|
86
86
|
"readmeFilename": "README.md",
|
|
87
87
|
"dependencies": {
|
|
88
|
-
"@types/d3-selection": "^3.0.
|
|
89
|
-
"@types/d3-transition": "^3.0.
|
|
88
|
+
"@types/d3-selection": "^3.0.9",
|
|
89
|
+
"@types/d3-transition": "^3.0.7",
|
|
90
90
|
"d3-axis": "^3.0.0",
|
|
91
91
|
"d3-brush": "^3.0.0",
|
|
92
92
|
"d3-drag": "^3.0.0",
|
|
@@ -110,24 +110,24 @@
|
|
|
110
110
|
"@babel/preset-env": "^7.23.2",
|
|
111
111
|
"@babel/preset-typescript": "^7.23.2",
|
|
112
112
|
"@babel/runtime": "^7.23.2",
|
|
113
|
-
"@commitlint/cli": "18.
|
|
114
|
-
"@commitlint/config-conventional": "^18.
|
|
113
|
+
"@commitlint/cli": "18.2.0",
|
|
114
|
+
"@commitlint/config-conventional": "^18.1.0",
|
|
115
115
|
"@rollup/plugin-babel": "^6.0.4",
|
|
116
116
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
117
|
-
"@rollup/plugin-replace": "^5.0.
|
|
117
|
+
"@rollup/plugin-replace": "^5.0.5",
|
|
118
118
|
"@rollup/plugin-typescript": "^11.1.5",
|
|
119
119
|
"@semantic-release/changelog": "^6.0.3",
|
|
120
|
-
"@semantic-release/commit-analyzer": "^11.
|
|
120
|
+
"@semantic-release/commit-analyzer": "^11.1.0",
|
|
121
121
|
"@semantic-release/exec": "^6.0.3",
|
|
122
122
|
"@semantic-release/git": "^10.0.1",
|
|
123
|
-
"@semantic-release/npm": "^11.0.
|
|
124
|
-
"@semantic-release/release-notes-generator": "^12.
|
|
123
|
+
"@semantic-release/npm": "^11.0.1",
|
|
124
|
+
"@semantic-release/release-notes-generator": "^12.1.0",
|
|
125
125
|
"@types/chai": "^4.3.9",
|
|
126
126
|
"@types/d3": "^7.4.2",
|
|
127
127
|
"@types/mocha": "^10.0.3",
|
|
128
|
-
"@types/sinon": "^
|
|
129
|
-
"@typescript-eslint/eslint-plugin": "^6.
|
|
130
|
-
"@typescript-eslint/parser": "^6.
|
|
128
|
+
"@types/sinon": "^17.0.0",
|
|
129
|
+
"@typescript-eslint/eslint-plugin": "^6.10.0",
|
|
130
|
+
"@typescript-eslint/parser": "^6.10.0",
|
|
131
131
|
"babel-helper-modules": "^6.0.0",
|
|
132
132
|
"babel-loader": "^9.1.3",
|
|
133
133
|
"babel-plugin-add-module-exports": "^1.0.4",
|
|
@@ -143,7 +143,7 @@
|
|
|
143
143
|
"chai": "^4.3.10",
|
|
144
144
|
"clean-webpack-plugin": "^4.0.0",
|
|
145
145
|
"cloc": "^2.11.0",
|
|
146
|
-
"core-js": "^3.33.
|
|
146
|
+
"core-js": "^3.33.2",
|
|
147
147
|
"coveralls": "^3.1.1",
|
|
148
148
|
"cross-env": "^7.0.3",
|
|
149
149
|
"css-loader": "^6.8.1",
|
|
@@ -154,7 +154,7 @@
|
|
|
154
154
|
"d3-polygon": "^3.0.1",
|
|
155
155
|
"docdash": "^2.0.2",
|
|
156
156
|
"dtslint": "^4.2.1",
|
|
157
|
-
"eslint": "^8.
|
|
157
|
+
"eslint": "^8.53.0",
|
|
158
158
|
"eslint-config-naver": "^2.1.0",
|
|
159
159
|
"eslint-plugin-import": "^2.29.0",
|
|
160
160
|
"eslint-plugin-jsdoc": "^46.8.2",
|
|
@@ -181,12 +181,12 @@
|
|
|
181
181
|
"mocha": "^10.2.0",
|
|
182
182
|
"node-sass": "^9.0.0",
|
|
183
183
|
"regenerator-runtime": "^0.14.0",
|
|
184
|
-
"rollup": "^4.
|
|
184
|
+
"rollup": "^4.3.0",
|
|
185
185
|
"rollup-plugin-delete": "^2.0.0",
|
|
186
186
|
"sass-loader": "^13.3.2",
|
|
187
|
-
"semantic-release": "^22.0.
|
|
187
|
+
"semantic-release": "^22.0.7",
|
|
188
188
|
"simulant": "^0.2.2",
|
|
189
|
-
"sinon": "^17.0.
|
|
189
|
+
"sinon": "^17.0.1",
|
|
190
190
|
"string-replace-loader": "^3.1.0",
|
|
191
191
|
"style-loader": "^3.3.3",
|
|
192
192
|
"taffydb": "^2.7.3",
|
|
@@ -587,12 +587,13 @@ class Axis {
|
|
|
587
587
|
const $$ = this.owner;
|
|
588
588
|
const {config, state: {current}, $el: {svg, chart}} = $$;
|
|
589
589
|
const currentTickMax = current.maxTickSize[id];
|
|
590
|
+
const configPrefix = `axis_${id}`;
|
|
590
591
|
const max = {
|
|
591
592
|
width: 0,
|
|
592
593
|
height: 0
|
|
593
594
|
};
|
|
594
595
|
|
|
595
|
-
if (withoutRecompute || !config[
|
|
596
|
+
if (withoutRecompute || !config[`${configPrefix}_show`] || (
|
|
596
597
|
currentTickMax.width > 0 && $$.filterTargetsToShow().length === 0
|
|
597
598
|
)) {
|
|
598
599
|
return currentTickMax;
|
|
@@ -624,8 +625,9 @@ class Axis {
|
|
|
624
625
|
}
|
|
625
626
|
|
|
626
627
|
const axis = this.getAxis(id, scale, false, false, true);
|
|
627
|
-
const
|
|
628
|
-
const
|
|
628
|
+
const tickRotate = config[`${configPrefix}_tick_rotate`];
|
|
629
|
+
const tickCount = config[`${configPrefix}_tick_count`];
|
|
630
|
+
const tickValues = config[`${configPrefix}_tick_values`];
|
|
629
631
|
|
|
630
632
|
// Make to generate the final tick text to be rendered
|
|
631
633
|
// https://github.com/naver/billboard.js/issues/920
|
|
@@ -651,6 +653,7 @@ class Axis {
|
|
|
651
653
|
axis.create(dummy);
|
|
652
654
|
|
|
653
655
|
dummy.selectAll("text")
|
|
656
|
+
.attr("transform", isNumber(tickRotate) ? `rotate(${tickRotate})` : null)
|
|
654
657
|
.each(function(d, i) {
|
|
655
658
|
const {width, height} = this.getBoundingClientRect();
|
|
656
659
|
|
|
@@ -683,7 +686,7 @@ class Axis {
|
|
|
683
686
|
|
|
684
687
|
if ((axis.isCategorized() || axis.isTimeSeries()) &&
|
|
685
688
|
config.axis_x_tick_fit &&
|
|
686
|
-
!config.axis_x_tick_culling &&
|
|
689
|
+
(!config.axis_x_tick_culling || isEmpty(config.axis_x_tick_culling)) &&
|
|
687
690
|
!config.axis_x_tick_multiline &&
|
|
688
691
|
positiveRotation
|
|
689
692
|
) {
|
|
@@ -899,14 +899,18 @@ export default {
|
|
|
899
899
|
const value = d?.value;
|
|
900
900
|
|
|
901
901
|
if (isArray(value)) {
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
902
|
+
if (type === "bar") {
|
|
903
|
+
return value.reduce((a, c) => c - a);
|
|
904
|
+
} else {
|
|
905
|
+
// @ts-ignore
|
|
906
|
+
const index = {
|
|
907
|
+
areaRange: ["high", "mid", "low"],
|
|
908
|
+
candlestick: ["open", "high", "low", "close", "volume"]
|
|
909
|
+
}[type].indexOf(key);
|
|
910
|
+
|
|
911
|
+
return index >= 0 && value ? value[index] : undefined;
|
|
912
|
+
}
|
|
913
|
+
} else if (value && key) {
|
|
910
914
|
return value[key];
|
|
911
915
|
}
|
|
912
916
|
|
|
@@ -992,7 +996,9 @@ export default {
|
|
|
992
996
|
const max = yScale.domain().reduce((a, c) => c - a);
|
|
993
997
|
|
|
994
998
|
// when all data are 0, return 0
|
|
995
|
-
ratio = max === 0 ? 0 : Math.abs(
|
|
999
|
+
ratio = max === 0 ? 0 : Math.abs(
|
|
1000
|
+
$$.getRangedData(d, null, type) / max
|
|
1001
|
+
);
|
|
996
1002
|
} else if (type === "treemap") {
|
|
997
1003
|
ratio /= $$.getTotalDataSum(true);
|
|
998
1004
|
}
|
|
@@ -59,7 +59,6 @@ export default {
|
|
|
59
59
|
|
|
60
60
|
// less than 20 is not enough to show the axis label 'outer' without legend
|
|
61
61
|
const h = (isRotated ? (margin.top + height) + 10 : margin.bottom) + 20;
|
|
62
|
-
|
|
63
62
|
const x = isRotated ? -(1 + left) : -(left - 1);
|
|
64
63
|
const y = -15; // -Math.max(15, margin.top);
|
|
65
64
|
const w = isRotated ? margin.left + 20 : width + 10 + left;
|
|
@@ -88,7 +87,7 @@ export default {
|
|
|
88
87
|
(isRotated ? -(1 + left) : -(left - 1));
|
|
89
88
|
const y = -(isRotated ? 20 : margin.top);
|
|
90
89
|
const w = (isRotated ? width + 15 + left : margin.left + 20) + (isInner ? 20 : 0);
|
|
91
|
-
const h = (isRotated ? margin.bottom +
|
|
90
|
+
const h = (isRotated ? margin.bottom + 10 : (margin.top + height)) + 10;
|
|
92
91
|
|
|
93
92
|
node
|
|
94
93
|
.attr("x", x)
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
3
3
|
* billboard.js project is licensed under the MIT license
|
|
4
4
|
*/
|
|
5
|
-
import {isValue, isFunction, isObjectType} from "../../module/util";
|
|
5
|
+
import {isArray, isValue, isFunction, isObjectType, isObject} from "../../module/util";
|
|
6
6
|
import type {AxisType} from "../../../types/types";
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -50,8 +50,8 @@ export default {
|
|
|
50
50
|
};
|
|
51
51
|
},
|
|
52
52
|
|
|
53
|
-
defaultValueFormat(v): number|string {
|
|
54
|
-
return isValue(v) ? +v : "";
|
|
53
|
+
defaultValueFormat(v: number|number[]): number|string {
|
|
54
|
+
return isArray(v) ? v.join("~") : (isValue(v) ? +v : "");
|
|
55
55
|
},
|
|
56
56
|
|
|
57
57
|
defaultArcValueFormat(v, ratio): string {
|
|
@@ -65,7 +65,18 @@ export default {
|
|
|
65
65
|
dataLabelFormat(targetId: string): Function {
|
|
66
66
|
const $$ = this;
|
|
67
67
|
const dataLabels = $$.config.data_labels;
|
|
68
|
-
const defaultFormat = v =>
|
|
68
|
+
const defaultFormat = v => {
|
|
69
|
+
const delimiter = "~";
|
|
70
|
+
let res = v;
|
|
71
|
+
|
|
72
|
+
if (isArray(v)) {
|
|
73
|
+
res = v.join(delimiter);
|
|
74
|
+
} else if (isObject(v)) {
|
|
75
|
+
res = Object.values(v).join(delimiter);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return res;
|
|
79
|
+
};
|
|
69
80
|
let format = defaultFormat;
|
|
70
81
|
|
|
71
82
|
// find format according to axis id
|
|
@@ -42,7 +42,7 @@ export default {
|
|
|
42
42
|
getHorizontalAxisHeight(id: AxisType): number {
|
|
43
43
|
const $$ = this;
|
|
44
44
|
const {config, state} = $$;
|
|
45
|
-
const {
|
|
45
|
+
const {rotatedPadding, isLegendRight, isLegendInset} = state;
|
|
46
46
|
const isRotated = config.axis_rotated;
|
|
47
47
|
const isFitPadding = config.padding?.mode === "fit";
|
|
48
48
|
const isInner = config[`axis_${id}_inner`];
|
|
@@ -70,21 +70,8 @@ export default {
|
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
const maxtickSize = $$.axis.getMaxTickSize(id);
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
// Calculate x/y axis height when tick rotated
|
|
76
|
-
if (
|
|
77
|
-
((id === "x" && !isRotated) || (/y2?/.test(id) && isRotated)) && rotate
|
|
78
|
-
) {
|
|
79
|
-
h += maxtickSize.width *
|
|
80
|
-
Math.cos(Math.PI * (90 - Math.abs(rotate)) / 180);
|
|
81
|
-
|
|
82
|
-
if (!config.axis_x_tick_multiline && current.height) {
|
|
83
|
-
if (h > current.height / 2) {
|
|
84
|
-
h = current.height / 2;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
} else if (maxtickSize.height > defaultHeight && config.legend_show) {
|
|
73
|
+
|
|
74
|
+
if (maxtickSize.height > defaultHeight) {
|
|
88
75
|
h += maxtickSize.height - defaultHeight;
|
|
89
76
|
}
|
|
90
77
|
|
|
@@ -140,10 +127,10 @@ export default {
|
|
|
140
127
|
}
|
|
141
128
|
|
|
142
129
|
if ($el.svg &&
|
|
130
|
+
config.axis_x_tick_autorotate &&
|
|
143
131
|
config.axis_x_tick_fit &&
|
|
144
132
|
!config.axis_x_tick_multiline &&
|
|
145
133
|
!config.axis_x_tick_culling &&
|
|
146
|
-
config.axis_x_tick_autorotate &&
|
|
147
134
|
allowedXAxisTypes
|
|
148
135
|
) {
|
|
149
136
|
rotate = $$.needToRotateXAxisTickTexts() ?
|
|
@@ -169,10 +169,11 @@ export default {
|
|
|
169
169
|
* Get padding by the direction.
|
|
170
170
|
* @param {string} type "top" | "bottom" | "left" | "right"
|
|
171
171
|
* @param {boolean} [withoutRecompute=false] If set true, do not recompute the padding value.
|
|
172
|
+
* @param {boolean} [withXAxisTickTextOverflow=false] If set true, calculate x axis tick text overflow.
|
|
172
173
|
* @returns {number} padding value
|
|
173
174
|
* @private
|
|
174
175
|
*/
|
|
175
|
-
getCurrentPaddingByDirection(type: "top" | "bottom" | "left" | "right", withoutRecompute = false): number {
|
|
176
|
+
getCurrentPaddingByDirection(type: "top" | "bottom" | "left" | "right", withoutRecompute = false, withXAxisTickTextOverflow = false): number {
|
|
176
177
|
const $$ = this;
|
|
177
178
|
const {config, $el, state: {hasAxis}} = $$;
|
|
178
179
|
const isRotated = config.axis_rotated;
|
|
@@ -219,6 +220,8 @@ export default {
|
|
|
219
220
|
padding += isRotated ? (
|
|
220
221
|
!isFitPadding && isUndefined(paddingOption) ? 10 : 2
|
|
221
222
|
) : !isAxisShow || isAxisInner ? (isFitPadding ? 2 : 1) : 0;
|
|
223
|
+
|
|
224
|
+
padding += withXAxisTickTextOverflow ? $$.axis.getXAxisTickTextY2Overflow(defaultPadding) : 0;
|
|
222
225
|
} else if (type === "left" && isRotated && isUndefined(paddingOption)) {
|
|
223
226
|
padding = !config.axis_x_show ?
|
|
224
227
|
1 : (isFitPadding ? axisSize : Math.max(axisSize, 40));
|
|
@@ -238,10 +241,12 @@ export default {
|
|
|
238
241
|
return padding + (axisSize * axesLen) - gap;
|
|
239
242
|
},
|
|
240
243
|
|
|
241
|
-
getCurrentPadding(
|
|
244
|
+
getCurrentPadding(withXAxisTickTextOverflow = false): {
|
|
245
|
+
top: number, bottom: number, left: number, right: number
|
|
246
|
+
} {
|
|
242
247
|
const $$ = this;
|
|
243
248
|
const [top, bottom, left, right] = ["top", "bottom", "left", "right"]
|
|
244
|
-
.map(v => $$.getCurrentPaddingByDirection(v));
|
|
249
|
+
.map(v => $$.getCurrentPaddingByDirection(v, null, withXAxisTickTextOverflow));
|
|
245
250
|
|
|
246
251
|
return {top, bottom, left, right};
|
|
247
252
|
},
|
|
@@ -299,7 +304,8 @@ export default {
|
|
|
299
304
|
}
|
|
300
305
|
|
|
301
306
|
const legendSize = {
|
|
302
|
-
right: config.legend_show && state.isLegendRight ?
|
|
307
|
+
right: config.legend_show && state.isLegendRight ?
|
|
308
|
+
$$.getLegendWidth() + (isFitPadding ? 0 : 20) : 0,
|
|
303
309
|
bottom: !config.legend_show || state.isLegendRight || state.isLegendInset ? 0 : currLegend.height
|
|
304
310
|
};
|
|
305
311
|
|
|
@@ -314,7 +320,7 @@ export default {
|
|
|
314
320
|
const gaugeHeight = $$.hasType("gauge") && config.arc_needle_show &&
|
|
315
321
|
!config.gauge_fullCircle && !config.gauge_label_show ? 10 : 0;
|
|
316
322
|
|
|
317
|
-
const padding = $$.getCurrentPadding();
|
|
323
|
+
const padding = $$.getCurrentPadding(true);
|
|
318
324
|
|
|
319
325
|
// for main
|
|
320
326
|
state.margin = !isNonAxis && isRotated ? {
|
|
@@ -255,7 +255,7 @@ export default {
|
|
|
255
255
|
* @returns {string|null}
|
|
256
256
|
* @private
|
|
257
257
|
*/
|
|
258
|
-
|
|
258
|
+
updateTextBackgroundColor(d: IDataRow | IArcData): string | null {
|
|
259
259
|
const $$ = this;
|
|
260
260
|
const {$el, config} = $$;
|
|
261
261
|
const backgroundColor = config.data_labels_backgroundColors;
|
|
@@ -293,7 +293,7 @@ export default {
|
|
|
293
293
|
|
|
294
294
|
$$.$el.text
|
|
295
295
|
.style("fill", $$.getStylePropValue($$.updateTextColor))
|
|
296
|
-
.attr("filter", $$.
|
|
296
|
+
.attr("filter", $$.updateTextBackgroundColor.bind($$))
|
|
297
297
|
.style("fill-opacity", forFlow ? 0 : $$.opacityForText.bind($$))
|
|
298
298
|
.each(function(d: IDataRow, i: number) {
|
|
299
299
|
// do not apply transition for newly added text elements
|
|
@@ -410,7 +410,7 @@ export default {
|
|
|
410
410
|
const rect = getBoundingRect(textElement);
|
|
411
411
|
|
|
412
412
|
if (isBarType) {
|
|
413
|
-
const isPositive = d
|
|
413
|
+
const isPositive = $$.getRangedData(d, null, "bar") >= 0;
|
|
414
414
|
|
|
415
415
|
if (isRotated) {
|
|
416
416
|
const w = (
|
|
@@ -198,9 +198,9 @@ export default {
|
|
|
198
198
|
|
|
199
199
|
value = `<b>Open:</b> ${open} <b>High:</b> ${high} <b>Low:</b> ${low} <b>Close:</b> ${close}${volume ? ` <b>Volume:</b> ${volume}` : ""}`;
|
|
200
200
|
} else if ($$.isBarRangeType(row)) {
|
|
201
|
-
const {value:
|
|
201
|
+
const {value: rangeValue, id, index} = row;
|
|
202
202
|
|
|
203
|
-
value = `${valueFormat(
|
|
203
|
+
value = `${valueFormat(rangeValue, undefined, id, index)}`;
|
|
204
204
|
} else {
|
|
205
205
|
value = valueFormat(getRowValue(row), ...param);
|
|
206
206
|
}
|
|
@@ -37,7 +37,7 @@ export default {
|
|
|
37
37
|
y = isRotated ? state.height + padding : 0;
|
|
38
38
|
} else if (target === "y2") {
|
|
39
39
|
x = isRotated ? 0 : state.width + padding;
|
|
40
|
-
y = isRotated ?
|
|
40
|
+
y = isRotated ? -padding - 1 : 0;
|
|
41
41
|
} else if (target === "subX") {
|
|
42
42
|
x = 0;
|
|
43
43
|
y = isRotated ? 0 : state.height2;
|
|
@@ -440,7 +440,7 @@ export default {
|
|
|
440
440
|
if ($$.shouldShowArcLabel()) {
|
|
441
441
|
selection
|
|
442
442
|
.style("fill", $$.updateTextColor.bind($$))
|
|
443
|
-
.attr("filter", $$.
|
|
443
|
+
.attr("filter", $$.updateTextBackgroundColor.bind($$))
|
|
444
444
|
.each(function(d) {
|
|
445
445
|
const node = d3Select(this);
|
|
446
446
|
const updated = $$.updateAngle(d);
|
|
@@ -273,6 +273,8 @@ export default {
|
|
|
273
273
|
|
|
274
274
|
if (isNumber(d)) {
|
|
275
275
|
value = d;
|
|
276
|
+
} else if ($$.isAreaRangeType(d)) {
|
|
277
|
+
value = $$.getBaseValue(d, "mid");
|
|
276
278
|
} else if (isStackNormalized) {
|
|
277
279
|
value = $$.getRatio("index", d, true);
|
|
278
280
|
} else if ($$.isBubbleZType(d)) {
|
package/src/module/browser.ts
CHANGED
|
@@ -33,14 +33,16 @@ function getGlobal() {
|
|
|
33
33
|
* @private
|
|
34
34
|
*/
|
|
35
35
|
function getFallback(w) {
|
|
36
|
-
const hasRAF = typeof w?.requestAnimationFrame === "function";
|
|
37
|
-
const hasRIC = typeof w?.requestIdleCallback === "function";
|
|
36
|
+
const hasRAF = typeof w?.requestAnimationFrame === "function" && typeof w?.cancelAnimationFrame === "function";
|
|
37
|
+
const hasRIC = typeof w?.requestIdleCallback === "function" && typeof w?.cancelIdleCallback === "function";
|
|
38
|
+
const request = cb => setTimeout(cb, 1);
|
|
39
|
+
const cancel = id => clearTimeout(id);
|
|
38
40
|
|
|
39
41
|
return [
|
|
40
|
-
hasRAF ? w.requestAnimationFrame :
|
|
41
|
-
hasRAF ? w.cancelAnimationFrame :
|
|
42
|
-
hasRIC ? w.requestIdleCallback :
|
|
43
|
-
hasRIC ? w.cancelIdleCallback :
|
|
42
|
+
hasRAF ? w.requestAnimationFrame : request,
|
|
43
|
+
hasRAF ? w.cancelAnimationFrame : cancel,
|
|
44
|
+
hasRIC ? w.requestIdleCallback : request,
|
|
45
|
+
hasRIC ? w.cancelIdleCallback : cancel
|
|
44
46
|
];
|
|
45
47
|
}
|
|
46
48
|
|