billboard.js 4.0.2 → 4.0.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 +102 -71
- package/dist/billboard.min.css +1 -1
- package/dist/billboard.min.js +16 -17
- package/dist/billboard.pkgd.js +102 -71
- package/dist/billboard.pkgd.min.js +22 -23
- 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/Chart/Chart.js +1 -1
- package/dist-esm/Chart/api/axis.js +1 -1
- package/dist-esm/Chart/api/category.js +1 -1
- package/dist-esm/Chart/api/chart.js +1 -1
- package/dist-esm/Chart/api/color.js +1 -1
- package/dist-esm/Chart/api/data.js +1 -1
- package/dist-esm/Chart/api/export.js +1 -1
- package/dist-esm/Chart/api/flow.js +1 -1
- package/dist-esm/Chart/api/focus.js +7 -11
- package/dist-esm/Chart/api/grid.js +1 -1
- package/dist-esm/Chart/api/group.js +1 -1
- package/dist-esm/Chart/api/legend.js +1 -1
- package/dist-esm/Chart/api/load.js +1 -1
- package/dist-esm/Chart/api/regions.js +1 -1
- package/dist-esm/Chart/api/selection.js +1 -1
- package/dist-esm/Chart/api/show.js +1 -1
- package/dist-esm/Chart/api/stubs.js +1 -1
- package/dist-esm/Chart/api/subchart.js +1 -1
- package/dist-esm/Chart/api/tooltip.js +1 -1
- package/dist-esm/Chart/api/x.js +1 -1
- package/dist-esm/Chart/api/zoom.js +1 -1
- package/dist-esm/ChartInternal/Axis/Axis.js +1 -1
- package/dist-esm/ChartInternal/Axis/AxisRenderer.js +1 -1
- package/dist-esm/ChartInternal/Axis/AxisRendererHelper.js +1 -1
- package/dist-esm/ChartInternal/ChartInternal.js +1 -1
- package/dist-esm/ChartInternal/data/convert.helper.js +1 -1
- package/dist-esm/ChartInternal/data/convert.js +1 -1
- package/dist-esm/ChartInternal/data/data.js +15 -6
- package/dist-esm/ChartInternal/data/load.js +1 -1
- package/dist-esm/ChartInternal/interactions/drag.js +1 -1
- package/dist-esm/ChartInternal/interactions/eventrect.js +1 -1
- package/dist-esm/ChartInternal/interactions/flow.js +1 -1
- package/dist-esm/ChartInternal/interactions/interaction.js +1 -1
- package/dist-esm/ChartInternal/interactions/subchart.js +1 -1
- package/dist-esm/ChartInternal/interactions/zoom.js +1 -1
- package/dist-esm/ChartInternal/internals/category.js +1 -1
- package/dist-esm/ChartInternal/internals/class.js +1 -1
- package/dist-esm/ChartInternal/internals/clip.js +1 -1
- package/dist-esm/ChartInternal/internals/color.js +5 -5
- package/dist-esm/ChartInternal/internals/domain.js +1 -1
- package/dist-esm/ChartInternal/internals/format.js +1 -1
- package/dist-esm/ChartInternal/internals/grid.js +1 -1
- package/dist-esm/ChartInternal/internals/legend.js +1 -1
- package/dist-esm/ChartInternal/internals/redraw.js +1 -1
- package/dist-esm/ChartInternal/internals/region.js +1 -1
- package/dist-esm/ChartInternal/internals/scale.js +1 -1
- package/dist-esm/ChartInternal/internals/selection.js +1 -1
- package/dist-esm/ChartInternal/internals/size.axis.js +1 -1
- package/dist-esm/ChartInternal/internals/size.js +1 -1
- package/dist-esm/ChartInternal/internals/style.js +1 -1
- package/dist-esm/ChartInternal/internals/text.arc.js +1 -1
- package/dist-esm/ChartInternal/internals/text.js +2 -2
- package/dist-esm/ChartInternal/internals/text.util.js +1 -1
- package/dist-esm/ChartInternal/internals/title.js +1 -1
- package/dist-esm/ChartInternal/internals/tooltip.js +1 -1
- package/dist-esm/ChartInternal/internals/transform.js +1 -1
- package/dist-esm/ChartInternal/internals/type.js +26 -34
- package/dist-esm/ChartInternal/shape/arc.js +1 -1
- package/dist-esm/ChartInternal/shape/area.js +1 -1
- package/dist-esm/ChartInternal/shape/bar.js +23 -7
- package/dist-esm/ChartInternal/shape/bubble.js +1 -1
- package/dist-esm/ChartInternal/shape/candlestick.js +1 -1
- package/dist-esm/ChartInternal/shape/core/barRadius.js +1 -1
- package/dist-esm/ChartInternal/shape/core/bubble.js +1 -1
- package/dist-esm/ChartInternal/shape/core/candlestick.js +1 -1
- package/dist-esm/ChartInternal/shape/core/dataRegion.js +1 -1
- package/dist-esm/ChartInternal/shape/core/geometry.js +1 -1
- package/dist-esm/ChartInternal/shape/core/path.js +1 -1
- package/dist-esm/ChartInternal/shape/core/point.js +1 -1
- package/dist-esm/ChartInternal/shape/core/treemap.js +1 -1
- package/dist-esm/ChartInternal/shape/funnel.js +1 -1
- package/dist-esm/ChartInternal/shape/gauge.js +1 -1
- package/dist-esm/ChartInternal/shape/line.js +2 -2
- package/dist-esm/ChartInternal/shape/point.js +22 -10
- package/dist-esm/ChartInternal/shape/polar.js +1 -1
- package/dist-esm/ChartInternal/shape/radar.js +1 -1
- package/dist-esm/ChartInternal/shape/shape.js +19 -4
- package/dist-esm/ChartInternal/shape/treemap.js +1 -1
- package/dist-esm/canvas/CanvasAxisRenderer.js +1 -1
- package/dist-esm/canvas/CanvasEngine.js +1 -1
- package/dist-esm/canvas/CanvasPainter.js +1 -1
- package/dist-esm/canvas/CanvasRenderer.js +1 -1
- package/dist-esm/canvas/CanvasTheme.js +1 -1
- package/dist-esm/canvas/HitDetector.js +1 -1
- package/dist-esm/canvas/axisTicks.js +1 -1
- package/dist-esm/canvas/classes.js +1 -1
- package/dist-esm/canvas/color.js +1 -1
- package/dist-esm/canvas/geometry.js +1 -1
- package/dist-esm/canvas/labels.js +1 -1
- package/dist-esm/canvas/pointPattern.js +1 -1
- package/dist-esm/canvas/util.js +1 -1
- package/dist-esm/config/Options/Options.js +1 -1
- package/dist-esm/config/Options/axis/axis.js +1 -1
- package/dist-esm/config/Options/axis/x.js +1 -1
- package/dist-esm/config/Options/axis/y.js +1 -1
- package/dist-esm/config/Options/axis/y2.js +1 -1
- package/dist-esm/config/Options/common/boost.js +1 -1
- package/dist-esm/config/Options/common/color.js +1 -1
- package/dist-esm/config/Options/common/grid.js +1 -1
- package/dist-esm/config/Options/common/legend.js +1 -1
- package/dist-esm/config/Options/common/main.js +1 -1
- package/dist-esm/config/Options/common/point.js +1 -1
- package/dist-esm/config/Options/common/title.js +1 -1
- package/dist-esm/config/Options/common/tooltip.js +1 -1
- package/dist-esm/config/Options/data/axis.js +1 -1
- package/dist-esm/config/Options/data/data.js +1 -1
- package/dist-esm/config/Options/data/selection.js +1 -1
- package/dist-esm/config/Options/interaction/interaction.js +1 -1
- package/dist-esm/config/Options/interaction/subchart.js +1 -1
- package/dist-esm/config/Options/interaction/zoom.js +1 -1
- package/dist-esm/config/Options/shape/arc.js +1 -1
- package/dist-esm/config/Options/shape/area.js +1 -1
- package/dist-esm/config/Options/shape/bar.js +1 -1
- package/dist-esm/config/Options/shape/bubble.js +1 -1
- package/dist-esm/config/Options/shape/candlestick.js +1 -1
- package/dist-esm/config/Options/shape/donut.js +1 -1
- package/dist-esm/config/Options/shape/funnel.js +1 -1
- package/dist-esm/config/Options/shape/gauge.js +1 -1
- package/dist-esm/config/Options/shape/line.js +1 -1
- package/dist-esm/config/Options/shape/pie.js +1 -1
- package/dist-esm/config/Options/shape/polar.js +1 -1
- package/dist-esm/config/Options/shape/radar.js +1 -1
- package/dist-esm/config/Options/shape/scatter.js +1 -1
- package/dist-esm/config/Options/shape/spline.js +1 -1
- package/dist-esm/config/Options/shape/treemap.js +1 -1
- package/dist-esm/config/Store/Element.js +1 -1
- package/dist-esm/config/Store/State.js +1 -1
- package/dist-esm/config/Store/Store.js +1 -1
- package/dist-esm/config/classes.js +1 -1
- package/dist-esm/config/config.js +1 -1
- package/dist-esm/config/const.js +1 -1
- package/dist-esm/config/resolver/axis.core.js +1 -1
- package/dist-esm/config/resolver/axis.js +1 -1
- package/dist-esm/config/resolver/canvas.js +1 -1
- package/dist-esm/config/resolver/canvasShape.js +1 -1
- package/dist-esm/config/resolver/category.js +1 -1
- package/dist-esm/config/resolver/export.js +1 -1
- package/dist-esm/config/resolver/flow.js +1 -1
- package/dist-esm/config/resolver/grid.js +1 -1
- package/dist-esm/config/resolver/interaction/selection.js +1 -1
- package/dist-esm/config/resolver/interaction/subchart.js +1 -1
- package/dist-esm/config/resolver/interaction/zoom.js +1 -1
- package/dist-esm/config/resolver/regions.js +1 -1
- package/dist-esm/config/resolver/shape/arc.helpers.js +1 -1
- package/dist-esm/config/resolver/shape/area.js +1 -1
- package/dist-esm/config/resolver/shape/axis.helpers.js +1 -1
- package/dist-esm/config/resolver/shape/bar.js +1 -1
- package/dist-esm/config/resolver/shape/bubble.js +1 -1
- package/dist-esm/config/resolver/shape/candlestick.js +1 -1
- package/dist-esm/config/resolver/shape/donut.js +1 -1
- package/dist-esm/config/resolver/shape/funnel.js +1 -1
- package/dist-esm/config/resolver/shape/gauge.js +1 -1
- package/dist-esm/config/resolver/shape/line.js +1 -1
- package/dist-esm/config/resolver/shape/pie.js +1 -1
- package/dist-esm/config/resolver/shape/polar.js +1 -1
- package/dist-esm/config/resolver/shape/radar.js +1 -1
- package/dist-esm/config/resolver/shape/scatter.js +1 -1
- package/dist-esm/config/resolver/shape/treemap.js +1 -1
- package/dist-esm/core.js +3 -3
- package/dist-esm/index.canvas.js +1 -1
- package/dist-esm/index.esm.js +1 -1
- package/dist-esm/module/Cache.js +1 -1
- package/dist-esm/module/browser.js +1 -1
- package/dist-esm/module/dsv.js +1 -1
- package/dist-esm/module/error.js +1 -1
- package/dist-esm/module/generator.js +1 -1
- package/dist-esm/module/sanitize.js +1 -1
- package/dist-esm/module/util/brush.js +1 -1
- package/dist-esm/module/util/dom.js +1 -1
- package/dist-esm/module/util/object.js +1 -1
- package/dist-esm/module/util/type-checks.js +1 -1
- package/dist-esm/module/worker.js +1 -1
- 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 +1 -1
- package/src/Chart/api/focus.ts +8 -12
- package/src/ChartInternal/data/data.ts +15 -5
- package/src/ChartInternal/internals/color.ts +5 -4
- package/src/ChartInternal/internals/text.ts +1 -1
- package/src/ChartInternal/internals/type.ts +26 -32
- package/src/ChartInternal/shape/bar.ts +26 -7
- package/src/ChartInternal/shape/line.ts +1 -1
- package/src/ChartInternal/shape/point.ts +26 -12
- package/src/ChartInternal/shape/shape.ts +25 -3
package/dist/billboard.css
CHANGED
package/dist/billboard.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 4.0.
|
|
8
|
+
* @version 4.0.3
|
|
9
9
|
*/
|
|
10
10
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
11
11
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
@@ -11442,6 +11442,9 @@ const rangedDataKeyIndex = {
|
|
|
11442
11442
|
areaRange: { high: 0, mid: 1, low: 2 },
|
|
11443
11443
|
candlestick: { open: 0, high: 1, low: 2, close: 3, volume: 4 }
|
|
11444
11444
|
};
|
|
11445
|
+
function normalizeTargetIds(targetIds) {
|
|
11446
|
+
return isArray(targetIds) ? targetIds : [targetIds];
|
|
11447
|
+
}
|
|
11445
11448
|
/* harmony default export */ var data_data = ({
|
|
11446
11449
|
isX(key) {
|
|
11447
11450
|
const $$ = this;
|
|
@@ -11878,8 +11881,7 @@ const rangedDataKeyIndex = {
|
|
|
11878
11881
|
*/
|
|
11879
11882
|
addTargetIds(type, targetIds) {
|
|
11880
11883
|
const { state } = this;
|
|
11881
|
-
|
|
11882
|
-
ids.forEach((v) => state[type].add(v));
|
|
11884
|
+
normalizeTargetIds(targetIds).forEach((v) => state[type].add(v));
|
|
11883
11885
|
},
|
|
11884
11886
|
/**
|
|
11885
11887
|
* Remove from the state target Ids
|
|
@@ -11889,8 +11891,7 @@ const rangedDataKeyIndex = {
|
|
|
11889
11891
|
*/
|
|
11890
11892
|
removeTargetIds(type, targetIds) {
|
|
11891
11893
|
const { state } = this;
|
|
11892
|
-
|
|
11893
|
-
ids.forEach((v) => state[type].delete(v));
|
|
11894
|
+
normalizeTargetIds(targetIds).forEach((v) => state[type].delete(v));
|
|
11894
11895
|
},
|
|
11895
11896
|
addHiddenTargetIds(targetIds) {
|
|
11896
11897
|
this.addTargetIds("hiddenTargetIds", targetIds);
|
|
@@ -12289,7 +12290,9 @@ const rangedDataKeyIndex = {
|
|
|
12289
12290
|
const yIndex = +!isRotated;
|
|
12290
12291
|
const y = $$.circleY(data, data.index);
|
|
12291
12292
|
const x = (scale.zoom || scale.x)(data.x);
|
|
12292
|
-
|
|
12293
|
+
const dx = x - pos[xIndex];
|
|
12294
|
+
const dy = y - pos[yIndex];
|
|
12295
|
+
return Math.sqrt(dx * dx + dy * dy);
|
|
12293
12296
|
},
|
|
12294
12297
|
/**
|
|
12295
12298
|
* Convert data for step type
|
|
@@ -13147,8 +13150,9 @@ const schemeCategory10 = [
|
|
|
13147
13150
|
const id = `${state.datetimeId}-labels-bg${$$.getTargetSelectorSuffix(v)}${isString(color) ? $$.getTargetSelectorSuffix(color) : ""}`;
|
|
13148
13151
|
const colorValue = sanitize(v === "" ? color : (color == null ? void 0 : color[v]) || "");
|
|
13149
13152
|
if (defs.select(`#${id}`).empty()) {
|
|
13150
|
-
defs.append("filter").attr("x", attr.x).attr("y", attr.y).attr("width", attr.width).attr("height", attr.height).attr("id", id)
|
|
13151
|
-
|
|
13153
|
+
const filter = defs.append("filter").attr("x", attr.x).attr("y", attr.y).attr("width", attr.width).attr("height", attr.height).attr("id", id);
|
|
13154
|
+
filter.append("feFlood").attr("flood-color", colorValue);
|
|
13155
|
+
filter.append("feComposite").attr("in", "SourceGraphic");
|
|
13152
13156
|
}
|
|
13153
13157
|
});
|
|
13154
13158
|
}
|
|
@@ -15799,7 +15803,7 @@ function batchGetBBox(elements) {
|
|
|
15799
15803
|
const filteredTextNodes = textNodes.filter((node) => node.data.id !== id);
|
|
15800
15804
|
const textNode = textNodes.filter((node) => node.data.id === id);
|
|
15801
15805
|
const translate = getTranslation(textNode.node());
|
|
15802
|
-
const calcHypo = (x, y) => Math.sqrt(
|
|
15806
|
+
const calcHypo = (x, y) => Math.sqrt(x * x + y * y);
|
|
15803
15807
|
textNode.node() && filteredTextNodes.each(function() {
|
|
15804
15808
|
const coordinate = getTranslation(this);
|
|
15805
15809
|
const filteredTextNode = (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(this);
|
|
@@ -16533,6 +16537,23 @@ const RE_TOOLTIP_TPL = /{{(.*)}}/;
|
|
|
16533
16537
|
;// ./src/ChartInternal/internals/type.ts
|
|
16534
16538
|
|
|
16535
16539
|
|
|
16540
|
+
const INTERPOLATION_TYPES = /* @__PURE__ */ new Set([
|
|
16541
|
+
"basis",
|
|
16542
|
+
"basis-closed",
|
|
16543
|
+
"basis-open",
|
|
16544
|
+
"bundle",
|
|
16545
|
+
"cardinal",
|
|
16546
|
+
"cardinal-closed",
|
|
16547
|
+
"cardinal-open",
|
|
16548
|
+
"catmull-rom",
|
|
16549
|
+
"catmull-rom-closed",
|
|
16550
|
+
"catmull-rom-open",
|
|
16551
|
+
"linear",
|
|
16552
|
+
"linear-closed",
|
|
16553
|
+
"monotone-x",
|
|
16554
|
+
"monotone-y",
|
|
16555
|
+
"natural"
|
|
16556
|
+
]);
|
|
16536
16557
|
/* harmony default export */ var type = ({
|
|
16537
16558
|
/**
|
|
16538
16559
|
* Check if the given chart type is valid
|
|
@@ -16587,26 +16608,17 @@ const RE_TOOLTIP_TPL = /{{(.*)}}/;
|
|
|
16587
16608
|
const { config, state: { current } } = $$;
|
|
16588
16609
|
const types = config.data_types;
|
|
16589
16610
|
const targets = targetsValue || $$.data.targets;
|
|
16590
|
-
let has = false;
|
|
16591
16611
|
if (!checkFromData && ((_a = current.types) == null ? void 0 : _a.indexOf(type)) > -1) {
|
|
16592
|
-
|
|
16612
|
+
return true;
|
|
16593
16613
|
} else if (targets == null ? void 0 : targets.length) {
|
|
16594
|
-
targets.
|
|
16614
|
+
return targets.some((target) => {
|
|
16595
16615
|
const t = types[target.id];
|
|
16596
|
-
|
|
16597
|
-
has = true;
|
|
16598
|
-
}
|
|
16616
|
+
return t === type || !t && type === "line";
|
|
16599
16617
|
});
|
|
16600
16618
|
} else if (Object.keys(types).length) {
|
|
16601
|
-
Object.
|
|
16602
|
-
if (types[id] === type) {
|
|
16603
|
-
has = true;
|
|
16604
|
-
}
|
|
16605
|
-
});
|
|
16606
|
-
} else {
|
|
16607
|
-
has = config.data_type === type;
|
|
16619
|
+
return Object.values(types).some((t) => t === type);
|
|
16608
16620
|
}
|
|
16609
|
-
return
|
|
16621
|
+
return config.data_type === type;
|
|
16610
16622
|
},
|
|
16611
16623
|
/**
|
|
16612
16624
|
* Check if contains given chart types
|
|
@@ -16729,25 +16741,8 @@ const RE_TOOLTIP_TPL = /{{(.*)}}/;
|
|
|
16729
16741
|
barLineBubbleData(d) {
|
|
16730
16742
|
return this.isBarType(d) || this.isLineType(d) || this.isBubbleType(d) ? d.values : [];
|
|
16731
16743
|
},
|
|
16732
|
-
// https://github.com/d3/d3-shape#curves
|
|
16733
16744
|
isInterpolationType(type) {
|
|
16734
|
-
return
|
|
16735
|
-
"basis",
|
|
16736
|
-
"basis-closed",
|
|
16737
|
-
"basis-open",
|
|
16738
|
-
"bundle",
|
|
16739
|
-
"cardinal",
|
|
16740
|
-
"cardinal-closed",
|
|
16741
|
-
"cardinal-open",
|
|
16742
|
-
"catmull-rom",
|
|
16743
|
-
"catmull-rom-closed",
|
|
16744
|
-
"catmull-rom-open",
|
|
16745
|
-
"linear",
|
|
16746
|
-
"linear-closed",
|
|
16747
|
-
"monotone-x",
|
|
16748
|
-
"monotone-y",
|
|
16749
|
-
"natural"
|
|
16750
|
-
].indexOf(type) >= 0;
|
|
16745
|
+
return INTERPOLATION_TYPES.has(type);
|
|
16751
16746
|
}
|
|
16752
16747
|
});
|
|
16753
16748
|
|
|
@@ -17197,8 +17192,13 @@ function updateTargetsForShape(targets, config) {
|
|
|
17197
17192
|
const y = $$.getShapeY(!!isSub);
|
|
17198
17193
|
const areaOffset = $$.getShapeOffset($$.isAreaType, areaIndices, isSub);
|
|
17199
17194
|
const yScale = $$.getYScaleById.bind($$);
|
|
17195
|
+
const y0Cache = /* @__PURE__ */ new Map();
|
|
17200
17196
|
return function(d, i) {
|
|
17201
|
-
|
|
17197
|
+
let y0 = y0Cache.get(d.id);
|
|
17198
|
+
if (y0 === void 0) {
|
|
17199
|
+
y0 = yScale.call($$, d.id, isSub)($$.getShapeYMin(d.id));
|
|
17200
|
+
y0Cache.set(d.id, y0);
|
|
17201
|
+
}
|
|
17202
17202
|
const offset = areaOffset(d, i) || y0;
|
|
17203
17203
|
const posX = x(d);
|
|
17204
17204
|
const value = d.value;
|
|
@@ -17231,12 +17231,20 @@ function updateTargetsForShape(targets, config) {
|
|
|
17231
17231
|
const barY = $$.getShapeY(!!isSub);
|
|
17232
17232
|
const barOffset = $$.getShapeOffset($$.isBarType, barIndices, !!isSub);
|
|
17233
17233
|
const yScale = $$.getYScaleById.bind($$);
|
|
17234
|
+
const idCache = /* @__PURE__ */ new Map();
|
|
17234
17235
|
return (d, i) => {
|
|
17235
17236
|
const { id } = d;
|
|
17236
|
-
|
|
17237
|
+
let idInfo = idCache.get(id);
|
|
17238
|
+
if (!idInfo) {
|
|
17239
|
+
idInfo = {
|
|
17240
|
+
y0: yScale.call($$, id, isSub)($$.getShapeYMin(id)),
|
|
17241
|
+
isInverted: config[`axis_${$$.axis.getId(id)}_inverted`]
|
|
17242
|
+
};
|
|
17243
|
+
idCache.set(id, idInfo);
|
|
17244
|
+
}
|
|
17245
|
+
const { y0, isInverted } = idInfo;
|
|
17237
17246
|
const offset = barOffset(d, i) || y0;
|
|
17238
17247
|
const width = isNumber(barW) ? barW : barW[d.id] || barW._$width;
|
|
17239
|
-
const isInverted = config[`axis_${$$.axis.getId(id)}_inverted`];
|
|
17240
17248
|
const value = d.value;
|
|
17241
17249
|
const posX = barX(d);
|
|
17242
17250
|
let posY = barY(d);
|
|
@@ -20871,14 +20879,17 @@ extend(api_data_data, {
|
|
|
20871
20879
|
const $$ = this.internal;
|
|
20872
20880
|
const { config, state, $el } = $$;
|
|
20873
20881
|
const targetIds = $$.mapToTargetIds(targetIdsValue);
|
|
20874
|
-
|
|
20875
|
-
const changed = !!((_a = state.focusedTargetIds) == null ? void 0 : _a.size) || !!((_b = state.defocusedTargetIds) == null ? void 0 : _b.size);
|
|
20882
|
+
const resetLegend = () => {
|
|
20876
20883
|
if (config.legend_show) {
|
|
20877
20884
|
$$.showLegend(targetIds.filter($$.isLegendToShow.bind($$)));
|
|
20878
20885
|
$el.legend.selectAll($$.selectorLegends(targetIds)).filter(function() {
|
|
20879
20886
|
return (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(this).classed($FOCUS.legendItemFocused);
|
|
20880
20887
|
}).classed($FOCUS.legendItemFocused, false);
|
|
20881
20888
|
}
|
|
20889
|
+
};
|
|
20890
|
+
if (state.isCanvasMode) {
|
|
20891
|
+
const changed = !!((_a = state.focusedTargetIds) == null ? void 0 : _a.size) || !!((_b = state.defocusedTargetIds) == null ? void 0 : _b.size);
|
|
20892
|
+
resetLegend();
|
|
20882
20893
|
state.focusedTargetIds = /* @__PURE__ */ new Set();
|
|
20883
20894
|
state.defocusedTargetIds = /* @__PURE__ */ new Set();
|
|
20884
20895
|
changed && ((_c = $$.renderCanvasFrame) == null ? void 0 : _c.call($$, void 0, null, false));
|
|
@@ -20887,12 +20898,7 @@ extend(api_data_data, {
|
|
|
20887
20898
|
const candidates = $el.svg.selectAll($$.selectorTargets(targetIds));
|
|
20888
20899
|
candidates.classed($FOCUS.focused, false).classed($FOCUS.defocused, false);
|
|
20889
20900
|
$$.hasArcType(null, ["polar"]) && $$.unexpandArc(targetIds);
|
|
20890
|
-
|
|
20891
|
-
$$.showLegend(targetIds.filter($$.isLegendToShow.bind($$)));
|
|
20892
|
-
$el.legend.selectAll($$.selectorLegends(targetIds)).filter(function() {
|
|
20893
|
-
return (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(this).classed($FOCUS.legendItemFocused);
|
|
20894
|
-
}).classed($FOCUS.legendItemFocused, false);
|
|
20895
|
-
}
|
|
20901
|
+
resetLegend();
|
|
20896
20902
|
state.focusedTargetIds = /* @__PURE__ */ new Set();
|
|
20897
20903
|
state.defocusedTargetIds = /* @__PURE__ */ new Set();
|
|
20898
20904
|
}
|
|
@@ -25162,7 +25168,7 @@ function _getStrokeDashArray(start, end, pattern, isLastX = false) {
|
|
|
25162
25168
|
if (hasNullDataValue) {
|
|
25163
25169
|
const dx = x(data.x) - x(prevData.x);
|
|
25164
25170
|
const dy = y(data.value) - y(prevData.value);
|
|
25165
|
-
const dd = Math.sqrt(
|
|
25171
|
+
const dd = Math.sqrt(dx * dx + dy * dy);
|
|
25166
25172
|
diff = style[0] / dd;
|
|
25167
25173
|
diffx2 = diff * style[1];
|
|
25168
25174
|
for (let j = diff; j <= 1; j += diffx2) {
|
|
@@ -25318,12 +25324,23 @@ function getPointBBox(node) {
|
|
|
25318
25324
|
});
|
|
25319
25325
|
circles.exit().remove();
|
|
25320
25326
|
const pointR = $$.pointR.bind($$);
|
|
25321
|
-
const updateCircleColor = $$.
|
|
25327
|
+
const updateCircleColor = $$.generateUpdateCircleColor();
|
|
25322
25328
|
const initialOpacityForCircle = $$.initialOpacityForCircle.bind($$);
|
|
25323
25329
|
circles.enter().filter(Boolean).append($$.point("create", this, pointR, updateCircleColor));
|
|
25324
25330
|
$root.circle = $root.main.selectAll(`.${$CIRCLE.circles} .${$CIRCLE.circle}`).style("stroke", $$.getStylePropValue($$.color)).style("opacity", initialOpacityForCircle);
|
|
25325
25331
|
}
|
|
25326
25332
|
},
|
|
25333
|
+
/**
|
|
25334
|
+
* Generate circle color accessor, hoisting the bound color function
|
|
25335
|
+
* to be created once per call (not per datum)
|
|
25336
|
+
* @returns {function} Color accessor
|
|
25337
|
+
* @private
|
|
25338
|
+
*/
|
|
25339
|
+
generateUpdateCircleColor() {
|
|
25340
|
+
const $$ = this;
|
|
25341
|
+
const fn = $$.getStylePropValue($$.color);
|
|
25342
|
+
return (d) => $$.config.point_radialGradient ? $$.getGradienColortUrl(d.id) : fn ? fn(d) : null;
|
|
25343
|
+
},
|
|
25327
25344
|
/**
|
|
25328
25345
|
* Update circle color
|
|
25329
25346
|
* @param {object} d Data object
|
|
@@ -25331,9 +25348,7 @@ function getPointBBox(node) {
|
|
|
25331
25348
|
* @private
|
|
25332
25349
|
*/
|
|
25333
25350
|
updateCircleColor(d) {
|
|
25334
|
-
|
|
25335
|
-
const fn = $$.getStylePropValue($$.color);
|
|
25336
|
-
return $$.config.point_radialGradient ? $$.getGradienColortUrl(d.id) : fn ? fn(d) : null;
|
|
25351
|
+
return this.generateUpdateCircleColor()(d);
|
|
25337
25352
|
},
|
|
25338
25353
|
redrawCircle(cx, cy, withTransition, flow, isSub = false) {
|
|
25339
25354
|
const $$ = this;
|
|
@@ -25346,6 +25361,7 @@ function getPointBBox(node) {
|
|
|
25346
25361
|
const posAttr = $$.isCirclePoint() ? "c" : "";
|
|
25347
25362
|
const t = getRandom();
|
|
25348
25363
|
const opacityStyleFn = $$.opacityForCircle.bind($$);
|
|
25364
|
+
const updateCircleColor = $$.generateUpdateCircleColor();
|
|
25349
25365
|
if ($$.isCirclePoint()) {
|
|
25350
25366
|
const sel = $root.circle;
|
|
25351
25367
|
if ($$.hasType("bubble")) {
|
|
@@ -25355,12 +25371,12 @@ function getPointBBox(node) {
|
|
|
25355
25371
|
flow && sel.attr("cx", cx);
|
|
25356
25372
|
$T(sel.filter(function() {
|
|
25357
25373
|
return !!this.getAttribute("cx");
|
|
25358
|
-
}), true, `${t}-pos`).attr("cx", cx).attr("cy", cy).style("fill",
|
|
25374
|
+
}), true, `${t}-pos`).attr("cx", cx).attr("cy", cy).style("fill", updateCircleColor);
|
|
25359
25375
|
sel.filter(function() {
|
|
25360
25376
|
return !this.getAttribute("cx");
|
|
25361
|
-
}).attr("cx", cx).attr("cy", cy).style("fill",
|
|
25377
|
+
}).attr("cx", cx).attr("cy", cy).style("fill", updateCircleColor);
|
|
25362
25378
|
} else {
|
|
25363
|
-
sel.attr("cx", cx).attr("cy", cy).style("fill",
|
|
25379
|
+
sel.attr("cx", cx).attr("cy", cy).style("fill", updateCircleColor);
|
|
25364
25380
|
}
|
|
25365
25381
|
const result = $T(sel, withTransition || !rendered, t).style("opacity", opacityStyleFn);
|
|
25366
25382
|
return [
|
|
@@ -25373,7 +25389,7 @@ function getPointBBox(node) {
|
|
|
25373
25389
|
$$,
|
|
25374
25390
|
cx,
|
|
25375
25391
|
cy,
|
|
25376
|
-
|
|
25392
|
+
updateCircleColor,
|
|
25377
25393
|
withTransition,
|
|
25378
25394
|
flow,
|
|
25379
25395
|
selectedCircles
|
|
@@ -25489,9 +25505,9 @@ function getPointBBox(node) {
|
|
|
25489
25505
|
cx = x;
|
|
25490
25506
|
cy = y;
|
|
25491
25507
|
}
|
|
25492
|
-
|
|
25493
|
-
|
|
25494
|
-
) < (r || pointSensitivity);
|
|
25508
|
+
const dx = cx - mouse[0];
|
|
25509
|
+
const dy = cy - mouse[1];
|
|
25510
|
+
return Math.sqrt(dx * dx + dy * dy) < (r || pointSensitivity);
|
|
25495
25511
|
},
|
|
25496
25512
|
updatePointClass(d) {
|
|
25497
25513
|
const $$ = this;
|
|
@@ -30726,9 +30742,20 @@ function _getConnectLineType(id) {
|
|
|
30726
30742
|
config.bar_linearGradient && $$.updateLinearGradient();
|
|
30727
30743
|
const bar = $root.main.selectAll(`.${$BAR.bars}`).selectAll(`.${$BAR.bar}`).data($$.labelishData.bind($$));
|
|
30728
30744
|
$T(bar.exit(), withTransition).style("opacity", "0").remove();
|
|
30729
|
-
$root.bar = bar.enter().append("path").attr("class", classBar).style("fill", $$.
|
|
30745
|
+
$root.bar = bar.enter().append("path").attr("class", classBar).style("fill", $$.generateUpdateBarColor()).merge(bar).style("opacity", initialOpacity);
|
|
30730
30746
|
$$.setRatioForGroupedData($root.bar.data());
|
|
30731
30747
|
},
|
|
30748
|
+
/**
|
|
30749
|
+
* Generate bar color accessor, hoisting the bound color function
|
|
30750
|
+
* to be created once per call (not per datum)
|
|
30751
|
+
* @returns {function} Color accessor
|
|
30752
|
+
* @private
|
|
30753
|
+
*/
|
|
30754
|
+
generateUpdateBarColor() {
|
|
30755
|
+
const $$ = this;
|
|
30756
|
+
const fn = $$.getStylePropValue($$.color) || (() => null);
|
|
30757
|
+
return (d) => getShapeColorWithGradient.call($$, d, "bar_linearGradient", fn);
|
|
30758
|
+
},
|
|
30732
30759
|
/**
|
|
30733
30760
|
* Update bar color
|
|
30734
30761
|
* @param {object} d Data object
|
|
@@ -30736,9 +30763,7 @@ function _getConnectLineType(id) {
|
|
|
30736
30763
|
* @private
|
|
30737
30764
|
*/
|
|
30738
30765
|
updateBarColor(d) {
|
|
30739
|
-
|
|
30740
|
-
const fn = $$.getStylePropValue($$.color);
|
|
30741
|
-
return getShapeColorWithGradient.call($$, d, "bar_linearGradient", fn || (() => null));
|
|
30766
|
+
return this.generateUpdateBarColor()(d);
|
|
30742
30767
|
},
|
|
30743
30768
|
/**
|
|
30744
30769
|
* Redraw function
|
|
@@ -30777,7 +30802,7 @@ function _getConnectLineType(id) {
|
|
|
30777
30802
|
barPath.splice(0);
|
|
30778
30803
|
}
|
|
30779
30804
|
return path[0];
|
|
30780
|
-
}).style("fill", $$.
|
|
30805
|
+
}).style("fill", $$.generateUpdateBarColor()).style("clip-path", (d) => d.clipPath).style("opacity", null)
|
|
30781
30806
|
];
|
|
30782
30807
|
},
|
|
30783
30808
|
/**
|
|
@@ -30806,6 +30831,7 @@ function _getConnectLineType(id) {
|
|
|
30806
30831
|
const getPoints = $$.generateGetBarPoints(barIndices, isSub);
|
|
30807
30832
|
const getRadius = getBarRadiusResolver($$);
|
|
30808
30833
|
const stackingRadiusSet = getRadius ? getStackingBarRadiusSet($$) : /* @__PURE__ */ new Set();
|
|
30834
|
+
const connectLineCache = /* @__PURE__ */ new Map();
|
|
30809
30835
|
return (d, i) => {
|
|
30810
30836
|
const points = getPoints(d, i);
|
|
30811
30837
|
const {
|
|
@@ -30833,7 +30859,12 @@ function _getConnectLineType(id) {
|
|
|
30833
30859
|
}
|
|
30834
30860
|
const path = config.axis_rotated ? `H${pos} ${pathRadius[0]}V${points[2][indexY] - radius} ${pathRadius[1]}H${points[3][indexX]}` : `V${pos} ${pathRadius[0]}H${points[2][indexX] - radius} ${pathRadius[1]}V${points[3][indexY]}`;
|
|
30835
30861
|
const coords = [`M${points[0][indexX]},${points[0][indexY]}${path}z`];
|
|
30836
|
-
|
|
30862
|
+
let connectLineType = connectLineCache.get(d.id);
|
|
30863
|
+
if (connectLineType === void 0) {
|
|
30864
|
+
connectLineType = _getConnectLineType.call($$, d.id);
|
|
30865
|
+
connectLineCache.set(d.id, connectLineType);
|
|
30866
|
+
}
|
|
30867
|
+
if (connectLineType) {
|
|
30837
30868
|
coords.push(config.axis_rotated ? {
|
|
30838
30869
|
x: points[0][indexX],
|
|
30839
30870
|
y: points[0][indexY],
|
|
@@ -34741,7 +34772,7 @@ const bb = {
|
|
|
34741
34772
|
* bb.version; // "1.0.0"
|
|
34742
34773
|
* @memberof bb
|
|
34743
34774
|
*/
|
|
34744
|
-
version: "4.0.
|
|
34775
|
+
version: "4.0.3",
|
|
34745
34776
|
/**
|
|
34746
34777
|
* Generate chart
|
|
34747
34778
|
* - **NOTE:** Bear in mind for the possibility of ***throwing an error***, during the generation when:
|
package/dist/billboard.min.css
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 4.0.
|
|
8
|
+
* @version 4.0.3
|
|
9
9
|
*/.bb svg{font:10px sans-serif;-webkit-tap-highlight-color:rgba(0,0,0,0)}.bb path,.bb line{fill:none;stroke:#000}.bb text,.bb .bb-button{-webkit-user-select:none;-moz-user-select:none;user-select:none}.bb-legend-item-tile,.bb-xgrid-focus,.bb-ygrid-focus,.bb-ygrid{shape-rendering:crispEdges}.bb-chart-arcs .bb-needle,.bb-chart-arc .bb-gauge-value{fill:#000}.bb-chart-arc path{stroke:#fff}.bb-chart-arc rect{stroke:#fff;stroke-width:1}.bb-chart-arc text{fill:#fff;font-size:13px}.bb-chart-arc .bb-arc-label-line{fill:none;stroke-width:1px;pointer-events:none}.bb-chart-arc .bb-arc-label-line{stroke:#7f7f7f}.bb-chart-arc>text.bb-arc-label-line-text{fill:#000}.bb-chart-funnels path{stroke-width:0}.bb-chart-funnels+.bb-chart-texts text{font-size:13px;fill:#fff}.bb-axis{shape-rendering:crispEdges}.bb-axis .bb-axis-x-tooltip,.bb-axis .bb-axis-y-tooltip,.bb-axis .bb-axis-y2-tooltip{font-size:1em;fill:#fff;white-space:nowrap}.bb-grid{pointer-events:none}.bb-grid line{stroke:#aaa}.bb-grid text{fill:#aaa}.bb-xgrid,.bb-ygrid{stroke-dasharray:3 3}.bb-text.bb-empty{fill:gray;font-size:2em}.bb-line{stroke-width:1px}.bb-circle._expanded_{stroke-width:1px;stroke:#fff}.bb-selected-circle{fill:#fff;stroke-width:2px}.bb-bar{stroke-width:0}.bb-bar._expanded_{fill-opacity:.75}.bb-candlestick{stroke-width:1px}.bb-candlestick._expanded_{fill-opacity:.75}.bb-target.bb-focused,.bb-circles.bb-focused{opacity:1}.bb-target.bb-focused path.bb-line,.bb-target.bb-focused path.bb-step,.bb-circles.bb-focused path.bb-line,.bb-circles.bb-focused path.bb-step{stroke-width:2px}.bb-target.bb-defocused,.bb-circles.bb-defocused{opacity:.3!important}.bb-target.bb-defocused .text-overlapping,.bb-circles.bb-defocused .text-overlapping{opacity:.05!important}.bb-region{fill:#4682b4}.bb-region rect{fill-opacity:.1}.bb-zoom-brush,.bb-brush .extent{fill-opacity:.1}.bb-legend-item{font-size:12px;user-select:none}div.bb-canvas-legend{position:absolute;z-index:1;box-sizing:border-box;display:block;overflow:visible;pointer-events:auto;font-family:sans-serif;font-size:12px;color:#000}div.bb-canvas-legend.bb-canvas-legend-bottom{right:0;bottom:6px;left:0}div.bb-canvas-legend.bb-canvas-legend-right{overflow:visible}button.bb-legend-item{position:absolute;display:block;box-sizing:border-box;margin:0;padding:0;border:0;background:transparent;color:inherit;font-family:inherit;font-size:inherit;line-height:normal;text-align:left}button.bb-legend-item.bb-legend-item-interactive{cursor:pointer}.bb-canvas-legend .bb-legend-item-title{position:absolute;white-space:nowrap;pointer-events:none}.bb-canvas-legend .bb-legend-item-tile{position:absolute;display:block;box-sizing:border-box;width:10px;height:10px}.bb-canvas-legend .bb-legend-item-tile.bb-legend-item-tile-circle{border-radius:50%}.bb-legend-item-hidden{opacity:.15}.bb-legend-background{opacity:.75;fill:#fff;stroke:#d3d3d3;stroke-width:1}.bb-title{font:14px sans-serif}.bb-chart-treemaps rect{stroke:#fff;stroke-width:1px}.bb-tooltip-container{z-index:10;user-select:none;transform:translateZ(0)}.bb-tooltip{border-collapse:collapse;border-spacing:0;background-color:#fff;empty-cells:show;opacity:.9;box-shadow:7px 7px 12px -9px #777;white-space:nowrap}.bb-tooltip tr{border:1px solid #CCC}.bb-tooltip th{background-color:#aaa;font-size:14px;padding:2px 5px;text-align:left;color:#fff}.bb-tooltip td{font-size:13px;padding:3px 6px;background-color:#fff;border-left:1px dotted #999}.bb-tooltip td>span,.bb-tooltip td>svg{display:inline-block;width:10px;height:10px;margin-right:6px}.bb-tooltip.value{text-align:right}.bb-area{stroke-width:0;opacity:.2}.bb-chart-arcs-title{dominant-baseline:middle;font-size:1.3em}text.bb-chart-arcs-gauge-title{dominant-baseline:middle;font-size:2.7em}.bb-chart-arcs .bb-chart-arcs-background{fill:#e0e0e0;stroke:#fff}.bb-chart-arcs .bb-chart-arcs-gauge-unit{fill:#000;font-size:16px}.bb-chart-arcs .bb-chart-arcs-gauge-max,.bb-chart-arcs .bb-chart-arcs-gauge-min{fill:#777}.bb-chart-arcs .bb-levels circle{fill:none;stroke:#848282;stroke-width:.5px}.bb-chart-arcs .bb-levels text{fill:#848282}.bb-chart-radars .bb-levels polygon{fill:none;stroke:#848282;stroke-width:.5px}.bb-chart-radars .bb-levels text{fill:#848282}.bb-chart-radars .bb-axis line{stroke:#848282;stroke-width:.5px}.bb-chart-radars .bb-axis text{font-size:1.15em;cursor:default}.bb-chart-radars .bb-shapes polygon{fill-opacity:.2;stroke-width:1px}.bb-button{position:absolute;top:10px;right:10px}.bb-button .bb-zoom-reset{font-size:11px;border:solid 1px #ccc;background-color:#fff;padding:5px;border-radius:5px;cursor:pointer}
|