billboard.js 4.0.0-next.3 → 4.0.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 +1 -1
- package/dist/billboard.js +240 -149
- package/dist/billboard.min.css +1 -1
- package/dist/billboard.min.js +20 -20
- package/dist/billboard.pkgd.js +240 -149
- package/dist/billboard.pkgd.min.js +27 -27
- 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 +11 -13
- package/dist/plugin/billboardjs-plugin-sparkline.min.js +3 -3
- package/dist/plugin/billboardjs-plugin-stanford.js +11 -13
- package/dist/plugin/billboardjs-plugin-stanford.min.js +4 -4
- package/dist/plugin/billboardjs-plugin-tableview.js +28 -15
- package/dist/plugin/billboardjs-plugin-tableview.min.js +4 -4
- 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 +11 -13
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.min.js +9 -9
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.js +11 -13
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.min.js +3 -3
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.js +28 -15
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.min.js +6 -6
- 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 +1 -1
- 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 +53 -0
- package/dist-esm/Chart/api/subchart.js +2 -2
- 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 +2 -2
- package/dist-esm/ChartInternal/Axis/Axis.js +1 -1
- package/dist-esm/ChartInternal/Axis/AxisRenderer.js +149 -96
- package/dist-esm/ChartInternal/Axis/AxisRendererHelper.js +1 -1
- package/dist-esm/ChartInternal/ChartInternal.js +8 -4
- 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 +1 -1
- 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 +2 -2
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- package/dist-esm/ChartInternal/shape/point.js +1 -1
- 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 +6 -4
- package/dist-esm/ChartInternal/shape/treemap.js +1 -1
- package/dist-esm/canvas/CanvasAxisRenderer.js +1 -1
- package/dist-esm/canvas/CanvasEngine.js +18 -5
- package/dist-esm/canvas/CanvasPainter.js +1 -1
- package/dist-esm/canvas/CanvasRenderer.js +58 -35
- 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 -13
- 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 +17 -2
- 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 +2 -1
- package/dist-esm/index.esm.js +2 -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 +16 -3
- package/dist-esm/module/generator.js +1 -1
- package/dist-esm/module/sanitize.js +14 -18
- 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 +7 -4
- package/dist-esm/module/util/type-checks.js +1 -1
- package/dist-esm/module/worker.js +32 -22
- 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 +32 -21
- package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +2 -2
- package/package.json +37 -11
- package/src/ChartInternal/Axis/AxisRenderer.ts +179 -105
- package/src/ChartInternal/ChartInternal.ts +11 -3
- package/src/ChartInternal/interactions/eventrect.ts +3 -1
- package/src/ChartInternal/shape/shape.ts +5 -3
- package/src/Plugin/tableview/Options.ts +17 -1
- package/src/Plugin/tableview/index.ts +1 -1
- package/src/canvas/CanvasEngine.ts +18 -5
- package/src/canvas/CanvasRenderer.ts +71 -36
- package/src/config/Options/axis/y2.ts +0 -13
- package/src/module/sanitize.ts +13 -20
- package/src/module/util/object.ts +4 -2
- package/src/module/worker.ts +34 -24
- package/types/index.d.ts +0 -3
- package/types/plugin/tableview/options.d.ts +5 -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 4.0.0
|
|
8
|
+
* @version 4.0.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
|
|
@@ -26598,7 +26598,7 @@ const DANGEROUS_CSS_PATTERNS = [
|
|
|
26598
26598
|
"-moz-binding:"
|
|
26599
26599
|
];
|
|
26600
26600
|
function decodeHTMLEntities(str) {
|
|
26601
|
-
return str.replace(/:/gi, ":").replace(/&newline;/gi, "\n").replace(/&tab;/gi, " ").replace(/ /gi, " ").replace(/</gi, "<").replace(/>/gi, ">").replace(/&/gi, "&").replace(/"/gi, '"').replace(/'/gi, "'").replace(/&#(\d+)
|
|
26601
|
+
return str.replace(/:/gi, ":").replace(/&newline;/gi, "\n").replace(/&tab;/gi, " ").replace(/ /gi, " ").replace(/</gi, "<").replace(/>/gi, ">").replace(/&/gi, "&").replace(/"/gi, '"').replace(/'/gi, "'").replace(/&#(\d+);?/gi, (_, code) => String.fromCharCode(parseInt(code, 10))).replace(/&#x([0-9a-f]+);?/gi, (_, code) => String.fromCharCode(parseInt(code, 16)));
|
|
26602
26602
|
}
|
|
26603
26603
|
function isSafeURI(uri) {
|
|
26604
26604
|
const decoded = decodeHTMLEntities(uri).trim();
|
|
@@ -26606,15 +26606,11 @@ function isSafeURI(uri) {
|
|
|
26606
26606
|
if (!normalized || normalized.startsWith("#")) {
|
|
26607
26607
|
return true;
|
|
26608
26608
|
}
|
|
26609
|
-
|
|
26610
|
-
|
|
26611
|
-
|
|
26612
|
-
const colonIndex = normalized.indexOf(":");
|
|
26613
|
-
if (colonIndex > 0) {
|
|
26614
|
-
const protocol = normalized.substring(0, colonIndex + 1);
|
|
26615
|
-
return ALLOWED_URI_PROTOCOLS.has(protocol);
|
|
26609
|
+
const schemeMatch = normalized.match(/^[^/?#]*:/);
|
|
26610
|
+
if (schemeMatch) {
|
|
26611
|
+
return ALLOWED_URI_PROTOCOLS.has(schemeMatch[0]);
|
|
26616
26612
|
}
|
|
26617
|
-
return
|
|
26613
|
+
return true;
|
|
26618
26614
|
}
|
|
26619
26615
|
function sanitizeStyleValue(style) {
|
|
26620
26616
|
const decoded = decodeHTMLEntities(style);
|
|
@@ -26770,7 +26766,7 @@ var __spreadValues = (a, b) => {
|
|
|
26770
26766
|
function _forEachValidItem(items, callback) {
|
|
26771
26767
|
for (let i = 0; i < items.length; i++) {
|
|
26772
26768
|
const item = items[i];
|
|
26773
|
-
if (item) {
|
|
26769
|
+
if (item !== null && isDefined(item)) {
|
|
26774
26770
|
callback(item, i);
|
|
26775
26771
|
}
|
|
26776
26772
|
}
|
|
@@ -26850,7 +26846,9 @@ function mergeObj(target, ...objectN) {
|
|
|
26850
26846
|
Object.keys(source).forEach((key) => {
|
|
26851
26847
|
if (!/^(__proto__|constructor|prototype)$/i.test(key)) {
|
|
26852
26848
|
const value = source[key];
|
|
26853
|
-
if (
|
|
26849
|
+
if (value instanceof Date) {
|
|
26850
|
+
target[key] = new Date(value.getTime());
|
|
26851
|
+
} else if (isObject(value)) {
|
|
26854
26852
|
!target[key] && (target[key] = {});
|
|
26855
26853
|
target[key] = mergeObj(target[key], value);
|
|
26856
26854
|
} else {
|
|
@@ -29634,6 +29632,7 @@ class CanvasEngine {
|
|
|
29634
29632
|
CanvasEngine_publicField(this, "dpr", 1);
|
|
29635
29633
|
CanvasEngine_publicField(this, "frame", null);
|
|
29636
29634
|
CanvasEngine_publicField(this, "frameCtx", null);
|
|
29635
|
+
CanvasEngine_publicField(this, "frameValid", false);
|
|
29637
29636
|
}
|
|
29638
29637
|
/**
|
|
29639
29638
|
* Create and attach the canvas element.
|
|
@@ -29668,13 +29667,14 @@ class CanvasEngine {
|
|
|
29668
29667
|
this.ctx.setTransform(this.dpr, 0, 0, this.dpr, 0, 0);
|
|
29669
29668
|
this.frame = null;
|
|
29670
29669
|
this.frameCtx = null;
|
|
29670
|
+
this.frameValid = false;
|
|
29671
29671
|
}
|
|
29672
29672
|
/**
|
|
29673
29673
|
* Clear transient overlay drawings by restoring the captured frame.
|
|
29674
29674
|
* @private
|
|
29675
29675
|
*/
|
|
29676
29676
|
clearOverlay() {
|
|
29677
|
-
this.restoreFrame();
|
|
29677
|
+
this.frameValid && this.restoreFrame();
|
|
29678
29678
|
}
|
|
29679
29679
|
/**
|
|
29680
29680
|
* Draw transient overlay content on the single visible canvas.
|
|
@@ -29683,7 +29683,12 @@ class CanvasEngine {
|
|
|
29683
29683
|
*/
|
|
29684
29684
|
withOverlay(draw) {
|
|
29685
29685
|
const { ctx } = this;
|
|
29686
|
-
this.
|
|
29686
|
+
const hasFrame = this.frameValid;
|
|
29687
|
+
if (hasFrame) {
|
|
29688
|
+
this.clearOverlay();
|
|
29689
|
+
} else {
|
|
29690
|
+
this.captureFrame();
|
|
29691
|
+
}
|
|
29687
29692
|
ctx.save();
|
|
29688
29693
|
ctx.setTransform(this.dpr, 0, 0, this.dpr, 0, 0);
|
|
29689
29694
|
try {
|
|
@@ -29700,6 +29705,7 @@ class CanvasEngine {
|
|
|
29700
29705
|
*/
|
|
29701
29706
|
beginFrame(w, h) {
|
|
29702
29707
|
const { ctx } = this;
|
|
29708
|
+
this.frameValid = false;
|
|
29703
29709
|
ctx.save();
|
|
29704
29710
|
ctx.setTransform(this.dpr, 0, 0, this.dpr, 0, 0);
|
|
29705
29711
|
ctx.clearRect(0, 0, w, h);
|
|
@@ -29710,7 +29716,6 @@ class CanvasEngine {
|
|
|
29710
29716
|
*/
|
|
29711
29717
|
endFrame() {
|
|
29712
29718
|
this.ctx.restore();
|
|
29713
|
-
this.captureFrame();
|
|
29714
29719
|
}
|
|
29715
29720
|
/**
|
|
29716
29721
|
* Capture the rendered frame for focus overlay restoration.
|
|
@@ -29718,6 +29723,7 @@ class CanvasEngine {
|
|
|
29718
29723
|
*/
|
|
29719
29724
|
captureFrame() {
|
|
29720
29725
|
const { canvas } = this;
|
|
29726
|
+
this.frameValid = false;
|
|
29721
29727
|
if (canvas.width && canvas.height) {
|
|
29722
29728
|
let { frame, frameCtx } = this;
|
|
29723
29729
|
if (!frame) {
|
|
@@ -29738,6 +29744,7 @@ class CanvasEngine {
|
|
|
29738
29744
|
frameCtx.clearRect(0, 0, canvas.width, canvas.height);
|
|
29739
29745
|
}
|
|
29740
29746
|
frameCtx.drawImage(canvas, 0, 0);
|
|
29747
|
+
this.frameValid = true;
|
|
29741
29748
|
}
|
|
29742
29749
|
}
|
|
29743
29750
|
/**
|
|
@@ -29745,7 +29752,7 @@ class CanvasEngine {
|
|
|
29745
29752
|
* @private
|
|
29746
29753
|
*/
|
|
29747
29754
|
restoreFrame() {
|
|
29748
|
-
if (!this.frame || !this.frameCtx) {
|
|
29755
|
+
if (!this.frameValid || !this.frame || !this.frameCtx) {
|
|
29749
29756
|
return;
|
|
29750
29757
|
}
|
|
29751
29758
|
const { canvas, ctx } = this;
|
|
@@ -29765,6 +29772,7 @@ class CanvasEngine {
|
|
|
29765
29772
|
(_a = this.canvas) == null ? void 0 : _a.remove();
|
|
29766
29773
|
this.frame = null;
|
|
29767
29774
|
this.frameCtx = null;
|
|
29775
|
+
this.frameValid = false;
|
|
29768
29776
|
}
|
|
29769
29777
|
}
|
|
29770
29778
|
|
|
@@ -31292,6 +31300,12 @@ function drawCanvasArea($$, target, indices, painter, isSub = false) {
|
|
|
31292
31300
|
generateDrawAreaPath($$, indices, isSub, ctx)(target);
|
|
31293
31301
|
});
|
|
31294
31302
|
}
|
|
31303
|
+
function getVisibleCanvasTarget($$, target) {
|
|
31304
|
+
const range = getCanvasTargetVisibleRange($$, target);
|
|
31305
|
+
return range.start === 0 && range.end === target.values.length ? target : CanvasRenderer_spreadProps(CanvasRenderer_spreadValues({}, target), {
|
|
31306
|
+
values: target.values.slice(range.start, range.end)
|
|
31307
|
+
});
|
|
31308
|
+
}
|
|
31295
31309
|
function getFocusedCanvasDatum(focusData, d) {
|
|
31296
31310
|
if (!(focusData == null ? void 0 : focusData.length) || !(d == null ? void 0 : d.id)) {
|
|
31297
31311
|
return null;
|
|
@@ -32295,7 +32309,7 @@ class CanvasRenderer {
|
|
|
32295
32309
|
*/
|
|
32296
32310
|
hasExpandedShapeFocus($$, selectedData) {
|
|
32297
32311
|
return !!(selectedData == null ? void 0 : selectedData.some(
|
|
32298
|
-
(d) => d && (isCanvasBarType($$, d) || isCanvasCandlestickType($$, d)
|
|
32312
|
+
(d) => d && (isCanvasBarType($$, d) || isCanvasCandlestickType($$, d))
|
|
32299
32313
|
));
|
|
32300
32314
|
}
|
|
32301
32315
|
/**
|
|
@@ -32316,13 +32330,14 @@ class CanvasRenderer {
|
|
|
32316
32330
|
painter.withTranslation(margin.left, margin.top, () => {
|
|
32317
32331
|
var _a;
|
|
32318
32332
|
for (const target of targets) {
|
|
32319
|
-
|
|
32333
|
+
const visibleTarget = getVisibleCanvasTarget($$, target);
|
|
32334
|
+
if (!visibleTarget.values.some(hasCanvasDrawableValue.bind(null, $$))) {
|
|
32320
32335
|
continue;
|
|
32321
32336
|
}
|
|
32322
32337
|
ctx.globalAlpha = getCanvasTargetFocusOpacity($$, target);
|
|
32323
32338
|
ctx.lineWidth = isCanvasTargetFocused($$, target) ? style.shape.lineFocusedWidth : style.shape.lineWidth;
|
|
32324
32339
|
ctx.strokeStyle = $$.color(target.id);
|
|
32325
|
-
((_a = $$.config.data_regions) == null ? void 0 : _a[
|
|
32340
|
+
((_a = $$.config.data_regions) == null ? void 0 : _a[visibleTarget.id]) ? drawCanvasLineWithDataRegions($$, visibleTarget, painter) : drawCanvasLine($$, visibleTarget, indices, painter);
|
|
32326
32341
|
}
|
|
32327
32342
|
ctx.globalAlpha = 1;
|
|
32328
32343
|
});
|
|
@@ -32345,21 +32360,23 @@ class CanvasRenderer {
|
|
|
32345
32360
|
}
|
|
32346
32361
|
painter.withTranslation(margin.left, margin.top, () => {
|
|
32347
32362
|
for (const target of targets) {
|
|
32348
|
-
|
|
32363
|
+
const visibleTarget = getVisibleCanvasTarget($$, target);
|
|
32364
|
+
if (!visibleTarget.values.some(hasCanvasDrawableValue.bind(null, $$))) {
|
|
32349
32365
|
continue;
|
|
32350
32366
|
}
|
|
32351
|
-
const color = getCanvasRenderColor($$,
|
|
32367
|
+
const color = getCanvasRenderColor($$, visibleTarget, focusData);
|
|
32352
32368
|
ctx.globalAlpha = style.shape.areaOpacity * getCanvasTargetFocusOpacity($$, target);
|
|
32353
32369
|
ctx.fillStyle = getCanvasLinearGradientFill(
|
|
32354
32370
|
$$,
|
|
32355
32371
|
ctx,
|
|
32356
|
-
|
|
32372
|
+
visibleTarget,
|
|
32357
32373
|
"area",
|
|
32358
|
-
//
|
|
32374
|
+
// Bounds computation walks visible rows, so skip it when no gradient is set.
|
|
32375
|
+
// Use the original target so the range cache stays aligned with unsliced values.
|
|
32359
32376
|
$$.config.area_linearGradient ? getCanvasAreaBounds($$, target, indices) : null,
|
|
32360
32377
|
color
|
|
32361
32378
|
);
|
|
32362
|
-
drawCanvasArea($$,
|
|
32379
|
+
drawCanvasArea($$, visibleTarget, indices, painter);
|
|
32363
32380
|
}
|
|
32364
32381
|
ctx.globalAlpha = 1;
|
|
32365
32382
|
});
|
|
@@ -32630,7 +32647,7 @@ class CanvasRenderer {
|
|
|
32630
32647
|
const d = data[i];
|
|
32631
32648
|
const text = getLabelText($$, d);
|
|
32632
32649
|
if (text && d.index >= range.start && d.index < range.end && hasCanvasDrawableValue($$, d)) {
|
|
32633
|
-
rows.push({ d,
|
|
32650
|
+
rows.push({ d, text });
|
|
32634
32651
|
}
|
|
32635
32652
|
}
|
|
32636
32653
|
labelCount += rows.length;
|
|
@@ -32643,12 +32660,12 @@ class CanvasRenderer {
|
|
|
32643
32660
|
ctx.font = style.label.font;
|
|
32644
32661
|
ctx.textAlign = "center";
|
|
32645
32662
|
targetRows.forEach((rows) => {
|
|
32646
|
-
var _a2;
|
|
32647
|
-
for (const { d,
|
|
32663
|
+
var _a2, _b;
|
|
32664
|
+
for (const { d, text } of rows) {
|
|
32648
32665
|
let x;
|
|
32649
32666
|
let y;
|
|
32650
32667
|
if (isCanvasBarType($$, d) && barPoints) {
|
|
32651
|
-
const geometry = getCanvasBarGeometry($$, barPoints, d,
|
|
32668
|
+
const geometry = getCanvasBarGeometry($$, barPoints, d, d.index);
|
|
32652
32669
|
if (!geometry) {
|
|
32653
32670
|
continue;
|
|
32654
32671
|
}
|
|
@@ -32667,19 +32684,21 @@ class CanvasRenderer {
|
|
|
32667
32684
|
$$,
|
|
32668
32685
|
candlestickPoints,
|
|
32669
32686
|
d,
|
|
32670
|
-
|
|
32687
|
+
d.index
|
|
32671
32688
|
);
|
|
32672
32689
|
const isUp = value == null ? void 0 : value._isUp;
|
|
32673
32690
|
if (!geometry) {
|
|
32674
32691
|
continue;
|
|
32675
32692
|
}
|
|
32676
|
-
const {
|
|
32677
|
-
|
|
32678
|
-
|
|
32693
|
+
const { wickEnd, wickStart } = geometry;
|
|
32694
|
+
const isInverted = $$.config[`axis_${(_b = $$.axis) == null ? void 0 : _b.getId(d.id)}_inverted`];
|
|
32695
|
+
x = $$.config.axis_rotated ? isUp ? wickEnd[0] + 4 : wickStart[0] - 4 : wickStart[0];
|
|
32696
|
+
y = $$.config.axis_rotated ? wickStart[1] + 3 : isUp ? wickEnd[1] - 3 : wickStart[1] + 12;
|
|
32697
|
+
!$$.config.axis_rotated && isInverted && (y += 15 * (isUp ? 1 : -1));
|
|
32679
32698
|
ctx.textAlign = $$.config.axis_rotated ? isUp ? "left" : "right" : "center";
|
|
32680
|
-
ctx.textBaseline =
|
|
32699
|
+
ctx.textBaseline = "alphabetic";
|
|
32681
32700
|
} else if (cx && cy) {
|
|
32682
|
-
({ x, y } = getShapePoint(shape.pos, d,
|
|
32701
|
+
({ x, y } = getShapePoint(shape.pos, d, d.index));
|
|
32683
32702
|
({ x, y } = getPointLabelAnchor($$, ctx, d, x, y));
|
|
32684
32703
|
}
|
|
32685
32704
|
x += getLabelPosition($$, d, "x", texts);
|
|
@@ -32909,15 +32928,24 @@ class CanvasRenderer {
|
|
|
32909
32928
|
const r = (_d = (_c = $$.pointExpandedR) == null ? void 0 : _c.call($$, d)) != null ? _d : baseR * 1.75;
|
|
32910
32929
|
const overColor = getCanvasOverColor($$, d);
|
|
32911
32930
|
const color = overColor || $$.color(d.id);
|
|
32931
|
+
const fill = overColor || style.focusPoint.fill || style.shape.pointFillColor || color;
|
|
32932
|
+
const stroke = overColor || style.focusPoint.stroke || color;
|
|
32933
|
+
const lineWidth = style.focusPoint.lineWidth;
|
|
32934
|
+
const alpha = getPointOpacity($$, d);
|
|
32935
|
+
const hasStroke = !!stroke && (lineWidth != null ? lineWidth : 0) > 0;
|
|
32936
|
+
const mergeSameColorStroke = pointType === "circle" && hasStroke && isNumber(alpha) && alpha < 1 && fill === stroke;
|
|
32912
32937
|
if (!isFiniteCanvasCoordinate(x, y)) {
|
|
32913
32938
|
return;
|
|
32914
32939
|
}
|
|
32915
|
-
drawPointPattern(
|
|
32916
|
-
|
|
32917
|
-
|
|
32918
|
-
|
|
32919
|
-
|
|
32920
|
-
|
|
32940
|
+
drawPointPattern(
|
|
32941
|
+
painter,
|
|
32942
|
+
pointType,
|
|
32943
|
+
x,
|
|
32944
|
+
y,
|
|
32945
|
+
mergeSameColorStroke ? r + (lineWidth || 0) / 2 : r,
|
|
32946
|
+
hasStroke && !mergeSameColorStroke ? { fill, lineWidth, stroke, alpha } : { fill, alpha },
|
|
32947
|
+
baseR
|
|
32948
|
+
);
|
|
32921
32949
|
});
|
|
32922
32950
|
}
|
|
32923
32951
|
this.drawFocusLabels($$, selectedData);
|
|
@@ -37269,20 +37297,24 @@ function getOrCreateWorkerResources(fn, depsFn) {
|
|
|
37269
37297
|
const depsString = (_a = depsFn == null ? void 0 : depsFn.map(String).join(";")) != null ? _a : "";
|
|
37270
37298
|
const key = (fnString + depsString).replace(/(function|[\s\W\n])/g, "").substring(0, 30);
|
|
37271
37299
|
if (!(key in cache)) {
|
|
37272
|
-
|
|
37273
|
-
|
|
37274
|
-
|
|
37275
|
-
|
|
37276
|
-
|
|
37277
|
-
|
|
37278
|
-
|
|
37279
|
-
|
|
37280
|
-
|
|
37281
|
-
|
|
37282
|
-
|
|
37283
|
-
|
|
37284
|
-
|
|
37285
|
-
|
|
37300
|
+
try {
|
|
37301
|
+
const blob = new win.Blob([
|
|
37302
|
+
`${depsString}
|
|
37303
|
+
|
|
37304
|
+
self.onmessage=function({data}) {
|
|
37305
|
+
const result = (${fnString}).apply(null, data.args);
|
|
37306
|
+
self.postMessage({id: data.id, result});
|
|
37307
|
+
};`
|
|
37308
|
+
], {
|
|
37309
|
+
type: "text/javascript"
|
|
37310
|
+
});
|
|
37311
|
+
cache[key] = {
|
|
37312
|
+
src: win.URL.createObjectURL(blob),
|
|
37313
|
+
worker: null
|
|
37314
|
+
};
|
|
37315
|
+
} catch (e) {
|
|
37316
|
+
return null;
|
|
37317
|
+
}
|
|
37286
37318
|
}
|
|
37287
37319
|
return { key, src: cache[key].src };
|
|
37288
37320
|
}
|
|
@@ -37292,7 +37324,11 @@ function getWorker(key, src) {
|
|
|
37292
37324
|
return null;
|
|
37293
37325
|
}
|
|
37294
37326
|
if (!cached.worker) {
|
|
37295
|
-
|
|
37327
|
+
try {
|
|
37328
|
+
cached.worker = new win.Worker(src);
|
|
37329
|
+
} catch (e) {
|
|
37330
|
+
return null;
|
|
37331
|
+
}
|
|
37296
37332
|
if (cached.worker) {
|
|
37297
37333
|
cached.worker.onerror = function(e) {
|
|
37298
37334
|
console.error ? console.error(e) : console.log(e);
|
|
@@ -37307,10 +37343,10 @@ function runWorker(useWorker = true, fn, callback, depsFn) {
|
|
|
37307
37343
|
callback(res);
|
|
37308
37344
|
};
|
|
37309
37345
|
if (win.Worker && useWorker) {
|
|
37310
|
-
const
|
|
37311
|
-
const worker = getWorker(key, src);
|
|
37312
|
-
|
|
37313
|
-
|
|
37346
|
+
const workerResources = getOrCreateWorkerResources(fn, depsFn);
|
|
37347
|
+
const worker = workerResources && getWorker(workerResources.key, workerResources.src);
|
|
37348
|
+
if (worker) {
|
|
37349
|
+
runFn = function(...args) {
|
|
37314
37350
|
const id = ++messageId;
|
|
37315
37351
|
const handler = function(e) {
|
|
37316
37352
|
var _a;
|
|
@@ -37321,8 +37357,8 @@ function runWorker(useWorker = true, fn, callback, depsFn) {
|
|
|
37321
37357
|
};
|
|
37322
37358
|
worker.addEventListener("message", handler);
|
|
37323
37359
|
worker.postMessage({ id, args });
|
|
37324
|
-
}
|
|
37325
|
-
}
|
|
37360
|
+
};
|
|
37361
|
+
}
|
|
37326
37362
|
}
|
|
37327
37363
|
return runFn;
|
|
37328
37364
|
}
|
|
@@ -46143,10 +46179,11 @@ function updateTargetsForShape(targets, config) {
|
|
|
46143
46179
|
const targets = $$.orderTargets(
|
|
46144
46180
|
$$.filterTargetsToShow($$.data.targets.filter(typeFilter, $$))
|
|
46145
46181
|
);
|
|
46182
|
+
const dataGeneration = $$.state.dataGeneration;
|
|
46146
46183
|
const targetIds = targets.map((t) => t.id).join("_");
|
|
46147
46184
|
const cacheKey = `${KEY.shapeOffset}_${targetIds}`;
|
|
46148
46185
|
const cachedData = $$.cache.get(cacheKey);
|
|
46149
|
-
if (cachedData) {
|
|
46186
|
+
if ((cachedData == null ? void 0 : cachedData.generation) === dataGeneration) {
|
|
46150
46187
|
return cachedData;
|
|
46151
46188
|
}
|
|
46152
46189
|
const isStackNormalized = $$.isStackNormalized();
|
|
@@ -46174,7 +46211,7 @@ function updateTargetsForShape(targets, config) {
|
|
|
46174
46211
|
out[id] = index;
|
|
46175
46212
|
return out;
|
|
46176
46213
|
}, {});
|
|
46177
|
-
const result = { indexMapByTargetId, shapeOffsetTargets };
|
|
46214
|
+
const result = { generation: dataGeneration, indexMapByTargetId, shapeOffsetTargets };
|
|
46178
46215
|
$$.cache.add(cacheKey, result);
|
|
46179
46216
|
return result;
|
|
46180
46217
|
},
|
|
@@ -46940,7 +46977,7 @@ class ChartInternal {
|
|
|
46940
46977
|
if (hasAxis || hasColorPatterns || hasPolar || hasTreemap || labelsBGColor || ((_b = $$.hasLegendDefsPoint) == null ? void 0 : _b.call($$))) {
|
|
46941
46978
|
$el.defs = $el.svg.append("defs");
|
|
46942
46979
|
if (hasAxis) {
|
|
46943
|
-
["id", "idXAxis", "idYAxis", "
|
|
46980
|
+
["id", "idXAxis", "idYAxis", "idGrid"].forEach((v) => {
|
|
46944
46981
|
$$.appendClip($el.defs, state.clip[v]);
|
|
46945
46982
|
});
|
|
46946
46983
|
}
|
|
@@ -47184,6 +47221,7 @@ class ChartInternal {
|
|
|
47184
47221
|
return $$.getBaseValue(d) !== null && withoutFadeIn[d.id] ? null : "0";
|
|
47185
47222
|
}
|
|
47186
47223
|
bindResize() {
|
|
47224
|
+
var _a, _b;
|
|
47187
47225
|
const $$ = this;
|
|
47188
47226
|
const { $el, config, state } = $$;
|
|
47189
47227
|
const resizeFunction = generateResize(config.resize_timer);
|
|
@@ -47192,7 +47230,7 @@ class ChartInternal {
|
|
|
47192
47230
|
list.push(() => callFn(config.onresize, $$.api));
|
|
47193
47231
|
if (/^(true|parent)$/.test(resize_auto)) {
|
|
47194
47232
|
list.push(() => {
|
|
47195
|
-
var
|
|
47233
|
+
var _a2;
|
|
47196
47234
|
const prevWidth = state.current.width;
|
|
47197
47235
|
const prevHeight = state.current.height;
|
|
47198
47236
|
$$.setContainerSize();
|
|
@@ -47202,7 +47240,7 @@ class ChartInternal {
|
|
|
47202
47240
|
state.resizing = true;
|
|
47203
47241
|
if (config.legend_show) {
|
|
47204
47242
|
$$.updateSizes();
|
|
47205
|
-
state.isCanvasMode ? (
|
|
47243
|
+
state.isCanvasMode ? (_a2 = $$.updateHtmlLegend) == null ? void 0 : _a2.call($$) : $$.updateLegend();
|
|
47206
47244
|
}
|
|
47207
47245
|
$$.api.flush(false);
|
|
47208
47246
|
});
|
|
@@ -47213,9 +47251,17 @@ class ChartInternal {
|
|
|
47213
47251
|
});
|
|
47214
47252
|
list.forEach((v) => resizeFunction.add(v));
|
|
47215
47253
|
$$.resizeFunction = resizeFunction;
|
|
47216
|
-
if (resize_auto === "parent") {
|
|
47217
|
-
($$.resizeFunction.resizeObserver = new ResizeObserver(
|
|
47254
|
+
if (resize_auto === "parent" && win.ResizeObserver) {
|
|
47255
|
+
($$.resizeFunction.resizeObserver = new win.ResizeObserver(
|
|
47256
|
+
$$.resizeFunction.bind($$)
|
|
47257
|
+
)).observe($el.chart.node().parentNode);
|
|
47218
47258
|
} else {
|
|
47259
|
+
if (resize_auto === "parent") {
|
|
47260
|
+
(_b = (_a = win.console) == null ? void 0 : _a.warn) == null ? void 0 : _b.call(
|
|
47261
|
+
_a,
|
|
47262
|
+
"[billboard.js] resize.auto='parent' requires ResizeObserver; falling back to window resize."
|
|
47263
|
+
);
|
|
47264
|
+
}
|
|
47219
47265
|
win.addEventListener("resize", $$.resizeFunction);
|
|
47220
47266
|
}
|
|
47221
47267
|
}
|
|
@@ -55875,6 +55921,33 @@ class AxisRenderer {
|
|
|
55875
55921
|
this.params = params;
|
|
55876
55922
|
this.helper = new AxisRendererHelper(this);
|
|
55877
55923
|
}
|
|
55924
|
+
canReuseTickTextOnResize(isLeftRight) {
|
|
55925
|
+
const { config, params } = this;
|
|
55926
|
+
const { config: chartConfig, id, owner } = params;
|
|
55927
|
+
const isX = /^(x|subX)$/.test(id);
|
|
55928
|
+
const type = id === "subX" ? "x" : id;
|
|
55929
|
+
const customTickFormat = id === "subX" ? chartConfig.subchart_axis_x_tick_format || chartConfig.axis_x_tick_format : chartConfig[`axis_${type}_tick_format`];
|
|
55930
|
+
const categoryAutoWrap = params.tickMultiline && params.isCategory && !isLeftRight && !(params.tickWidth > 0);
|
|
55931
|
+
return !!(owner.state.resizing && !owner.state.flowing && !isFunction(chartConfig.axis_evalTextSize) && !customTickFormat && !params.tickTitle && !(isX && chartConfig.axis_x_tick_autorotate) && !categoryAutoWrap && config.withoutTransition);
|
|
55932
|
+
}
|
|
55933
|
+
canReuseTickNodesOnResize(tickNodes, ticks, isLeftRight, tickShow) {
|
|
55934
|
+
if (tickShow.tick || !tickShow.text || !this.canReuseTickTextOnResize(isLeftRight) || tickNodes.size() !== ticks.length) {
|
|
55935
|
+
return false;
|
|
55936
|
+
}
|
|
55937
|
+
const nodes = tickNodes.nodes();
|
|
55938
|
+
for (let i = 0; i < ticks.length; i++) {
|
|
55939
|
+
const current = nodes[i].__data__;
|
|
55940
|
+
const next = ticks[i];
|
|
55941
|
+
if (current instanceof Date || next instanceof Date) {
|
|
55942
|
+
if (+current !== +next) {
|
|
55943
|
+
return false;
|
|
55944
|
+
}
|
|
55945
|
+
} else if (current !== next) {
|
|
55946
|
+
return false;
|
|
55947
|
+
}
|
|
55948
|
+
}
|
|
55949
|
+
return true;
|
|
55950
|
+
}
|
|
55878
55951
|
/**
|
|
55879
55952
|
* Create axis element
|
|
55880
55953
|
* @param {d3.selection} g Axis selection
|
|
@@ -55919,76 +55992,106 @@ class AxisRenderer {
|
|
|
55919
55992
|
if (tickShow.tick || tickShow.text) {
|
|
55920
55993
|
const ticks = config.tickValues || helper.generateTicks(scale1, isLeftRight || params.config.axis_rotated);
|
|
55921
55994
|
ctx.generatedTicks = ticks;
|
|
55922
|
-
let tick = g2.selectAll(".tick")
|
|
55923
|
-
const
|
|
55924
|
-
|
|
55925
|
-
|
|
55926
|
-
|
|
55927
|
-
|
|
55928
|
-
|
|
55929
|
-
|
|
55930
|
-
|
|
55931
|
-
|
|
55932
|
-
|
|
55933
|
-
|
|
55934
|
-
|
|
55935
|
-
|
|
55936
|
-
|
|
55937
|
-
|
|
55938
|
-
|
|
55939
|
-
|
|
55940
|
-
|
|
55941
|
-
let
|
|
55942
|
-
if (
|
|
55943
|
-
|
|
55944
|
-
|
|
55945
|
-
|
|
55946
|
-
|
|
55995
|
+
let tick = g2.selectAll(".tick");
|
|
55996
|
+
const canReuseTickNodes = ctx.canReuseTickNodesOnResize(
|
|
55997
|
+
tick,
|
|
55998
|
+
ticks,
|
|
55999
|
+
isLeftRight || params.config.axis_rotated,
|
|
56000
|
+
tickShow
|
|
56001
|
+
);
|
|
56002
|
+
if (canReuseTickNodes) {
|
|
56003
|
+
tickTransform(tick, scale1);
|
|
56004
|
+
} else {
|
|
56005
|
+
tick = tick.data(ticks, scale1);
|
|
56006
|
+
const tickEnter = tick.enter().insert("g", ".domain").attr("class", "tick");
|
|
56007
|
+
const tickExit = tick.exit().remove();
|
|
56008
|
+
tick = tickEnter.merge(tick);
|
|
56009
|
+
tickShow.tick && tickEnter.append("line");
|
|
56010
|
+
tickShow.text && tickEnter.append("text");
|
|
56011
|
+
const hasTickChange = !tickEnter.empty() || !tickExit.empty();
|
|
56012
|
+
const reuseTickText = tickShow.text && !hasTickChange && ctx.canReuseTickTextOnResize(isLeftRight || params.config.axis_rotated);
|
|
56013
|
+
let sizeFor1Char = { w: 0, h: 0 };
|
|
56014
|
+
let textUpdate = tick.selectAll("text.__bb-empty");
|
|
56015
|
+
if (tickShow.text && !reuseTickText) {
|
|
56016
|
+
const tickText = tick.select("text");
|
|
56017
|
+
const counts = [];
|
|
56018
|
+
textUpdate = tickText;
|
|
56019
|
+
if (isFunction(evalTextSize)) {
|
|
56020
|
+
sizeFor1Char = evalTextSize.bind(ctx.params.owner.api)(
|
|
56021
|
+
tickText.node(),
|
|
56022
|
+
id
|
|
56023
|
+
);
|
|
56024
|
+
if (this.classList.contains($COMMON.dummy)) {
|
|
56025
|
+
this.sizeFor1Char = sizeFor1Char;
|
|
56026
|
+
}
|
|
56027
|
+
}
|
|
56028
|
+
if (!sizeFor1Char || sizeFor1Char.w === 0 || sizeFor1Char.h === 0) {
|
|
56029
|
+
sizeFor1Char = ctx.helper.getSizeFor1Char(
|
|
56030
|
+
orient,
|
|
56031
|
+
tickText,
|
|
56032
|
+
!!evalTextSize
|
|
56033
|
+
);
|
|
56034
|
+
}
|
|
56035
|
+
let tspan = tickText.selectAll("tspan").data((d, index) => {
|
|
56036
|
+
let split;
|
|
56037
|
+
if (params.tickMultiline) {
|
|
56038
|
+
split = splitTickText(
|
|
56039
|
+
d,
|
|
56040
|
+
scale1,
|
|
56041
|
+
ticks,
|
|
56042
|
+
isLeftRight,
|
|
56043
|
+
sizeFor1Char.w
|
|
56044
|
+
);
|
|
56045
|
+
} else {
|
|
56046
|
+
const formatted = helper.textFormatted(d);
|
|
56047
|
+
split = isArray(formatted) ? formatted.concat() : [formatted];
|
|
56048
|
+
}
|
|
56049
|
+
counts[index] = split.length;
|
|
56050
|
+
return split.map((splitted) => ({ index, splitted }));
|
|
56051
|
+
});
|
|
56052
|
+
tspan.exit().remove();
|
|
56053
|
+
tspan = tspan.enter().append("tspan").merge(tspan).text((d) => d.splitted);
|
|
56054
|
+
tspan.attr("x", isTopBottom ? 0 : tickLength * sign).attr("dx", (() => {
|
|
56055
|
+
let dx = 0;
|
|
56056
|
+
if (/(top|bottom)/.test(orient) && rotate) {
|
|
56057
|
+
dx = 8 * Math.sin(Math.PI * (rotate / 180)) * (orient === "top" ? -1 : 1);
|
|
56058
|
+
}
|
|
56059
|
+
return dx + (tickTextPos.x || 0);
|
|
56060
|
+
})()).attr("dy", (d, i) => {
|
|
56061
|
+
const defValue = ".71em";
|
|
56062
|
+
let dy = 0;
|
|
56063
|
+
if (orient !== "top") {
|
|
56064
|
+
dy = sizeFor1Char.h;
|
|
56065
|
+
if (i === 0) {
|
|
56066
|
+
dy = isLeftRight ? -((counts[d.index] - 1) * (sizeFor1Char.h / 2) - 3) : tickTextPos.y === 0 ? defValue : 0;
|
|
56067
|
+
}
|
|
56068
|
+
}
|
|
56069
|
+
return isNumber(dy) && tickTextPos.y ? dy + tickTextPos.y : dy || defValue;
|
|
56070
|
+
});
|
|
55947
56071
|
}
|
|
55948
|
-
|
|
55949
|
-
|
|
55950
|
-
|
|
55951
|
-
|
|
55952
|
-
|
|
55953
|
-
|
|
55954
|
-
|
|
55955
|
-
|
|
55956
|
-
dx = 8 * Math.sin(Math.PI * (rotate / 180)) * (orient === "top" ? -1 : 1);
|
|
56072
|
+
const lineUpdate = tick.select("line");
|
|
56073
|
+
tickEnter.select("line").attr(`${axisPx}2`, innerTickSize * sign);
|
|
56074
|
+
tickEnter.select("text").attr(axisPx, tickLength * sign);
|
|
56075
|
+
ctx.setTickLineTextPosition(lineUpdate, textUpdate, sizeFor1Char);
|
|
56076
|
+
if (params.tickTitle) {
|
|
56077
|
+
const title = textUpdate.select("title");
|
|
56078
|
+
const tickTitle = params.tickTitle;
|
|
56079
|
+
(title.empty() ? textUpdate.append("title") : title).text((index) => tickTitle[Number(index)]);
|
|
55957
56080
|
}
|
|
55958
|
-
|
|
55959
|
-
|
|
55960
|
-
|
|
55961
|
-
|
|
55962
|
-
|
|
55963
|
-
|
|
55964
|
-
|
|
55965
|
-
|
|
55966
|
-
|
|
56081
|
+
if (scale1.bandwidth) {
|
|
56082
|
+
const x = scale1;
|
|
56083
|
+
const dx = x.bandwidth() / 2;
|
|
56084
|
+
scale0 = (d) => x(d) + dx;
|
|
56085
|
+
scale1 = scale0;
|
|
56086
|
+
} else if (scale0.bandwidth) {
|
|
56087
|
+
scale0 = scale1;
|
|
56088
|
+
} else {
|
|
56089
|
+
tickTransform(tickExit, scale1);
|
|
55967
56090
|
}
|
|
55968
|
-
|
|
55969
|
-
|
|
55970
|
-
|
|
55971
|
-
const textUpdate = tick.select("text");
|
|
55972
|
-
tickEnter.select("line").attr(`${axisPx}2`, innerTickSize * sign);
|
|
55973
|
-
tickEnter.select("text").attr(axisPx, tickLength * sign);
|
|
55974
|
-
ctx.setTickLineTextPosition(lineUpdate, textUpdate, sizeFor1Char);
|
|
55975
|
-
if (params.tickTitle) {
|
|
55976
|
-
const title = textUpdate.select("title");
|
|
55977
|
-
(title.empty() ? textUpdate.append("title") : title).text((index) => params.tickTitle[index]);
|
|
55978
|
-
}
|
|
55979
|
-
if (scale1.bandwidth) {
|
|
55980
|
-
const x = scale1;
|
|
55981
|
-
const dx = x.bandwidth() / 2;
|
|
55982
|
-
scale0 = (d) => x(d) + dx;
|
|
55983
|
-
scale1 = scale0;
|
|
55984
|
-
} else if (scale0.bandwidth) {
|
|
55985
|
-
scale0 = scale1;
|
|
55986
|
-
} else {
|
|
55987
|
-
tickTransform(tickExit, scale1);
|
|
56091
|
+
tick = params.owner.state.flowing ? helper.transitionise(tick) : params.owner.$T(tick);
|
|
56092
|
+
tickTransform(tickEnter, scale0);
|
|
56093
|
+
tickTransform(tick.style("opacity", null), scale1);
|
|
55988
56094
|
}
|
|
55989
|
-
tick = params.owner.state.flowing ? helper.transitionise(tick) : params.owner.$T(tick);
|
|
55990
|
-
tickTransform(tickEnter, scale0);
|
|
55991
|
-
tickTransform(tick.style("opacity", null), scale1);
|
|
55992
56095
|
}
|
|
55993
56096
|
});
|
|
55994
56097
|
this.g = $g;
|
|
@@ -56071,7 +56174,7 @@ class AxisRenderer {
|
|
|
56071
56174
|
switch (orient) {
|
|
56072
56175
|
case "bottom":
|
|
56073
56176
|
lineUpdate.attr("x1", tickPos.x).attr("x2", tickPos.x).attr("y2", (d) => this.getTickSize.bind(this)(d) * (tickLineInner ? -1 : 1));
|
|
56074
|
-
textUpdate.attr("x", 0).attr("y", yForText(rotate)).style("text-anchor",
|
|
56177
|
+
textUpdate.attr("x", 0).attr("y", yForText(rotate)).style("text-anchor", (d, i, { length }) => {
|
|
56075
56178
|
if (!isRotated && i === 0 && (inner === true || inner.first)) {
|
|
56076
56179
|
return "start";
|
|
56077
56180
|
} else if (!isRotated && i === length - 1 && (inner === true || inner.last)) {
|
|
@@ -57567,7 +57670,7 @@ var eventrect_pow = Math.pow;
|
|
|
57567
57670
|
const isRotated = config.axis_rotated;
|
|
57568
57671
|
const isMultipleX = $$.isMultipleX();
|
|
57569
57672
|
const xDomain = xScale == null ? void 0 : xScale.domain();
|
|
57570
|
-
const fingerprint = xDomain ? `${xDomain[0]}_${xDomain[1]}_${state.width}_${state.height}_${$$.data.targets.length}_${[...state.hiddenTargetIds].join(",")}` : null;
|
|
57673
|
+
const fingerprint = xDomain ? `${xDomain[0]}_${xDomain[1]}_${state.width}_${state.height}_${$$.data.targets.length}_${state.dataGeneration}_${[...state.hiddenTargetIds].join(",")}` : null;
|
|
57571
57674
|
if (fingerprint && fingerprint === state._eventRectFingerprint) {
|
|
57572
57675
|
return;
|
|
57573
57676
|
}
|
|
@@ -59372,18 +59475,6 @@ var eventrect_pow = Math.pow;
|
|
|
59372
59475
|
|
|
59373
59476
|
;// ./src/config/Options/axis/y2.ts
|
|
59374
59477
|
/* harmony default export */ var y2 = ({
|
|
59375
|
-
/**
|
|
59376
|
-
* Set clip-path attribute for y2 axis element
|
|
59377
|
-
* - **NOTE**: `clip-path` attribute for y2 Axis is set only when `axis.y2.inner` option is true.
|
|
59378
|
-
* @name axis․y2․clipPath
|
|
59379
|
-
* @memberof Options
|
|
59380
|
-
* @type {boolean}
|
|
59381
|
-
* @default true
|
|
59382
|
-
* @example
|
|
59383
|
-
* // don't set 'clip-path' attribute
|
|
59384
|
-
* clipPath: false
|
|
59385
|
-
*/
|
|
59386
|
-
axis_y2_clipPath: true,
|
|
59387
59478
|
/**
|
|
59388
59479
|
* Show or hide y2 axis.
|
|
59389
59480
|
* - **NOTE**:
|
|
@@ -64940,7 +65031,7 @@ const bb = {
|
|
|
64940
65031
|
* bb.version; // "1.0.0"
|
|
64941
65032
|
* @memberof bb
|
|
64942
65033
|
*/
|
|
64943
|
-
version: "4.0.0
|
|
65034
|
+
version: "4.0.0",
|
|
64944
65035
|
/**
|
|
64945
65036
|
* Generate chart
|
|
64946
65037
|
* - **NOTE:** Bear in mind for the possibility of ***throwing an error***, during the generation when:
|