@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,104 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { calculateRadiusAndCenter } from './chunk-NPDZLYIF.mjs';
|
|
4
|
-
import { computeSliceHoverEffects } from './chunk-BZN2QHGP.mjs';
|
|
5
|
-
import { DEFAULT_FALLBACK_COLOR } from './chunk-NKUYIWAP.mjs';
|
|
6
|
-
import { defaultLightTheme, isGradientColor, remapStopsForDonut, createCanvasGradientFromColor, resolveAccessor, makeItemContext, resolveDash, getColorValue, getColor } from './chunk-O2X6FF45.mjs';
|
|
7
|
-
import { withCanvasState } from './chunk-SSLTFJ3U.mjs';
|
|
1
|
+
import { calculateRadiusAndCenter } from './chunk-AJ24XDEK.mjs';
|
|
2
|
+
import { defaultLightTheme, resolveAccessor, makeItemContext, resolveDash, getColorValue, getColor } from './chunk-BDCNBS6W.mjs';
|
|
8
3
|
|
|
9
4
|
// src/circular/canvas.utils.ts
|
|
10
|
-
function renderCanvasSlices(ctx, frame, hoverConfig, theme) {
|
|
11
|
-
const { slices, center, fullCircle, hoverState } = frame;
|
|
12
|
-
const hasAnyHover = hoverState.index !== null;
|
|
13
|
-
for (const slice of slices) {
|
|
14
|
-
const angle = slice.endAngle - slice.rotation;
|
|
15
|
-
if (angle < 1e-3) continue;
|
|
16
|
-
const geo = computeSliceGeometry(slice, slice.rotation, frame);
|
|
17
|
-
withCanvasState(ctx, () => {
|
|
18
|
-
const arcConfig = {
|
|
19
|
-
rotation: geo.renderRotation,
|
|
20
|
-
endAngle: geo.renderRotation + geo.renderAngle,
|
|
21
|
-
outerRadius: geo.sliceOuterRadius,
|
|
22
|
-
innerRadius: geo.sliceInnerRadius,
|
|
23
|
-
borderRadius: slice.borderRadius
|
|
24
|
-
};
|
|
25
|
-
const cx = center.x + geo.offsetX;
|
|
26
|
-
const cy = center.y + geo.offsetY;
|
|
27
|
-
if (geo.scale !== 1) {
|
|
28
|
-
ctx.translate(cx, cy);
|
|
29
|
-
ctx.scale(geo.scale, geo.scale);
|
|
30
|
-
ctx.translate(-cx, -cy);
|
|
31
|
-
}
|
|
32
|
-
const { fillColor, opacity } = computeSliceHoverEffects(slice.color ?? DEFAULT_FALLBACK_COLOR, slice.borderColor ?? "transparent", slice.borderStrokeWidth ?? 0, geo.isHovered, hasAnyHover, hoverConfig, theme);
|
|
33
|
-
if (opacity < 1) {
|
|
34
|
-
ctx.globalAlpha = opacity;
|
|
35
|
-
}
|
|
36
|
-
drawCanvasArc(ctx, cx, cy, arcConfig, fullCircle);
|
|
37
|
-
const cv = slice.colorValue;
|
|
38
|
-
if (cv && isGradientColor(cv)) {
|
|
39
|
-
const gradientColor = geo.sliceInnerRadius > 0 && cv.radialGradient ? { ...cv, stops: remapStopsForDonut(cv.stops, geo.sliceInnerRadius / geo.sliceOuterRadius) } : cv;
|
|
40
|
-
ctx.fillStyle = createCanvasGradientFromColor(ctx, gradientColor, { x: cx, y: cy }, geo.sliceOuterRadius);
|
|
41
|
-
} else {
|
|
42
|
-
ctx.fillStyle = geo.isHovered && slice.hoverColor ? slice.hoverColor : fillColor;
|
|
43
|
-
}
|
|
44
|
-
ctx.fill();
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
const useInnerBorder = frame.borderAlign === "inner";
|
|
48
|
-
for (const slice of slices) {
|
|
49
|
-
const angle = slice.endAngle - slice.rotation;
|
|
50
|
-
if (angle < 1e-3) continue;
|
|
51
|
-
const baseBorderWidth = slice.borderStrokeWidth ?? 0;
|
|
52
|
-
const geo = computeSliceGeometry(slice, slice.rotation, frame);
|
|
53
|
-
const {
|
|
54
|
-
borderStrokeWidth,
|
|
55
|
-
borderColor: computedBorderColor,
|
|
56
|
-
borderDash: hoverBorderDash,
|
|
57
|
-
opacity
|
|
58
|
-
} = computeSliceHoverEffects(slice.color ?? DEFAULT_FALLBACK_COLOR, slice.borderColor ?? "transparent", baseBorderWidth, geo.isHovered, hasAnyHover, hoverConfig, theme);
|
|
59
|
-
const borderColor = geo.isHovered && slice.hoverBorderColor ? slice.hoverBorderColor : computedBorderColor;
|
|
60
|
-
if (borderStrokeWidth <= 0 || borderColor === "transparent") continue;
|
|
61
|
-
withCanvasState(ctx, () => {
|
|
62
|
-
const arcConfig = {
|
|
63
|
-
rotation: geo.renderRotation,
|
|
64
|
-
endAngle: geo.renderRotation + geo.renderAngle,
|
|
65
|
-
outerRadius: geo.sliceOuterRadius,
|
|
66
|
-
innerRadius: geo.sliceInnerRadius,
|
|
67
|
-
borderRadius: slice.borderRadius
|
|
68
|
-
};
|
|
69
|
-
const cx = center.x + geo.offsetX;
|
|
70
|
-
const cy = center.y + geo.offsetY;
|
|
71
|
-
if (opacity < 1) {
|
|
72
|
-
ctx.globalAlpha = opacity;
|
|
73
|
-
}
|
|
74
|
-
if (borderStrokeWidth > 0 && borderColor !== "transparent") {
|
|
75
|
-
ctx.strokeStyle = borderColor;
|
|
76
|
-
ctx.lineJoin = useInnerBorder ? "miter" : "round";
|
|
77
|
-
const activeDash = hoverBorderDash ?? slice.borderDash;
|
|
78
|
-
if (activeDash && activeDash.length > 0) {
|
|
79
|
-
ctx.setLineDash(activeDash);
|
|
80
|
-
ctx.lineDashOffset = slice.borderDashOffset ?? 0;
|
|
81
|
-
}
|
|
82
|
-
if (useInnerBorder) {
|
|
83
|
-
const PIXEL_MARGIN = CLIP_PIXEL_MARGIN;
|
|
84
|
-
const angleDelta = arcConfig.outerRadius > 0 ? PIXEL_MARGIN / arcConfig.outerRadius * (180 / Math.PI) : 0;
|
|
85
|
-
const expandedArc = {
|
|
86
|
-
...arcConfig,
|
|
87
|
-
rotation: arcConfig.rotation - angleDelta,
|
|
88
|
-
endAngle: arcConfig.endAngle + angleDelta
|
|
89
|
-
};
|
|
90
|
-
drawCanvasArc(ctx, cx, cy, expandedArc, fullCircle);
|
|
91
|
-
ctx.clip();
|
|
92
|
-
ctx.lineWidth = borderStrokeWidth * 2;
|
|
93
|
-
} else {
|
|
94
|
-
ctx.lineWidth = borderStrokeWidth;
|
|
95
|
-
}
|
|
96
|
-
drawCanvasArc(ctx, cx, cy, arcConfig, fullCircle);
|
|
97
|
-
ctx.stroke();
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
5
|
function buildHitTestStates(slices) {
|
|
103
6
|
const statesByDataset = /* @__PURE__ */ new Map();
|
|
104
7
|
for (const slice of slices) {
|
|
@@ -323,4 +226,4 @@ function calculateRingLayouts(datasets, isDatasetVisible, isItemVisible, baseInn
|
|
|
323
226
|
});
|
|
324
227
|
}
|
|
325
228
|
|
|
326
|
-
export { applyRingLayout, buildHitTestStates, buildPieSliceContentItems, buildPieVisibilityMap, buildRingTarget, buildSliceStyleData, calculateRingLayouts, computeSliceRadiusRatios
|
|
229
|
+
export { applyRingLayout, buildHitTestStates, buildPieSliceContentItems, buildPieVisibilityMap, buildRingTarget, buildSliceStyleData, calculateRingLayouts, computeSliceRadiusRatios };
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { calculatePolarLayout, hitTestPolar } from './chunk-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { renderResolvedLabels } from './chunk-
|
|
5
|
-
import { AnimatedScene, resolveAnimatedProps, POLAR_ANIMATABLE_PROPS } from './chunk-
|
|
6
|
-
import { reconcileSvgChildren } from './chunk-
|
|
7
|
-
import { parseAnimationConfig } from './chunk-
|
|
8
|
-
import { cancelRaf, raf } from './chunk-
|
|
9
|
-
import { buildAccessibilityRenderContext, generateSeriesDescription } from './chunk-
|
|
10
|
-
import { collectItems } from './chunk-
|
|
11
|
-
import { DEFAULT_HOVER_DIM_OPACITY, DEFAULT_HOVER_BRIGHTNESS } from './chunk-
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { setAttr, createSvgGroup, materializeSvgNode } from './chunk-
|
|
1
|
+
import { calculatePolarLayout, hitTestPolar } from './chunk-LJ6BXF3H.mjs';
|
|
2
|
+
import { resolveSharedRadialGrid } from './chunk-CFA2SUBF.mjs';
|
|
3
|
+
import { resolvePolarLabels } from './chunk-RH3OQ2VX.mjs';
|
|
4
|
+
import { renderResolvedLabels } from './chunk-G3DYNMWT.mjs';
|
|
5
|
+
import { AnimatedScene, resolveAnimatedProps, POLAR_ANIMATABLE_PROPS } from './chunk-JS47MSB2.mjs';
|
|
6
|
+
import { reconcileSvgChildren } from './chunk-FWNWV3H7.mjs';
|
|
7
|
+
import { parseAnimationConfig } from './chunk-LTQH3LQJ.mjs';
|
|
8
|
+
import { cancelRaf, raf } from './chunk-5WFF272M.mjs';
|
|
9
|
+
import { buildAccessibilityRenderContext, generateSeriesDescription } from './chunk-IFJPDARC.mjs';
|
|
10
|
+
import { collectItems } from './chunk-FRVJH7ZG.mjs';
|
|
11
|
+
import { DEFAULT_HOVER_DIM_OPACITY, DEFAULT_HOVER_BRIGHTNESS } from './chunk-6LUIVTNV.mjs';
|
|
12
|
+
import { defaultLightTheme, resolveSwatchColor, getDefaultColor } from './chunk-BDCNBS6W.mjs';
|
|
13
|
+
import { interpolateRadialGrid } from './chunk-CKQ4DNNJ.mjs';
|
|
14
|
+
import { setAttr, createSvgGroup, materializeSvgNode } from './chunk-BF7RP4A3.mjs';
|
|
15
15
|
|
|
16
16
|
// src/series/polar/controller/index.ts
|
|
17
17
|
var POLAR_BAR_REGISTRY = {
|
|
@@ -72,17 +72,23 @@ var PolarRendererController = class {
|
|
|
72
72
|
if (!this._hasPolarDatasets) {
|
|
73
73
|
this._layout = null;
|
|
74
74
|
this.lastRenderedLayout = null;
|
|
75
|
+
if (input.renderer === "svg" && this.svgGroup) {
|
|
76
|
+
while (this.svgGroup.firstChild) this.svgGroup.removeChild(this.svgGroup.firstChild);
|
|
77
|
+
}
|
|
75
78
|
return;
|
|
76
79
|
}
|
|
77
80
|
const sortedDatasets = Array.from(datasets.entries()).sort(([, a], [, b]) => a.order - b.order);
|
|
78
81
|
const polarEntries = collectItems(sortedDatasets, datasetVisibility).polar;
|
|
79
82
|
if (polarEntries.length === 0) {
|
|
80
83
|
this._layout = null;
|
|
84
|
+
if (input.renderer === "svg" && this.svgGroup) {
|
|
85
|
+
while (this.svgGroup.firstChild) this.svgGroup.removeChild(this.svgGroup.firstChild);
|
|
86
|
+
}
|
|
81
87
|
return;
|
|
82
88
|
}
|
|
83
89
|
const anyVisible = polarEntries.some((e) => e.visible);
|
|
84
90
|
if (!anyVisible) {
|
|
85
|
-
const liveCount = this._scene.
|
|
91
|
+
const liveCount = this._scene.elementCount;
|
|
86
92
|
if (liveCount === 0) {
|
|
87
93
|
this._layout = null;
|
|
88
94
|
this.lastRenderedLayout = null;
|
|
@@ -114,7 +120,7 @@ var PolarRendererController = class {
|
|
|
114
120
|
this._startAnimLoop();
|
|
115
121
|
} else {
|
|
116
122
|
this._scene.tick(performance.now());
|
|
117
|
-
if (this._scene.
|
|
123
|
+
if (this._scene.elementCount === 0) {
|
|
118
124
|
this._layout = null;
|
|
119
125
|
}
|
|
120
126
|
this._renderSceneFrame();
|
|
@@ -137,7 +143,10 @@ var PolarRendererController = class {
|
|
|
137
143
|
const fingerprint = targetLayout.bars.map((b) => `${polarBarKey(b)}:${b.value}:${Math.round(b.outerRadius)}:${Math.round(b.startAngle)}`).join("|") + `|dom:${targetLayout.domain[0]},${targetLayout.domain[1]}`;
|
|
138
144
|
const dataChanged = fingerprint !== this._lastFingerprint;
|
|
139
145
|
const shouldAnimate = animEnabled && duration > 0 && dataChanged;
|
|
140
|
-
if (!dataChanged)
|
|
146
|
+
if (!dataChanged) {
|
|
147
|
+
if (input.renderer === "canvas") input.requestRedraw?.();
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
141
150
|
const sceneTargets = /* @__PURE__ */ new Map();
|
|
142
151
|
for (const b of targetLayout.bars) {
|
|
143
152
|
sceneTargets.set(polarBarKey(b), b);
|
|
@@ -150,7 +159,8 @@ var PolarRendererController = class {
|
|
|
150
159
|
this._scene.diff(sceneTargets, opts);
|
|
151
160
|
this._lastFingerprint = fingerprint;
|
|
152
161
|
const tickCount = yAxes ? Array.from(yAxes.values())[0]?.props?.tickCount : void 0;
|
|
153
|
-
const
|
|
162
|
+
const targetInnerRadius = targetLayout.innerRadiusRatio * targetLayout.maxRadius;
|
|
163
|
+
const resolved = resolveSharedRadialGrid(targetLayout.grid, targetLayout.domain, targetLayout.rawDataMax, targetLayout.maxRadius, tickCount, targetInnerRadius);
|
|
154
164
|
const targetDomain = resolved.domain;
|
|
155
165
|
const prevSettled = this._lastSettledDomain;
|
|
156
166
|
const domainChanged = !prevSettled || prevSettled[0] !== targetDomain[0] || prevSettled[1] !== targetDomain[1];
|
|
@@ -161,6 +171,7 @@ var PolarRendererController = class {
|
|
|
161
171
|
toDomain: targetDomain,
|
|
162
172
|
targetGrid: { ...targetLayout.grid, levels: resolved.levelValues.length, levelValues: resolved.levelValues, levelRadii: resolved.levelRadii },
|
|
163
173
|
targetRadius: targetLayout.maxRadius,
|
|
174
|
+
targetInnerRadius,
|
|
164
175
|
startTime: -1,
|
|
165
176
|
duration,
|
|
166
177
|
easing
|
|
@@ -190,9 +201,22 @@ var PolarRendererController = class {
|
|
|
190
201
|
this.lastInput.requestRedraw?.();
|
|
191
202
|
}
|
|
192
203
|
}
|
|
204
|
+
/**
|
|
205
|
+
* Drop toggled-off datasets' bars from a layout before hit-testing. Both the
|
|
206
|
+
* all-hidden path (which keeps `_layout` anchored with the last-toggled
|
|
207
|
+
* dataset's full-thickness bars) and the no-animation path (which leaves a
|
|
208
|
+
* stale `lastRenderedLayout`) can present a hidden series' bars with
|
|
209
|
+
* `hidden: false`, so gate on the authoritative `datasetVisibility` rather
|
|
210
|
+
* than the layout's own flags (mirrors the radar fix).
|
|
211
|
+
*/
|
|
212
|
+
_gateHidden(layout) {
|
|
213
|
+
const vis = this.lastInput?.datasetVisibility;
|
|
214
|
+
if (!vis) return layout;
|
|
215
|
+
return { ...layout, bars: layout.bars.filter((b) => vis.get(b.datasetId) !== false) };
|
|
216
|
+
}
|
|
193
217
|
hitTest(x, y) {
|
|
194
218
|
if (!this._layout) return null;
|
|
195
|
-
return hitTestPolar(x, y, this._layout, this.lastInput?.theme ?? defaultLightTheme);
|
|
219
|
+
return hitTestPolar(x, y, this._gateHidden(this._layout), this.lastInput?.theme ?? defaultLightTheme);
|
|
196
220
|
}
|
|
197
221
|
/**
|
|
198
222
|
* Shared-mode lookup: find the wedge under the cursor, then return all
|
|
@@ -200,8 +224,9 @@ var PolarRendererController = class {
|
|
|
200
224
|
* cartesian bar/line shared tooltip).
|
|
201
225
|
*/
|
|
202
226
|
findAllNearest(x, y) {
|
|
203
|
-
const
|
|
204
|
-
if (!
|
|
227
|
+
const raw = this.lastRenderedLayout ?? this._layout;
|
|
228
|
+
if (!raw) return null;
|
|
229
|
+
const layout = this._gateHidden(raw);
|
|
205
230
|
const primary = hitTestPolar(x, y, layout, this.lastInput?.theme ?? defaultLightTheme);
|
|
206
231
|
if (!primary) return null;
|
|
207
232
|
const label = layout.categories[primary.index] ?? primary.label;
|
|
@@ -214,12 +239,13 @@ var PolarRendererController = class {
|
|
|
214
239
|
datasetId: bar.datasetId,
|
|
215
240
|
name: bar.name,
|
|
216
241
|
label,
|
|
217
|
-
color: bar.color ?? getDefaultColor(bar.
|
|
242
|
+
color: bar.color ?? getDefaultColor(bar.colorIndex, this.lastInput?.theme ?? defaultLightTheme),
|
|
218
243
|
colorGradient: gradColor,
|
|
219
|
-
swatchColor: resolveSwatchColor({ color: bar.color ?? gradColor }, bar.
|
|
244
|
+
swatchColor: resolveSwatchColor({ color: bar.color ?? gradColor }, bar.colorIndex, void 0, this.lastInput?.theme),
|
|
220
245
|
value: bar.value,
|
|
221
|
-
|
|
222
|
-
|
|
246
|
+
// No pre-formatted value: the HTML tooltip formats the raw value via
|
|
247
|
+
// `buildTooltipContent` (locale-aware, 2dp). Polar has no crosshair, so
|
|
248
|
+
// `cursorFormattedValue` is unused.
|
|
223
249
|
snapPixel: bar.outerRadius
|
|
224
250
|
});
|
|
225
251
|
}
|
|
@@ -319,7 +345,7 @@ var PolarRendererController = class {
|
|
|
319
345
|
if (!this._layout) return null;
|
|
320
346
|
const bars = [];
|
|
321
347
|
const hasOverrides = this._propertyOverrides.size > 0;
|
|
322
|
-
for (const el of this._scene.
|
|
348
|
+
for (const el of this._scene.elementValues()) {
|
|
323
349
|
const base = el.current;
|
|
324
350
|
const overrides = hasOverrides ? this._propertyOverrides.get(base.datasetId) : void 0;
|
|
325
351
|
bars.push(overrides ? { ...base, ...overrides } : { ...base });
|
|
@@ -331,7 +357,7 @@ var PolarRendererController = class {
|
|
|
331
357
|
const elapsed = now - this._gridLerp.startTime;
|
|
332
358
|
const raw = Math.max(0, Math.min(1, elapsed / this._gridLerp.duration));
|
|
333
359
|
const p = this._gridLerp.easing(raw);
|
|
334
|
-
grid = interpolateRadialGrid(this._gridLerp.fromDomain, this._gridLerp.toDomain, this._gridLerp.targetGrid, this._gridLerp.targetRadius, p);
|
|
360
|
+
grid = interpolateRadialGrid(this._gridLerp.fromDomain, this._gridLerp.toDomain, this._gridLerp.targetGrid, this._gridLerp.targetRadius, p, this._gridLerp.targetInnerRadius);
|
|
335
361
|
gridAnimating = true;
|
|
336
362
|
if (raw >= 1) {
|
|
337
363
|
this._lastSettledDomain = this._gridLerp.toDomain;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { formatTimeLabel, formatHitValue, formatCursorValue } from './chunk-
|
|
2
|
-
import { hitTestBar } from './chunk-
|
|
3
|
-
import { makeItemContext, resolveAccessor, getColor, resolveSwatchColor, asGradient } from './chunk-
|
|
1
|
+
import { formatTimeLabel, formatHitValue, formatCursorValue } from './chunk-HHBFQ6AI.mjs';
|
|
2
|
+
import { hitTestBar } from './chunk-DJOHDKTP.mjs';
|
|
3
|
+
import { makeItemContext, resolveAccessor, getColor, resolveSwatchColor, asGradient } from './chunk-BDCNBS6W.mjs';
|
|
4
|
+
import { resolveCartesianAccessors } from './chunk-G3DIMENH.mjs';
|
|
4
5
|
|
|
5
6
|
// src/cartesian/hittest-wrappers/bar.ts
|
|
6
7
|
function barHitTest(x, y, ctx) {
|
|
@@ -11,15 +12,16 @@ function barHitTest(x, y, ctx) {
|
|
|
11
12
|
const dataset = datasets.get(datasetId);
|
|
12
13
|
if (!dataset) continue;
|
|
13
14
|
const barProps = renderPropsCache.get(datasetId) ?? dataset.props;
|
|
15
|
+
const acc = resolveCartesianAccessors(barProps);
|
|
14
16
|
const hitIndex = hitTestBar(x, y, {}, layout);
|
|
15
17
|
if (hitIndex !== null) {
|
|
16
18
|
const item = barProps.data?.[hitIndex];
|
|
17
19
|
const hitCtx = makeItemContext(item, hitIndex);
|
|
18
|
-
const rawLabel = item ? String(resolveAccessor(
|
|
20
|
+
const rawLabel = item ? String(resolveAccessor(acc.independentField, hitCtx) ?? `Item ${hitIndex}`) : `Item ${hitIndex}`;
|
|
19
21
|
const label = formatTimeLabel(rawLabel, layoutData);
|
|
20
|
-
const value = item ? Number(resolveAccessor(
|
|
21
|
-
const color = typeof layout.colors[hitIndex] === "string" ? layout.colors[hitIndex] : getColor({ color: layout.colors[hitIndex] }, layout.
|
|
22
|
-
const swatchColor = resolveSwatchColor({ color: layout.colors[hitIndex] }, layout.
|
|
22
|
+
const value = item ? Number(resolveAccessor(acc.measureField, hitCtx) ?? 0) : 0;
|
|
23
|
+
const color = typeof layout.colors[hitIndex] === "string" ? layout.colors[hitIndex] : getColor({ color: layout.colors[hitIndex] }, layout.colorIndex, void 0, ctx.theme);
|
|
24
|
+
const swatchColor = resolveSwatchColor({ color: layout.colors[hitIndex] }, layout.colorIndex, void 0, ctx.theme);
|
|
23
25
|
let percentage;
|
|
24
26
|
if (layoutData.isPercentStacked && layoutData.categoryTotals) {
|
|
25
27
|
const catTotal = layoutData.categoryTotals[hitIndex];
|
|
@@ -43,7 +45,28 @@ function barHitTest(x, y, ctx) {
|
|
|
43
45
|
const displayValue = layoutData.isPercentStacked ? Math.round(value * 10) / 10 : value;
|
|
44
46
|
const formattedValue = formatHitValue(displayValue, barProps, orientation, layoutData);
|
|
45
47
|
const cursorFormattedValue = formatCursorValue(x, y, barProps, orientation, layoutData);
|
|
46
|
-
|
|
48
|
+
const xyExtra = acc.independentIsCategory ? {} : {
|
|
49
|
+
xValue: item ? Number(resolveAccessor(acc.independentField, hitCtx)) : hitIndex,
|
|
50
|
+
yValue: value,
|
|
51
|
+
xAxisTitle: layoutData.xAxisLayout?.title?.text,
|
|
52
|
+
yAxisTitle: layoutData.yAxisLayout?.title?.text
|
|
53
|
+
};
|
|
54
|
+
return {
|
|
55
|
+
datasetId,
|
|
56
|
+
index: hitIndex,
|
|
57
|
+
label,
|
|
58
|
+
value,
|
|
59
|
+
color,
|
|
60
|
+
colorGradient: asGradient(layout.colors[hitIndex]),
|
|
61
|
+
swatchColor,
|
|
62
|
+
percentage,
|
|
63
|
+
snapX,
|
|
64
|
+
snapY,
|
|
65
|
+
formattedValue,
|
|
66
|
+
cursorFormattedValue,
|
|
67
|
+
independentIsCategory: acc.independentIsCategory,
|
|
68
|
+
...xyExtra
|
|
69
|
+
};
|
|
47
70
|
}
|
|
48
71
|
}
|
|
49
72
|
return null;
|
|
@@ -80,11 +103,12 @@ function barFindNearest(x, y, ctx) {
|
|
|
80
103
|
if (dist < bestDist) {
|
|
81
104
|
bestDist = dist;
|
|
82
105
|
const barProps = renderPropsCache.get(datasetId) ?? dataset.props;
|
|
106
|
+
const acc = resolveCartesianAccessors(barProps);
|
|
83
107
|
const item = barProps.data?.[nearestCatIdx];
|
|
84
108
|
const nearCtx = makeItemContext(item, nearestCatIdx);
|
|
85
|
-
const rawLabel = item ? String(resolveAccessor(
|
|
109
|
+
const rawLabel = item ? String(resolveAccessor(acc.independentField, nearCtx) ?? `Item ${nearestCatIdx}`) : `Item ${nearestCatIdx}`;
|
|
86
110
|
const label = formatTimeLabel(rawLabel, layoutData);
|
|
87
|
-
const value = item ? Number(resolveAccessor(
|
|
111
|
+
const value = item ? Number(resolveAccessor(acc.measureField, nearCtx) ?? 0) : 0;
|
|
88
112
|
const color = typeof layout.colors[nearestCatIdx] === "string" ? layout.colors[nearestCatIdx] : getColor({ color: layout.colors[nearestCatIdx] }, layout.datasetIndex, void 0, ctx.theme);
|
|
89
113
|
const swatchColor = resolveSwatchColor({ color: layout.colors[nearestCatIdx] }, layout.datasetIndex, void 0, ctx.theme);
|
|
90
114
|
let snapX;
|
|
@@ -137,11 +161,12 @@ function barFindAllNearest(x, y, ctx) {
|
|
|
137
161
|
const dataset = datasets.get(datasetId);
|
|
138
162
|
if (!dataset) continue;
|
|
139
163
|
const barProps = renderPropsCache.get(datasetId) ?? dataset.props;
|
|
164
|
+
const acc = resolveCartesianAccessors(barProps);
|
|
140
165
|
const item = barProps.data?.[nearestCatIdx];
|
|
141
166
|
const nearCtx2 = makeItemContext(item, nearestCatIdx);
|
|
142
|
-
const rawLabel = item ? String(resolveAccessor(
|
|
167
|
+
const rawLabel = item ? String(resolveAccessor(acc.independentField, nearCtx2) ?? `Item ${nearestCatIdx}`) : `Item ${nearestCatIdx}`;
|
|
143
168
|
const label = formatTimeLabel(rawLabel, layoutData);
|
|
144
|
-
const value = item ? Number(resolveAccessor(
|
|
169
|
+
const value = item ? Number(resolveAccessor(acc.measureField, nearCtx2) ?? 0) : 0;
|
|
145
170
|
const color = typeof layout.colors[nearestCatIdx] === "string" ? layout.colors[nearestCatIdx] : getColor({ color: layout.colors[nearestCatIdx] }, layout.datasetIndex, void 0, ctx.theme);
|
|
146
171
|
const colorGradient = asGradient(layout.colors[nearestCatIdx]);
|
|
147
172
|
const swatchColor = resolveSwatchColor({ color: layout.colors[nearestCatIdx] }, layout.datasetIndex, void 0, ctx.theme);
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { toRad } from './chunk-RQ3CKQOX.mjs';
|
|
1
|
+
import { computeSlices, isFullCircle, findSliceAtPoint } from './chunk-4S3FOFCN.mjs';
|
|
2
|
+
import { calculateRadiusAndCenter } from './chunk-AJ24XDEK.mjs';
|
|
3
|
+
import { isIndexVisible } from './chunk-JQVX6XFW.mjs';
|
|
4
|
+
import { computeItemHoverState, applyHoverEffects } from './chunk-F6AGZQDA.mjs';
|
|
5
|
+
import { FIELD_DEFAULTS, batchResolveRequired, batchResolveAccessor, resolveAccessor, makeItemContext, getDefaultColor, resolveDash } from './chunk-BDCNBS6W.mjs';
|
|
6
|
+
import { toRad } from './chunk-K7AGQTVK.mjs';
|
|
8
7
|
|
|
9
8
|
// src/series/pie/geometry.ts
|
|
10
9
|
var DEFAULT_START_ANGLE = -90;
|
|
@@ -179,12 +178,101 @@ function applyRingLayoutToProps(props, ringLayout) {
|
|
|
179
178
|
};
|
|
180
179
|
}
|
|
181
180
|
|
|
182
|
-
// src/series/pie/
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
};
|
|
181
|
+
// src/series/pie/shared.ts
|
|
182
|
+
function computeSliceRenderStates(props, layout, theme) {
|
|
183
|
+
const { interaction, effects } = props;
|
|
184
|
+
const { visibleSlices, center, outerRadius, innerRadius, colors, borderColors, isFullCircle: fullCircle } = layout;
|
|
185
|
+
const borderWidth = typeof props.borderStrokeWidth === "number" ? props.borderStrokeWidth : 0;
|
|
186
|
+
const dataArr = props.data ?? [];
|
|
187
|
+
const seriesExtras = { seriesIndex: props.order ?? 0, seriesId: props.id ?? "" };
|
|
188
|
+
const valueAccessor = props.valueField ?? FIELD_DEFAULTS.valueField;
|
|
189
|
+
const categoryAccessor = props.categoryField ?? props.labelField ?? FIELD_DEFAULTS.categoryField;
|
|
190
|
+
const ctxFor = (i) => {
|
|
191
|
+
const value = valueAccessor ? resolveAccessor(valueAccessor, makeItemContext(dataArr[i], i)) ?? null : null;
|
|
192
|
+
const category = categoryAccessor ? resolveAccessor(categoryAccessor, makeItemContext(dataArr[i], i)) ?? void 0 : void 0;
|
|
193
|
+
return makeItemContext(dataArr[i], i, { value, category, ...seriesExtras });
|
|
194
|
+
};
|
|
195
|
+
const resolveSliceBorderDash = (i) => resolveDash(props.borderDash, ctxFor(i));
|
|
196
|
+
const resolveSliceBorderDashOffset = (i) => resolveAccessor(props.borderDashOffset, ctxFor(i), { arrayMode: "clip", fallback: 0 }) ?? 0;
|
|
197
|
+
const resolveSliceOpacity = (i) => resolveAccessor(props.opacity, ctxFor(i), { arrayMode: "clip" });
|
|
198
|
+
const resolveSliceHoverColor = (i) => resolveAccessor(props.hoverColor, ctxFor(i), { arrayMode: "cycle" });
|
|
199
|
+
const resolveSliceHoverBorderColor = (i) => resolveAccessor(props.hoverBorderColor, ctxFor(i), { arrayMode: "cycle" });
|
|
200
|
+
const resolveSliceOffset = (i) => resolveAccessor(props.offset, ctxFor(i), { arrayMode: "clip", fallback: 0 }) ?? 0;
|
|
201
|
+
const borderRadius = typeof props.borderRadius === "number" ? props.borderRadius : typeof props.borderRadius === "object" && props.borderRadius !== null && !Array.isArray(props.borderRadius) ? props.borderRadius : void 0;
|
|
202
|
+
const hoverEnabled = effects !== void 0;
|
|
203
|
+
const slices = visibleSlices.map((slice) => {
|
|
204
|
+
const dataIndex = slice.dataIndex;
|
|
205
|
+
const userFill = colors[dataIndex];
|
|
206
|
+
const borderColor = borderColors[dataIndex];
|
|
207
|
+
const canvasFill = userFill ?? getDefaultColor(dataIndex, theme);
|
|
208
|
+
const hoverState = computeItemHoverState(dataIndex, interaction?.hoveredIndex, hoverEnabled);
|
|
209
|
+
const isInactive = hoverState.hasAnyHover && !hoverState.isHovered;
|
|
210
|
+
const itemHoverColor = resolveSliceHoverColor(dataIndex);
|
|
211
|
+
const itemHoverBorderColor = resolveSliceHoverBorderColor(dataIndex);
|
|
212
|
+
const itemEffects = hoverEnabled && effects && (itemHoverColor !== void 0 || itemHoverBorderColor !== void 0) ? {
|
|
213
|
+
...effects,
|
|
214
|
+
hoverBackgroundColor: itemHoverColor ?? effects.hoverBackgroundColor,
|
|
215
|
+
hoverBorderColor: itemHoverBorderColor ?? effects.hoverBorderColor
|
|
216
|
+
} : hoverEnabled ? effects : void 0;
|
|
217
|
+
const {
|
|
218
|
+
color: effectColor,
|
|
219
|
+
opacity: hoverOpacity,
|
|
220
|
+
borderColor: effectBorderColor,
|
|
221
|
+
borderStrokeWidth: effectBorderWidth,
|
|
222
|
+
borderDash: effectBorderDash,
|
|
223
|
+
borderDashOffset: effectBorderDashOffset
|
|
224
|
+
} = applyHoverEffects(canvasFill, borderColor, borderWidth, resolveSliceBorderDash(dataIndex), resolveSliceBorderDashOffset(dataIndex), hoverState, itemEffects, theme);
|
|
225
|
+
const userOpacity = resolveSliceOpacity(dataIndex);
|
|
226
|
+
const opacity = userOpacity !== void 0 ? hoverOpacity * userOpacity : hoverOpacity;
|
|
227
|
+
const finalEffectColor = effectColor;
|
|
228
|
+
const baseSliceOffset = resolveSliceOffset(dataIndex);
|
|
229
|
+
const offset = baseSliceOffset > 0 || hoverEnabled && effects ? calculateSliceOffset(slice, hoverState.isHovered, hoverEnabled ? effects : void 0, baseSliceOffset) : { dx: 0, dy: 0 };
|
|
230
|
+
const scale = hoverEnabled && hoverState.isHovered && effects?.hoverScale ? effects.hoverScale : 1;
|
|
231
|
+
const arcConfig = {
|
|
232
|
+
rotation: slice.rotation,
|
|
233
|
+
endAngle: slice.endAngle,
|
|
234
|
+
outerRadius,
|
|
235
|
+
innerRadius,
|
|
236
|
+
borderRadius
|
|
237
|
+
};
|
|
238
|
+
return {
|
|
239
|
+
slice,
|
|
240
|
+
dataIndex,
|
|
241
|
+
effectColor: finalEffectColor,
|
|
242
|
+
effectBorderColor,
|
|
243
|
+
effectBorderWidth,
|
|
244
|
+
effectBorderDash,
|
|
245
|
+
effectBorderDashOffset,
|
|
246
|
+
opacity,
|
|
247
|
+
// SVG state — class composition + inline overrides
|
|
248
|
+
userFill,
|
|
249
|
+
userBorder: borderColor === "transparent" ? void 0 : borderColor,
|
|
250
|
+
isInactive,
|
|
251
|
+
offset,
|
|
252
|
+
scale,
|
|
253
|
+
arcConfig,
|
|
254
|
+
isHovered: hoverState.isHovered
|
|
255
|
+
};
|
|
256
|
+
});
|
|
257
|
+
return {
|
|
258
|
+
slices,
|
|
259
|
+
center,
|
|
260
|
+
outerRadius,
|
|
261
|
+
innerRadius,
|
|
262
|
+
isFullCircle: fullCircle
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
function calculateSliceOffset(slice, isHovered, effects, baseOffset = 0) {
|
|
266
|
+
let offset = baseOffset;
|
|
267
|
+
if (isHovered && effects?.hoverOffset) {
|
|
268
|
+
offset = Math.max(offset, effects.hoverOffset);
|
|
269
|
+
}
|
|
270
|
+
if (offset === 0) return { dx: 0, dy: 0 };
|
|
271
|
+
const angleRad = toRad(slice.valueAngle);
|
|
272
|
+
return {
|
|
273
|
+
dx: Math.cos(angleRad) * offset,
|
|
274
|
+
dy: Math.sin(angleRad) * offset
|
|
275
|
+
};
|
|
276
|
+
}
|
|
189
277
|
|
|
190
|
-
export { applyRingLayoutToProps, calculateMultiRingLayout, calculatePieLayout,
|
|
278
|
+
export { applyRingLayoutToProps, calculateMultiRingLayout, calculatePieLayout, computeSliceRenderStates, hitTestPie };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DEFAULT_FALLBACK_COLOR } from './chunk-
|
|
2
|
-
import { getPrimaryColor } from './chunk-
|
|
1
|
+
import { DEFAULT_FALLBACK_COLOR } from './chunk-6LUIVTNV.mjs';
|
|
2
|
+
import { getPrimaryColor } from './chunk-BDCNBS6W.mjs';
|
|
3
3
|
|
|
4
4
|
// src/cartesian/marker-overlay.utils.ts
|
|
5
5
|
function literalSeriesColor(c) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { DEFAULT_SCATTER_HIT_RADIUS, SCATTER_SPATIAL_INDEX_THRESHOLD } from './chunk-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { DEFAULT_SCATTER_HIT_RADIUS, SCATTER_SPATIAL_INDEX_THRESHOLD } from './chunk-6LUIVTNV.mjs';
|
|
2
|
+
import { getDefaultColor, resolveSwatchColor, asGradient, getPrimaryColor } from './chunk-BDCNBS6W.mjs';
|
|
3
|
+
import { buildQuadtree } from './chunk-KMKULH54.mjs';
|
|
4
|
+
import { resolveCartesianAccessors } from './chunk-G3DIMENH.mjs';
|
|
4
5
|
|
|
5
6
|
// src/cartesian/hittest-wrappers/scatter.ts
|
|
6
7
|
function scatterHitTest(x, y, ctx) {
|
|
@@ -9,7 +10,7 @@ function scatterHitTest(x, y, ctx) {
|
|
|
9
10
|
for (const [datasetId, scatterLayout] of ctx.layouts) {
|
|
10
11
|
if (!ctx.renderPropsCache.has(datasetId)) continue;
|
|
11
12
|
let hitPoint = null;
|
|
12
|
-
const layoutDefaultColor = scatterLayout.seriesColor ?? getDefaultColor(scatterLayout.
|
|
13
|
+
const layoutDefaultColor = scatterLayout.seriesColor ?? getDefaultColor(scatterLayout.colorIndex, ctx.theme);
|
|
13
14
|
const scatterProps = ctx.renderPropsCache.get(datasetId);
|
|
14
15
|
const configuredHitRadius = scatterProps?.pointHitRadius ?? DEFAULT_SCATTER_HIT_RADIUS;
|
|
15
16
|
if (scatterLayout.visiblePoints.length > SCATTER_SPATIAL_INDEX_THRESHOLD) {
|
|
@@ -35,9 +36,10 @@ function scatterHitTest(x, y, ctx) {
|
|
|
35
36
|
py: pt.py,
|
|
36
37
|
xValue: pt.xValue,
|
|
37
38
|
yValue: pt.yValue,
|
|
39
|
+
category: pt.category,
|
|
38
40
|
sizeValue: pt.sizeValue,
|
|
39
41
|
color: pt.color ?? layoutDefaultColor,
|
|
40
|
-
swatchColor: resolveSwatchColor({ color: pt.color ?? scatterLayout.seriesColor }, scatterLayout.
|
|
42
|
+
swatchColor: resolveSwatchColor({ color: pt.color ?? scatterLayout.seriesColor }, scatterLayout.colorIndex, void 0, ctx.theme),
|
|
41
43
|
distSq: result.distSq
|
|
42
44
|
};
|
|
43
45
|
}
|
|
@@ -55,9 +57,10 @@ function scatterHitTest(x, y, ctx) {
|
|
|
55
57
|
py: pt.py,
|
|
56
58
|
xValue: pt.xValue,
|
|
57
59
|
yValue: pt.yValue,
|
|
60
|
+
category: pt.category,
|
|
58
61
|
sizeValue: pt.sizeValue,
|
|
59
62
|
color: pt.color ?? layoutDefaultColor,
|
|
60
|
-
swatchColor: resolveSwatchColor({ color: pt.color ?? scatterLayout.seriesColor }, scatterLayout.
|
|
63
|
+
swatchColor: resolveSwatchColor({ color: pt.color ?? scatterLayout.seriesColor }, scatterLayout.colorIndex, void 0, ctx.theme),
|
|
61
64
|
distSq
|
|
62
65
|
};
|
|
63
66
|
}
|
|
@@ -65,13 +68,18 @@ function scatterHitTest(x, y, ctx) {
|
|
|
65
68
|
}
|
|
66
69
|
if (hitPoint && hitPoint.distSq < bestDistSq) {
|
|
67
70
|
bestDistSq = hitPoint.distSq;
|
|
68
|
-
const
|
|
71
|
+
const scatterRenderProps = ctx.renderPropsCache.get(datasetId);
|
|
72
|
+
const seriesName = scatterRenderProps?.name ?? datasetId;
|
|
73
|
+
const independentIsCategory = scatterRenderProps ? resolveCartesianAccessors(scatterRenderProps).independentIsCategory : false;
|
|
74
|
+
const label = independentIsCategory && hitPoint.category != null ? hitPoint.category : seriesName;
|
|
69
75
|
bestResult = {
|
|
70
76
|
datasetId,
|
|
71
77
|
index: hitPoint.dataIndex,
|
|
72
|
-
label
|
|
78
|
+
label,
|
|
73
79
|
xValue: hitPoint.xValue,
|
|
74
80
|
yValue: hitPoint.yValue,
|
|
81
|
+
category: hitPoint.category,
|
|
82
|
+
independentIsCategory,
|
|
75
83
|
...hitPoint.sizeValue != null ? { bubbleValue: hitPoint.sizeValue } : {},
|
|
76
84
|
x: hitPoint.px,
|
|
77
85
|
y: hitPoint.py,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { drawMarkerCanvas } from './chunk-
|
|
2
|
-
import { DEFAULT_HOVER_POINT_RADIUS_MULTIPLIER, DEFAULT_LINE_MARKER_SIZE } from './chunk-
|
|
3
|
-
import { getDefaultColor, createCanvasGradientFromColor, makeItemContext, resolveDash, resolveAccessor, sampleGradientAt, getPrimaryColor } from './chunk-
|
|
4
|
-
import { createCanvasPathBuilder, traceClosedSpline } from './chunk-
|
|
5
|
-
import { adjustBrightness, withCanvasState } from './chunk-
|
|
1
|
+
import { drawMarkerCanvas } from './chunk-QIYJUZ7I.mjs';
|
|
2
|
+
import { DEFAULT_HOVER_POINT_RADIUS_MULTIPLIER, DEFAULT_LINE_MARKER_SIZE } from './chunk-6LUIVTNV.mjs';
|
|
3
|
+
import { getDefaultColor, createCanvasGradientFromColor, makeItemContext, resolveDash, resolveAccessor, sampleGradientAt, getPrimaryColor } from './chunk-BDCNBS6W.mjs';
|
|
4
|
+
import { createCanvasPathBuilder, traceClosedSpline } from './chunk-PXUXZADY.mjs';
|
|
5
|
+
import { adjustBrightness, withCanvasState } from './chunk-BF7RP4A3.mjs';
|
|
6
6
|
|
|
7
7
|
// src/series/radar/canvas/index.ts
|
|
8
8
|
function renderRadarSeriesCanvas(ctx, layout, seriesIndex, hoverState, effectConfig, seriesProps, theme) {
|
|
@@ -16,7 +16,7 @@ function renderRadarSeriesCanvas(ctx, layout, seriesIndex, hoverState, effectCon
|
|
|
16
16
|
if (anyHover && !isSharedHover && !isSeriesHovered && effectConfig?.dimOpacity !== void 0) {
|
|
17
17
|
seriesOpacity = effectConfig.dimOpacity;
|
|
18
18
|
}
|
|
19
|
-
const baseColor = sd.color ?? getDefaultColor(sd.
|
|
19
|
+
const baseColor = sd.color ?? getDefaultColor(sd.colorIndex, theme);
|
|
20
20
|
let fillColor = baseColor;
|
|
21
21
|
let strokeColor = baseColor;
|
|
22
22
|
if (!isSharedHover && isSeriesHovered && effectConfig?.hoverBrightness) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { handleSyncedHighlightCartesian, handleSyncedHighlightRect, handleSyncedHighlightRadial, buildDatasetRegistrations } from './chunk-
|
|
1
|
+
import { handleSyncedHighlightCartesian, handleSyncedHighlightRect, handleSyncedHighlightRadial, buildDatasetRegistrations } from './chunk-K44SD67H.mjs';
|
|
2
2
|
|
|
3
3
|
// src/sync/SyncBus.ts
|
|
4
4
|
function resolveAxis(value, fallback) {
|
|
@@ -270,9 +270,9 @@ var ChartSyncCoordinator = class {
|
|
|
270
270
|
if (options.getIsCartesian()) {
|
|
271
271
|
options.applyHighlight(handleSyncedHighlightCartesian(normalizedEvent, options.getRendererDelegate(), options.getHasCrosshair(), options.getIsSharedMode(), datasets));
|
|
272
272
|
} else if (options.getIsRect() && event.categoryIndex != null) {
|
|
273
|
-
options.applyHighlight(handleSyncedHighlightRect(normalizedEvent, datasets, width, height));
|
|
273
|
+
options.applyHighlight(handleSyncedHighlightRect(normalizedEvent, datasets, width, height, this.prevVisibility));
|
|
274
274
|
} else if (event.categoryIndex != null) {
|
|
275
|
-
options.applyHighlight(handleSyncedHighlightRadial(normalizedEvent, datasets, options.getRendererDelegate(), width, height));
|
|
275
|
+
options.applyHighlight(handleSyncedHighlightRadial(normalizedEvent, datasets, options.getRendererDelegate(), width, height, this.prevVisibility));
|
|
276
276
|
}
|
|
277
277
|
})
|
|
278
278
|
);
|