billboard.js 3.12.1 → 3.12.2
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 +45 -24
- package/dist/billboard.min.css +1 -1
- package/dist/billboard.min.js +9 -9
- package/dist/billboard.pkgd.js +45 -24
- package/dist/billboard.pkgd.min.js +16 -16
- package/dist/plugin/billboardjs-plugin-bubblecompare.js +2 -2
- package/dist/plugin/billboardjs-plugin-bubblecompare.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-sparkline.js +2 -2
- package/dist/plugin/billboardjs-plugin-sparkline.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-stanford.js +2 -2
- package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-tableview.js +2 -2
- package/dist/plugin/billboardjs-plugin-tableview.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-textoverlap.js +2 -2
- package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.js +2 -2
- 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 +54 -27
- 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 +7 -7
- package/src/ChartInternal/data/load.ts +3 -0
- package/src/ChartInternal/shape/funnel.ts +49 -25
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.12.
|
|
8
|
+
* @version 3.12.2
|
|
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.0
|
|
@@ -27708,6 +27708,7 @@ function callDone(fn, resizeAfter = false) {
|
|
|
27708
27708
|
$$.data.targets = $$.data.targets.filter((t) => t.id !== id);
|
|
27709
27709
|
hasLegendDefsPoint && ((_a2 = $el.defs) == null ? void 0 : _a2.select(`#${$$.getDefsPointId(suffixId)}`).remove());
|
|
27710
27710
|
});
|
|
27711
|
+
state.hasFunnel && $$.updateFunnel($$.data.targets);
|
|
27711
27712
|
state.hasTreemap && $$.updateTargetsForTreemap($$.data.targets);
|
|
27712
27713
|
$$.updateTypesElements();
|
|
27713
27714
|
}
|
|
@@ -45205,13 +45206,16 @@ function getSize(checkNeck = false) {
|
|
|
45205
45206
|
height: height - (config.legend_show ? $$.getLegendHeight() + 10 : 0) - (padding.top + padding.bottom)
|
|
45206
45207
|
}, padding);
|
|
45207
45208
|
if (checkNeck) {
|
|
45208
|
-
const { width: neckWidth } = getNecklSize.call($$, {
|
|
45209
|
+
const { width: neckWidth, height: neckHeight } = getNecklSize.call($$, {
|
|
45209
45210
|
width: size.width,
|
|
45210
45211
|
height: size.height
|
|
45211
45212
|
});
|
|
45212
45213
|
if (size.width < neckWidth) {
|
|
45213
45214
|
size.width = neckWidth;
|
|
45214
45215
|
}
|
|
45216
|
+
if (size.height < neckHeight) {
|
|
45217
|
+
size.height = neckHeight;
|
|
45218
|
+
}
|
|
45215
45219
|
}
|
|
45216
45220
|
return size;
|
|
45217
45221
|
}
|
|
@@ -45234,49 +45238,55 @@ function getNecklSize(current) {
|
|
|
45234
45238
|
}
|
|
45235
45239
|
function getCoord(d) {
|
|
45236
45240
|
const $$ = this;
|
|
45237
|
-
const { top, width } = getSize.call($$, true);
|
|
45241
|
+
const { top, left, width } = getSize.call($$, true);
|
|
45238
45242
|
const coords = [];
|
|
45239
45243
|
d.forEach((d2, i) => {
|
|
45240
45244
|
const { ratio } = d2;
|
|
45241
45245
|
const y = i > 0 ? coords[i - 1][2][1] : top;
|
|
45242
45246
|
coords.push(d2.coords = [
|
|
45243
|
-
[
|
|
45247
|
+
[left, y],
|
|
45244
45248
|
// M
|
|
45245
|
-
[width, y],
|
|
45249
|
+
[left + width, y],
|
|
45246
45250
|
// 1
|
|
45247
|
-
[width, i > 0 ? ratio + y : ratio + top],
|
|
45251
|
+
[left + width, i > 0 ? ratio + y : ratio + top],
|
|
45248
45252
|
// 2
|
|
45249
|
-
[
|
|
45253
|
+
[left, i > 0 ? ratio + y : ratio + top],
|
|
45250
45254
|
// 3
|
|
45251
|
-
[
|
|
45255
|
+
[left, y]
|
|
45252
45256
|
// 4
|
|
45253
45257
|
]);
|
|
45254
45258
|
});
|
|
45255
45259
|
return coords;
|
|
45256
45260
|
}
|
|
45257
|
-
function
|
|
45261
|
+
function getClipPath(forBackground = false) {
|
|
45258
45262
|
const $$ = this;
|
|
45259
45263
|
const { width, height, top, left } = getSize.call($$, true);
|
|
45260
45264
|
const neck = getNecklSize.call($$, { width, height });
|
|
45261
|
-
const rightX = (width + neck.width) / 2;
|
|
45262
45265
|
const leftX = (width - neck.width) / 2;
|
|
45266
|
+
const rightX = (width + neck.width) / 2;
|
|
45263
45267
|
const bodyHeigth = height - neck.height;
|
|
45264
45268
|
const coords = [
|
|
45265
|
-
[0
|
|
45269
|
+
[0, 0],
|
|
45266
45270
|
// M
|
|
45267
|
-
[width
|
|
45271
|
+
[width, 0],
|
|
45268
45272
|
// 1
|
|
45269
45273
|
[rightX, bodyHeigth],
|
|
45270
45274
|
// 2
|
|
45271
|
-
[rightX, height
|
|
45275
|
+
[rightX, height],
|
|
45272
45276
|
// 3
|
|
45273
|
-
[leftX, height
|
|
45277
|
+
[leftX, height],
|
|
45274
45278
|
// 4
|
|
45275
45279
|
[leftX, bodyHeigth],
|
|
45276
45280
|
// 5
|
|
45277
|
-
[0
|
|
45281
|
+
[0, 0]
|
|
45278
45282
|
// 6
|
|
45279
45283
|
];
|
|
45284
|
+
if (forBackground) {
|
|
45285
|
+
coords.forEach((d) => {
|
|
45286
|
+
d[0] += left;
|
|
45287
|
+
d[1] += top;
|
|
45288
|
+
});
|
|
45289
|
+
}
|
|
45280
45290
|
return `M${coords.join("L")}z`;
|
|
45281
45291
|
}
|
|
45282
45292
|
function getFunnelData(d) {
|
|
@@ -45364,23 +45374,35 @@ function updateRatio(data) {
|
|
|
45364
45374
|
mainFunnelEnter.append("path");
|
|
45365
45375
|
funnel.path = mainFunnelEnter.merge(mainFunnelUpdate).attr("class", (d) => classChartFunnel(d)).select("path").attr("class", classFunnel).style("opacity", "0").style("fill", $$.color);
|
|
45366
45376
|
},
|
|
45377
|
+
/**
|
|
45378
|
+
* Update funnel path selection
|
|
45379
|
+
* @param {object} targets Updated target data
|
|
45380
|
+
* @private
|
|
45381
|
+
*/
|
|
45382
|
+
updateFunnel(targets) {
|
|
45383
|
+
const $$ = this;
|
|
45384
|
+
const { $el: { funnel } } = $$;
|
|
45385
|
+
const targetIds = targets.map(({ id }) => id);
|
|
45386
|
+
funnel.path = funnel.path.filter((d) => targetIds.indexOf(d.id) >= 0);
|
|
45387
|
+
},
|
|
45367
45388
|
/**
|
|
45368
45389
|
* Generate treemap coordinate points data
|
|
45369
45390
|
* @returns {Array} Array of coordinate points
|
|
45370
45391
|
* @private
|
|
45371
45392
|
*/
|
|
45372
45393
|
generateGetFunnelPoints() {
|
|
45373
|
-
var _a;
|
|
45374
45394
|
const $$ = this;
|
|
45375
45395
|
const { $el: { funnel } } = $$;
|
|
45376
45396
|
const targets = $$.filterTargetsToShow(funnel.path);
|
|
45397
|
+
const { top, left, right } = getSize.call($$);
|
|
45398
|
+
const center = (left - right) / 2;
|
|
45377
45399
|
const points = {};
|
|
45378
|
-
let accumulatedHeight =
|
|
45400
|
+
let accumulatedHeight = top != null ? top : 0;
|
|
45379
45401
|
targets.each((d, i) => {
|
|
45380
|
-
var
|
|
45402
|
+
var _a;
|
|
45381
45403
|
points[d.id] = [
|
|
45382
|
-
[
|
|
45383
|
-
[
|
|
45404
|
+
[center, accumulatedHeight],
|
|
45405
|
+
[center, accumulatedHeight += ((_a = targets == null ? void 0 : targets[i]) != null ? _a : d).ratio]
|
|
45384
45406
|
];
|
|
45385
45407
|
});
|
|
45386
45408
|
return (d) => points[d.id];
|
|
@@ -45394,9 +45416,8 @@ function updateRatio(data) {
|
|
|
45394
45416
|
const { $T, $el: { funnel } } = $$;
|
|
45395
45417
|
const targets = $$.filterTargetsToShow(funnel.path);
|
|
45396
45418
|
const coords = getCoord.call($$, updateRatio.call($$, targets.data()));
|
|
45397
|
-
|
|
45398
|
-
funnel.attr("
|
|
45399
|
-
funnel.background.attr("d", neckPath);
|
|
45419
|
+
funnel.attr("clip-path", `path('${getClipPath.bind($$)()}')`);
|
|
45420
|
+
funnel.background.attr("d", getClipPath.call($$, true));
|
|
45400
45421
|
$T(targets).attr("d", (d, i) => `M${coords[i].join("L")}z`).style("opacity", "1");
|
|
45401
45422
|
funnel.selectAll("g").style("opacity", null);
|
|
45402
45423
|
}
|
|
@@ -48558,7 +48579,7 @@ const bb = {
|
|
|
48558
48579
|
* bb.version; // "1.0.0"
|
|
48559
48580
|
* @memberof bb
|
|
48560
48581
|
*/
|
|
48561
|
-
version: "3.12.
|
|
48582
|
+
version: "3.12.2",
|
|
48562
48583
|
/**
|
|
48563
48584
|
* Generate chart
|
|
48564
48585
|
* - **NOTE:** Bear in mind for the possiblity of ***throwing an error***, during the generation when:
|