@primeui/chart-core 0.0.1-alpha.1 → 1.0.0-rc.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/LICENSE.md +35 -0
- package/README.md +12 -0
- 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-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-DN6AXQYZ.mjs → chunks/chunk-72M66Y2U.mjs} +46 -41
- 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-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-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/{chunk-WCG35U6M.mjs → chunks/chunk-FYVMRQFF.mjs} +35 -27
- 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-3WEMHXZI.mjs → chunks/chunk-LTQH3LQJ.mjs} +2 -8
- package/dist/{chunk-OHGCZZPZ.mjs → chunks/chunk-M5PZVFY5.mjs} +57 -29
- package/dist/{chunk-A6ZQZFL2.mjs → chunks/chunk-NUHW3U7G.mjs} +14 -11
- 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-PLSDU3C2.mjs → chunks/chunk-RXQ22JQS.mjs} +67 -39
- 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-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.d.mts +1 -1
- 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 +3 -3
- 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-C3z-UKm4.d.mts} +4 -4
- 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 +5 -10
- package/LICENSE +0 -23
- 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,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,9 +1,10 @@
|
|
|
1
|
-
import { getCategoryLabelAnchor } from './chunk-
|
|
2
|
-
import { resolveBandGeometry, buildWedgePath, buildCircleSvgPath, buildPolygonPath, resolveLineGeometry } from './chunk-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { getCategoryLabelAnchor } from './chunk-FYVMRQFF.mjs';
|
|
2
|
+
import { resolveBandGeometry, buildWedgePath, buildCircleSvgPath, buildPolygonPath, resolveLineGeometry } from './chunk-CFA2SUBF.mjs';
|
|
3
|
+
import { safeFormat } from './chunk-DIJFKY6H.mjs';
|
|
4
|
+
import { formatCompactValue, measureFontMetrics, svgAnchorToCanvasAlign, formatTooltipValue } from './chunk-56MASQS2.mjs';
|
|
5
|
+
import { resolveAxisColor } from './chunk-6LUIVTNV.mjs';
|
|
6
|
+
import { createSvgGroup, appendChild, createSvgPath, createSvgText, createSvgLine, createSvgCircle, withCanvasState } from './chunk-BF7RP4A3.mjs';
|
|
7
|
+
import { toRad } from './chunk-K7AGQTVK.mjs';
|
|
7
8
|
|
|
8
9
|
// src/renderers/radial-grid.svg.ts
|
|
9
10
|
function renderRadialGridSvg(layout, theme, axisIndex = 0) {
|
|
@@ -39,7 +40,7 @@ function renderRadialGridSvg(layout, theme, axisIndex = 0) {
|
|
|
39
40
|
appendChild(
|
|
40
41
|
group,
|
|
41
42
|
createSvgText(lx, ly, band.label, {
|
|
42
|
-
class: "p-chart-tick-label",
|
|
43
|
+
class: "p-chart-tick-label p-chart-radial-tick-label",
|
|
43
44
|
"text-anchor": "start",
|
|
44
45
|
"dominant-baseline": "middle",
|
|
45
46
|
fill: band.labelColor ?? theme.tickLabel,
|
|
@@ -118,7 +119,6 @@ function renderRadialGridSvg(layout, theme, axisIndex = 0) {
|
|
|
118
119
|
const ep = spokeEndpoints[si];
|
|
119
120
|
appendChild(group, createSvgLine(center.x, center.y, ep.x, ep.y, spokeAttrs));
|
|
120
121
|
}
|
|
121
|
-
const haloColor = theme.tickHalo;
|
|
122
122
|
for (let ci = 0; ci < spokes.length; ci++) {
|
|
123
123
|
const entry = spokes[ci];
|
|
124
124
|
if (entry.showLabels === false) continue;
|
|
@@ -137,7 +137,11 @@ function renderRadialGridSvg(layout, theme, axisIndex = 0) {
|
|
|
137
137
|
const r = entry.levelRadii[li];
|
|
138
138
|
if (r <= 0) continue;
|
|
139
139
|
const val = entry.levelValues[li];
|
|
140
|
-
const text = formatter ?
|
|
140
|
+
const text = formatter ? safeFormat(
|
|
141
|
+
() => formatter(val),
|
|
142
|
+
() => formatCompactValue(val),
|
|
143
|
+
"tick"
|
|
144
|
+
) : formatCompactValue(val);
|
|
141
145
|
const px = -dy * 4;
|
|
142
146
|
const py = dx * 4;
|
|
143
147
|
const cx = center.x + dx * r + px;
|
|
@@ -145,15 +149,11 @@ function renderRadialGridSvg(layout, theme, axisIndex = 0) {
|
|
|
145
149
|
appendChild(
|
|
146
150
|
group,
|
|
147
151
|
createSvgText(cx, cy, text, {
|
|
148
|
-
class: "p-chart-tick-label",
|
|
152
|
+
class: "p-chart-tick-label p-chart-radial-tick-label",
|
|
149
153
|
"text-anchor": "middle",
|
|
150
154
|
"dominant-baseline": "central",
|
|
151
155
|
transform: `rotate(${rotation.toFixed(2)} ${cx} ${cy})`,
|
|
152
156
|
fill: resolvedColor ?? theme.tickLabel,
|
|
153
|
-
stroke: haloColor,
|
|
154
|
-
"stroke-width": "3",
|
|
155
|
-
"stroke-linejoin": "round",
|
|
156
|
-
"paint-order": "stroke fill",
|
|
157
157
|
"font-size": resolvedFontSize,
|
|
158
158
|
"font-family": layout.fontFamily,
|
|
159
159
|
opacity: 0.85
|
|
@@ -189,7 +189,6 @@ function renderRadialGridSvg(layout, theme, axisIndex = 0) {
|
|
|
189
189
|
appendChild(group, createSvgLine(center.x, center.y, ep.x, ep.y, spokeAttrs));
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
|
-
const haloColor = theme.tickHalo;
|
|
193
192
|
const resolvedTickFontSize = Math.round(tickFontSize * 0.83);
|
|
194
193
|
const labelEnd = yAxis.showLabels === false ? 0 : xDrawsPerimeter ? levelValues.length - 1 : levelValues.length;
|
|
195
194
|
for (let li = 1; li < labelEnd; li++) {
|
|
@@ -200,13 +199,9 @@ function renderRadialGridSvg(layout, theme, axisIndex = 0) {
|
|
|
200
199
|
appendChild(
|
|
201
200
|
group,
|
|
202
201
|
createSvgText(center.x + 4, ly + 8, label, {
|
|
203
|
-
class: "p-chart-tick-label",
|
|
202
|
+
class: "p-chart-tick-label p-chart-radial-tick-label",
|
|
204
203
|
"text-anchor": "start",
|
|
205
204
|
fill: tickColor ?? theme.tickLabel,
|
|
206
|
-
stroke: haloColor,
|
|
207
|
-
"stroke-width": "3",
|
|
208
|
-
"stroke-linejoin": "round",
|
|
209
|
-
"paint-order": "stroke fill",
|
|
210
205
|
"font-size": resolvedTickFontSize,
|
|
211
206
|
"font-family": layout.fontFamily,
|
|
212
207
|
opacity: 0.7
|
|
@@ -241,7 +236,7 @@ function renderRadialGridSvg(layout, theme, axisIndex = 0) {
|
|
|
241
236
|
appendChild(
|
|
242
237
|
group,
|
|
243
238
|
createSvgText(lx, finalY, categories[i], {
|
|
244
|
-
class: "p-chart-tick-label",
|
|
239
|
+
class: "p-chart-tick-label p-chart-radial-tick-label",
|
|
245
240
|
"text-anchor": getCategoryLabelAnchor(angleDeg),
|
|
246
241
|
"dominant-baseline": "auto",
|
|
247
242
|
fill: xAxis.color ?? theme.tickLabel,
|
|
@@ -426,17 +421,17 @@ function renderRadialGridCanvas(ctx, layout, theme, axisIndex = 0) {
|
|
|
426
421
|
ctx.font = `${resolvedTickFontSize}px ${layout.fontFamily}`;
|
|
427
422
|
ctx.textAlign = "left";
|
|
428
423
|
ctx.textBaseline = "alphabetic";
|
|
429
|
-
ctx.strokeStyle = theme.tickHalo;
|
|
430
|
-
ctx.lineWidth = 3;
|
|
431
|
-
ctx.lineJoin = "round";
|
|
432
424
|
const labelEnd = yAxis.showLabels === false ? 0 : xAxis && xAxis.visible !== false && xAxis.showLine !== false ? levelValues.length - 1 : levelValues.length;
|
|
433
425
|
for (let li = 1; li < labelEnd; li++) {
|
|
434
426
|
const r = levelRadii[li];
|
|
435
427
|
const val = levelValues[li];
|
|
436
|
-
const label = tickFormat ?
|
|
428
|
+
const label = tickFormat ? safeFormat(
|
|
429
|
+
() => tickFormat(val),
|
|
430
|
+
() => formatCompactValue(val),
|
|
431
|
+
"tick"
|
|
432
|
+
) : formatCompactValue(val);
|
|
437
433
|
const tx = center.x + 4;
|
|
438
434
|
const ty = center.y - r + 8;
|
|
439
|
-
ctx.strokeText(label, tx, ty);
|
|
440
435
|
ctx.fillText(label, tx, ty);
|
|
441
436
|
}
|
|
442
437
|
});
|
|
@@ -499,14 +494,15 @@ function renderRadialGridCanvas(ctx, layout, theme, axisIndex = 0) {
|
|
|
499
494
|
ctx.font = `${resolvedFontSize}px ${layout.fontFamily}`;
|
|
500
495
|
ctx.textAlign = "center";
|
|
501
496
|
ctx.textBaseline = "middle";
|
|
502
|
-
ctx.strokeStyle = theme.tickHalo;
|
|
503
|
-
ctx.lineWidth = 3;
|
|
504
|
-
ctx.lineJoin = "round";
|
|
505
497
|
for (let li = 1; li < entry.levelValues.length; li++) {
|
|
506
498
|
const r = entry.levelRadii[li];
|
|
507
499
|
if (r <= 0) continue;
|
|
508
500
|
const val = entry.levelValues[li];
|
|
509
|
-
const text = formatter ?
|
|
501
|
+
const text = formatter ? safeFormat(
|
|
502
|
+
() => formatter(val),
|
|
503
|
+
() => formatCompactValue(val),
|
|
504
|
+
"tick"
|
|
505
|
+
) : formatCompactValue(val);
|
|
510
506
|
const px = -dy * 4;
|
|
511
507
|
const py = dx * 4;
|
|
512
508
|
const cx = center.x + dx * r + px;
|
|
@@ -514,7 +510,6 @@ function renderRadialGridCanvas(ctx, layout, theme, axisIndex = 0) {
|
|
|
514
510
|
ctx.save();
|
|
515
511
|
ctx.translate(cx, cy);
|
|
516
512
|
ctx.rotate(toRad(rotation));
|
|
517
|
-
ctx.strokeText(text, 0, 0);
|
|
518
513
|
ctx.fillText(text, 0, 0);
|
|
519
514
|
ctx.restore();
|
|
520
515
|
}
|
|
@@ -579,14 +574,18 @@ function buildTooltipContent(data, isSharedMode, opts = {}) {
|
|
|
579
574
|
type: "multi-series",
|
|
580
575
|
label: data.label,
|
|
581
576
|
series: data.allSeriesHits.map((hit) => {
|
|
582
|
-
const formatted2 = valueFormatter ?
|
|
577
|
+
const formatted2 = valueFormatter ? safeFormat(
|
|
578
|
+
() => valueFormatter(hit.value, { label: data.label, color: hit.color, datasetId: hit.datasetId }),
|
|
579
|
+
() => void 0,
|
|
580
|
+
"tooltip value"
|
|
581
|
+
) : void 0;
|
|
583
582
|
return {
|
|
584
583
|
datasetId: hit.datasetId,
|
|
585
584
|
color: hit.color,
|
|
586
585
|
colorGradient: hit.colorGradient,
|
|
587
586
|
swatchColor: hit.swatchColor,
|
|
588
587
|
label: hit.name ?? hit.datasetId,
|
|
589
|
-
formattedValue: typeof formatted2 === "string" ? formatted2 : hit.formattedValue,
|
|
588
|
+
formattedValue: typeof formatted2 === "string" ? formatted2 : hit.formattedValue ?? formatTooltipValue(hit.value, locale),
|
|
590
589
|
ohlc: hit.ohlc
|
|
591
590
|
};
|
|
592
591
|
})
|
|
@@ -594,7 +593,11 @@ function buildTooltipContent(data, isSharedMode, opts = {}) {
|
|
|
594
593
|
}
|
|
595
594
|
const ctx = { label: data.label, color: data.color, datasetId: data.datasetId ?? "", percentage: data.percentage, index: data.index };
|
|
596
595
|
const primary = data.value ?? data.yValue ?? data.ohlc?.close ?? 0;
|
|
597
|
-
const formatted = valueFormatter ?
|
|
596
|
+
const formatted = valueFormatter ? safeFormat(
|
|
597
|
+
() => valueFormatter(primary, ctx),
|
|
598
|
+
() => void 0,
|
|
599
|
+
"tooltip value"
|
|
600
|
+
) : void 0;
|
|
598
601
|
if (Array.isArray(formatted)) {
|
|
599
602
|
return { type: "rows", color: data.color, colorGradient: data.colorGradient, swatchColor: data.swatchColor, label: data.label, rows: formatted };
|
|
600
603
|
}
|
|
@@ -607,20 +610,22 @@ function buildTooltipContent(data, isSharedMode, opts = {}) {
|
|
|
607
610
|
label: data.label,
|
|
608
611
|
rows: ["open", "high", "low", "close"].map((key) => ({
|
|
609
612
|
key,
|
|
610
|
-
value: data.ohlc[key]
|
|
613
|
+
value: formatTooltipValue(data.ohlc[key], locale)
|
|
611
614
|
}))
|
|
612
615
|
};
|
|
613
616
|
}
|
|
614
|
-
if (data.xValue !== void 0 && data.yValue !== void 0) {
|
|
617
|
+
if (!data.independentIsCategory && data.xValue !== void 0 && data.yValue !== void 0) {
|
|
615
618
|
return {
|
|
616
|
-
type: "
|
|
619
|
+
type: "xy",
|
|
617
620
|
color: data.color,
|
|
618
621
|
colorGradient: data.colorGradient,
|
|
619
622
|
swatchColor: data.swatchColor,
|
|
620
623
|
label: data.label,
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
+
xLabel: data.xAxisTitle ?? "x",
|
|
625
|
+
yLabel: data.yAxisTitle ?? "y",
|
|
626
|
+
xValue: formatTooltipValue(data.xValue, locale),
|
|
627
|
+
yValue: formatTooltipValue(data.yValue, locale),
|
|
628
|
+
bubbleValue: data.bubbleValue != null ? formatTooltipValue(data.bubbleValue, locale) : void 0
|
|
624
629
|
};
|
|
625
630
|
}
|
|
626
631
|
return {
|
|
@@ -629,7 +634,7 @@ function buildTooltipContent(data, isSharedMode, opts = {}) {
|
|
|
629
634
|
colorGradient: data.colorGradient,
|
|
630
635
|
swatchColor: data.swatchColor,
|
|
631
636
|
label: data.label,
|
|
632
|
-
value: typeof formatted === "string" ? formatted : data.formattedValue ?? data.value,
|
|
637
|
+
value: typeof formatted === "string" ? formatted : data.formattedValue ?? (typeof data.value === "number" ? formatTooltipValue(data.value, locale) : data.value),
|
|
633
638
|
percentage: data.percentage != null ? +data.percentage.toFixed(1) : void 0
|
|
634
639
|
};
|
|
635
640
|
}
|
|
@@ -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;
|