billboard.js 3.16.0-next.1 → 3.16.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 +2 -1
- package/dist/billboard.js +215 -165
- package/dist/billboard.min.css +2 -2
- package/dist/billboard.min.js +9 -9
- package/dist/billboard.pkgd.js +215 -165
- package/dist/billboard.pkgd.min.js +17 -17
- 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 +23 -9
- package/dist/plugin/billboardjs-plugin-sparkline.min.js +3 -3
- package/dist/plugin/billboardjs-plugin-stanford.js +23 -9
- package/dist/plugin/billboardjs-plugin-stanford.min.js +5 -5
- package/dist/plugin/billboardjs-plugin-tableview.js +18 -7
- package/dist/plugin/billboardjs-plugin-tableview.min.js +4 -4
- package/dist/plugin/billboardjs-plugin-textoverlap.js +18 -7
- package/dist/plugin/billboardjs-plugin-textoverlap.min.js +4 -4
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.js +23 -9
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.min.js +3 -3
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.js +23 -9
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.min.js +4 -4
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.js +18 -7
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.min.js +4 -4
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.js +18 -7
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.min.js +5 -5
- package/dist/theme/dark.css +2 -1
- package/dist/theme/dark.min.css +2 -2
- package/dist/theme/datalab.css +2 -1
- package/dist/theme/datalab.min.css +2 -2
- package/dist/theme/graph.css +2 -1
- package/dist/theme/graph.min.css +2 -2
- package/dist/theme/insight.css +2 -1
- package/dist/theme/insight.min.css +2 -2
- package/dist/theme/modern.css +2 -1
- package/dist/theme/modern.min.css +2 -2
- package/dist-esm/billboard.js +293 -208
- package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-sparkline.js +7 -4
- 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 +11 -11
- package/src/Chart/api/export.ts +11 -4
- package/src/ChartInternal/Axis/Axis.ts +18 -5
- package/src/ChartInternal/Axis/AxisRenderer.ts +15 -3
- package/src/ChartInternal/Axis/AxisRendererHelper.ts +2 -2
- package/src/ChartInternal/ChartInternal.ts +51 -60
- package/src/ChartInternal/data/convert.ts +87 -48
- package/src/ChartInternal/data/data.ts +17 -38
- package/src/ChartInternal/interactions/eventrect.ts +8 -3
- package/src/ChartInternal/interactions/interaction.ts +2 -1
- package/src/ChartInternal/internals/domain.ts +1 -1
- package/src/ChartInternal/internals/grid.ts +1 -1
- package/src/ChartInternal/internals/size.ts +16 -5
- package/src/ChartInternal/internals/text.ts +30 -17
- package/src/ChartInternal/internals/tooltip.ts +2 -1
- package/src/ChartInternal/shape/arc.ts +2 -4
- package/src/ChartInternal/shape/point.ts +3 -2
- package/src/ChartInternal/shape/radar.ts +2 -1
- package/src/ChartInternal/shape/shape.ts +2 -1
- package/src/config/Options/axis/axis.ts +19 -5
- package/src/config/Options/axis/y2.ts +0 -13
- package/src/config/Options/common/main.ts +1 -1
- package/src/config/classes.ts +5 -2
- package/src/module/util.ts +45 -20
- package/src/scss/billboard.scss +1 -0
- package/src/scss/theme/dark.scss +1 -0
- package/src/scss/theme/datalab.scss +1 -0
- package/src/scss/theme/graph.scss +1 -0
- package/src/scss/theme/insight.scss +1 -0
- package/src/scss/theme/modern.scss +1 -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.16.0
|
|
8
|
+
* @version 3.16.0
|
|
9
9
|
*
|
|
10
10
|
* All-in-one packaged file for ease use of 'billboard.js' with dependant d3.js modules & polyfills.
|
|
11
11
|
* - @types/d3-selection ^3.0.11
|
|
@@ -23176,7 +23176,8 @@ const $COMMON = {
|
|
|
23176
23176
|
empty: "bb-empty",
|
|
23177
23177
|
main: "bb-main",
|
|
23178
23178
|
target: "bb-target",
|
|
23179
|
-
EXPANDED: "_expanded_"
|
|
23179
|
+
EXPANDED: "_expanded_",
|
|
23180
|
+
dummy: "_dummy_"
|
|
23180
23181
|
};
|
|
23181
23182
|
const $ARC = {
|
|
23182
23183
|
arc: "bb-arc",
|
|
@@ -23203,7 +23204,9 @@ const $AXIS = {
|
|
|
23203
23204
|
axisYLabel: "bb-axis-y-label",
|
|
23204
23205
|
axisXTooltip: "bb-axis-x-tooltip",
|
|
23205
23206
|
axisYTooltip: "bb-axis-y-tooltip",
|
|
23206
|
-
axisY2Tooltip: "bb-axis-y2-tooltip"
|
|
23207
|
+
axisY2Tooltip: "bb-axis-y2-tooltip",
|
|
23208
|
+
axisTooltipX: "bb-axis-tooltip-x",
|
|
23209
|
+
axisTooltipY: "bb-axis-tooltip-y"
|
|
23207
23210
|
};
|
|
23208
23211
|
const $BAR = {
|
|
23209
23212
|
bar: "bb-bar",
|
|
@@ -23800,7 +23803,7 @@ const $ZOOM = {
|
|
|
23800
23803
|
* }
|
|
23801
23804
|
*/
|
|
23802
23805
|
resize_auto: true,
|
|
23803
|
-
resize_timer:
|
|
23806
|
+
resize_timer: true,
|
|
23804
23807
|
/**
|
|
23805
23808
|
* Set a callback to execute when the chart is clicked.
|
|
23806
23809
|
* @name onclick
|
|
@@ -27539,7 +27542,7 @@ function getRectSegList(path) {
|
|
|
27539
27542
|
];
|
|
27540
27543
|
}
|
|
27541
27544
|
function getPathBox(path) {
|
|
27542
|
-
const { width, height } = path
|
|
27545
|
+
const { width, height } = getBoundingRect(path);
|
|
27543
27546
|
const items = getRectSegList(path);
|
|
27544
27547
|
const x = items[0].x;
|
|
27545
27548
|
const y = Math.min(items[0].y, items[1].y);
|
|
@@ -27571,9 +27574,20 @@ function getBrushSelection(ctx) {
|
|
|
27571
27574
|
}
|
|
27572
27575
|
return selection;
|
|
27573
27576
|
}
|
|
27574
|
-
function
|
|
27575
|
-
const
|
|
27576
|
-
|
|
27577
|
+
function getRect(relativeViewport, node, forceEval = false) {
|
|
27578
|
+
const _ = (n) => n[relativeViewport ? "getBoundingClientRect" : "getBBox"]();
|
|
27579
|
+
if (forceEval) {
|
|
27580
|
+
return _(node);
|
|
27581
|
+
} else {
|
|
27582
|
+
const needEvaluate = !("rect" in node) || "rect" in node && node.hasAttribute("width") && node.rect.width !== +(node.getAttribute("width") || 0);
|
|
27583
|
+
return needEvaluate ? node.rect = _(node) : node.rect;
|
|
27584
|
+
}
|
|
27585
|
+
}
|
|
27586
|
+
function getBoundingRect(node, forceEval = false) {
|
|
27587
|
+
return getRect(true, node, forceEval);
|
|
27588
|
+
}
|
|
27589
|
+
function getBBox(node, forceEval = false) {
|
|
27590
|
+
return getRect(false, node, forceEval);
|
|
27577
27591
|
}
|
|
27578
27592
|
function getRandom(asStr = true, min = 0, max = 1e4) {
|
|
27579
27593
|
const crpt = win.crypto || win.msCrypto;
|
|
@@ -27669,7 +27683,7 @@ function getTransformCTM(node, x = 0, y = 0, inverse = true) {
|
|
|
27669
27683
|
inverse ? screen == null ? void 0 : screen.inverse() : screen
|
|
27670
27684
|
);
|
|
27671
27685
|
if (inverse === false) {
|
|
27672
|
-
const rect = node
|
|
27686
|
+
const rect = getBoundingRect(node);
|
|
27673
27687
|
res.x -= rect.x;
|
|
27674
27688
|
res.y -= rect.y;
|
|
27675
27689
|
}
|
|
@@ -28782,6 +28796,35 @@ function getDataKeyForJson(keysParam, config) {
|
|
|
28782
28796
|
}
|
|
28783
28797
|
return keys;
|
|
28784
28798
|
}
|
|
28799
|
+
function setXS(ids, data, params) {
|
|
28800
|
+
const $$ = this;
|
|
28801
|
+
const { config } = $$;
|
|
28802
|
+
let xsData;
|
|
28803
|
+
ids.forEach((id) => {
|
|
28804
|
+
const xKey = $$.getXKey(id);
|
|
28805
|
+
if (params.customX || params.timeSeries) {
|
|
28806
|
+
if (params.xs.indexOf(xKey) >= 0) {
|
|
28807
|
+
xsData = (params.appendXs && $$.data.xs[id] || []).concat(
|
|
28808
|
+
data.map((d, i) => {
|
|
28809
|
+
const rawX = isValue(d[xKey]);
|
|
28810
|
+
return rawX ? $$.generateTargetX(rawX, id, i) : false;
|
|
28811
|
+
}).filter((v) => v !== false)
|
|
28812
|
+
);
|
|
28813
|
+
} else if (config.data_x) {
|
|
28814
|
+
xsData = this.getOtherTargetXs();
|
|
28815
|
+
} else if (notEmpty(config.data_xs)) {
|
|
28816
|
+
xsData = $$.getXValuesOfXKey(xKey, $$.data.targets);
|
|
28817
|
+
}
|
|
28818
|
+
} else {
|
|
28819
|
+
xsData = data.map((d, i) => i);
|
|
28820
|
+
}
|
|
28821
|
+
if (xsData) {
|
|
28822
|
+
$$.data.xs[id] = xsData;
|
|
28823
|
+
} else {
|
|
28824
|
+
throw new Error(`x is not defined for id = "${id}".`);
|
|
28825
|
+
}
|
|
28826
|
+
});
|
|
28827
|
+
}
|
|
28785
28828
|
/* harmony default export */ var convert = ({
|
|
28786
28829
|
/**
|
|
28787
28830
|
* Convert data according its type
|
|
@@ -28823,49 +28866,43 @@ function getDataKeyForJson(keysParam, config) {
|
|
|
28823
28866
|
throw Error("url or json or rows or columns is required.");
|
|
28824
28867
|
}
|
|
28825
28868
|
},
|
|
28869
|
+
/**
|
|
28870
|
+
* Convert data to targets
|
|
28871
|
+
* @param {object[]} data Data to convert
|
|
28872
|
+
* @param {boolean} appendXs Whether to append xs
|
|
28873
|
+
* @returns {IData[]} Converted targets
|
|
28874
|
+
* @private
|
|
28875
|
+
*/
|
|
28826
28876
|
convertDataToTargets(data, appendXs) {
|
|
28827
28877
|
const $$ = this;
|
|
28828
28878
|
const { axis, config, state } = $$;
|
|
28829
28879
|
const chartType = config.data_type;
|
|
28830
|
-
let isCategorized = false;
|
|
28831
|
-
let isTimeSeries = false;
|
|
28832
|
-
let isCustomX = false;
|
|
28833
|
-
if (axis) {
|
|
28834
|
-
isCategorized = axis.isCategorized();
|
|
28835
|
-
isTimeSeries = axis.isTimeSeries();
|
|
28836
|
-
isCustomX = axis.isCustomX();
|
|
28837
|
-
}
|
|
28838
28880
|
const dataKeys = Object.keys(data[0] || {});
|
|
28839
|
-
const ids = dataKeys.length ? dataKeys.
|
|
28840
|
-
|
|
28841
|
-
|
|
28842
|
-
|
|
28843
|
-
|
|
28844
|
-
|
|
28845
|
-
|
|
28846
|
-
|
|
28847
|
-
|
|
28848
|
-
|
|
28849
|
-
|
|
28850
|
-
|
|
28851
|
-
|
|
28852
|
-
|
|
28853
|
-
|
|
28854
|
-
|
|
28855
|
-
|
|
28856
|
-
}
|
|
28857
|
-
xsData && (this.data.xs[id] = xsData);
|
|
28858
|
-
});
|
|
28859
|
-
ids.forEach((id) => {
|
|
28860
|
-
if (!this.data.xs[id]) {
|
|
28861
|
-
throw new Error(`x is not defined for id = "${id}".`);
|
|
28862
|
-
}
|
|
28863
|
-
});
|
|
28881
|
+
const { ids, xs } = dataKeys.length ? dataKeys.reduce((acc, key) => {
|
|
28882
|
+
if ($$.isX.call($$, key)) {
|
|
28883
|
+
acc.xs.push(key);
|
|
28884
|
+
} else if ($$.isNotX.call($$, key)) {
|
|
28885
|
+
acc.ids.push(key);
|
|
28886
|
+
}
|
|
28887
|
+
return acc;
|
|
28888
|
+
}, { ids: [], xs: [] }) : { ids: [], xs: [] };
|
|
28889
|
+
const params = {
|
|
28890
|
+
appendXs,
|
|
28891
|
+
xs,
|
|
28892
|
+
idConverter: config.data_idConverter.bind($$.api),
|
|
28893
|
+
categorized: axis == null ? void 0 : axis.isCategorized(),
|
|
28894
|
+
timeSeries: axis == null ? void 0 : axis.isTimeSeries(),
|
|
28895
|
+
customX: axis == null ? void 0 : axis.isCustomX()
|
|
28896
|
+
};
|
|
28897
|
+
setXS.bind($$)(ids, data, params);
|
|
28864
28898
|
const targets = ids.map((id, index) => {
|
|
28865
28899
|
const convertedId = config.data_idConverter.bind($$.api)(id);
|
|
28866
28900
|
const xKey = $$.getXKey(id);
|
|
28867
|
-
const isCategory =
|
|
28868
|
-
const hasCategory = isCategory &&
|
|
28901
|
+
const isCategory = params.customX && params.categorized;
|
|
28902
|
+
const hasCategory = isCategory && (() => {
|
|
28903
|
+
const categorySet = new Set(config.axis_x_categories);
|
|
28904
|
+
return data.every((v) => categorySet.has(v.x));
|
|
28905
|
+
})();
|
|
28869
28906
|
const isDataAppend = data.__append__;
|
|
28870
28907
|
const xIndex = xKey === null && isDataAppend ? $$.api.data.values(id).length : 0;
|
|
28871
28908
|
return {
|
|
@@ -29129,9 +29166,10 @@ function getDataKeyForJson(keysParam, config) {
|
|
|
29129
29166
|
const minMax = $$.getMinMaxValue(data);
|
|
29130
29167
|
let min = [];
|
|
29131
29168
|
let max = [];
|
|
29169
|
+
const { min: minVal, max: maxVal } = minMax;
|
|
29132
29170
|
data.forEach((v) => {
|
|
29133
|
-
const minData = $$.getFilteredDataByValue(v,
|
|
29134
|
-
const maxData = $$.getFilteredDataByValue(v,
|
|
29171
|
+
const minData = $$.getFilteredDataByValue(v, minVal);
|
|
29172
|
+
const maxData = $$.getFilteredDataByValue(v, maxVal);
|
|
29135
29173
|
if (minData.length) {
|
|
29136
29174
|
min = min.concat(minData);
|
|
29137
29175
|
}
|
|
@@ -29159,7 +29197,7 @@ function getDataKeyForJson(keysParam, config) {
|
|
|
29159
29197
|
if (!sum[i]) {
|
|
29160
29198
|
sum[i] = 0;
|
|
29161
29199
|
}
|
|
29162
|
-
sum[i] +=
|
|
29200
|
+
sum[i] += ~~v.value;
|
|
29163
29201
|
});
|
|
29164
29202
|
});
|
|
29165
29203
|
}
|
|
@@ -29176,8 +29214,9 @@ function getDataKeyForJson(keysParam, config) {
|
|
|
29176
29214
|
const cacheKey = KEY.dataTotalSum;
|
|
29177
29215
|
let total = $$.cache.get(cacheKey);
|
|
29178
29216
|
if (!isNumber(total)) {
|
|
29179
|
-
|
|
29180
|
-
|
|
29217
|
+
total = $$.data.targets.reduce((acc, t) => {
|
|
29218
|
+
return acc + t.values.reduce((sum, v) => sum + ~~v.value, 0);
|
|
29219
|
+
}, 0);
|
|
29181
29220
|
$$.cache.add(cacheKey, total);
|
|
29182
29221
|
}
|
|
29183
29222
|
if (subtractHidden) {
|
|
@@ -29341,17 +29380,7 @@ function getDataKeyForJson(keysParam, config) {
|
|
|
29341
29380
|
return ys;
|
|
29342
29381
|
},
|
|
29343
29382
|
checkValueInTargets(targets, checker) {
|
|
29344
|
-
|
|
29345
|
-
let values;
|
|
29346
|
-
for (let i = 0; i < ids.length; i++) {
|
|
29347
|
-
values = targets[ids[i]].values;
|
|
29348
|
-
for (let j = 0; j < values.length; j++) {
|
|
29349
|
-
if (checker(values[j].value)) {
|
|
29350
|
-
return true;
|
|
29351
|
-
}
|
|
29352
|
-
}
|
|
29353
|
-
}
|
|
29354
|
-
return false;
|
|
29383
|
+
return Object.keys(targets).some((id) => targets[id].values.some((v) => checker(v.value)));
|
|
29355
29384
|
},
|
|
29356
29385
|
hasMultiTargets() {
|
|
29357
29386
|
return this.filterTargetsToShow().length > 1;
|
|
@@ -29478,13 +29507,12 @@ function getDataKeyForJson(keysParam, config) {
|
|
|
29478
29507
|
return index;
|
|
29479
29508
|
},
|
|
29480
29509
|
getDataLabelLength(min, max, key) {
|
|
29510
|
+
var _a;
|
|
29481
29511
|
const $$ = this;
|
|
29482
|
-
const lengths = [0, 0];
|
|
29483
29512
|
const paddingCoef = 1.3;
|
|
29484
|
-
|
|
29485
|
-
|
|
29486
|
-
|
|
29487
|
-
return lengths;
|
|
29513
|
+
return ((_a = $$.getTextRect(
|
|
29514
|
+
[min, max].map((v) => $$.dataLabelFormat()(v))
|
|
29515
|
+
)) == null ? void 0 : _a.map((rect) => rect[key] * paddingCoef)) || [0, 0];
|
|
29488
29516
|
},
|
|
29489
29517
|
isNoneArc(d) {
|
|
29490
29518
|
return this.hasTarget(this.data.targets, d.id);
|
|
@@ -29666,9 +29694,7 @@ function getDataKeyForJson(keysParam, config) {
|
|
|
29666
29694
|
if (state.hiddenTargetIds.length) {
|
|
29667
29695
|
let hiddenSum = dataValues(state.hiddenTargetIds, false);
|
|
29668
29696
|
if (hiddenSum.length) {
|
|
29669
|
-
hiddenSum = hiddenSum.reduce(
|
|
29670
|
-
(acc, curr) => acc.map((v, i) => (isNumber(v) ? v : 0) + curr[i])
|
|
29671
|
-
);
|
|
29697
|
+
hiddenSum = hiddenSum.reduce((acc, curr) => acc.map((v, i) => ~~v + curr[i]));
|
|
29672
29698
|
total = total.map((v, i) => v - hiddenSum[i]);
|
|
29673
29699
|
}
|
|
29674
29700
|
}
|
|
@@ -29729,7 +29755,7 @@ function getDataKeyForJson(keysParam, config) {
|
|
|
29729
29755
|
isBarRangeType(d) {
|
|
29730
29756
|
const $$ = this;
|
|
29731
29757
|
const { value } = d;
|
|
29732
|
-
return $$.isBarType(d) && isArray(value) && value.length >= 2 && value.every(
|
|
29758
|
+
return $$.isBarType(d) && isArray(value) && value.length >= 2 && value.every(isNumber);
|
|
29733
29759
|
},
|
|
29734
29760
|
/**
|
|
29735
29761
|
* Get data object by id
|
|
@@ -30193,7 +30219,7 @@ function drag_defaultTouchable() {
|
|
|
30193
30219
|
if (element) {
|
|
30194
30220
|
const isMultipleX = $$.isMultipleX();
|
|
30195
30221
|
const isRotated = config.axis_rotated;
|
|
30196
|
-
let { width, left, top } = element
|
|
30222
|
+
let { width, left, top } = getBoundingRect(element);
|
|
30197
30223
|
if (hasAxis && !hasRadar && !isMultipleX) {
|
|
30198
30224
|
const coords = eventReceiver.coords[index];
|
|
30199
30225
|
if (coords) {
|
|
@@ -33176,7 +33202,7 @@ function getScale(type = "linear", min, max) {
|
|
|
33176
33202
|
let v = 0;
|
|
33177
33203
|
while (v < 30 && parent && parent.tagName !== "BODY") {
|
|
33178
33204
|
try {
|
|
33179
|
-
v = parent
|
|
33205
|
+
v = getBoundingRect(parent, true)[key];
|
|
33180
33206
|
} catch (e) {
|
|
33181
33207
|
if (offsetName in parent) {
|
|
33182
33208
|
v = parent[offsetName];
|
|
@@ -33211,11 +33237,11 @@ function getScale(type = "linear", min, max) {
|
|
|
33211
33237
|
if (hasAxis && (isString(leftLabel) || isString(leftLabel.text) || /^inner-/.test(leftLabel == null ? void 0 : leftLabel.position))) {
|
|
33212
33238
|
const label = $el.main.select(`.${leftAxisClass}-label`);
|
|
33213
33239
|
if (!label.empty()) {
|
|
33214
|
-
labelWidth = label.node()
|
|
33240
|
+
labelWidth = getBoundingRect(label.node()).left;
|
|
33215
33241
|
}
|
|
33216
33242
|
}
|
|
33217
|
-
const svgRect = leftAxis && hasLeftAxisRect ? leftAxis
|
|
33218
|
-
const chartRectLeft = $el.chart.node()
|
|
33243
|
+
const svgRect = leftAxis && hasLeftAxisRect ? getBoundingRect(leftAxis, !withoutRecompute) : { right: 0 };
|
|
33244
|
+
const chartRectLeft = getBoundingRect($el.chart.node(), !withoutRecompute).left + labelWidth;
|
|
33219
33245
|
const hasArc = $$.hasArcType();
|
|
33220
33246
|
const svgLeft = svgRect.right - chartRectLeft - (hasArc ? 0 : $$.getCurrentPaddingByDirection("left", withoutRecompute));
|
|
33221
33247
|
return svgLeft > 0 ? svgLeft : 0;
|
|
@@ -33705,27 +33731,35 @@ function getTextPos(d, type) {
|
|
|
33705
33731
|
},
|
|
33706
33732
|
/**
|
|
33707
33733
|
* Gets the getBoundingClientRect value of the element
|
|
33708
|
-
* @param {HTMLElement|d3.selection}
|
|
33734
|
+
* @param {HTMLElement|d3.selection|Array} source Target element
|
|
33709
33735
|
* @param {string} className Class name
|
|
33710
33736
|
* @returns {object} value of element.getBoundingClientRect()
|
|
33711
33737
|
* @private
|
|
33712
33738
|
*/
|
|
33713
|
-
getTextRect(
|
|
33739
|
+
getTextRect(source, className) {
|
|
33740
|
+
var _a, _b;
|
|
33714
33741
|
const $$ = this;
|
|
33715
|
-
let
|
|
33716
|
-
|
|
33717
|
-
|
|
33742
|
+
let cacheKey;
|
|
33743
|
+
let base;
|
|
33744
|
+
let text;
|
|
33745
|
+
if (Array.isArray(source)) {
|
|
33746
|
+
cacheKey = `${KEY.textRect}-${source.join("_")}`;
|
|
33747
|
+
} else {
|
|
33748
|
+
base = (_b = (_a = source.node) == null ? void 0 : _a.call(source)) != null ? _b : source;
|
|
33749
|
+
if (!/text/i.test(base.tagName)) {
|
|
33750
|
+
base = base.querySelector("text");
|
|
33751
|
+
}
|
|
33752
|
+
text = base.textContent;
|
|
33753
|
+
cacheKey = `${KEY.textRect}-${text.replace(/\W/g, "_")}`;
|
|
33718
33754
|
}
|
|
33719
|
-
const
|
|
33720
|
-
|
|
33721
|
-
|
|
33722
|
-
|
|
33723
|
-
$$.$el.svg.append("text").style("visibility", "hidden").style("font", src_select(base).style("font")).classed(className, true).text(text).call((v) => {
|
|
33724
|
-
rect = getBoundingRect(v.node());
|
|
33755
|
+
const rect = $$.cache.get(cacheKey) || [];
|
|
33756
|
+
if (rect.length === 0) {
|
|
33757
|
+
($$.$el.svg || $$.$el.chart.select("svg")).selectAll(`.${$COMMON.dummy}`).data(text ? [text] : source).enter().append("text").style("visibility", "hidden").style("font", base ? src_select(base).style("font") : null).classed(className || $COMMON.dummy, true).text((d) => d).each(function(v, i) {
|
|
33758
|
+
rect[i] = getBoundingRect(this);
|
|
33725
33759
|
}).remove();
|
|
33726
33760
|
$$.cache.add(cacheKey, rect);
|
|
33727
33761
|
}
|
|
33728
|
-
return rect;
|
|
33762
|
+
return rect.length > 1 ? rect : rect[0];
|
|
33729
33763
|
},
|
|
33730
33764
|
/**
|
|
33731
33765
|
* Gets the x or y coordinate of the text
|
|
@@ -34255,7 +34289,7 @@ function getTextXPos(pos = "left", width) {
|
|
|
34255
34289
|
y = isRotated ? currPos.xAxis : y;
|
|
34256
34290
|
}
|
|
34257
34291
|
const ctm = getTransformCTM(target, x, y, false);
|
|
34258
|
-
const rect = target
|
|
34292
|
+
const rect = getBoundingRect(target);
|
|
34259
34293
|
const size = getTransformCTM(target, 20, 0, false).x;
|
|
34260
34294
|
let top = ctm.y;
|
|
34261
34295
|
let left = ctm.x + tWidth / 2 + size;
|
|
@@ -36122,7 +36156,7 @@ function getGroupedDataPointsFn(d) {
|
|
|
36122
36156
|
const x = Math.min(seg0.x, seg1.x);
|
|
36123
36157
|
const y = Math.min(seg0.y, seg1.y);
|
|
36124
36158
|
const offset = this.config.bar_sensitivity;
|
|
36125
|
-
const { width, height } =
|
|
36159
|
+
const { width, height } = getBBox(that, true);
|
|
36126
36160
|
const sx = x - offset;
|
|
36127
36161
|
const ex = x + width + offset;
|
|
36128
36162
|
const sy = y + height + offset;
|
|
@@ -36264,14 +36298,15 @@ class ChartInternal {
|
|
|
36264
36298
|
init() {
|
|
36265
36299
|
const $$ = this;
|
|
36266
36300
|
const { config, state, $el } = $$;
|
|
36267
|
-
const
|
|
36301
|
+
const { boost_useCssRule, bindto } = config;
|
|
36268
36302
|
checkModuleImport($$);
|
|
36303
|
+
const hasArcType = $$.hasArcType();
|
|
36269
36304
|
state.hasRadar = !state.hasAxis && $$.hasType("radar");
|
|
36270
36305
|
state.hasFunnel = !state.hasAxis && $$.hasType("funnel");
|
|
36271
36306
|
state.hasTreemap = !state.hasAxis && $$.hasType("treemap");
|
|
36272
|
-
state.hasAxis =
|
|
36307
|
+
state.hasAxis = !hasArcType && !state.hasFunnel && !state.hasTreemap;
|
|
36273
36308
|
state.datetimeId = `bb-${+/* @__PURE__ */ new Date() * getRandom()}`;
|
|
36274
|
-
if (
|
|
36309
|
+
if (boost_useCssRule) {
|
|
36275
36310
|
const styleEl = browser_doc.createElement("style");
|
|
36276
36311
|
styleEl.type = "text/css";
|
|
36277
36312
|
browser_doc.head.appendChild(styleEl);
|
|
@@ -36281,19 +36316,19 @@ class ChartInternal {
|
|
|
36281
36316
|
};
|
|
36282
36317
|
$el.style = styleEl;
|
|
36283
36318
|
}
|
|
36284
|
-
const
|
|
36285
|
-
element:
|
|
36319
|
+
const bindConfig = {
|
|
36320
|
+
element: bindto,
|
|
36286
36321
|
classname: "bb"
|
|
36287
36322
|
};
|
|
36288
|
-
if (isObject(
|
|
36289
|
-
|
|
36290
|
-
|
|
36323
|
+
if (isObject(bindto)) {
|
|
36324
|
+
bindConfig.element = bindto.element || "#chart";
|
|
36325
|
+
bindConfig.classname = bindto.classname || bindConfig.classname;
|
|
36291
36326
|
}
|
|
36292
|
-
$el.chart = isFunction(
|
|
36327
|
+
$el.chart = isFunction(bindConfig.element.node) ? bindto.element : src_select(bindConfig.element || []);
|
|
36293
36328
|
if ($el.chart.empty()) {
|
|
36294
36329
|
$el.chart = src_select(browser_doc.body.appendChild(browser_doc.createElement("div")));
|
|
36295
36330
|
}
|
|
36296
|
-
$el.chart.html("").classed(
|
|
36331
|
+
$el.chart.html("").classed(bindConfig.classname, true).classed(state.datetimeId, boost_useCssRule).style("position", "relative");
|
|
36297
36332
|
$$.initParams();
|
|
36298
36333
|
$$.initToRender();
|
|
36299
36334
|
}
|
|
@@ -36330,7 +36365,6 @@ class ChartInternal {
|
|
|
36330
36365
|
var _a;
|
|
36331
36366
|
const $$ = this;
|
|
36332
36367
|
const { config, format: format2, state } = $$;
|
|
36333
|
-
const isRotated = config.axis_rotated;
|
|
36334
36368
|
$$.color = $$.generateColor();
|
|
36335
36369
|
$$.levelColor = $$.generateLevelColor();
|
|
36336
36370
|
if (config.padding === false) {
|
|
@@ -36347,7 +36381,7 @@ class ChartInternal {
|
|
|
36347
36381
|
format2.extraLineClasses = $$.generateExtraLineClass();
|
|
36348
36382
|
format2.dataTime = config.data_xLocaltime ? timeParse : utcParse;
|
|
36349
36383
|
format2.axisTime = config.axis_x_localtime ? timeFormat : utcFormat;
|
|
36350
|
-
const isDragZoom =
|
|
36384
|
+
const isDragZoom = config.zoom_enabled && config.zoom_type === "drag";
|
|
36351
36385
|
format2.defaultAxisTime = (d) => {
|
|
36352
36386
|
const { x, zoom } = $$.scale;
|
|
36353
36387
|
const isZoomed = isDragZoom ? zoom : zoom && x.orgDomain().toString() !== zoom.domain().toString();
|
|
@@ -36355,12 +36389,13 @@ class ChartInternal {
|
|
|
36355
36389
|
return format2.axisTime(specifier)(d);
|
|
36356
36390
|
};
|
|
36357
36391
|
}
|
|
36358
|
-
|
|
36359
|
-
state.
|
|
36360
|
-
state.
|
|
36361
|
-
state.
|
|
36392
|
+
const { legend_position, legend_inset_anchor, axis_rotated } = config;
|
|
36393
|
+
state.isLegendRight = legend_position === "right";
|
|
36394
|
+
state.isLegendInset = legend_position === "inset";
|
|
36395
|
+
state.isLegendTop = legend_inset_anchor === "top-left" || legend_inset_anchor === "top-right";
|
|
36396
|
+
state.isLegendLeft = legend_inset_anchor === "top-left" || legend_inset_anchor === "bottom-left";
|
|
36362
36397
|
state.rotatedPadding.top = $$.getResettedPadding(state.rotatedPadding.top);
|
|
36363
|
-
state.rotatedPadding.right =
|
|
36398
|
+
state.rotatedPadding.right = axis_rotated && !config.axis_x_show ? 0 : 30;
|
|
36364
36399
|
state.inputType = convertInputType(
|
|
36365
36400
|
config.interaction_inputType_mouse,
|
|
36366
36401
|
config.interaction_inputType_touch
|
|
@@ -36422,7 +36457,7 @@ class ChartInternal {
|
|
|
36422
36457
|
if (hasAxis || hasColorPatterns || hasPolar || hasTreemap || labelsBGColor || ((_a = $$.hasLegendDefsPoint) == null ? void 0 : _a.call($$))) {
|
|
36423
36458
|
$el.defs = $el.svg.append("defs");
|
|
36424
36459
|
if (hasAxis) {
|
|
36425
|
-
["id", "idXAxis", "idYAxis", "
|
|
36460
|
+
["id", "idXAxis", "idYAxis", "idGrid"].forEach((v) => {
|
|
36426
36461
|
$$.appendClip($el.defs, state.clip[v]);
|
|
36427
36462
|
});
|
|
36428
36463
|
}
|
|
@@ -36487,22 +36522,23 @@ class ChartInternal {
|
|
|
36487
36522
|
if ($$.config.bar_front) {
|
|
36488
36523
|
shapes.push(shapes.shift());
|
|
36489
36524
|
}
|
|
36490
|
-
shapes
|
|
36491
|
-
const name = capitalize(
|
|
36492
|
-
if (
|
|
36525
|
+
for (const shape2 of shapes) {
|
|
36526
|
+
const name = capitalize(shape2);
|
|
36527
|
+
if (shape2 === "line" && $$.hasTypeOf(name) || $$.hasType(shape2)) {
|
|
36493
36528
|
types.push(name);
|
|
36494
36529
|
}
|
|
36495
|
-
}
|
|
36530
|
+
}
|
|
36496
36531
|
} else if (hasTreemap) {
|
|
36497
36532
|
types.push("Treemap");
|
|
36498
36533
|
} else if ($$.hasType("funnel")) {
|
|
36499
36534
|
types.push("Funnel");
|
|
36500
36535
|
} else {
|
|
36501
36536
|
const hasPolar = $$.hasType("polar");
|
|
36537
|
+
const hasGauge = $$.hasType("gauge");
|
|
36502
36538
|
if (!hasRadar) {
|
|
36503
36539
|
types.push("Arc", "Pie");
|
|
36504
36540
|
}
|
|
36505
|
-
if (
|
|
36541
|
+
if (hasGauge) {
|
|
36506
36542
|
types.push("Gauge");
|
|
36507
36543
|
} else if (hasRadar) {
|
|
36508
36544
|
types.push("Radar");
|
|
@@ -36510,10 +36546,12 @@ class ChartInternal {
|
|
|
36510
36546
|
types.push("Polar");
|
|
36511
36547
|
}
|
|
36512
36548
|
}
|
|
36513
|
-
types
|
|
36514
|
-
$$[`init${
|
|
36515
|
-
}
|
|
36516
|
-
notEmpty($$.config.data_labels) && !$$.hasArcType(null, ["radar"])
|
|
36549
|
+
for (const type of types) {
|
|
36550
|
+
$$[`init${type}`]();
|
|
36551
|
+
}
|
|
36552
|
+
if (notEmpty($$.config.data_labels) && !$$.hasArcType(null, ["radar"])) {
|
|
36553
|
+
$$.initText();
|
|
36554
|
+
}
|
|
36517
36555
|
}
|
|
36518
36556
|
/**
|
|
36519
36557
|
* Set chart elements
|
|
@@ -36582,7 +36620,7 @@ class ChartInternal {
|
|
|
36582
36620
|
* @private
|
|
36583
36621
|
*/
|
|
36584
36622
|
updateTargets(targets) {
|
|
36585
|
-
var _a;
|
|
36623
|
+
var _a, _b;
|
|
36586
36624
|
const $$ = this;
|
|
36587
36625
|
const { hasAxis, hasFunnel, hasRadar, hasTreemap } = $$.state;
|
|
36588
36626
|
const helper = (type) => $$[`updateTargetsFor${type}`](
|
|
@@ -36590,13 +36628,14 @@ class ChartInternal {
|
|
|
36590
36628
|
);
|
|
36591
36629
|
$$.updateTargetsForText(targets);
|
|
36592
36630
|
if (hasAxis) {
|
|
36593
|
-
["bar", "candlestick", "line"]
|
|
36594
|
-
|
|
36595
|
-
|
|
36631
|
+
const shapes = ["bar", "candlestick", "line"];
|
|
36632
|
+
for (const shape2 of shapes) {
|
|
36633
|
+
const name = capitalize(shape2);
|
|
36634
|
+
if (shape2 === "line" && $$.hasTypeOf(name) || $$.hasType(shape2)) {
|
|
36596
36635
|
helper(name);
|
|
36597
36636
|
}
|
|
36598
|
-
}
|
|
36599
|
-
$$.updateTargetsForSubchart
|
|
36637
|
+
}
|
|
36638
|
+
(_a = $$.updateTargetsForSubchart) == null ? void 0 : _a.call($$, targets);
|
|
36600
36639
|
} else if ($$.hasArcType(targets)) {
|
|
36601
36640
|
let type = "Arc";
|
|
36602
36641
|
if (hasRadar) {
|
|
@@ -36612,7 +36651,7 @@ class ChartInternal {
|
|
|
36612
36651
|
}
|
|
36613
36652
|
const hasPointType = $$.hasType("bubble") || $$.hasType("scatter");
|
|
36614
36653
|
if (hasPointType) {
|
|
36615
|
-
(
|
|
36654
|
+
(_b = $$.updateTargetForCircle) == null ? void 0 : _b.call($$);
|
|
36616
36655
|
}
|
|
36617
36656
|
$$.filterTargetsToShowAtInit(hasPointType);
|
|
36618
36657
|
}
|
|
@@ -36646,28 +36685,25 @@ class ChartInternal {
|
|
|
36646
36685
|
TransitionForAxis: "Transition",
|
|
36647
36686
|
Y: true
|
|
36648
36687
|
};
|
|
36649
|
-
Object.
|
|
36650
|
-
|
|
36651
|
-
|
|
36652
|
-
|
|
36653
|
-
}
|
|
36654
|
-
withOptions[key] = getOption(options, `with${key}`, defVal);
|
|
36655
|
-
});
|
|
36688
|
+
for (const [key, defVal] of Object.entries(withOptions)) {
|
|
36689
|
+
const value = isString(defVal) ? withOptions[defVal] : defVal;
|
|
36690
|
+
withOptions[key] = getOption(options, `with${key}`, value);
|
|
36691
|
+
}
|
|
36656
36692
|
return withOptions;
|
|
36657
36693
|
}
|
|
36658
36694
|
initialOpacity(d) {
|
|
36659
36695
|
const $$ = this;
|
|
36660
36696
|
const { withoutFadeIn } = $$.state;
|
|
36661
|
-
|
|
36662
|
-
return r;
|
|
36697
|
+
return $$.getBaseValue(d) !== null && withoutFadeIn[d.id] ? null : "0";
|
|
36663
36698
|
}
|
|
36664
36699
|
bindResize() {
|
|
36665
36700
|
const $$ = this;
|
|
36666
36701
|
const { $el, config, state } = $$;
|
|
36667
36702
|
const resizeFunction = generateResize(config.resize_timer);
|
|
36703
|
+
const { resize_auto } = config;
|
|
36668
36704
|
const list = [];
|
|
36669
36705
|
list.push(() => callFn(config.onresize, $$.api));
|
|
36670
|
-
if (/^(true|parent)$/.test(
|
|
36706
|
+
if (/^(true|parent)$/.test(resize_auto)) {
|
|
36671
36707
|
list.push(() => {
|
|
36672
36708
|
state.resizing = true;
|
|
36673
36709
|
if (config.legend_show) {
|
|
@@ -36683,7 +36719,7 @@ class ChartInternal {
|
|
|
36683
36719
|
});
|
|
36684
36720
|
list.forEach((v) => resizeFunction.add(v));
|
|
36685
36721
|
$$.resizeFunction = resizeFunction;
|
|
36686
|
-
if (
|
|
36722
|
+
if (resize_auto === "parent") {
|
|
36687
36723
|
($$.resizeFunction.resizeObserver = new ResizeObserver($$.resizeFunction.bind($$))).observe($el.chart.node().parentNode);
|
|
36688
36724
|
} else {
|
|
36689
36725
|
win.addEventListener("resize", $$.resizeFunction);
|
|
@@ -37145,9 +37181,9 @@ function nodeToSvgDataUrl(node, option, orgSize) {
|
|
|
37145
37181
|
}
|
|
37146
37182
|
function getCoords(elem, svgOffset) {
|
|
37147
37183
|
const { top, left } = svgOffset;
|
|
37148
|
-
const { x, y } =
|
|
37184
|
+
const { x, y } = getBBox(elem, true);
|
|
37149
37185
|
const { a, b, c, d, e, f } = elem.getScreenCTM();
|
|
37150
|
-
const { width, height } = elem
|
|
37186
|
+
const { width, height } = getBoundingRect(elem, true);
|
|
37151
37187
|
return {
|
|
37152
37188
|
x: a * x + c * y + e - left,
|
|
37153
37189
|
y: b * x + d * y + f - top + (height - Math.round(height / 4)),
|
|
@@ -37156,7 +37192,7 @@ function getCoords(elem, svgOffset) {
|
|
|
37156
37192
|
};
|
|
37157
37193
|
}
|
|
37158
37194
|
function getGlyph(svg) {
|
|
37159
|
-
const { left, top } = svg
|
|
37195
|
+
const { left, top } = getBoundingRect(svg);
|
|
37160
37196
|
const filterFn = (t) => t.textContent || t.childElementCount;
|
|
37161
37197
|
const glyph = [];
|
|
37162
37198
|
toArray(svg.querySelectorAll("text")).filter(filterFn).forEach((t) => {
|
|
@@ -40823,7 +40859,7 @@ class AxisRendererHelper {
|
|
|
40823
40859
|
};
|
|
40824
40860
|
!text.empty() && text.text("0").call((el) => {
|
|
40825
40861
|
try {
|
|
40826
|
-
const { width, height } = el.node()
|
|
40862
|
+
const { width, height } = getBBox(el.node(), true);
|
|
40827
40863
|
if (width && height) {
|
|
40828
40864
|
size.w = width;
|
|
40829
40865
|
size.h = height;
|
|
@@ -40924,6 +40960,7 @@ var AxisRenderer_publicField = (obj, key, value) => AxisRenderer_defNormalProp(o
|
|
|
40924
40960
|
|
|
40925
40961
|
|
|
40926
40962
|
|
|
40963
|
+
|
|
40927
40964
|
class AxisRenderer {
|
|
40928
40965
|
constructor(params = {}) {
|
|
40929
40966
|
AxisRenderer_publicField(this, "helper");
|
|
@@ -41003,8 +41040,17 @@ class AxisRenderer {
|
|
|
41003
41040
|
tickShow.tick && tickEnter.append("line");
|
|
41004
41041
|
tickShow.text && tickEnter.append("text");
|
|
41005
41042
|
const tickText = tick.select("text");
|
|
41006
|
-
const sizeFor1Char = isFunction(evalTextSize) ? evalTextSize.bind(ctx.params.owner.api)(tickText.node()) : AxisRendererHelper.getSizeFor1Char(tickText, evalTextSize);
|
|
41007
41043
|
const counts = [];
|
|
41044
|
+
let sizeFor1Char;
|
|
41045
|
+
if (isFunction(evalTextSize)) {
|
|
41046
|
+
sizeFor1Char = evalTextSize.bind(ctx.params.owner.api)(tickText.node(), id);
|
|
41047
|
+
if (this.classList.contains($COMMON.dummy)) {
|
|
41048
|
+
this.sizeFor1Char = sizeFor1Char;
|
|
41049
|
+
}
|
|
41050
|
+
}
|
|
41051
|
+
if (!sizeFor1Char) {
|
|
41052
|
+
sizeFor1Char = AxisRendererHelper.getSizeFor1Char(tickText, !!evalTextSize);
|
|
41053
|
+
}
|
|
41008
41054
|
let tspan = tickText.selectAll("tspan").data((d, index) => {
|
|
41009
41055
|
const split = params.tickMultiline ? splitTickText(d, scale1, ticks, isLeftRight, sizeFor1Char.w) : isArray(helper.textFormatted(d)) ? helper.textFormatted(d).concat() : [helper.textFormatted(d)];
|
|
41010
41056
|
counts[index] = split.length;
|
|
@@ -41740,14 +41786,14 @@ class Axis_Axis {
|
|
|
41740
41786
|
*/
|
|
41741
41787
|
getMaxTickSize(id, withoutRecompute) {
|
|
41742
41788
|
const $$ = this.owner;
|
|
41743
|
-
const { config, state: { current }, $el: { svg, chart } } = $$;
|
|
41789
|
+
const { config, state: { current, resizing }, $el: { svg, chart } } = $$;
|
|
41744
41790
|
const currentTickMax = current.maxTickSize[id];
|
|
41745
41791
|
const configPrefix = `axis_${id}`;
|
|
41746
41792
|
const max = {
|
|
41747
41793
|
width: 0,
|
|
41748
41794
|
height: 0
|
|
41749
41795
|
};
|
|
41750
|
-
if (withoutRecompute || !config[`${configPrefix}_show`] || currentTickMax.width > 0 && $$.filterTargetsToShow().length === 0) {
|
|
41796
|
+
if (resizing || withoutRecompute || !config[`${configPrefix}_show`] || currentTickMax.width > 0 && $$.filterTargetsToShow().length === 0) {
|
|
41751
41797
|
return currentTickMax;
|
|
41752
41798
|
}
|
|
41753
41799
|
if (svg) {
|
|
@@ -41782,9 +41828,14 @@ class Axis_Axis {
|
|
|
41782
41828
|
}
|
|
41783
41829
|
!isYAxis && this.updateXAxisTickValues(targetsToShow, axis);
|
|
41784
41830
|
const dummy = chart.append("svg").style("visibility", "hidden").style("position", "fixed").style("top", "0").style("left", "0");
|
|
41785
|
-
axis.
|
|
41831
|
+
const g = dummy.append("g").attr("class", `${$AXIS[`axis${capitalize(id)}`]} ${$COMMON.dummy}`);
|
|
41832
|
+
axis.create(g);
|
|
41833
|
+
const { sizeFor1Char } = g.node();
|
|
41786
41834
|
dummy.selectAll("text").attr("transform", isNumber(tickRotate) ? `rotate(${tickRotate})` : null).each(function(d, i) {
|
|
41787
|
-
const { width, height } =
|
|
41835
|
+
const { width, height } = sizeFor1Char ? {
|
|
41836
|
+
width: this.textContent.length * sizeFor1Char.w,
|
|
41837
|
+
height: sizeFor1Char.h
|
|
41838
|
+
} : getBoundingRect(this, true);
|
|
41788
41839
|
max.width = Math.max(max.width, width);
|
|
41789
41840
|
max.height = Math.max(max.height, height);
|
|
41790
41841
|
if (!isYAxis) {
|
|
@@ -42229,7 +42280,7 @@ class Axis_Axis {
|
|
|
42229
42280
|
const updateClientRect = () => {
|
|
42230
42281
|
if (eventReceiver) {
|
|
42231
42282
|
const scrollPos = getScrollPosition($el.chart.node());
|
|
42232
|
-
eventReceiver.rect = rectElement.node()
|
|
42283
|
+
eventReceiver.rect = getBoundingRect(rectElement.node(), true).toJSON();
|
|
42233
42284
|
eventReceiver.rect.top += scrollPos.y;
|
|
42234
42285
|
eventReceiver.rect.left += scrollPos.x;
|
|
42235
42286
|
}
|
|
@@ -43060,7 +43111,7 @@ function smoothLines(el, type) {
|
|
|
43060
43111
|
hideAxisGridFocus() {
|
|
43061
43112
|
const $$ = this;
|
|
43062
43113
|
$$.$el.main.selectAll(
|
|
43063
|
-
`line.
|
|
43114
|
+
`line.${$AXIS.axisTooltipX}, line.${$AXIS.axisTooltipY}`
|
|
43064
43115
|
).style("visibility", "hidden");
|
|
43065
43116
|
Object.values($$.$el.axisTooltip).forEach((v) => v == null ? void 0 : v.style("display", "none"));
|
|
43066
43117
|
},
|
|
@@ -44676,18 +44727,6 @@ function smoothLines(el, type) {
|
|
|
44676
44727
|
|
|
44677
44728
|
;// ./src/config/Options/axis/y2.ts
|
|
44678
44729
|
/* harmony default export */ var y2 = ({
|
|
44679
|
-
/**
|
|
44680
|
-
* Set clip-path attribute for y2 axis element
|
|
44681
|
-
* - **NOTE**: `clip-path` attribute for y2 Axis is set only when `axis.y2.inner` option is true.
|
|
44682
|
-
* @name axis․y2․clipPath
|
|
44683
|
-
* @memberof Options
|
|
44684
|
-
* @type {boolean}
|
|
44685
|
-
* @default true
|
|
44686
|
-
* @example
|
|
44687
|
-
* // don't set 'clip-path' attribute
|
|
44688
|
-
* clipPath: false
|
|
44689
|
-
*/
|
|
44690
|
-
axis_y2_clipPath: true,
|
|
44691
44730
|
/**
|
|
44692
44731
|
* Show or hide y2 axis.
|
|
44693
44732
|
* - **NOTE**:
|
|
@@ -45178,23 +45217,34 @@ var axis_spreadValues = (a, b) => {
|
|
|
45178
45217
|
* @memberof Options
|
|
45179
45218
|
* @type {boolean|Function}
|
|
45180
45219
|
* @default true
|
|
45220
|
+
* @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.AxisEvalTextSize)
|
|
45181
45221
|
* @example
|
|
45182
45222
|
* axis: {
|
|
45183
45223
|
* // will evaluate getting text size every time.
|
|
45184
45224
|
* evalTextSize: false.
|
|
45185
45225
|
*
|
|
45186
45226
|
* // set a custom evaluator
|
|
45187
|
-
* evalTextSize: function(textElement) {
|
|
45227
|
+
* evalTextSize: function(textElement, axisId) {
|
|
45188
45228
|
* // set some character to be evaluated
|
|
45189
|
-
*
|
|
45229
|
+
* // NOTE: The dummy textElement is a descendant of given axisId('x', 'y' or 'y2').
|
|
45230
|
+
* textElement.textContent = "0";
|
|
45190
45231
|
*
|
|
45191
45232
|
* // get the size
|
|
45192
|
-
*
|
|
45233
|
+
* const box = textElement.getBBox();
|
|
45193
45234
|
*
|
|
45194
45235
|
* // clear text
|
|
45195
|
-
*
|
|
45236
|
+
* textElement.textContent = "";
|
|
45196
45237
|
*
|
|
45197
45238
|
* return { w: 7, h: 12};
|
|
45239
|
+
* },
|
|
45240
|
+
*
|
|
45241
|
+
* // set a custom evaluator by returning fixed value
|
|
45242
|
+
* evalTextSize: function(textElement, axisId) {
|
|
45243
|
+
* return {
|
|
45244
|
+
* x: {w: 7, h: 12},
|
|
45245
|
+
* y: {w: 15.75, h: 30},
|
|
45246
|
+
* y2: {w: 9.5, h: 18}
|
|
45247
|
+
* }[axisId];
|
|
45198
45248
|
* }
|
|
45199
45249
|
* }
|
|
45200
45250
|
*/
|
|
@@ -46374,7 +46424,7 @@ function getAttrTweenFn(fn) {
|
|
|
46374
46424
|
value = config.arc_needle_value;
|
|
46375
46425
|
}
|
|
46376
46426
|
return tplProcess(title, {
|
|
46377
|
-
NEEDLE_VALUE:
|
|
46427
|
+
NEEDLE_VALUE: ~~value
|
|
46378
46428
|
});
|
|
46379
46429
|
}
|
|
46380
46430
|
return false;
|
|
@@ -48337,7 +48387,7 @@ const getTransitionName = () => getRandom();
|
|
|
48337
48387
|
if (this.tagName === "circle") {
|
|
48338
48388
|
point.attr("r", r);
|
|
48339
48389
|
} else {
|
|
48340
|
-
const { width, height } =
|
|
48390
|
+
const { width, height } = getBBox(this);
|
|
48341
48391
|
const x = ratio * (+point.attr("x") + width / 2);
|
|
48342
48392
|
const y = ratio * (+point.attr("y") + height / 2);
|
|
48343
48393
|
point.attr("transform", `translate(${x} ${y}) scale(${scale})`);
|
|
@@ -48470,7 +48520,7 @@ const getTransitionName = () => getRandom();
|
|
|
48470
48520
|
},
|
|
48471
48521
|
update(element, xPosFn, yPosFn, fillStyleFn, withTransition, flow, selectedCircles) {
|
|
48472
48522
|
const $$ = this;
|
|
48473
|
-
const { width, height } = element.node()
|
|
48523
|
+
const { width, height } = getBBox(element.node());
|
|
48474
48524
|
const xPosFn2 = (d) => isValue(d.value) ? xPosFn(d) - width / 2 : 0;
|
|
48475
48525
|
const yPosFn2 = (d) => isValue(d.value) ? yPosFn(d) - height / 2 : 0;
|
|
48476
48526
|
let mainCircles = element;
|
|
@@ -48878,7 +48928,7 @@ const cacheKeyTextWidth = KEY.radarTextWidth;
|
|
|
48878
48928
|
});
|
|
48879
48929
|
}).datum((d, i) => ({ index: i })).attr("transform", function(d) {
|
|
48880
48930
|
if (isUndefined(this.width)) {
|
|
48881
|
-
this.width = this
|
|
48931
|
+
this.width = getBoundingRect(this, true).width / 2;
|
|
48882
48932
|
}
|
|
48883
48933
|
let posX = $$.getRadarPosition("x", d.index, void 0, 1);
|
|
48884
48934
|
let posY = Math.round($$.getRadarPosition("y", d.index, void 0, 1));
|
|
@@ -50997,7 +51047,7 @@ const bb = {
|
|
|
50997
51047
|
* bb.version; // "1.0.0"
|
|
50998
51048
|
* @memberof bb
|
|
50999
51049
|
*/
|
|
51000
|
-
version: "3.16.0
|
|
51050
|
+
version: "3.16.0",
|
|
51001
51051
|
/**
|
|
51002
51052
|
* Generate chart
|
|
51003
51053
|
* - **NOTE:** Bear in mind for the possiblity of ***throwing an error***, during the generation when:
|