@primeui/chart-core 0.0.1-alpha.1 → 1.0.0-beta.1
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/animations/index.d.mts +1 -1
- package/dist/animations/index.mjs +19 -18
- package/dist/{annotation.utils-Bm0lOO1o.d.mts → annotation.utils-D-7ijAWO.d.mts} +22 -1
- package/dist/cartesian/index.d.mts +3 -2
- package/dist/cartesian/index.mjs +96 -93
- package/dist/{chunk-WPFUV7K3.mjs → chunks/chunk-2LLTN7T4.mjs} +23 -14
- package/dist/{chunk-RO4N6YFS.mjs → chunks/chunk-2T226WJI.mjs} +31 -14
- package/dist/{chunk-A6ZQZFL2.mjs → chunks/chunk-3CUSPV47.mjs} +12 -9
- package/dist/{chunk-3FFJEX4A.mjs → chunks/chunk-3QQLETCJ.mjs} +13 -12
- package/dist/{chunk-JWFBOPM6.mjs → chunks/chunk-4N2XIMAB.mjs} +2 -2
- package/dist/{chunk-LVMDQ4OJ.mjs → chunks/chunk-4S3FOFCN.mjs} +2 -2
- package/dist/{chunk-XTVE4P3L.mjs → chunks/chunk-56MASQS2.mjs} +6 -2
- package/dist/{chunk-DTWTCFRG.mjs → chunks/chunk-5EQSFUBA.mjs} +41 -13
- package/dist/{chunk-KQIFO5I3.mjs → chunks/chunk-5QSTMSPW.mjs} +15 -10
- package/dist/{chunk-NKUYIWAP.mjs → chunks/chunk-6LUIVTNV.mjs} +6 -6
- package/dist/chunks/chunk-6MAO6I3E.mjs +6 -0
- package/dist/{chunk-WFVOQ2QZ.mjs → chunks/chunk-77K3DEKL.mjs} +2 -2
- package/dist/{chunk-4C6EVJ54.mjs → chunks/chunk-7I2SAKHL.mjs} +7 -44
- package/dist/{chunk-6HSEJLSR.mjs → chunks/chunk-7I2SNJ2X.mjs} +35 -18
- package/dist/{chunk-66T4MRC5.mjs → chunks/chunk-7IKKWWRT.mjs} +4 -6
- package/dist/{chunk-BKP26M4K.mjs → chunks/chunk-7LZWQVTL.mjs} +43 -24
- package/dist/{chunk-NHRK5KU2.mjs → chunks/chunk-A5YBHYIS.mjs} +25 -17
- package/dist/{chunk-ZT2Z7ERM.mjs → chunks/chunk-AC5EAWIP.mjs} +12 -9
- package/dist/{chunk-ZTL2FQEW.mjs → chunks/chunk-AETETRB4.mjs} +24 -9
- package/dist/{chunk-NPDZLYIF.mjs → chunks/chunk-AJ24XDEK.mjs} +2 -2
- package/dist/chunks/chunk-ARVMVGWS.mjs +40 -0
- package/dist/{chunk-3IYSJ2U7.mjs → chunks/chunk-AYEAEAOV.mjs} +10 -7
- package/dist/{chunk-M7B3JF43.mjs → chunks/chunk-AZPJMIZE.mjs} +4 -3
- package/dist/{chunk-O2X6FF45.mjs → chunks/chunk-BDCNBS6W.mjs} +194 -168
- package/dist/{chunk-55Y3WI6S.mjs → chunks/chunk-BR4PSSPU.mjs} +6 -6
- package/dist/{chunk-DN6AXQYZ.mjs → chunks/chunk-BYAAMQBN.mjs} +46 -41
- package/dist/{chunk-TA4MVAEX.mjs → chunks/chunk-CFA2SUBF.mjs} +32 -24
- package/dist/{chunk-WH3C3Y7P.mjs → chunks/chunk-CKQ4DNNJ.mjs} +7 -18
- package/dist/chunks/chunk-DIJFKY6H.mjs +21 -0
- package/dist/{chunk-AUF4CHDP.mjs → chunks/chunk-DJOHDKTP.mjs} +18 -11
- package/dist/{chunk-3Z62EUJN.mjs → chunks/chunk-DKWZKYHF.mjs} +5 -5
- package/dist/{chunk-PLSDU3C2.mjs → chunks/chunk-DOC4YOCD.mjs} +63 -37
- package/dist/{chunk-Y3L3D4GQ.mjs → chunks/chunk-DORUY7GR.mjs} +69 -34
- package/dist/chunks/chunk-DWBJKYLH.mjs +238 -0
- package/dist/{chunk-XQQCGFYB.mjs → chunks/chunk-EQLCJTM4.mjs} +1 -1
- package/dist/{chunk-VGLSBZDN.mjs → chunks/chunk-F2E2QCZM.mjs} +1 -1
- package/dist/{chunk-BZN2QHGP.mjs → chunks/chunk-F6AGZQDA.mjs} +4 -72
- package/dist/{chunk-ILUWFYGY.mjs → chunks/chunk-FNMLVZOA.mjs} +8 -8
- package/dist/{chunk-SXHVDJGF.mjs → chunks/chunk-FQAFGPW6.mjs} +6 -6
- package/dist/{chunk-N3TIT3OH.mjs → chunks/chunk-FSPE3M5E.mjs} +66 -43
- package/dist/{chunk-KNDZP446.mjs → chunks/chunk-FSWYYRPX.mjs} +5 -5
- package/dist/{chunk-KP2TWD4Z.mjs → chunks/chunk-FWNWV3H7.mjs} +1 -1
- package/dist/chunks/chunk-G3DIMENH.mjs +63 -0
- package/dist/{chunk-QQBXUDM4.mjs → chunks/chunk-G3DYNMWT.mjs} +20 -16
- package/dist/{chunk-J65DBT4R.mjs → chunks/chunk-GA6YZQYT.mjs} +3 -3
- package/dist/chunks/chunk-GAQLLQUM.mjs +20 -0
- package/dist/{chunk-TAHCOZHF.mjs → chunks/chunk-GN7VQCCH.mjs} +27 -30
- package/dist/{chunk-R6Y3R7EW.mjs → chunks/chunk-GOOBVFFH.mjs} +1 -1
- package/dist/chunks/chunk-GSW5OBEG.mjs +233 -0
- package/dist/{chunk-22ST6YPP.mjs → chunks/chunk-GTX6MLTG.mjs} +9 -9
- package/dist/{chunk-XUAASRXW.mjs → chunks/chunk-GWHRTGGC.mjs} +35 -27
- package/dist/{chunk-TQ6S34QZ.mjs → chunks/chunk-GXCLRRE5.mjs} +6 -6
- package/dist/{chunk-DP2IZNN3.mjs → chunks/chunk-HHBFQ6AI.mjs} +4 -3
- package/dist/{chunk-3OZLP4I4.mjs → chunks/chunk-HWT6UEYE.mjs} +14 -10
- package/dist/{chunk-X7T34OLW.mjs → chunks/chunk-I25SSZE3.mjs} +3 -3
- package/dist/{chunk-OGJ6IIBW.mjs → chunks/chunk-IFJPDARC.mjs} +21 -9
- package/dist/{chunk-CINXJIRR.mjs → chunks/chunk-ISU27QL2.mjs} +66 -6
- package/dist/{chunk-OXTFAWSK.mjs → chunks/chunk-J2WHJ73Y.mjs} +7 -2
- package/dist/{chunk-VN7CKCSE.mjs → chunks/chunk-JS47MSB2.mjs} +9 -1
- package/dist/{chunk-WYLILAOO.mjs → chunks/chunk-K44SD67H.mjs} +16 -7
- package/dist/{chunk-RQ3CKQOX.mjs → chunks/chunk-K7AGQTVK.mjs} +63 -3
- package/dist/{chunk-VVI3OBPJ.mjs → chunks/chunk-KCSMOAZO.mjs} +7 -9
- package/dist/{chunk-ARRGOEFX.mjs → chunks/chunk-L6GXEQOO.mjs} +7 -7
- package/dist/{chunk-7QQ6ETB4.mjs → chunks/chunk-LBNP5PJA.mjs} +14 -12
- package/dist/{chunk-AHYIS6EB.mjs → chunks/chunk-LC2ZEZWP.mjs} +7 -7
- package/dist/{chunk-WCG35U6M.mjs → chunks/chunk-LJ6BXF3H.mjs} +31 -23
- package/dist/{chunk-3WEMHXZI.mjs → chunks/chunk-LTQH3LQJ.mjs} +2 -8
- package/dist/{chunk-QWQ6HY4I.mjs → chunks/chunk-O4BTKF5R.mjs} +9 -8
- package/dist/{chunk-WY4AURRE.mjs → chunks/chunk-P2Q4DYOS.mjs} +240 -83
- package/dist/{chunk-KVDEROP6.mjs → chunks/chunk-P563L7WL.mjs} +1 -1
- package/dist/{chunk-SDBPQ5CF.mjs → chunks/chunk-PJLFNUOW.mjs} +45 -30
- package/dist/{chunk-MTGMXRNF.mjs → chunks/chunk-PSDRVQSK.mjs} +7 -7
- package/dist/{chunk-6STOLMCA.mjs → chunks/chunk-QCBESCLG.mjs} +13 -12
- package/dist/{chunk-PRDVPOZX.mjs → chunks/chunk-QIYJUZ7I.mjs} +7 -2
- package/dist/{chunk-UPRXABX5.mjs → chunks/chunk-RH3OQ2VX.mjs} +6 -6
- package/dist/{chunk-QS76E3TD.mjs → chunks/chunk-RI32WIDX.mjs} +2 -2
- package/dist/{chunk-OWW3K55O.mjs → chunks/chunk-RIAPS5AW.mjs} +49 -7
- package/dist/{chunk-ERVQB2VZ.mjs → chunks/chunk-RJ3ZOZTS.mjs} +4 -4
- package/dist/{chunk-WFTX4AQJ.mjs → chunks/chunk-RKNL7UWZ.mjs} +19 -7
- package/dist/chunks/chunk-RLS3GMJ6.mjs +8 -0
- package/dist/{chunk-WRULPWHD.mjs → chunks/chunk-RVTEIKW5.mjs} +5 -5
- package/dist/{chunk-FHTC2YDB.mjs → chunks/chunk-SVASYTK5.mjs} +70 -5
- package/dist/{chunk-ARB5T6MP.mjs → chunks/chunk-SWVOBJLG.mjs} +3 -100
- package/dist/{chunk-OHGCZZPZ.mjs → chunks/chunk-SY7LVXIW.mjs} +53 -27
- package/dist/{chunk-JGOVWSKH.mjs → chunks/chunk-TW3KLJVO.mjs} +37 -12
- package/dist/{chunk-RBLZRT5K.mjs → chunks/chunk-UF2TPGQB.mjs} +103 -15
- package/dist/{chunk-X4D7FKUS.mjs → chunks/chunk-UZWWYKL7.mjs} +2 -2
- package/dist/{chunk-LKC7MZKK.mjs → chunks/chunk-XECVYJE2.mjs} +16 -8
- package/dist/chunks/chunk-XMSAUIVL.mjs +1 -0
- package/dist/{chunk-J4RI2C2G.mjs → chunks/chunk-XPZTRMU2.mjs} +6 -6
- package/dist/{chunk-BABQKA6K.mjs → chunks/chunk-XXJRGDKE.mjs} +3 -3
- package/dist/{chunk-SALTGZFR.mjs → chunks/chunk-YVDVKLPR.mjs} +10 -9
- package/dist/circular/arc/index.mjs +3 -3
- package/dist/circular/index.d.mts +1 -1
- package/dist/circular/index.mjs +14 -13
- package/dist/controllers/index.mjs +113 -110
- package/dist/{datalabel.utils-CkjGeB8S.d.mts → datalabel.utils-CNRKHy7j.d.mts} +10 -1
- package/dist/{decimation.utils-CcvJVhI4.d.mts → decimation.utils-C0xpslz_.d.mts} +33 -2
- package/dist/geometry-BVWJedvw.d.mts +53 -0
- package/dist/index.d.mts +16 -17
- package/dist/index.mjs +113 -110
- package/dist/luminance-TvUgaQ91.d.mts +57 -0
- package/dist/orchestrator/index.d.mts +2 -2
- package/dist/orchestrator/index.mjs +36 -33
- package/dist/plugins/index.mjs +1 -1
- package/dist/{property-animations-D433wXzz.d.mts → property-animations-CI0zyp6V.d.mts} +6 -20
- package/dist/radial/index.mjs +40 -37
- package/dist/renderers/axis/index.mjs +9 -8
- package/dist/renderers/index.d.mts +8 -9
- package/dist/renderers/index.mjs +78 -75
- package/dist/renderers/navigator/index.d.mts +1 -1
- package/dist/renderers/navigator/index.mjs +10 -8
- package/dist/{ring.utils-DXvrxMkU.d.mts → ring.utils-aHt9Nqum.d.mts} +2 -7
- package/dist/{scale-KFv30jqZ.d.mts → scale-CFkPlyUe.d.mts} +2 -2
- package/dist/{scales-Drf8AIhL.d.mts → scales-BZzjlR4U.d.mts} +15 -1
- package/dist/series/bar/canvas/index.mjs +11 -10
- package/dist/series/bar/controller/index.d.mts +17 -0
- package/dist/series/bar/controller/index.mjs +47 -44
- package/dist/series/bar/controller-canvas/index.mjs +47 -44
- package/dist/series/bar/controller-svg/index.mjs +47 -44
- package/dist/series/bar/index.d.mts +2 -2
- package/dist/series/bar/index.mjs +16 -13
- package/dist/series/bar/svg/index.mjs +14 -11
- package/dist/series/candlestick/canvas/index.mjs +8 -8
- package/dist/series/candlestick/controller/index.d.mts +2 -0
- package/dist/series/candlestick/controller/index.mjs +43 -40
- package/dist/series/candlestick/controller-canvas/index.mjs +43 -40
- package/dist/series/candlestick/controller-svg/index.mjs +43 -40
- package/dist/series/candlestick/index.mjs +11 -10
- package/dist/series/candlestick/svg/index.mjs +8 -8
- package/dist/series/heatmap/canvas/index.mjs +9 -9
- package/dist/series/heatmap/controller/index.d.mts +9 -0
- package/dist/series/heatmap/controller/index.mjs +26 -23
- package/dist/series/heatmap/controller-canvas/index.mjs +26 -23
- package/dist/series/heatmap/controller-svg/index.mjs +26 -23
- package/dist/series/heatmap/index.mjs +14 -13
- package/dist/series/heatmap/svg/index.mjs +11 -10
- package/dist/series/line/canvas/index.mjs +9 -9
- package/dist/series/line/controller/index.d.mts +7 -0
- package/dist/series/line/controller/index.mjs +51 -47
- package/dist/series/line/controller-canvas/index.mjs +53 -49
- package/dist/series/line/controller-svg/index.mjs +53 -49
- package/dist/series/line/index.d.mts +1 -1
- package/dist/series/line/index.mjs +17 -13
- package/dist/series/line/svg/index.mjs +12 -9
- package/dist/series/pie/canvas/index.d.mts +12 -4
- package/dist/series/pie/canvas/index.mjs +15 -10
- package/dist/series/pie/controller/index.mjs +113 -110
- package/dist/series/pie/controller-canvas/index.mjs +113 -110
- package/dist/series/pie/controller-svg/index.mjs +113 -110
- package/dist/series/pie/index.d.mts +3 -56
- package/dist/series/pie/index.mjs +11 -15
- package/dist/series/pie/svg/index.d.mts +18 -4
- package/dist/series/pie/svg/index.mjs +10 -11
- package/dist/series/polar/canvas/index.mjs +7 -7
- package/dist/series/polar/controller/index.d.mts +9 -0
- package/dist/series/polar/controller/index.mjs +49 -46
- package/dist/series/polar/controller-canvas/index.mjs +50 -47
- package/dist/series/polar/controller-svg/index.mjs +50 -47
- package/dist/series/polar/index.mjs +19 -16
- package/dist/series/polar/svg/index.mjs +11 -8
- package/dist/series/radar/canvas/index.mjs +8 -8
- package/dist/series/radar/controller/index.d.mts +11 -0
- package/dist/series/radar/controller/index.mjs +46 -43
- package/dist/series/radar/controller-canvas/index.mjs +49 -46
- package/dist/series/radar/controller-svg/index.mjs +49 -46
- package/dist/series/radar/index.d.mts +2 -2
- package/dist/series/radar/index.mjs +16 -13
- package/dist/series/radar/svg/index.mjs +12 -9
- package/dist/series/scatter/canvas/index.mjs +13 -11
- package/dist/series/scatter/controller/index.mjs +48 -44
- package/dist/series/scatter/controller-canvas/index.mjs +50 -46
- package/dist/series/scatter/controller-svg/index.mjs +50 -46
- package/dist/series/scatter/index.d.mts +1 -1
- package/dist/series/scatter/index.mjs +18 -14
- package/dist/series/scatter/svg/index.mjs +16 -12
- package/dist/series/treemap/canvas/index.mjs +10 -10
- package/dist/series/treemap/controller/index.mjs +23 -20
- package/dist/series/treemap/controller-canvas/index.mjs +23 -20
- package/dist/series/treemap/controller-svg/index.mjs +23 -20
- package/dist/series/treemap/index.d.mts +17 -9
- package/dist/series/treemap/index.mjs +12 -12
- package/dist/series/treemap/svg/index.mjs +9 -9
- package/dist/{stacking-CChuAcLN.d.mts → stacking-Dz1OBhzm.d.mts} +1 -1
- package/dist/sync/index.mjs +6 -5
- package/dist/{tooltip.renderer-D5wpSlBa.d.mts → tooltip.renderer-DZfza6xV.d.mts} +3 -3
- package/dist/utils/color/index.d.mts +11 -53
- package/dist/utils/color/index.mjs +4 -4
- package/dist/utils/data/index.d.mts +2 -2
- package/dist/utils/data/index.mjs +7 -7
- package/dist/utils/export/index.mjs +6 -6
- package/dist/utils/index.d.mts +7 -7
- package/dist/utils/index.mjs +32 -29
- package/dist/utils/interaction/index.d.mts +1 -31
- package/dist/utils/interaction/index.mjs +12 -9
- package/dist/utils/layout/index.mjs +10 -10
- package/dist/utils/math/index.d.mts +1 -1
- package/dist/utils/math/index.mjs +1 -1
- package/dist/utils/render/index.mjs +3 -3
- package/dist/utils/specialized/index.d.mts +1 -1
- package/dist/utils/specialized/index.mjs +13 -15
- package/dist/utils/text/index.d.mts +1 -1
- package/dist/utils/text/index.mjs +9 -8
- package/dist/utils/theme/index.d.mts +6 -6
- package/dist/utils/theme/index.mjs +5 -5
- package/dist/utils/zoom/index.mjs +3 -3
- package/package.json +3 -3
- package/dist/canvas-D4vigq47.d.mts +0 -34
- package/dist/chunk-2QRS4YQ5.mjs +0 -18
- package/dist/chunk-53HW45JB.mjs +0 -102
- package/dist/chunk-B4FTADAZ.mjs +0 -561
- package/dist/chunk-IXOWSEHO.mjs +0 -114
- package/dist/chunk-VWF57TS3.mjs +0 -62
- package/dist/chunk-XIHBK5D3.mjs +0 -68
- package/dist/renderers/circular/index.d.mts +0 -13
- package/dist/renderers/circular/index.mjs +0 -13
- package/dist/{chunk-WA3OVISZ.mjs → chunks/chunk-4KQZXAHZ.mjs} +0 -0
- package/dist/{chunk-CHW4RKY3.mjs → chunks/chunk-576P5DBH.mjs} +0 -0
- package/dist/{chunk-EDAKJLNA.mjs → chunks/chunk-5WFF272M.mjs} +0 -0
- package/dist/{chunk-ADKLH73T.mjs → chunks/chunk-6XZ6U7GL.mjs} +0 -0
- package/dist/{chunk-2QK2KOBN.mjs → chunks/chunk-AOTUNMVD.mjs} +0 -0
- package/dist/{chunk-AGU3NG6D.mjs → chunks/chunk-AWMO5TS3.mjs} +0 -0
- package/dist/{chunk-SSLTFJ3U.mjs → chunks/chunk-BF7RP4A3.mjs} +132 -132
- /package/dist/{chunk-BETFQBM2.mjs → chunks/chunk-FML3QEEI.mjs} +0 -0
- /package/dist/{chunk-FFMT6OCO.mjs → chunks/chunk-FRVJH7ZG.mjs} +0 -0
- /package/dist/{chunk-HDFGCN2F.mjs → chunks/chunk-HBTCRORW.mjs} +0 -0
- /package/dist/{chunk-7CMVDIOU.mjs → chunks/chunk-HXDLOOCS.mjs} +0 -0
- /package/dist/{chunk-5JCI2DEB.mjs → chunks/chunk-JQVX6XFW.mjs} +0 -0
- /package/dist/{chunk-C36VWQ7A.mjs → chunks/chunk-KMKULH54.mjs} +0 -0
- /package/dist/{chunk-Q6PPVIHU.mjs → chunks/chunk-MT3OLVZC.mjs} +0 -0
- /package/dist/{chunk-WS64BZXT.mjs → chunks/chunk-OWVSSQZ4.mjs} +0 -0
- /package/dist/{chunk-EAMUNLRU.mjs → chunks/chunk-P2LG7GDM.mjs} +0 -0
- /package/dist/{chunk-IEGLX7VL.mjs → chunks/chunk-PXUXZADY.mjs} +0 -0
- /package/dist/{chunk-SANZPAJ4.mjs → chunks/chunk-SFUDXJKO.mjs} +0 -0
- /package/dist/{chunk-ZQFK6CAE.mjs → chunks/chunk-SJNUJM54.mjs} +0 -0
- /package/dist/{chunk-AP3UYWYT.mjs → chunks/chunk-SPU6BO3B.mjs} +0 -0
- /package/dist/{chunk-YBJ56XJS.mjs → chunks/chunk-T2UAEMHY.mjs} +0 -0
- /package/dist/{chunk-JO7VACY2.mjs → chunks/chunk-VADXCPQ4.mjs} +0 -0
- /package/dist/{chunk-FRST55HY.mjs → chunks/chunk-ZZCVDIU5.mjs} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { clampArcBorderRadius, hasArcBorderRadius } from './chunk-
|
|
2
|
-
import { toRad, normalizeAngleRelativeTo, xCalc, yCalc } from './chunk-
|
|
1
|
+
import { clampArcBorderRadius, hasArcBorderRadius } from './chunk-F2E2QCZM.mjs';
|
|
2
|
+
import { toRad, normalizeAngleRelativeTo, xCalc, yCalc } from './chunk-K7AGQTVK.mjs';
|
|
3
3
|
|
|
4
4
|
// src/circular/arc/shared.ts
|
|
5
5
|
var CLIP_PIXEL_MARGIN = 1;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createSvgText } from './chunk-
|
|
1
|
+
import { createSvgText } from './chunk-BF7RP4A3.mjs';
|
|
2
2
|
|
|
3
3
|
// src/utils/text/text.utils.ts
|
|
4
4
|
var CHAR_WIDTH_RATIO = 0.65;
|
|
@@ -205,10 +205,14 @@ function formatCompactValue(v, locale) {
|
|
|
205
205
|
if (Number.isInteger(v)) return String(v);
|
|
206
206
|
return v.toFixed(1);
|
|
207
207
|
}
|
|
208
|
+
function formatTooltipValue(v, locale) {
|
|
209
|
+
if (!Number.isFinite(v)) return String(v);
|
|
210
|
+
return v.toLocaleString(locale, { maximumFractionDigits: 2 });
|
|
211
|
+
}
|
|
208
212
|
function svgAnchorToCanvasAlign(anchor) {
|
|
209
213
|
if (anchor === "middle") return "center";
|
|
210
214
|
if (anchor === "end") return "right";
|
|
211
215
|
return "left";
|
|
212
216
|
}
|
|
213
217
|
|
|
214
|
-
export { CHAR_WIDTH_RATIO, calculateWrappedTextHeight, calculateWrappedTextWidth, cleanupMeasureContext, clearTextWidthCache, createSvgTitle, formatCompactValue, getTitleAnchor, getTitleX, getTitleY, measureFontMetrics, measureText, measureTextWidth, renderCanvasTitle, setTextMeasurer, svgAnchorToCanvasAlign, wrapText };
|
|
218
|
+
export { CHAR_WIDTH_RATIO, calculateWrappedTextHeight, calculateWrappedTextWidth, cleanupMeasureContext, clearTextWidthCache, createSvgTitle, formatCompactValue, formatTooltipValue, getTitleAnchor, getTitleX, getTitleY, measureFontMetrics, measureText, measureTextWidth, renderCanvasTitle, setTextMeasurer, svgAnchorToCanvasAlign, wrapText };
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { batchResolveAccessor, resolveAccessor, makeItemContext } from './chunk-
|
|
1
|
+
import { bandCenter } from './chunk-RLS3GMJ6.mjs';
|
|
2
|
+
import { resolveBoostActive } from './chunk-QIYJUZ7I.mjs';
|
|
3
|
+
import { SCATTER_BOOST_AUTO_THRESHOLD, DEFAULT_MIN_BUBBLE_SIZE, DEFAULT_MAX_BUBBLE_SIZE, DEFAULT_SCATTER_MARKER_SIZE, DEFAULT_SCATTER_HIT_RADIUS, SCATTER_SPATIAL_INDEX_THRESHOLD } from './chunk-6LUIVTNV.mjs';
|
|
4
|
+
import { batchResolveAccessor, resolveAccessor, makeItemContext } from './chunk-BDCNBS6W.mjs';
|
|
5
|
+
import { buildQuadtree } from './chunk-KMKULH54.mjs';
|
|
6
|
+
import { resolveCartesianAccessors } from './chunk-G3DIMENH.mjs';
|
|
5
7
|
|
|
6
8
|
// src/series/scatter/geometry.ts
|
|
7
9
|
function isBoostActive(props, visibleCount) {
|
|
@@ -9,15 +11,21 @@ function isBoostActive(props, visibleCount) {
|
|
|
9
11
|
}
|
|
10
12
|
function calculateScatterLayout(props, chartArea, config) {
|
|
11
13
|
const { data = [] } = props;
|
|
12
|
-
const { xScale, yScale, stackBases } = config ?? { xScale: void 0, yScale: void 0, stackBases: void 0 };
|
|
14
|
+
const { xScale, yScale, stackBases, orientation } = config ?? { xScale: void 0, yScale: void 0, stackBases: void 0, orientation: "vertical" };
|
|
15
|
+
const horizontal = orientation === "horizontal";
|
|
13
16
|
const markerSizeAccessor = props.markerSize;
|
|
14
17
|
const minSize = props.minSize ?? DEFAULT_MIN_BUBBLE_SIZE;
|
|
15
18
|
const maxSize = props.maxSize ?? DEFAULT_MAX_BUBBLE_SIZE;
|
|
16
19
|
const seriesIdx = props.order ?? 0;
|
|
17
20
|
const seriesExtras = { seriesIndex: seriesIdx, seriesId: props.id ?? "" };
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
+
const acc = resolveCartesianAccessors(props);
|
|
22
|
+
const isCategoryX = acc.independentIsCategory;
|
|
23
|
+
const yValues = batchResolveAccessor(acc.measureField, data);
|
|
24
|
+
const categoriesRaw = isCategoryX ? batchResolveAccessor(acc.independentField, data) : void 0;
|
|
25
|
+
const xValues = isCategoryX ? void 0 : batchResolveAccessor(acc.independentField, data);
|
|
26
|
+
const bandScale = isCategoryX ? xScale : void 0;
|
|
27
|
+
const firstCategory = isCategoryX ? categoriesRaw != null && categoriesRaw[0] != null ? String(categoriesRaw[0]) : "" : String(xValues?.[0]);
|
|
28
|
+
const seriesColor = props.color != null && data.length > 0 ? resolveAccessor(props.color, makeItemContext(data[0], 0, { value: yValues[0], category: firstCategory, ...seriesExtras })) : void 0;
|
|
21
29
|
let sizeValues;
|
|
22
30
|
let sizeMin = Infinity;
|
|
23
31
|
let sizeMax = -Infinity;
|
|
@@ -38,15 +46,34 @@ function calculateScatterLayout(props, chartArea, config) {
|
|
|
38
46
|
const colorAccessor = props.color;
|
|
39
47
|
const rotationAccessor = props.pointRotation;
|
|
40
48
|
const points = data.map((item, i) => {
|
|
41
|
-
const rawX = xValues[i];
|
|
42
49
|
const rawY = yValues[i];
|
|
43
|
-
const xVal = (rawX == null || isNaN(rawX)) && treatNullAsZero ? 0 : rawX;
|
|
44
50
|
const yVal = (rawY == null || isNaN(rawY)) && treatNullAsZero ? 0 : rawY;
|
|
45
51
|
const visible = props.visibility ? props.visibility.get(i) !== false : true;
|
|
46
52
|
const stackBase = stackBases?.[i] ?? 0;
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
53
|
+
const valuePos = yScale(yVal == null || typeof yVal === "number" && isNaN(yVal) ? yVal : stackBase + yVal);
|
|
54
|
+
let px;
|
|
55
|
+
let py;
|
|
56
|
+
let xVal;
|
|
57
|
+
let categoryLabel;
|
|
58
|
+
if (isCategoryX) {
|
|
59
|
+
const cat = categoriesRaw[i];
|
|
60
|
+
categoryLabel = cat == null ? void 0 : String(cat);
|
|
61
|
+
const bandPos = categoryLabel != null ? bandCenter(bandScale, categoryLabel) : NaN;
|
|
62
|
+
if (horizontal) {
|
|
63
|
+
px = valuePos;
|
|
64
|
+
py = bandPos;
|
|
65
|
+
} else {
|
|
66
|
+
px = bandPos;
|
|
67
|
+
py = valuePos;
|
|
68
|
+
}
|
|
69
|
+
xVal = i;
|
|
70
|
+
} else {
|
|
71
|
+
const rawX = xValues[i];
|
|
72
|
+
xVal = (rawX == null || isNaN(rawX)) && treatNullAsZero ? 0 : rawX;
|
|
73
|
+
px = xScale(xVal);
|
|
74
|
+
py = valuePos;
|
|
75
|
+
}
|
|
76
|
+
const ctx = makeItemContext(item, i, { value: yVal, category: categoryLabel ?? String(xVal), ...seriesExtras });
|
|
50
77
|
let radius = resolveAccessor(markerSizeAccessor, ctx, { arrayMode: "clip", fallback: DEFAULT_SCATTER_MARKER_SIZE }) ?? DEFAULT_SCATTER_MARKER_SIZE;
|
|
51
78
|
if (sizeValues) {
|
|
52
79
|
const sizeVal = sizeValues[i];
|
|
@@ -67,6 +94,7 @@ function calculateScatterLayout(props, chartArea, config) {
|
|
|
67
94
|
py,
|
|
68
95
|
xValue: xVal,
|
|
69
96
|
yValue: yVal,
|
|
97
|
+
...categoryLabel != null ? { category: categoryLabel } : {},
|
|
70
98
|
radius,
|
|
71
99
|
rotation,
|
|
72
100
|
...sizeValues ? { sizeValue: sizeValues[i] } : {},
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { createCanvasLinePathBuilder, traceCurve, reversedBaseEdge } from './chunk-
|
|
2
|
-
import { resolveBoostActive, MARKER_SHAPE_NAMES, traceMarkerShapeCanvasAt, drawMarkerCanvas } from './chunk-
|
|
3
|
-
import { computeItemHoverState, applyHoverEffects } from './chunk-
|
|
4
|
-
import { DEFAULT_LINE_WIDTH, DEFAULT_LINE_MARKER_SIZE, DEFAULT_AREA_FILL_OPACITY, DEFAULT_HOVER_DIM_OPACITY, LINE_BOOST_AUTO_THRESHOLD, DEFAULT_HOVER_POINT_RADIUS_MULTIPLIER } from './chunk-
|
|
5
|
-
import { makeItemContext, resolveDash, resolveAccessor, getDefaultColor, isGradientColor, createCanvasGradientFromColor, getPrimaryColor } from './chunk-
|
|
6
|
-
import { withCanvasState } from './chunk-
|
|
1
|
+
import { createCanvasLinePathBuilder, traceCurve, reversedBaseEdge } from './chunk-HBTCRORW.mjs';
|
|
2
|
+
import { resolveBoostActive, MARKER_SHAPE_NAMES, traceMarkerShapeCanvasAt, drawMarkerCanvas } from './chunk-QIYJUZ7I.mjs';
|
|
3
|
+
import { computeItemHoverState, applyHoverEffects } from './chunk-F6AGZQDA.mjs';
|
|
4
|
+
import { DEFAULT_LINE_WIDTH, DEFAULT_LINE_MARKER_SIZE, DEFAULT_AREA_FILL_OPACITY, DEFAULT_HOVER_DIM_OPACITY, LINE_BOOST_AUTO_THRESHOLD, DEFAULT_HOVER_POINT_RADIUS_MULTIPLIER } from './chunk-6LUIVTNV.mjs';
|
|
5
|
+
import { makeItemContext, resolveDash, resolveAccessor, getDefaultColor, isGradientColor, createCanvasGradientFromColor, getPrimaryColor } from './chunk-BDCNBS6W.mjs';
|
|
6
|
+
import { withCanvasState } from './chunk-BF7RP4A3.mjs';
|
|
7
7
|
|
|
8
8
|
// src/series/line/canvas/index.ts
|
|
9
9
|
var DEFAULT_CURVE = "linear";
|
|
@@ -34,7 +34,7 @@ function renderLineCanvas(props, layout, ctx, context) {
|
|
|
34
34
|
const isSeriesDimmed = props.interaction?.isSeriesDimmed ?? false;
|
|
35
35
|
const effects = props.effects;
|
|
36
36
|
const seriesDimOpacity = isSeriesDimmed ? effects?.dimOpacity ?? context.theme.dimOpacity ?? DEFAULT_HOVER_DIM_OPACITY : 1;
|
|
37
|
-
const lineColor = layout.lineColor ?? getDefaultColor(layout.
|
|
37
|
+
const lineColor = layout.lineColor ?? getDefaultColor(layout.colorIndex, context.theme);
|
|
38
38
|
const seriesExtras = { seriesIndex: layout.seriesIdx, seriesId: layout.datasetId };
|
|
39
39
|
let strokeStyle;
|
|
40
40
|
if (isGradientColor(lineColor)) {
|
|
@@ -187,7 +187,8 @@ function renderLineCanvas(props, layout, ctx, context) {
|
|
|
187
187
|
if (!showMarkers && !hoverState.isHovered) continue;
|
|
188
188
|
const pointColor = props.pointColors?.[pt.dataIndex];
|
|
189
189
|
const ptCtxC = makeItemContext(props.data?.[pt.dataIndex], pt.dataIndex, { value: pt.value, category: pt.category, ...seriesExtras });
|
|
190
|
-
const
|
|
190
|
+
const resolvedPointColor = pointColor ?? resolveAccessor(props.pointBackgroundColor, ptCtxC, { arrayMode: "cycle" });
|
|
191
|
+
const baseColor = resolvedPointColor ? getPrimaryColor(resolvedPointColor) : getPrimaryColor(lineColor ?? "#000");
|
|
191
192
|
const baseBorderColor = resolveAccessor(props.pointBorderColor, ptCtxC, { arrayMode: "cycle" }) ?? baseColor;
|
|
192
193
|
const baseBorderWidth = resolveAccessor(props.pointBorderStrokeWidth, ptCtxC, { arrayMode: "clip", fallback: 0 }) ?? 0;
|
|
193
194
|
const ptHoverBgC = resolveAccessor(props.pointHoverBackgroundColor, ptCtxC, { arrayMode: "cycle" });
|
|
@@ -203,19 +204,23 @@ function renderLineCanvas(props, layout, ctx, context) {
|
|
|
203
204
|
const effectResult = applyHoverEffects(baseColor, baseBorderColor, baseBorderWidth, props.lineDash, props.lineDashOffset ?? 0, hoverState, effectConfig, context.theme);
|
|
204
205
|
const ptMarkerSize = resolveMarkerSize(ptCtxC);
|
|
205
206
|
const currentSize = hoverState.isHovered ? effects?.hoverPointRadius ?? ptMarkerSize * (effects?.hoverRadiusMultiplier ?? DEFAULT_HOVER_POINT_RADIUS_MULTIPLIER) : ptMarkerSize;
|
|
207
|
+
const useGradientFill = !resolvedPointColor && isGradientColor(lineColor);
|
|
208
|
+
const markerFill = useGradientFill ? strokeStyle : effectResult.color;
|
|
209
|
+
const brightnessOverlay = useGradientFill && hoverState.isHovered && effects?.hoverBrightness && effects.hoverBrightness > 1 ? (effects.hoverBrightness - 1) * 0.6 : void 0;
|
|
206
210
|
drawMarkerCanvas(ctx, {
|
|
207
211
|
x: pt.x,
|
|
208
212
|
y: pt.y,
|
|
209
213
|
size: currentSize,
|
|
210
214
|
shape: resolveMarkerShape(ptCtxC, currentSize),
|
|
211
|
-
fillStyle:
|
|
215
|
+
fillStyle: markerFill,
|
|
212
216
|
strokeStyle: effectResult.borderColor,
|
|
213
217
|
lineStrokeWidth: effectResult.borderStrokeWidth,
|
|
214
218
|
opacity: effectResult.opacity,
|
|
215
219
|
rotation: resolveMarkerRotation(ptCtxC),
|
|
216
220
|
lineDash: resolvePointDash(ptCtxC),
|
|
217
221
|
lineDashOffset: resolvePointDashOffset(ptCtxC),
|
|
218
|
-
lineJoin: props.pointBorderJoinStyle
|
|
222
|
+
lineJoin: props.pointBorderJoinStyle,
|
|
223
|
+
brightnessOverlay
|
|
219
224
|
});
|
|
220
225
|
}
|
|
221
226
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { perceivedLuminanceFromRGB } from './chunk-
|
|
2
|
-
import { defaultLightTheme } from './chunk-
|
|
3
|
-
import { parseHexColor } from './chunk-
|
|
1
|
+
import { perceivedLuminanceFromRGB } from './chunk-RI32WIDX.mjs';
|
|
2
|
+
import { defaultLightTheme } from './chunk-BDCNBS6W.mjs';
|
|
3
|
+
import { parseHexColor } from './chunk-BF7RP4A3.mjs';
|
|
4
4
|
|
|
5
5
|
// src/utils/theme/defaults.ts
|
|
6
6
|
var LIGHT_MODE_COLORS = {
|
|
@@ -59,7 +59,7 @@ var DEFAULT_REFERENCE_LABEL_FONT_SIZE = 11;
|
|
|
59
59
|
var DEFAULT_REFERENCE_LABEL_FONT_WEIGHT = 500;
|
|
60
60
|
var DEFAULT_REFERENCE_LABEL_OFFSET = 4;
|
|
61
61
|
var DEFAULT_HOVER_BRIGHTNESS = 1.1;
|
|
62
|
-
var DEFAULT_HOVER_DIM_OPACITY =
|
|
62
|
+
var DEFAULT_HOVER_DIM_OPACITY = 1;
|
|
63
63
|
var DEFAULT_HOVER_POINT_RADIUS_MULTIPLIER = 1.3;
|
|
64
64
|
var DEFAULT_HOVER_OFFSET = 0;
|
|
65
65
|
var DEFAULT_LINE_WIDTH = 2;
|
|
@@ -87,11 +87,11 @@ var DEFAULT_CANDLESTICK_NEUTRAL_COLOR = "#6b7280";
|
|
|
87
87
|
var DEFAULT_CANDLESTICK_WICK_WIDTH = 1;
|
|
88
88
|
var DEFAULT_TREEMAP_PADDING = 2;
|
|
89
89
|
var DEFAULT_TREEMAP_GROUP_LABEL_HEIGHT = 18;
|
|
90
|
-
var DEFAULT_TREEMAP_CELL_COLOR = "#
|
|
90
|
+
var DEFAULT_TREEMAP_CELL_COLOR = "#5daeea";
|
|
91
91
|
var DEFAULT_TREEMAP_HEADER_BG = "rgba(0,0,0,0.6)";
|
|
92
92
|
var DEFAULT_TREEMAP_HEADER_TEXT_COLOR = "#FFFFFF";
|
|
93
93
|
var DEFAULT_TREEMAP_CELL_BORDER_COLOR = "rgba(0,0,0,0.15)";
|
|
94
|
-
var DEFAULT_TREEMAP_GROUP_COLORS = ["#
|
|
94
|
+
var DEFAULT_TREEMAP_GROUP_COLORS = ["#5daeea", "#ffad5a", "#ffd166", "#4ecdc4", "#7c8cff", "#c084fc", "#ff6fae", "#9ccc3c", "#ff7a66", "#36b7d6", "#a78bfa", "#5ccf9f", "#fda4af", "#94a3b8"];
|
|
95
95
|
var DEFAULT_NAV_PADDING_Y = 4;
|
|
96
96
|
var DEFAULT_NAV_PADDING_X = 6;
|
|
97
97
|
var DEFAULT_NAV_MIN_SELECTION_WIDTH = 20;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { renderHeatmapSvg } from './chunk-
|
|
2
|
-
import { renderHeatmapCanvas } from './chunk-
|
|
1
|
+
import { renderHeatmapSvg } from './chunk-PSDRVQSK.mjs';
|
|
2
|
+
import { renderHeatmapCanvas } from './chunk-GXCLRRE5.mjs';
|
|
3
3
|
|
|
4
4
|
// src/series/heatmap/index.ts
|
|
5
5
|
var heatmapRenderer = {
|
|
@@ -1,46 +1,9 @@
|
|
|
1
|
-
import { formatDataLabelText } from './chunk-
|
|
2
|
-
import { wrapText, calculateWrappedTextWidth, calculateWrappedTextHeight } from './chunk-
|
|
3
|
-
import { DEFAULT_FALLBACK_COLOR } from './chunk-
|
|
4
|
-
import { makeItemContext, resolveAccessor } from './chunk-
|
|
5
|
-
import { withCanvasState } from './chunk-
|
|
6
|
-
import { toRad, pointOnCircle } from './chunk-
|
|
7
|
-
|
|
8
|
-
// src/circular/radial.helpers.ts
|
|
9
|
-
function computeSliceGeometry(slice, currentAngle, frame) {
|
|
10
|
-
const { outerRadius, innerRadius, willBeSingleSlice, currentRingRadii, hoverState, hoverOffset, hoverScale } = frame;
|
|
11
|
-
const ringRadii = currentRingRadii.get(String(slice.datasetIndex));
|
|
12
|
-
const baseOuterRadius = ringRadii?.outer ?? outerRadius;
|
|
13
|
-
const sliceInnerRadius = ringRadii?.inner ?? innerRadius;
|
|
14
|
-
const sliceOuterRadius = sliceInnerRadius + (baseOuterRadius - sliceInnerRadius) * slice.radiusRatio;
|
|
15
|
-
const spacing = slice.spacing ?? 0;
|
|
16
|
-
const spacingAngle = spacing > 0 && sliceOuterRadius > 0 ? spacing / sliceOuterRadius * (180 / Math.PI) : 0;
|
|
17
|
-
const halfSpacing = spacingAngle / 2;
|
|
18
|
-
const angle = slice.endAngle - slice.rotation;
|
|
19
|
-
const isFullCircleSlice = willBeSingleSlice || slice.targetAngle >= 355 || angle >= 355;
|
|
20
|
-
const midAngle = currentAngle + angle / 2;
|
|
21
|
-
const midRadius = (sliceOuterRadius + sliceInnerRadius) / 2;
|
|
22
|
-
const isHovered = hoverState.datasetIndex === slice.datasetIndex && hoverState.index === slice.originalIndex;
|
|
23
|
-
const sliceHoverOffset = isHovered && !isFullCircleSlice ? hoverOffset : 0;
|
|
24
|
-
const hoverOffsetX = sliceHoverOffset > 0 ? Math.cos(toRad(midAngle)) * sliceHoverOffset : 0;
|
|
25
|
-
const hoverOffsetY = sliceHoverOffset > 0 ? Math.sin(toRad(midAngle)) * sliceHoverOffset : 0;
|
|
26
|
-
const baseOffset = slice.baseOffset ?? 0;
|
|
27
|
-
const baseOffsetX = baseOffset !== 0 ? Math.cos(toRad(midAngle)) * baseOffset : 0;
|
|
28
|
-
const baseOffsetY = baseOffset !== 0 ? Math.sin(toRad(midAngle)) * baseOffset : 0;
|
|
29
|
-
const scale = isHovered && !isFullCircleSlice && hoverScale > 1 ? hoverScale : 1;
|
|
30
|
-
return {
|
|
31
|
-
sliceOuterRadius,
|
|
32
|
-
sliceInnerRadius,
|
|
33
|
-
isFullCircleSlice,
|
|
34
|
-
midAngle,
|
|
35
|
-
midRadius,
|
|
36
|
-
isHovered,
|
|
37
|
-
offsetX: hoverOffsetX + baseOffsetX,
|
|
38
|
-
offsetY: hoverOffsetY + baseOffsetY,
|
|
39
|
-
scale,
|
|
40
|
-
renderRotation: isFullCircleSlice ? currentAngle : currentAngle + halfSpacing,
|
|
41
|
-
renderAngle: isFullCircleSlice ? angle : Math.max(0, angle - spacingAngle)
|
|
42
|
-
};
|
|
43
|
-
}
|
|
1
|
+
import { formatDataLabelText } from './chunk-J2WHJ73Y.mjs';
|
|
2
|
+
import { wrapText, calculateWrappedTextWidth, calculateWrappedTextHeight } from './chunk-56MASQS2.mjs';
|
|
3
|
+
import { DEFAULT_FALLBACK_COLOR } from './chunk-6LUIVTNV.mjs';
|
|
4
|
+
import { makeItemContext, resolveAccessor } from './chunk-BDCNBS6W.mjs';
|
|
5
|
+
import { withCanvasState } from './chunk-BF7RP4A3.mjs';
|
|
6
|
+
import { toRad, pointOnCircle } from './chunk-K7AGQTVK.mjs';
|
|
44
7
|
|
|
45
8
|
// src/circular/label.utils.ts
|
|
46
9
|
function getLabelSide(angle) {
|
|
@@ -359,4 +322,4 @@ function buildPieDataLabelLayout(frame, labelConfig, viewport, datasetPropsMap)
|
|
|
359
322
|
return { labelLayout, configsByIndex, labelSlices };
|
|
360
323
|
}
|
|
361
324
|
|
|
362
|
-
export { DEFAULT_LABEL_LAYOUT_OPTIONS, boxAreaToBounds, buildPieDataLabelLayout, calculateLabelLayout, computeLabelAwareRadius,
|
|
325
|
+
export { DEFAULT_LABEL_LAYOUT_OPTIONS, boxAreaToBounds, buildPieDataLabelLayout, calculateLabelLayout, computeLabelAwareRadius, drawCanvasLabelLines, drawCanvasLeaderLine, drawCanvasStraightLeaderLine, getLabelSide };
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { createSvgLinePathBuilder, traceCurve, reversedBaseEdge, invertCurveForReverse } from './chunk-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { createSvgLinePathBuilder, traceCurve, reversedBaseEdge, invertCurveForReverse } from './chunk-HBTCRORW.mjs';
|
|
2
|
+
import { bandCenter } from './chunk-RLS3GMJ6.mjs';
|
|
3
|
+
import { batchResolveAccessor, batchResolveRequired, resolveAccessor, makeItemContext } from './chunk-BDCNBS6W.mjs';
|
|
4
|
+
import { resolveCartesianAccessors } from './chunk-G3DIMENH.mjs';
|
|
5
|
+
import { createBandScale, calculateNiceDomain, createLinearScale } from './chunk-K7AGQTVK.mjs';
|
|
4
6
|
|
|
5
7
|
// src/series/line/geometry.ts
|
|
6
8
|
var DEFAULT_CURVE = "linear";
|
|
@@ -260,6 +262,7 @@ function splitSegmentByStyle(segPts, overrides, curve, tension, isArea, isStacke
|
|
|
260
262
|
};
|
|
261
263
|
});
|
|
262
264
|
}
|
|
265
|
+
var numericXCache = /* @__PURE__ */ new WeakMap();
|
|
263
266
|
function calculateLineLayout(props, chartArea, config) {
|
|
264
267
|
const { data = [] } = props;
|
|
265
268
|
const curve = props.curve ?? DEFAULT_CURVE;
|
|
@@ -267,14 +270,27 @@ function calculateLineLayout(props, chartArea, config) {
|
|
|
267
270
|
const connectNulls = props.connectNulls ?? DEFAULT_CONNECT_NULLS;
|
|
268
271
|
const fillOpacity = props.fillOpacity;
|
|
269
272
|
const isArea = typeof fillOpacity === "number" && fillOpacity > 0;
|
|
270
|
-
const
|
|
271
|
-
const valueAccessor =
|
|
272
|
-
const
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
273
|
+
const acc = resolveCartesianAccessors(props);
|
|
274
|
+
const valueAccessor = acc.measureField;
|
|
275
|
+
const isNumericX = !acc.independentIsCategory && config?.valueXScale != null;
|
|
276
|
+
let numericXValues;
|
|
277
|
+
let numericLabels;
|
|
278
|
+
if (isNumericX) {
|
|
279
|
+
const cached = numericXCache.get(data);
|
|
280
|
+
if (cached && cached.field === acc.independentField) {
|
|
281
|
+
numericXValues = cached.raw;
|
|
282
|
+
numericLabels = cached.labels;
|
|
283
|
+
} else {
|
|
284
|
+
numericXValues = batchResolveAccessor(acc.independentField, data);
|
|
285
|
+
numericLabels = numericXValues.map((v) => String(v));
|
|
286
|
+
numericXCache.set(data, { field: acc.independentField, raw: numericXValues, labels: numericLabels });
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
const categoryAccessor = isNumericX ? void 0 : acc.independentField;
|
|
290
|
+
const categories = isNumericX ? numericLabels : categoryAccessor ? batchResolveRequired(categoryAccessor, data, "categoryField") : data.map((_, i) => String(i));
|
|
291
|
+
const rawValues = valueAccessor ? batchResolveRequired(valueAccessor, data, "valueField") : data.map(() => null);
|
|
292
|
+
const valueXScale = isNumericX ? config.valueXScale : void 0;
|
|
293
|
+
const categoryScale = isNumericX ? void 0 : config?.categoryScale ?? createBandScale(categories, [chartArea.x, chartArea.x + chartArea.width]);
|
|
278
294
|
const numericValues = rawValues.filter((v) => v !== null && v !== void 0 && !isNaN(Number(v)));
|
|
279
295
|
const valueDomain = config?.valueScale?.domain() ?? calculateNiceDomain(numericValues.length > 0 ? numericValues : [0, 1], {
|
|
280
296
|
includeZero: true
|
|
@@ -285,30 +301,30 @@ function calculateLineLayout(props, chartArea, config) {
|
|
|
285
301
|
const seriesIdx = props.order ?? 0;
|
|
286
302
|
const stackBases = config?.stackBases;
|
|
287
303
|
const transformedValues = config?.transformedValues;
|
|
304
|
+
const horizontal = config?.orientation === "horizontal";
|
|
288
305
|
const treatNullAsZero = connectNulls === "zero";
|
|
289
306
|
const points = data.map((_, i) => {
|
|
290
307
|
const category = categories[i] ?? String(i);
|
|
291
308
|
const rawVal = rawValues[i];
|
|
292
309
|
const value = rawVal !== null && rawVal !== void 0 && !isNaN(Number(rawVal)) ? Number(rawVal) : null;
|
|
293
310
|
const visible = props.visibility ? props.visibility.get(i) !== false : true;
|
|
294
|
-
const
|
|
295
|
-
const centerX = bandLeft + categoryScale.bandwidth() / 2;
|
|
311
|
+
const bandPos = isNumericX ? valueXScale(numericXValues[i]) : bandCenter(categoryScale, category);
|
|
296
312
|
const stackBase = stackBases?.[i] ?? 0;
|
|
297
313
|
const effectiveValue = transformedValues ? transformedValues[i] : value;
|
|
298
314
|
const isNullPoint = effectiveValue === null || effectiveValue === void 0 || typeof effectiveValue === "number" && isNaN(effectiveValue);
|
|
299
|
-
const
|
|
315
|
+
const valuePos = !isNullPoint ? valueScale(stackBase + effectiveValue) : treatNullAsZero ? valueScale(stackBase) : NaN;
|
|
300
316
|
return {
|
|
301
317
|
dataIndex: i,
|
|
302
|
-
x:
|
|
303
|
-
y,
|
|
318
|
+
x: horizontal ? valuePos : bandPos,
|
|
319
|
+
y: horizontal ? bandPos : valuePos,
|
|
304
320
|
value,
|
|
305
321
|
category,
|
|
306
322
|
visible,
|
|
307
323
|
...stackBases && { baseY: valueScale(stackBase) }
|
|
308
324
|
};
|
|
309
325
|
});
|
|
310
|
-
const step = categoryScale.step();
|
|
311
|
-
if (step > 0) {
|
|
326
|
+
const step = categoryScale ? categoryScale.step() : 0;
|
|
327
|
+
if (categoryScale && !horizontal && step > 0) {
|
|
312
328
|
for (let i = 0; i < points.length; i++) {
|
|
313
329
|
const pt = points[i];
|
|
314
330
|
if (isNaN(pt.x) && pt.visible && pt.value !== null && !isNaN(pt.y)) {
|
|
@@ -346,6 +362,7 @@ function calculateLineLayout(props, chartArea, config) {
|
|
|
346
362
|
visiblePoints,
|
|
347
363
|
segments,
|
|
348
364
|
categoryScale,
|
|
365
|
+
valueXScale,
|
|
349
366
|
valueScale,
|
|
350
367
|
lineColor,
|
|
351
368
|
seriesIdx,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { computeBarLabelPosition } from './chunk-
|
|
2
|
-
import { formatDataLabelText } from './chunk-
|
|
3
|
-
import { DEFAULT_LABEL_SPACING } from './chunk-
|
|
4
|
-
import { makeItemContext, resolveAccessor } from './chunk-
|
|
1
|
+
import { computeBarLabelPosition } from './chunk-DJOHDKTP.mjs';
|
|
2
|
+
import { formatDataLabelText } from './chunk-J2WHJ73Y.mjs';
|
|
3
|
+
import { DEFAULT_LABEL_SPACING } from './chunk-6LUIVTNV.mjs';
|
|
4
|
+
import { makeItemContext, resolveAccessor } from './chunk-BDCNBS6W.mjs';
|
|
5
5
|
|
|
6
6
|
// src/cartesian/label.ts
|
|
7
7
|
var BASELINE_TO_CANVAS = { central: "middle", hanging: "top", auto: "alphabetic" };
|
|
@@ -13,7 +13,6 @@ function resolveBarLabels(bars, colors, datasetTotal, orientation, config, isPer
|
|
|
13
13
|
for (const bar of bars) {
|
|
14
14
|
if (orientation === "vertical" ? bar.height < 2 : bar.width < 2) continue;
|
|
15
15
|
const percentage = isPercentStacked ? bar.value : datasetTotal > 0 ? Math.abs(bar.value) / datasetTotal * 100 : 0;
|
|
16
|
-
if (config.minPercentage > 0 && percentage < config.minPercentage) continue;
|
|
17
16
|
const text = formatDataLabelText(bar.value, percentage, config.display, config.formatter);
|
|
18
17
|
if (!text) continue;
|
|
19
18
|
const pos = computeBarLabelPosition(bar, orientation, DEFAULT_LABEL_SPACING);
|
|
@@ -82,7 +81,6 @@ function resolvePointLabels(points, seriesColor, datasetTotal, config, seriesNam
|
|
|
82
81
|
for (const pt of points) {
|
|
83
82
|
if (pt.value == null || Number.isNaN(pt.y)) continue;
|
|
84
83
|
const percentage = datasetTotal > 0 ? Math.abs(pt.value) / datasetTotal * 100 : 0;
|
|
85
|
-
if (config.minPercentage > 0 && percentage < config.minPercentage) continue;
|
|
86
84
|
const text = formatDataLabelText(pt.value, percentage, config.display, config.formatter);
|
|
87
85
|
if (!text) continue;
|
|
88
86
|
const labelCtx = needsCtx ? makeItemContext(data?.[pt.dataIndex], pt.dataIndex) : null;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { normalizePadding } from './chunk-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { normalizePadding } from './chunk-AJ24XDEK.mjs';
|
|
2
|
+
import { safeFormat } from './chunk-DIJFKY6H.mjs';
|
|
3
|
+
import { DEFAULT_NAV_GRIP_LINE_GAP, DEFAULT_NAV_HANDLE_WIDTH, DEFAULT_NAV_MIN_SELECTION_WIDTH, DEFAULT_NAV_STYLE, DEFAULT_NAV_PADDING_X, DEFAULT_NAV_PADDING_Y } from './chunk-6LUIVTNV.mjs';
|
|
4
|
+
import { defaultLightTheme, batchResolveAccessor } from './chunk-BDCNBS6W.mjs';
|
|
5
|
+
import { resolveCartesianAccessors } from './chunk-G3DIMENH.mjs';
|
|
6
|
+
import { toTimestamp, createLinearScale, generateNiceTicks, generateTimeTicks, formatTimeTick } from './chunk-K7AGQTVK.mjs';
|
|
5
7
|
|
|
6
8
|
// src/renderers/navigator/geometry.ts
|
|
7
9
|
var NAV_PADDING_Y = DEFAULT_NAV_PADDING_Y;
|
|
@@ -62,9 +64,12 @@ function extractNavigatorData(datasets, targetSeriesId, isTimeAxis) {
|
|
|
62
64
|
let isCategoryAxis = false;
|
|
63
65
|
let isNumericAxis = false;
|
|
64
66
|
let catLabels;
|
|
67
|
+
let orientation = "vertical";
|
|
65
68
|
if (targetDs.type === "candlestick") {
|
|
66
69
|
const cp = props;
|
|
67
|
-
const
|
|
70
|
+
const cacc = resolveCartesianAccessors(cp);
|
|
71
|
+
orientation = cacc.orientation;
|
|
72
|
+
const rawTimeValues = batchResolveAccessor(cacc.independentField, data);
|
|
68
73
|
if (isTimeAxis) {
|
|
69
74
|
xValues = rawTimeValues.map((v) => toTimestamp(v));
|
|
70
75
|
} else {
|
|
@@ -73,25 +78,21 @@ function extractNavigatorData(datasets, targetSeriesId, isTimeAxis) {
|
|
|
73
78
|
xValues = rawTimeValues.map((_, i) => i);
|
|
74
79
|
}
|
|
75
80
|
yValues = batchResolveAccessor(cp.closeField, data);
|
|
76
|
-
} else if (targetDs.type === "scatter") {
|
|
77
|
-
const xField = props.xField ?? props.x ?? FIELD_DEFAULTS.xField;
|
|
78
|
-
const yField = props.yField ?? props.y ?? FIELD_DEFAULTS.yField;
|
|
79
|
-
xValues = batchResolveAccessor(xField, data);
|
|
80
|
-
yValues = batchResolveAccessor(yField, data);
|
|
81
|
-
isCategoryAxis = false;
|
|
82
|
-
isNumericAxis = true;
|
|
83
81
|
} else {
|
|
84
|
-
const
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
82
|
+
const acc = resolveCartesianAccessors(props);
|
|
83
|
+
const rawIndep = batchResolveAccessor(acc.independentField, data);
|
|
84
|
+
orientation = acc.orientation;
|
|
85
|
+
yValues = batchResolveAccessor(acc.measureField, data);
|
|
86
|
+
if (!acc.independentIsCategory) {
|
|
87
|
+
isNumericAxis = true;
|
|
88
|
+
xValues = rawIndep.map((v) => Number(v));
|
|
89
|
+
} else if (isTimeAxis) {
|
|
90
|
+
xValues = rawIndep.map((v) => toTimestamp(v));
|
|
89
91
|
} else {
|
|
90
92
|
isCategoryAxis = true;
|
|
91
|
-
catLabels =
|
|
92
|
-
xValues =
|
|
93
|
+
catLabels = rawIndep.map((v) => String(v ?? ""));
|
|
94
|
+
xValues = rawIndep.map((_, i) => i);
|
|
93
95
|
}
|
|
94
|
-
yValues = batchResolveAccessor(valField, data);
|
|
95
96
|
}
|
|
96
97
|
const points = [];
|
|
97
98
|
for (let i = 0; i < xValues.length; i++) {
|
|
@@ -114,7 +115,7 @@ function extractNavigatorData(datasets, targetSeriesId, isTimeAxis) {
|
|
|
114
115
|
yMin -= 1;
|
|
115
116
|
yMax += 1;
|
|
116
117
|
}
|
|
117
|
-
return { points, xDomain, yDomain: [yMin, yMax], isCategory: isCategoryAxis, categoryLabels: catLabels, isNumericAxis, sourceType: targetDs.type };
|
|
118
|
+
return { points, xDomain, yDomain: [yMin, yMax], isCategory: isCategoryAxis, categoryLabels: catLabels, isNumericAxis, sourceType: targetDs.type, orientation };
|
|
118
119
|
}
|
|
119
120
|
function createNavigatorScales(data, width, height, padding) {
|
|
120
121
|
const px = padding?.left ?? NAV_PADDING_X;
|
|
@@ -170,7 +171,14 @@ function computeNavigatorTicks(xDomain, xScale, width, locale, categoryLabels, i
|
|
|
170
171
|
const ticks2 = [];
|
|
171
172
|
for (let i = 0; i < totalCats; i += step) {
|
|
172
173
|
const raw = categoryLabels[i];
|
|
173
|
-
ticks2.push({
|
|
174
|
+
ticks2.push({
|
|
175
|
+
px: xScale(i),
|
|
176
|
+
label: formatter ? safeFormat(
|
|
177
|
+
() => formatter(raw, i),
|
|
178
|
+
() => raw,
|
|
179
|
+
"navigator tick"
|
|
180
|
+
) : raw
|
|
181
|
+
});
|
|
174
182
|
}
|
|
175
183
|
return ticks2;
|
|
176
184
|
}
|
|
@@ -190,7 +198,18 @@ function computeNavigatorTicks(xDomain, xScale, width, locale, categoryLabels, i
|
|
|
190
198
|
label: formatTimeTick(ts, interval.unit, void 0, void 0, locale)
|
|
191
199
|
}));
|
|
192
200
|
}
|
|
193
|
-
function computeNavigatorSelection(zoomState, xScale, width, yScale, height) {
|
|
201
|
+
function computeNavigatorSelection(zoomState, xScale, width, yScale, height, orientation = "vertical") {
|
|
202
|
+
if (orientation === "horizontal") {
|
|
203
|
+
if (!xScale || !zoomState.y) {
|
|
204
|
+
return { x: 0, width, isZoomed: false };
|
|
205
|
+
}
|
|
206
|
+
const minW2 = Math.min(MIN_SELECTION_WIDTH, width);
|
|
207
|
+
const rawLeft2 = Math.max(0, xScale(zoomState.y.min));
|
|
208
|
+
const rawRight2 = Math.min(width, xScale(zoomState.y.max));
|
|
209
|
+
const selW2 = Math.max(rawRight2 - rawLeft2, minW2);
|
|
210
|
+
const selX2 = Math.min(rawLeft2, Math.max(0, width - selW2));
|
|
211
|
+
return { x: selX2, width: selW2, isZoomed: true };
|
|
212
|
+
}
|
|
194
213
|
if (!xScale || !zoomState.x) {
|
|
195
214
|
return { x: 0, width, isZoomed: false };
|
|
196
215
|
}
|
|
@@ -273,7 +292,7 @@ function calculateNavigatorLayout(chartArea, config, datasets, zoomState, isTime
|
|
|
273
292
|
const scales = createNavigatorScales(animatedData, area.width, area.height, resolved.padding);
|
|
274
293
|
const paths = buildNavigatorPaths(data.points, scales, area.height, data.sourceType);
|
|
275
294
|
const ticks = computeNavigatorTicks(effectiveXDomain, scales.x, area.width, locale, data.categoryLabels, data.isNumericAxis, tickFormat);
|
|
276
|
-
const selection = computeNavigatorSelection(zoomState, scales.x, area.width, data.isNumericAxis ? scales.y : null, data.isNumericAxis ? area.height : void 0);
|
|
295
|
+
const selection = computeNavigatorSelection(zoomState, scales.x, area.width, data.isNumericAxis ? scales.y : null, data.isNumericAxis ? area.height : void 0, data.orientation);
|
|
277
296
|
const primaryColor = resolveSeriesColor(primaryConfig, primarySeriesId ? datasets.get(primarySeriesId) : void 0);
|
|
278
297
|
const allSeries = [
|
|
279
298
|
{ points: data.points, paths, color: primaryColor, sourceType: data.sourceType },
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { computeDrillOutOrigin, computeZoomTransform } from './chunk-
|
|
2
|
-
import { AnimatedScene, resolveAnimatedProps, TREEMAP_ANIMATABLE_PROPS } from './chunk-
|
|
3
|
-
import { getCellLabelInfo } from './chunk-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { buildAncestorChain } from './chunk-
|
|
11
|
-
import { configureCanvasHiDPI, materializeSvgNode, setAttr } from './chunk-
|
|
1
|
+
import { computeDrillOutOrigin, computeZoomTransform } from './chunk-AWMO5TS3.mjs';
|
|
2
|
+
import { AnimatedScene, resolveAnimatedProps, TREEMAP_ANIMATABLE_PROPS } from './chunk-JS47MSB2.mjs';
|
|
3
|
+
import { calculateTreemapLayout, getCellLabelInfo } from './chunk-KCSMOAZO.mjs';
|
|
4
|
+
import { reconcileSvgChildren } from './chunk-FWNWV3H7.mjs';
|
|
5
|
+
import { parseAnimationConfig, getEasing } from './chunk-LTQH3LQJ.mjs';
|
|
6
|
+
import { raf, cancelRaf } from './chunk-5WFF272M.mjs';
|
|
7
|
+
import { buildAccessibilityRenderContext, generateSeriesDescription } from './chunk-IFJPDARC.mjs';
|
|
8
|
+
import { CHAR_WIDTH_RATIO } from './chunk-56MASQS2.mjs';
|
|
9
|
+
import { DEFAULT_HOVER_DIM_OPACITY, DEFAULT_HOVER_BRIGHTNESS } from './chunk-6LUIVTNV.mjs';
|
|
10
|
+
import { buildAncestorChain } from './chunk-4KQZXAHZ.mjs';
|
|
11
|
+
import { configureCanvasHiDPI, materializeSvgNode, setAttr } from './chunk-BF7RP4A3.mjs';
|
|
12
12
|
|
|
13
13
|
// src/series/treemap/controller/helpers.ts
|
|
14
14
|
function buildTreemapDataFingerprint(layouts) {
|
|
@@ -89,7 +89,7 @@ function projectTreemapSceneFrame(cellScene, groupBgScene, targetLayouts) {
|
|
|
89
89
|
targetBgByDataset.set(datasetId, bgMap);
|
|
90
90
|
}
|
|
91
91
|
const cellsByDataset = /* @__PURE__ */ new Map();
|
|
92
|
-
for (const el of cellScene.
|
|
92
|
+
for (const el of cellScene.elementValues()) {
|
|
93
93
|
const s = el.current;
|
|
94
94
|
const sep = el.id.indexOf("::");
|
|
95
95
|
if (sep < 0) continue;
|
|
@@ -119,7 +119,7 @@ function projectTreemapSceneFrame(cellScene, groupBgScene, targetLayouts) {
|
|
|
119
119
|
arr.push(cell);
|
|
120
120
|
}
|
|
121
121
|
const bgsByDataset = /* @__PURE__ */ new Map();
|
|
122
|
-
for (const el of groupBgScene.
|
|
122
|
+
for (const el of groupBgScene.elementValues()) {
|
|
123
123
|
const s = el.current;
|
|
124
124
|
const sep = el.id.indexOf("::");
|
|
125
125
|
if (sep < 0) continue;
|
|
@@ -205,7 +205,7 @@ function resolveId(ctx, item, categoryField, nodeIdField, itemIndex) {
|
|
|
205
205
|
function buildTreemapSvgChildren(params) {
|
|
206
206
|
const children = [];
|
|
207
207
|
for (const [dsId, { props, layout }] of params.layoutMap) {
|
|
208
|
-
const node = params.paint.renderSvg(props, layout, { ...params.fontContext, interaction: params.interaction });
|
|
208
|
+
const node = params.paint.renderSvg(props, layout, { ...params.fontContext, interaction: params.interaction, effects: params.effects });
|
|
209
209
|
setAttr(node, "data-dataset", dsId);
|
|
210
210
|
if (params.accessibility?.enabled && params.accessibility.landmarkVerbosity === "all") {
|
|
211
211
|
setAttr(node, "role", "region");
|
|
@@ -215,13 +215,21 @@ function buildTreemapSvgChildren(params) {
|
|
|
215
215
|
}
|
|
216
216
|
return children;
|
|
217
217
|
}
|
|
218
|
+
function resolveTreemapHoverEffects(input) {
|
|
219
|
+
if (!input?.hoverConfig) return void 0;
|
|
220
|
+
return {
|
|
221
|
+
hoverBrightness: input.hoverConfig.brightness ?? input.theme.hoverBrightness ?? DEFAULT_HOVER_BRIGHTNESS,
|
|
222
|
+
dimOpacity: input.hoverConfig.dimOpacity ?? input.theme.dimOpacity ?? DEFAULT_HOVER_DIM_OPACITY
|
|
223
|
+
};
|
|
224
|
+
}
|
|
218
225
|
function renderSvgGroup(ctx, group, layoutMap, fontContext, interaction, accessibility) {
|
|
219
|
-
const children = buildTreemapSvgChildren({ paint: ctx._paint, layoutMap, fontContext, interaction, accessibility });
|
|
226
|
+
const children = buildTreemapSvgChildren({ paint: ctx._paint, layoutMap, fontContext, interaction, effects: resolveTreemapHoverEffects(ctx.lastInput), accessibility });
|
|
220
227
|
group.replaceChildren(...children.map(materializeSvgNode));
|
|
221
228
|
}
|
|
222
229
|
function renderAllCanvas(ctx, c2d, layoutMap, fontContext, interaction) {
|
|
230
|
+
const effects = resolveTreemapHoverEffects(ctx.lastInput);
|
|
223
231
|
for (const [, { props, layout }] of layoutMap) {
|
|
224
|
-
ctx._paint.renderCanvas(props, layout, c2d, { ...fontContext, interaction });
|
|
232
|
+
ctx._paint.renderCanvas(props, layout, c2d, { ...fontContext, interaction, effects });
|
|
225
233
|
}
|
|
226
234
|
renderCanvasCustomContent(ctx, c2d);
|
|
227
235
|
}
|
|
@@ -275,7 +283,7 @@ function applyHover(ctx, hover) {
|
|
|
275
283
|
liveLayoutMap.set(id, { props: mergedProps, layout: liveLayout });
|
|
276
284
|
}
|
|
277
285
|
if (input.renderer === "svg" && ctx.svgGroup) {
|
|
278
|
-
const children = buildTreemapSvgChildren({ paint: ctx._paint, layoutMap: liveLayoutMap, fontContext, interaction });
|
|
286
|
+
const children = buildTreemapSvgChildren({ paint: ctx._paint, layoutMap: liveLayoutMap, fontContext, interaction, effects: resolveTreemapHoverEffects(input) });
|
|
279
287
|
reconcileSvgChildren(ctx.svgGroup, children);
|
|
280
288
|
return;
|
|
281
289
|
}
|