@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,8 +1,9 @@
|
|
|
1
|
-
import { resolveBorderRadius, clampRectBorderRadius, isUniformBorderRadius, hasBorderRadius } from './chunk-
|
|
2
|
-
import { isIndexVisible } from './chunk-
|
|
3
|
-
import { computeItemHoverState, applyHoverEffects } from './chunk-
|
|
4
|
-
import { batchResolveRequired, batchResolveAccessor, resolveAccessor, makeItemContext, getDefaultColor, resolveDash } from './chunk-
|
|
5
|
-
import {
|
|
1
|
+
import { resolveBorderRadius, clampRectBorderRadius, isUniformBorderRadius, hasBorderRadius } from './chunk-F2E2QCZM.mjs';
|
|
2
|
+
import { isIndexVisible } from './chunk-JQVX6XFW.mjs';
|
|
3
|
+
import { computeItemHoverState, applyHoverEffects } from './chunk-F6AGZQDA.mjs';
|
|
4
|
+
import { batchResolveRequired, batchResolveAccessor, resolveAccessor, makeItemContext, getDefaultColor, resolveDash } from './chunk-BDCNBS6W.mjs';
|
|
5
|
+
import { resolveCartesianAccessors } from './chunk-G3DIMENH.mjs';
|
|
6
|
+
import { calculateNiceDomain, createBandScale, createLinearScale } from './chunk-K7AGQTVK.mjs';
|
|
6
7
|
|
|
7
8
|
// src/series/bar/shared.ts
|
|
8
9
|
var EDGES = ["top", "right", "bottom", "left"];
|
|
@@ -75,7 +76,6 @@ function tracePartialBorder(pb, x, y, w, h, skipped, radius) {
|
|
|
75
76
|
}
|
|
76
77
|
|
|
77
78
|
// src/series/bar/geom/layout.ts
|
|
78
|
-
var DEFAULT_ORIENTATION = "vertical";
|
|
79
79
|
var DEFAULT_BASE = 0;
|
|
80
80
|
function resolveSkippedEdges(borderSkipped, orientation, isNegative) {
|
|
81
81
|
if (borderSkipped === false || borderSkipped === void 0) return EMPTY_EDGE_SET;
|
|
@@ -99,13 +99,15 @@ function resolveSkippedEdges(borderSkipped, orientation, isNegative) {
|
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
101
|
function calculateBarLayout(props, chartArea, config) {
|
|
102
|
-
const { data,
|
|
103
|
-
const
|
|
104
|
-
const
|
|
102
|
+
const { data, color: colorProp, visibility } = props;
|
|
103
|
+
const acc = resolveCartesianAccessors(props);
|
|
104
|
+
const orientation = acc.orientation;
|
|
105
|
+
const categoryAccessor = acc.independentField;
|
|
106
|
+
const valueAccessor = acc.measureField;
|
|
105
107
|
const openAccessor = props.openField;
|
|
106
108
|
const base = props.base ?? DEFAULT_BASE;
|
|
107
109
|
const categories = categoryAccessor ? batchResolveRequired(categoryAccessor, data, "categoryField") : data.map((_, i) => String(i));
|
|
108
|
-
const values = valueAccessor ? batchResolveRequired(valueAccessor, data, "valueField") :
|
|
110
|
+
const values = valueAccessor ? batchResolveRequired(valueAccessor, data, "valueField") : [];
|
|
109
111
|
const openValues = openAccessor ? batchResolveAccessor(openAccessor, data) : void 0;
|
|
110
112
|
let valueDomain;
|
|
111
113
|
let categoryScale;
|
|
@@ -124,6 +126,9 @@ function calculateBarLayout(props, chartArea, config) {
|
|
|
124
126
|
valueScale = createLinearScale(valueDomain, [chartArea.x, chartArea.x + chartArea.width]);
|
|
125
127
|
}
|
|
126
128
|
}
|
|
129
|
+
if (!valueAccessor) {
|
|
130
|
+
return { bars: [], visibleBars: [], categoryScale, valueScale, orientation, colors: [], borderColors: [], chartArea, valueDomain, base, openValues };
|
|
131
|
+
}
|
|
127
132
|
const borderColorProp = props.borderColor;
|
|
128
133
|
const seriesExtras = { seriesIndex: props.order ?? 0, seriesId: props.id ?? "" };
|
|
129
134
|
const bars = [];
|
|
@@ -315,6 +320,7 @@ function computeBarRenderStates(props, layout, theme) {
|
|
|
315
320
|
const isSeriesDimmed = interaction?.isSeriesDimmed ?? false;
|
|
316
321
|
const isSeriesHovered = interaction?.isSeriesHovered ?? false;
|
|
317
322
|
const seriesIdx = props.order ?? 0;
|
|
323
|
+
const colorIndex = layout.colorIndex;
|
|
318
324
|
const seriesExtras = { seriesIndex: seriesIdx, seriesId: props.id ?? "" };
|
|
319
325
|
const bars = visibleBars.map((bar) => {
|
|
320
326
|
const { dataIndex, width, height, isNegative } = bar;
|
|
@@ -323,7 +329,7 @@ function computeBarRenderStates(props, layout, theme) {
|
|
|
323
329
|
const borderColor = borderColors[dataIndex];
|
|
324
330
|
const borderWidth = resolveBarBorderWidth(ctx);
|
|
325
331
|
const resolvedRadius = resolveBorderRadius(resolveBarBorderRadius(ctx));
|
|
326
|
-
const canvasFill = userFill ?? getDefaultColor(
|
|
332
|
+
const canvasFill = userFill ?? getDefaultColor(colorIndex, theme);
|
|
327
333
|
let hoverState;
|
|
328
334
|
if (hoverEnabled && isSeriesDimmed) {
|
|
329
335
|
hoverState = { isHovered: false, hasAnyHover: true };
|
|
@@ -378,6 +384,7 @@ function computeBarRenderStates(props, layout, theme) {
|
|
|
378
384
|
hoverColorOverride: itemEffects?.hoverBackgroundColor,
|
|
379
385
|
userBorder: borderColor === "transparent" ? void 0 : borderColor,
|
|
380
386
|
seriesIdx,
|
|
387
|
+
colorIndex,
|
|
381
388
|
isHovered: hoverState.isHovered,
|
|
382
389
|
isInactive,
|
|
383
390
|
drawX: bar.x + offsetX - (drawWidth - width) / 2,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { CHAR_WIDTH_RATIO, formatCompactValue, measureFontMetrics } from './chunk-
|
|
2
|
-
import { resolveColorScaleRange, interpolateColor } from './chunk-
|
|
3
|
-
import { FIELD_DEFAULTS, batchResolveAccessor } from './chunk-
|
|
4
|
-
import { hexToRgbString } from './chunk-
|
|
1
|
+
import { CHAR_WIDTH_RATIO, formatCompactValue, measureFontMetrics } from './chunk-56MASQS2.mjs';
|
|
2
|
+
import { resolveColorScaleRange, interpolateColor } from './chunk-RI32WIDX.mjs';
|
|
3
|
+
import { FIELD_DEFAULTS, batchResolveAccessor } from './chunk-BDCNBS6W.mjs';
|
|
4
|
+
import { hexToRgbString } from './chunk-BF7RP4A3.mjs';
|
|
5
5
|
|
|
6
6
|
// src/series/heatmap/geometry.ts
|
|
7
7
|
var DEFAULT_HEATMAP_NULL_COLOR = "#f3f4f6";
|
|
@@ -27,7 +27,7 @@ function getHeatmapLabelInfo(cell) {
|
|
|
27
27
|
return { fontSize: 0, show: false };
|
|
28
28
|
}
|
|
29
29
|
function calculateHeatmapLayout(props, chartArea, scales, theme) {
|
|
30
|
-
const { data,
|
|
30
|
+
const { data, categoryXField: xField = FIELD_DEFAULTS.columnField, categoryYField: yField = FIELD_DEFAULTS.rowField, valueField = FIELD_DEFAULTS.valueField } = props;
|
|
31
31
|
const { xScale, yScale } = scales;
|
|
32
32
|
const cellPadding = props.spacing ?? DEFAULT_HEATMAP_CELL_PADDING;
|
|
33
33
|
const showEmptyCells = props.showEmptyCells !== false;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { barHitTest, barFindNearest, barFindAllNearest } from './chunk-
|
|
2
|
-
import { animatableBarToComputedBar } from './chunk-
|
|
3
|
-
import { registerDatasetLayers, triggerCompositorRepaint } from './chunk-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { computeBarVisualLayout } from './chunk-
|
|
7
|
-
import { AnimatedScene, resolveAnimatedProps, BAR_ANIMATABLE_PROPS } from './chunk-
|
|
8
|
-
import { reconcileSvgChildren } from './chunk-
|
|
9
|
-
import { parseAnimationConfig } from './chunk-
|
|
10
|
-
import { cancelRaf, raf } from './chunk-
|
|
11
|
-
import { hoverConfigToFullEffect } from './chunk-
|
|
12
|
-
import { generateSeriesDescription } from './chunk-
|
|
13
|
-
import { collectItems } from './chunk-
|
|
14
|
-
import { defaultLightTheme } from './chunk-
|
|
15
|
-
import { setAttr, createSvgGroup, svgNode, appendChild, createSvgRect, materializeSvgNode } from './chunk-
|
|
1
|
+
import { barHitTest, barFindNearest, barFindAllNearest } from './chunk-TW3KLJVO.mjs';
|
|
2
|
+
import { animatableBarToComputedBar } from './chunk-ZZCVDIU5.mjs';
|
|
3
|
+
import { registerDatasetLayers, triggerCompositorRepaint } from './chunk-MT3OLVZC.mjs';
|
|
4
|
+
import { renderResolvedLabels } from './chunk-G3DYNMWT.mjs';
|
|
5
|
+
import { resolveBarLabels } from './chunk-7IKKWWRT.mjs';
|
|
6
|
+
import { computeBarVisualLayout } from './chunk-LBNP5PJA.mjs';
|
|
7
|
+
import { AnimatedScene, resolveAnimatedProps, BAR_ANIMATABLE_PROPS } from './chunk-JS47MSB2.mjs';
|
|
8
|
+
import { reconcileSvgChildren } from './chunk-FWNWV3H7.mjs';
|
|
9
|
+
import { parseAnimationConfig } from './chunk-LTQH3LQJ.mjs';
|
|
10
|
+
import { cancelRaf, raf } from './chunk-5WFF272M.mjs';
|
|
11
|
+
import { hoverConfigToFullEffect } from './chunk-F6AGZQDA.mjs';
|
|
12
|
+
import { generateSeriesDescription } from './chunk-IFJPDARC.mjs';
|
|
13
|
+
import { collectItems } from './chunk-FRVJH7ZG.mjs';
|
|
14
|
+
import { buildColorIndexMap, defaultLightTheme } from './chunk-BDCNBS6W.mjs';
|
|
15
|
+
import { setAttr, createSvgGroup, svgNode, appendChild, createSvgRect, materializeSvgNode } from './chunk-BF7RP4A3.mjs';
|
|
16
16
|
|
|
17
17
|
// src/series/bar/controller/types.ts
|
|
18
18
|
var BAR_SCENE_REGISTRY = {
|
|
@@ -33,14 +33,28 @@ function groupAnimatedBarsByDataset(animatedBars) {
|
|
|
33
33
|
}
|
|
34
34
|
return grouped;
|
|
35
35
|
}
|
|
36
|
-
function
|
|
36
|
+
function findNearestBarIndexByX(visibleBars, axisX, orientation) {
|
|
37
|
+
let bestIdx = null;
|
|
38
|
+
let bestDist = Infinity;
|
|
39
|
+
for (const bar of visibleBars) {
|
|
40
|
+
const center = orientation === "vertical" ? bar.x + bar.width / 2 : bar.y + bar.height / 2;
|
|
41
|
+
const dist = Math.abs(center - axisX);
|
|
42
|
+
if (dist < bestDist) {
|
|
43
|
+
bestDist = dist;
|
|
44
|
+
bestIdx = bar.dataIndex;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return bestIdx;
|
|
48
|
+
}
|
|
49
|
+
function barHoverInteraction(base, dsId, hover, flags, visibleBars, orientation) {
|
|
37
50
|
const isAnyHover = hover.datasetId !== null;
|
|
38
|
-
const isAxisHover = hover.axisIndex != null;
|
|
39
51
|
const isThisSeriesHovered = hover.datasetId === dsId;
|
|
40
52
|
const { isWaterfall, isStacked, isGrouped } = flags;
|
|
53
|
+
const resolvedAxisIndex = hover.axisX != null && visibleBars ? findNearestBarIndexByX(visibleBars, hover.axisX, orientation ?? "vertical") : hover.axisIndex ?? null;
|
|
54
|
+
const isAxisHover = resolvedAxisIndex != null;
|
|
41
55
|
return {
|
|
42
56
|
...base,
|
|
43
|
-
hoveredIndex: isAxisHover ?
|
|
57
|
+
hoveredIndex: isAxisHover ? resolvedAxisIndex : isThisSeriesHovered ? hover.index : null,
|
|
44
58
|
isSeriesHovered: isAxisHover || isWaterfall ? false : (isStacked || isGrouped) && isAnyHover && isThisSeriesHovered,
|
|
45
59
|
isSeriesDimmed: isAxisHover || isWaterfall ? false : isAnyHover && !isThisSeriesHovered
|
|
46
60
|
};
|
|
@@ -54,7 +68,7 @@ function buildBarSvgChildren(params) {
|
|
|
54
68
|
if (!props) continue;
|
|
55
69
|
const propsWithHover = {
|
|
56
70
|
...props,
|
|
57
|
-
interaction: barHoverInteraction(props.interaction, dsId, hover, flags)
|
|
71
|
+
interaction: barHoverInteraction(props.interaction, dsId, hover, flags, layout.visibleBars, orientation)
|
|
58
72
|
};
|
|
59
73
|
const barNode = paint.renderSvg(propsWithHover, layout, context);
|
|
60
74
|
setAttr(barNode, "data-dataset", dsId);
|
|
@@ -156,7 +170,7 @@ function renderBarsFrame(params) {
|
|
|
156
170
|
if (!props) continue;
|
|
157
171
|
const propsWithHover = {
|
|
158
172
|
...props,
|
|
159
|
-
interaction: barHoverInteraction(props.interaction, dsId, hover, { isWaterfall, isStacked, isGrouped })
|
|
173
|
+
interaction: barHoverInteraction(props.interaction, dsId, hover, { isWaterfall, isStacked, isGrouped }, layout.visibleBars, orientation)
|
|
160
174
|
};
|
|
161
175
|
paint.renderCanvas(propsWithHover, layout, ctx, context);
|
|
162
176
|
}
|
|
@@ -242,7 +256,7 @@ function applyHover(ctx, hover) {
|
|
|
242
256
|
// src/series/bar/controller/scene.ts
|
|
243
257
|
function buildBarsFromScene(ctx) {
|
|
244
258
|
const result = [];
|
|
245
|
-
for (const el of ctx._scene.
|
|
259
|
+
for (const el of ctx._scene.elementValues()) {
|
|
246
260
|
const s = el.current;
|
|
247
261
|
result.push({
|
|
248
262
|
dataIndex: s.dataIndex,
|
|
@@ -411,7 +425,8 @@ var BarRendererController = class {
|
|
|
411
425
|
axisLayouts: layoutData.axisLayouts,
|
|
412
426
|
hover: this.hover,
|
|
413
427
|
hoverConfig: input.hoverConfig ? hoverConfigToFullEffect(input.hoverConfig) : void 0,
|
|
414
|
-
theme: input.theme
|
|
428
|
+
theme: input.theme,
|
|
429
|
+
colorIndexById: buildColorIndexMap(datasets)
|
|
415
430
|
}) : null;
|
|
416
431
|
const prevLayoutCache = this.layoutCache;
|
|
417
432
|
const prevRenderPropsCache = this.renderPropsCache;
|
|
@@ -430,6 +445,7 @@ var BarRendererController = class {
|
|
|
430
445
|
}
|
|
431
446
|
this._scene.reset();
|
|
432
447
|
this._lastFingerprint = "";
|
|
448
|
+
compositor?.removeLayersByPrefix("bar:");
|
|
433
449
|
if (input.renderer === "svg" && this.svgGroup) {
|
|
434
450
|
while (this.svgGroup.firstChild) this.svgGroup.removeChild(this.svgGroup.firstChild);
|
|
435
451
|
}
|
|
@@ -455,17 +471,9 @@ var BarRendererController = class {
|
|
|
455
471
|
ctx.rect(layoutData.cartesianArea.x, layoutData.cartesianArea.y, layoutData.cartesianArea.width, layoutData.cartesianArea.height);
|
|
456
472
|
ctx.clip();
|
|
457
473
|
}
|
|
458
|
-
const isAnyHoverCompositor = this.hover.datasetId !== null;
|
|
459
|
-
const isAxisHoverCompositor = this.hover.axisIndex != null;
|
|
460
|
-
const isThisSeriesHoveredCompositor = this.hover.datasetId === dsId;
|
|
461
474
|
const propsWithHover = {
|
|
462
475
|
...props,
|
|
463
|
-
interaction: {
|
|
464
|
-
...props.interaction,
|
|
465
|
-
hoveredIndex: isAxisHoverCompositor ? this.hover.axisIndex ?? null : isThisSeriesHoveredCompositor ? this.hover.index : null,
|
|
466
|
-
isSeriesHovered: isAxisHoverCompositor ? false : (layoutData.isStacked || layoutData.isGrouped) && isAnyHoverCompositor && isThisSeriesHoveredCompositor,
|
|
467
|
-
isSeriesDimmed: isAxisHoverCompositor ? false : isAnyHoverCompositor && !isThisSeriesHoveredCompositor
|
|
468
|
-
}
|
|
476
|
+
interaction: barHoverInteraction(props.interaction, dsId, this.hover, { isWaterfall: layoutData.isWaterfall, isStacked: layoutData.isStacked, isGrouped: layoutData.isGrouped }, layout.visibleBars, orientation)
|
|
469
477
|
};
|
|
470
478
|
this._paint.renderCanvas(propsWithHover, layout, ctx, context);
|
|
471
479
|
if (this.labelConfig && this.lastInput?.datasetVisibility?.get(dsId) !== false) {
|
|
@@ -550,26 +558,44 @@ var BarRendererController = class {
|
|
|
550
558
|
applyHover(hover) {
|
|
551
559
|
applyHover(this, hover);
|
|
552
560
|
}
|
|
561
|
+
/**
|
|
562
|
+
* Hit-test layouts excluding toggled-off datasets. `computeBarVisualLayout`
|
|
563
|
+
* writes a full-size layout into `layoutCache` for EVERY dataset (the
|
|
564
|
+
* `layouts.set` runs before its `if (ds.visible)` gate) so an exiting bar
|
|
565
|
+
* can animate out, which means a hidden dataset lingers in the cache at full
|
|
566
|
+
* size. Gating on the authoritative `datasetVisibility` keeps a toggled-off
|
|
567
|
+
* series from producing a tooltip without disturbing the cache the exit
|
|
568
|
+
* animation relies on.
|
|
569
|
+
*/
|
|
570
|
+
get _hitTestLayouts() {
|
|
571
|
+
const vis = this.lastInput?.datasetVisibility;
|
|
572
|
+
if (!vis) return this.layoutCache;
|
|
573
|
+
const visible = /* @__PURE__ */ new Map();
|
|
574
|
+
for (const [id, layout] of this.layoutCache) {
|
|
575
|
+
if (vis.get(id) !== false) visible.set(id, layout);
|
|
576
|
+
}
|
|
577
|
+
return visible;
|
|
578
|
+
}
|
|
553
579
|
/**
|
|
554
580
|
* Hit test at pixel coordinates.
|
|
555
581
|
*/
|
|
556
582
|
hitTest(x, y) {
|
|
557
583
|
if (!this.lastInput?.layoutData) return null;
|
|
558
|
-
return barHitTest(x, y, { layouts: this.
|
|
584
|
+
return barHitTest(x, y, { layouts: this._hitTestLayouts, renderPropsCache: this.renderPropsCache, datasets: this.lastInput.datasets, layoutData: this.lastInput.layoutData, theme: this.lastInput.theme });
|
|
559
585
|
}
|
|
560
586
|
/**
|
|
561
587
|
* Find the nearest data point by category axis proximity (for crosshair mode).
|
|
562
588
|
*/
|
|
563
589
|
findNearest(x, y) {
|
|
564
590
|
if (!this.lastInput?.layoutData) return null;
|
|
565
|
-
return barFindNearest(x, y, { layouts: this.
|
|
591
|
+
return barFindNearest(x, y, { layouts: this._hitTestLayouts, renderPropsCache: this.renderPropsCache, datasets: this.lastInput.datasets, layoutData: this.lastInput.layoutData, theme: this.lastInput.theme });
|
|
566
592
|
}
|
|
567
593
|
/**
|
|
568
594
|
* Find ALL dataset hits at the nearest category (for multi-series crosshair badges).
|
|
569
595
|
*/
|
|
570
596
|
findAllNearest(x, y) {
|
|
571
597
|
if (!this.lastInput?.layoutData) return null;
|
|
572
|
-
return barFindAllNearest(x, y, { layouts: this.
|
|
598
|
+
return barFindAllNearest(x, y, { layouts: this._hitTestLayouts, renderPropsCache: this.renderPropsCache, datasets: this.lastInput.datasets, layoutData: this.lastInput.layoutData, theme: this.lastInput.theme });
|
|
573
599
|
}
|
|
574
600
|
/**
|
|
575
601
|
* Not used for bar (renders directly to DOM). Provided for interface compliance.
|
|
@@ -585,6 +611,15 @@ var BarRendererController = class {
|
|
|
585
611
|
get layouts() {
|
|
586
612
|
return this.layoutCache;
|
|
587
613
|
}
|
|
614
|
+
/**
|
|
615
|
+
* Live animated bar layouts — the geometry of the current rAF frame, falling back to
|
|
616
|
+
* the settled target layout when no frame has rendered yet. Per-frame consumers (e.g.
|
|
617
|
+
* custom SVG data-label VNodes) read this so their positions track the entrance/transition
|
|
618
|
+
* animation instead of snapping to the final layout, matching the canvas label path.
|
|
619
|
+
*/
|
|
620
|
+
get renderedLayouts() {
|
|
621
|
+
return this.lastRenderedLayouts ?? this.layoutCache;
|
|
622
|
+
}
|
|
588
623
|
/** Current bar render props (for external consumers) */
|
|
589
624
|
get renderProps() {
|
|
590
625
|
return this.renderPropsCache;
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import { computeSliceGeometry } from './chunk-ARVMVGWS.mjs';
|
|
2
|
+
import { buildSvgArcPath, CLIP_PIXEL_MARGIN } from './chunk-4S3FOFCN.mjs';
|
|
3
|
+
import { computeSliceHoverEffects } from './chunk-F6AGZQDA.mjs';
|
|
4
|
+
import { DEFAULT_FALLBACK_COLOR, DEFAULT_HOVER_BRIGHTNESS, DEFAULT_HOVER_DIM_OPACITY } from './chunk-6LUIVTNV.mjs';
|
|
5
|
+
import { getDefaultColor, makeItemContext, resolveAccessor, getColor, isGradientColor, remapStopsForDonut, createSvgGradientFromColor } from './chunk-BDCNBS6W.mjs';
|
|
6
|
+
import { svgNode, svgClass, brightenGradientStops, adjustBrightness } from './chunk-BF7RP4A3.mjs';
|
|
7
|
+
import { pointOnCircle, toRad } from './chunk-K7AGQTVK.mjs';
|
|
8
|
+
|
|
9
|
+
// src/series/pie/svg/index.ts
|
|
10
|
+
function buildSliceRenderContext(slice, renderInfo, position, geo, theme, chartCenter, fontFamily) {
|
|
11
|
+
const item = renderInfo.data[slice.originalIndex];
|
|
12
|
+
const angle = slice.endAngle - slice.rotation;
|
|
13
|
+
const sliceCtx = makeItemContext(item, slice.originalIndex);
|
|
14
|
+
const originalValue = Number(resolveAccessor(renderInfo.props.valueField, sliceCtx)) || slice.value;
|
|
15
|
+
const sliceLabel = String(resolveAccessor(renderInfo.props.categoryField, sliceCtx) ?? "");
|
|
16
|
+
return {
|
|
17
|
+
index: slice.originalIndex,
|
|
18
|
+
data: item,
|
|
19
|
+
value: originalValue,
|
|
20
|
+
percentage: slice.percentage,
|
|
21
|
+
label: sliceLabel,
|
|
22
|
+
color: slice.color ?? getColor(renderInfo.props, slice.originalIndex, item, theme, { value: originalValue, category: sliceLabel }),
|
|
23
|
+
center: chartCenter ?? position,
|
|
24
|
+
x: position.x,
|
|
25
|
+
y: position.y,
|
|
26
|
+
angle: geo.midAngle,
|
|
27
|
+
isHovered: geo.isHovered,
|
|
28
|
+
isVisible: angle > 0.1,
|
|
29
|
+
fontFamily: fontFamily ?? "sans-serif"
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
function updatePieCustomContent(frame, refs, theme, fontFamily) {
|
|
33
|
+
const { slices, center } = frame;
|
|
34
|
+
const activeCustomKeys = /* @__PURE__ */ new Set();
|
|
35
|
+
for (const slice of slices) {
|
|
36
|
+
const key = `${slice.datasetIndex}-${slice.originalIndex}`;
|
|
37
|
+
const angle = slice.endAngle - slice.rotation;
|
|
38
|
+
const geo = computeSliceGeometry(slice, slice.rotation, frame);
|
|
39
|
+
const customEl = refs.customContent.get(key);
|
|
40
|
+
if (!customEl) continue;
|
|
41
|
+
const pt = pointOnCircle(center.x + geo.offsetX, center.y + geo.offsetY, geo.midAngle, geo.midRadius);
|
|
42
|
+
customEl.setAttribute("transform", `translate(${pt.x}, ${pt.y})`);
|
|
43
|
+
customEl.style.opacity = String(Math.min(1, angle / 10));
|
|
44
|
+
activeCustomKeys.add(key);
|
|
45
|
+
let renderInfo;
|
|
46
|
+
for (const [, info] of refs.renderFns) {
|
|
47
|
+
if (info.datasetIndex === slice.datasetIndex) {
|
|
48
|
+
renderInfo = info;
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
if (renderInfo && renderInfo.data[slice.originalIndex]) {
|
|
53
|
+
const result = renderInfo.fn(buildSliceRenderContext(slice, renderInfo, pt, geo, theme, void 0, fontFamily));
|
|
54
|
+
if (result && typeof result === "object" && "text" in result) {
|
|
55
|
+
const textEl = customEl.querySelector("text");
|
|
56
|
+
if (textEl) {
|
|
57
|
+
textEl.textContent = result.text;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
if (activeCustomKeys.size > 0) {
|
|
63
|
+
for (const [key, el] of refs.customContent) {
|
|
64
|
+
if (!activeCustomKeys.has(key)) {
|
|
65
|
+
el.style.opacity = "0";
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
function resolveSliceFillDescriptor(slice, isHovered, hasAnyHover, hoverConfig, theme, gradientId, innerRadius, outerRadius) {
|
|
71
|
+
const colorValue = slice.colorValue;
|
|
72
|
+
const isGradient = colorValue !== void 0 && isGradientColor(colorValue);
|
|
73
|
+
let baseFill;
|
|
74
|
+
if (isGradient) {
|
|
75
|
+
baseFill = `url(#${gradientId})`;
|
|
76
|
+
} else if (typeof colorValue === "string") {
|
|
77
|
+
baseFill = colorValue;
|
|
78
|
+
} else if (typeof slice.color === "string") {
|
|
79
|
+
baseFill = slice.color;
|
|
80
|
+
} else {
|
|
81
|
+
baseFill = theme.series[slice.originalIndex % theme.series.length];
|
|
82
|
+
}
|
|
83
|
+
const originalFill = baseFill;
|
|
84
|
+
const fillHoverConfig = isHovered && slice.hoverColor ? { ...hoverConfig, backgroundColor: slice.hoverColor } : hoverConfig;
|
|
85
|
+
let fill = baseFill;
|
|
86
|
+
let opacityAttr;
|
|
87
|
+
let hoverClass = false;
|
|
88
|
+
let inactiveClass = false;
|
|
89
|
+
let gradStops = isGradient ? colorValue.stops : void 0;
|
|
90
|
+
if (fillHoverConfig) {
|
|
91
|
+
const brightness = fillHoverConfig.brightness ?? theme.hoverBrightness ?? DEFAULT_HOVER_BRIGHTNESS;
|
|
92
|
+
if (isHovered) {
|
|
93
|
+
if (fillHoverConfig.backgroundColor) {
|
|
94
|
+
fill = fillHoverConfig.backgroundColor;
|
|
95
|
+
} else if (isGradient) {
|
|
96
|
+
gradStops = brightenGradientStops(colorValue, brightness).stops;
|
|
97
|
+
fill = baseFill;
|
|
98
|
+
} else if (fillHoverConfig.brightness === void 0) {
|
|
99
|
+
hoverClass = true;
|
|
100
|
+
fill = baseFill;
|
|
101
|
+
} else {
|
|
102
|
+
fill = adjustBrightness(baseFill, fillHoverConfig.brightness);
|
|
103
|
+
}
|
|
104
|
+
} else if (hasAnyHover) {
|
|
105
|
+
if (fillHoverConfig.dimOpacity !== void 0) {
|
|
106
|
+
if (fillHoverConfig.dimOpacity < 1) opacityAttr = String(fillHoverConfig.dimOpacity);
|
|
107
|
+
} else if ((theme.dimOpacity ?? DEFAULT_HOVER_DIM_OPACITY) < 1) {
|
|
108
|
+
inactiveClass = true;
|
|
109
|
+
}
|
|
110
|
+
fill = baseFill;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
let gradientDef;
|
|
114
|
+
if (isGradient) {
|
|
115
|
+
const cv = colorValue;
|
|
116
|
+
const remapped = innerRadius > 0 && cv.radialGradient ? remapStopsForDonut(gradStops ?? cv.stops, innerRadius / outerRadius) : gradStops ?? cv.stops;
|
|
117
|
+
const gradientColor = { ...cv, stops: remapped };
|
|
118
|
+
gradientDef = createSvgGradientFromColor(gradientColor, gradientId, { x: 0, y: 0 }, outerRadius);
|
|
119
|
+
}
|
|
120
|
+
return { fill, opacityAttr, originalFill, gradientDef, hoverClass, inactiveClass };
|
|
121
|
+
}
|
|
122
|
+
function buildPieSvgChildren(frame, hoverConfig, theme, chartId, datasetIndex) {
|
|
123
|
+
const { fullCircle, hoverState } = frame;
|
|
124
|
+
const hasAnyHover = hoverState.index !== null;
|
|
125
|
+
const defsChildren = [];
|
|
126
|
+
const sliceGroups = [];
|
|
127
|
+
for (const slice of frame.slices) {
|
|
128
|
+
if (slice.datasetIndex !== datasetIndex) continue;
|
|
129
|
+
const dataIndex = slice.originalIndex;
|
|
130
|
+
const angle = slice.endAngle - slice.rotation;
|
|
131
|
+
const geo = computeSliceGeometry(slice, slice.rotation, frame);
|
|
132
|
+
const isHovered = geo.isHovered;
|
|
133
|
+
const gradientId = `${chartId}-pie-${datasetIndex}-grad-${dataIndex}`;
|
|
134
|
+
const clipId = `${chartId}-pie-${datasetIndex}-clip-${dataIndex}`;
|
|
135
|
+
const pathD = buildSvgArcPath(
|
|
136
|
+
{
|
|
137
|
+
rotation: geo.renderRotation,
|
|
138
|
+
endAngle: geo.renderRotation + geo.renderAngle,
|
|
139
|
+
outerRadius: geo.sliceOuterRadius,
|
|
140
|
+
innerRadius: geo.sliceInnerRadius,
|
|
141
|
+
borderRadius: slice.borderRadius
|
|
142
|
+
},
|
|
143
|
+
fullCircle
|
|
144
|
+
);
|
|
145
|
+
const PIXEL_MARGIN = CLIP_PIXEL_MARGIN;
|
|
146
|
+
const angleDelta = geo.sliceOuterRadius > 0 ? PIXEL_MARGIN / geo.sliceOuterRadius * (180 / Math.PI) : 0;
|
|
147
|
+
const expandedClipPath = buildSvgArcPath(
|
|
148
|
+
{
|
|
149
|
+
rotation: geo.renderRotation - angleDelta,
|
|
150
|
+
endAngle: geo.renderRotation + geo.renderAngle + angleDelta,
|
|
151
|
+
outerRadius: geo.sliceOuterRadius,
|
|
152
|
+
innerRadius: geo.sliceInnerRadius,
|
|
153
|
+
borderRadius: slice.borderRadius
|
|
154
|
+
},
|
|
155
|
+
fullCircle
|
|
156
|
+
);
|
|
157
|
+
defsChildren.push(svgNode("clipPath", { id: clipId }, [svgNode("path", { d: expandedClipPath })]));
|
|
158
|
+
const { fill, opacityAttr, originalFill, gradientDef, hoverClass, inactiveClass } = resolveSliceFillDescriptor(slice, isHovered, hasAnyHover, hoverConfig, theme, gradientId, frame.innerRadius, frame.outerRadius);
|
|
159
|
+
if (gradientDef) defsChildren.push(gradientDef);
|
|
160
|
+
const {
|
|
161
|
+
borderStrokeWidth: bw,
|
|
162
|
+
borderColor: computedBorderColor,
|
|
163
|
+
borderDash: hoverBorderDash
|
|
164
|
+
} = computeSliceHoverEffects(slice.color ?? DEFAULT_FALLBACK_COLOR, slice.borderColor ?? "transparent", slice.borderStrokeWidth ?? 0, isHovered, hasAnyHover, hoverConfig, theme);
|
|
165
|
+
const bc = isHovered && slice.hoverBorderColor ? slice.hoverBorderColor : computedBorderColor;
|
|
166
|
+
const isInner = (frame.borderAlign ?? "inner") === "inner";
|
|
167
|
+
const joinStyle = frame.borderJoinStyle ?? "miter";
|
|
168
|
+
const strokeAttrs = {
|
|
169
|
+
d: pathD,
|
|
170
|
+
fill: "none",
|
|
171
|
+
"stroke-linejoin": joinStyle,
|
|
172
|
+
"data-stroke-path": "true",
|
|
173
|
+
"data-clip-id": clipId,
|
|
174
|
+
...isInner ? { "clip-path": `url(#${clipId})` } : {}
|
|
175
|
+
};
|
|
176
|
+
if (bw > 0 && bc !== "transparent") {
|
|
177
|
+
strokeAttrs.stroke = bc;
|
|
178
|
+
strokeAttrs["stroke-width"] = String(isInner ? bw * 2 : bw);
|
|
179
|
+
const bd = hoverBorderDash ?? slice.borderDash;
|
|
180
|
+
if (bd && bd.length > 0) {
|
|
181
|
+
strokeAttrs["stroke-dasharray"] = bd.join(" ");
|
|
182
|
+
strokeAttrs["stroke-dashoffset"] = String(slice.borderDashOffset ?? 0);
|
|
183
|
+
}
|
|
184
|
+
} else {
|
|
185
|
+
strokeAttrs.stroke = "transparent";
|
|
186
|
+
strokeAttrs["stroke-width"] = "0";
|
|
187
|
+
}
|
|
188
|
+
const colorClassN = `p-chart-color-${dataIndex % 14}`;
|
|
189
|
+
const usesColorClass = slice.colorValue === getDefaultColor(slice.originalIndex, theme);
|
|
190
|
+
const fillCls = svgClass("p-chart-arc", `p-chart-series-${dataIndex}`, usesColorClass && colorClassN, hoverClass && "p-chart-point-hover", inactiveClass && "p-chart-point-inactive");
|
|
191
|
+
const fillAttrs = {
|
|
192
|
+
d: pathD,
|
|
193
|
+
fill,
|
|
194
|
+
"data-index": dataIndex,
|
|
195
|
+
class: fillCls,
|
|
196
|
+
"data-fill-path": "true",
|
|
197
|
+
// applySvgHoverFill / applySvgHoverStroke bookkeeping (only written when a hoverConfig is
|
|
198
|
+
// present). applySvgHoverStroke runs on the FILL path (updateSvgSlices:286); on its first
|
|
199
|
+
// call it seeds `data-original-stroke` / `data-original-stroke-width` from the fill path's
|
|
200
|
+
// (absent) stroke attrs → empty strings. `data-original-stroke-dasharray` is only seeded
|
|
201
|
+
// when a base dasharray exists (the fill path never has one), so it stays absent here.
|
|
202
|
+
...hoverConfig ? { "data-original-fill": originalFill, "data-original-stroke": "", "data-original-stroke-width": "" } : {},
|
|
203
|
+
...opacityAttr !== void 0 ? { opacity: opacityAttr } : {}
|
|
204
|
+
};
|
|
205
|
+
if (isHovered && hoverConfig && (hoverConfig.borderColor || hoverConfig.borderStrokeWidth !== void 0)) {
|
|
206
|
+
if (hoverConfig.borderColor) fillAttrs.stroke = hoverConfig.borderColor;
|
|
207
|
+
if (hoverConfig.borderStrokeWidth !== void 0) fillAttrs["stroke-width"] = String(hoverConfig.borderStrokeWidth * 2);
|
|
208
|
+
if (hoverConfig.borderDash) fillAttrs["stroke-dasharray"] = hoverConfig.borderDash.join(" ");
|
|
209
|
+
fillAttrs["paint-order"] = "stroke fill";
|
|
210
|
+
}
|
|
211
|
+
const fillPath = svgNode("path", fillAttrs);
|
|
212
|
+
const strokePath = svgNode("path", strokeAttrs);
|
|
213
|
+
const slotX = Math.cos(toRad(geo.midAngle)) * geo.midRadius;
|
|
214
|
+
const slotY = Math.sin(toRad(geo.midAngle)) * geo.midRadius;
|
|
215
|
+
const contentSlot = svgNode("g", {
|
|
216
|
+
class: "slice-content",
|
|
217
|
+
"data-content-index": dataIndex,
|
|
218
|
+
transform: `translate(${slotX}, ${slotY})`,
|
|
219
|
+
opacity: angle < 0.1 ? "0" : "1"
|
|
220
|
+
});
|
|
221
|
+
const hasOffset = geo.offsetX !== 0 || geo.offsetY !== 0;
|
|
222
|
+
const hasScale = geo.scale !== 1;
|
|
223
|
+
const transformParts = [];
|
|
224
|
+
if (hasOffset) transformParts.push(`translate(${geo.offsetX}, ${geo.offsetY})`);
|
|
225
|
+
if (hasScale) transformParts.push(`scale(${geo.scale})`);
|
|
226
|
+
const groupAttrs = {
|
|
227
|
+
"data-slice-index": dataIndex,
|
|
228
|
+
"data-index": dataIndex,
|
|
229
|
+
// userOpacity + span<0.1 hide, as an ATTRIBUTE (normalized vs style in the parity test).
|
|
230
|
+
opacity: angle < 0.1 ? "0" : String(slice.userOpacity ?? 1),
|
|
231
|
+
...transformParts.length > 0 ? { transform: transformParts.join(" ") } : {}
|
|
232
|
+
};
|
|
233
|
+
sliceGroups.push(svgNode("g", groupAttrs, [fillPath, strokePath, contentSlot]));
|
|
234
|
+
}
|
|
235
|
+
return defsChildren.length > 0 ? [svgNode("defs", void 0, defsChildren), ...sliceGroups] : sliceGroups;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
export { buildPieSvgChildren, updatePieCustomContent };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { DEFAULT_HOVER_BRIGHTNESS, DEFAULT_HOVER_DIM_OPACITY } from './chunk-
|
|
2
|
-
import { defaultLightTheme, isGradientColor } from './chunk-
|
|
3
|
-
import { adjustBrightness, brightenGradientStops } from './chunk-
|
|
1
|
+
import { DEFAULT_HOVER_BRIGHTNESS, DEFAULT_HOVER_DIM_OPACITY } from './chunk-6LUIVTNV.mjs';
|
|
2
|
+
import { defaultLightTheme, isGradientColor } from './chunk-BDCNBS6W.mjs';
|
|
3
|
+
import { adjustBrightness, brightenGradientStops } from './chunk-BF7RP4A3.mjs';
|
|
4
4
|
|
|
5
5
|
// src/utils/interaction/hover.utils.ts
|
|
6
6
|
function computeItemHoverState(dataIndex, hoveredIndex, hoverEnabled) {
|
|
@@ -122,74 +122,6 @@ function computeLeaderLineHoverEffects(baseColor, isHovered, hasAnyHover, hoverP
|
|
|
122
122
|
}
|
|
123
123
|
return { strokeColor, strokeWidth };
|
|
124
124
|
}
|
|
125
|
-
function applySvgHoverFill(pathEl, isHovered, hasAnyHover, hoverConfig, applyGradientBrightness, restoreGradientBrightness, theme) {
|
|
126
|
-
if (!hoverConfig) return;
|
|
127
|
-
if (!pathEl.hasAttribute("data-original-fill")) {
|
|
128
|
-
pathEl.setAttribute("data-original-fill", pathEl.getAttribute("fill") || "");
|
|
129
|
-
}
|
|
130
|
-
const originalFill = pathEl.getAttribute("data-original-fill") || "";
|
|
131
|
-
const isGradient = originalFill.startsWith("url(");
|
|
132
|
-
const brightness = hoverConfig.brightness ?? theme.hoverBrightness ?? DEFAULT_HOVER_BRIGHTNESS;
|
|
133
|
-
if (isHovered) {
|
|
134
|
-
if (hoverConfig.backgroundColor) {
|
|
135
|
-
pathEl.setAttribute("fill", hoverConfig.backgroundColor);
|
|
136
|
-
} else if (isGradient && applyGradientBrightness) {
|
|
137
|
-
applyGradientBrightness(pathEl, brightness);
|
|
138
|
-
} else if (originalFill) {
|
|
139
|
-
pathEl.setAttribute("fill", adjustBrightness(originalFill, brightness));
|
|
140
|
-
}
|
|
141
|
-
pathEl.removeAttribute("opacity");
|
|
142
|
-
} else if (hasAnyHover && hoverConfig.dimOpacity !== void 0 && hoverConfig.dimOpacity < 1) {
|
|
143
|
-
pathEl.setAttribute("opacity", String(hoverConfig.dimOpacity));
|
|
144
|
-
if (isGradient && restoreGradientBrightness) {
|
|
145
|
-
restoreGradientBrightness(pathEl);
|
|
146
|
-
} else if (originalFill) {
|
|
147
|
-
pathEl.setAttribute("fill", originalFill);
|
|
148
|
-
}
|
|
149
|
-
} else {
|
|
150
|
-
if (isGradient && restoreGradientBrightness) {
|
|
151
|
-
restoreGradientBrightness(pathEl);
|
|
152
|
-
} else if (originalFill) {
|
|
153
|
-
pathEl.setAttribute("fill", originalFill);
|
|
154
|
-
}
|
|
155
|
-
pathEl.removeAttribute("opacity");
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
function applySvgHoverStroke(pathEl, isHovered, hoverConfig) {
|
|
159
|
-
if (!hoverConfig) return;
|
|
160
|
-
if (!pathEl.hasAttribute("data-original-stroke")) {
|
|
161
|
-
pathEl.setAttribute("data-original-stroke", pathEl.getAttribute("stroke") || "");
|
|
162
|
-
pathEl.setAttribute("data-original-stroke-width", pathEl.getAttribute("stroke-width") || "");
|
|
163
|
-
const dashArray = pathEl.getAttribute("stroke-dasharray");
|
|
164
|
-
if (dashArray) {
|
|
165
|
-
pathEl.setAttribute("data-original-stroke-dasharray", dashArray);
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
if (isHovered && (hoverConfig.borderColor || hoverConfig.borderStrokeWidth !== void 0)) {
|
|
169
|
-
if (hoverConfig.borderColor) {
|
|
170
|
-
pathEl.setAttribute("stroke", hoverConfig.borderColor);
|
|
171
|
-
}
|
|
172
|
-
if (hoverConfig.borderStrokeWidth !== void 0) {
|
|
173
|
-
pathEl.setAttribute("stroke-width", String(hoverConfig.borderStrokeWidth * 2));
|
|
174
|
-
}
|
|
175
|
-
if (hoverConfig.borderDash) {
|
|
176
|
-
pathEl.setAttribute("stroke-dasharray", hoverConfig.borderDash.join(" "));
|
|
177
|
-
}
|
|
178
|
-
if (!pathEl.hasAttribute("paint-order")) {
|
|
179
|
-
pathEl.setAttribute("paint-order", "stroke fill");
|
|
180
|
-
}
|
|
181
|
-
} else {
|
|
182
|
-
const originalStroke = pathEl.getAttribute("data-original-stroke");
|
|
183
|
-
const originalWidth = pathEl.getAttribute("data-original-stroke-width");
|
|
184
|
-
const originalDash = pathEl.getAttribute("data-original-stroke-dasharray");
|
|
185
|
-
if (originalStroke) pathEl.setAttribute("stroke", originalStroke);
|
|
186
|
-
else pathEl.removeAttribute("stroke");
|
|
187
|
-
if (originalWidth) pathEl.setAttribute("stroke-width", originalWidth);
|
|
188
|
-
else pathEl.removeAttribute("stroke-width");
|
|
189
|
-
if (originalDash) pathEl.setAttribute("stroke-dasharray", originalDash);
|
|
190
|
-
else pathEl.removeAttribute("stroke-dasharray");
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
125
|
function resolveSvgHoverFill(baseFill, isHovered, overrideColor) {
|
|
194
126
|
if (isHovered && typeof overrideColor === "string") {
|
|
195
127
|
return { fill: overrideColor, overridden: true };
|
|
@@ -197,4 +129,4 @@ function resolveSvgHoverFill(baseFill, isHovered, overrideColor) {
|
|
|
197
129
|
return { fill: baseFill, overridden: false };
|
|
198
130
|
}
|
|
199
131
|
|
|
200
|
-
export { applyHoverEffects,
|
|
132
|
+
export { applyHoverEffects, computeItemHoverState, computeLeaderLineHoverEffects, computeSliceHoverEffects, hoverConfigToBaseEffect, hoverConfigToFullEffect, resolveSvgHoverFill };
|