@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,9 +1,10 @@
|
|
|
1
|
-
import { getCategoryLabelAnchor } from './chunk-
|
|
2
|
-
import { resolveBandGeometry, buildWedgePath, buildCircleSvgPath, buildPolygonPath, resolveLineGeometry } from './chunk-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { getCategoryLabelAnchor } from './chunk-LJ6BXF3H.mjs';
|
|
2
|
+
import { resolveBandGeometry, buildWedgePath, buildCircleSvgPath, buildPolygonPath, resolveLineGeometry } from './chunk-CFA2SUBF.mjs';
|
|
3
|
+
import { safeFormat } from './chunk-DIJFKY6H.mjs';
|
|
4
|
+
import { formatCompactValue, measureFontMetrics, svgAnchorToCanvasAlign, formatTooltipValue } from './chunk-56MASQS2.mjs';
|
|
5
|
+
import { resolveAxisColor } from './chunk-6LUIVTNV.mjs';
|
|
6
|
+
import { createSvgGroup, appendChild, createSvgPath, createSvgText, createSvgLine, createSvgCircle, withCanvasState } from './chunk-BF7RP4A3.mjs';
|
|
7
|
+
import { toRad } from './chunk-K7AGQTVK.mjs';
|
|
7
8
|
|
|
8
9
|
// src/renderers/radial-grid.svg.ts
|
|
9
10
|
function renderRadialGridSvg(layout, theme, axisIndex = 0) {
|
|
@@ -39,7 +40,7 @@ function renderRadialGridSvg(layout, theme, axisIndex = 0) {
|
|
|
39
40
|
appendChild(
|
|
40
41
|
group,
|
|
41
42
|
createSvgText(lx, ly, band.label, {
|
|
42
|
-
class: "p-chart-tick-label",
|
|
43
|
+
class: "p-chart-tick-label p-chart-radial-tick-label",
|
|
43
44
|
"text-anchor": "start",
|
|
44
45
|
"dominant-baseline": "middle",
|
|
45
46
|
fill: band.labelColor ?? theme.tickLabel,
|
|
@@ -118,7 +119,6 @@ function renderRadialGridSvg(layout, theme, axisIndex = 0) {
|
|
|
118
119
|
const ep = spokeEndpoints[si];
|
|
119
120
|
appendChild(group, createSvgLine(center.x, center.y, ep.x, ep.y, spokeAttrs));
|
|
120
121
|
}
|
|
121
|
-
const haloColor = theme.tickHalo;
|
|
122
122
|
for (let ci = 0; ci < spokes.length; ci++) {
|
|
123
123
|
const entry = spokes[ci];
|
|
124
124
|
if (entry.showLabels === false) continue;
|
|
@@ -137,7 +137,11 @@ function renderRadialGridSvg(layout, theme, axisIndex = 0) {
|
|
|
137
137
|
const r = entry.levelRadii[li];
|
|
138
138
|
if (r <= 0) continue;
|
|
139
139
|
const val = entry.levelValues[li];
|
|
140
|
-
const text = formatter ?
|
|
140
|
+
const text = formatter ? safeFormat(
|
|
141
|
+
() => formatter(val),
|
|
142
|
+
() => formatCompactValue(val),
|
|
143
|
+
"tick"
|
|
144
|
+
) : formatCompactValue(val);
|
|
141
145
|
const px = -dy * 4;
|
|
142
146
|
const py = dx * 4;
|
|
143
147
|
const cx = center.x + dx * r + px;
|
|
@@ -145,15 +149,11 @@ function renderRadialGridSvg(layout, theme, axisIndex = 0) {
|
|
|
145
149
|
appendChild(
|
|
146
150
|
group,
|
|
147
151
|
createSvgText(cx, cy, text, {
|
|
148
|
-
class: "p-chart-tick-label",
|
|
152
|
+
class: "p-chart-tick-label p-chart-radial-tick-label",
|
|
149
153
|
"text-anchor": "middle",
|
|
150
154
|
"dominant-baseline": "central",
|
|
151
155
|
transform: `rotate(${rotation.toFixed(2)} ${cx} ${cy})`,
|
|
152
156
|
fill: resolvedColor ?? theme.tickLabel,
|
|
153
|
-
stroke: haloColor,
|
|
154
|
-
"stroke-width": "3",
|
|
155
|
-
"stroke-linejoin": "round",
|
|
156
|
-
"paint-order": "stroke fill",
|
|
157
157
|
"font-size": resolvedFontSize,
|
|
158
158
|
"font-family": layout.fontFamily,
|
|
159
159
|
opacity: 0.85
|
|
@@ -189,7 +189,6 @@ function renderRadialGridSvg(layout, theme, axisIndex = 0) {
|
|
|
189
189
|
appendChild(group, createSvgLine(center.x, center.y, ep.x, ep.y, spokeAttrs));
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
|
-
const haloColor = theme.tickHalo;
|
|
193
192
|
const resolvedTickFontSize = Math.round(tickFontSize * 0.83);
|
|
194
193
|
const labelEnd = yAxis.showLabels === false ? 0 : xDrawsPerimeter ? levelValues.length - 1 : levelValues.length;
|
|
195
194
|
for (let li = 1; li < labelEnd; li++) {
|
|
@@ -200,13 +199,9 @@ function renderRadialGridSvg(layout, theme, axisIndex = 0) {
|
|
|
200
199
|
appendChild(
|
|
201
200
|
group,
|
|
202
201
|
createSvgText(center.x + 4, ly + 8, label, {
|
|
203
|
-
class: "p-chart-tick-label",
|
|
202
|
+
class: "p-chart-tick-label p-chart-radial-tick-label",
|
|
204
203
|
"text-anchor": "start",
|
|
205
204
|
fill: tickColor ?? theme.tickLabel,
|
|
206
|
-
stroke: haloColor,
|
|
207
|
-
"stroke-width": "3",
|
|
208
|
-
"stroke-linejoin": "round",
|
|
209
|
-
"paint-order": "stroke fill",
|
|
210
205
|
"font-size": resolvedTickFontSize,
|
|
211
206
|
"font-family": layout.fontFamily,
|
|
212
207
|
opacity: 0.7
|
|
@@ -241,7 +236,7 @@ function renderRadialGridSvg(layout, theme, axisIndex = 0) {
|
|
|
241
236
|
appendChild(
|
|
242
237
|
group,
|
|
243
238
|
createSvgText(lx, finalY, categories[i], {
|
|
244
|
-
class: "p-chart-tick-label",
|
|
239
|
+
class: "p-chart-tick-label p-chart-radial-tick-label",
|
|
245
240
|
"text-anchor": getCategoryLabelAnchor(angleDeg),
|
|
246
241
|
"dominant-baseline": "auto",
|
|
247
242
|
fill: xAxis.color ?? theme.tickLabel,
|
|
@@ -426,17 +421,17 @@ function renderRadialGridCanvas(ctx, layout, theme, axisIndex = 0) {
|
|
|
426
421
|
ctx.font = `${resolvedTickFontSize}px ${layout.fontFamily}`;
|
|
427
422
|
ctx.textAlign = "left";
|
|
428
423
|
ctx.textBaseline = "alphabetic";
|
|
429
|
-
ctx.strokeStyle = theme.tickHalo;
|
|
430
|
-
ctx.lineWidth = 3;
|
|
431
|
-
ctx.lineJoin = "round";
|
|
432
424
|
const labelEnd = yAxis.showLabels === false ? 0 : xAxis && xAxis.visible !== false && xAxis.showLine !== false ? levelValues.length - 1 : levelValues.length;
|
|
433
425
|
for (let li = 1; li < labelEnd; li++) {
|
|
434
426
|
const r = levelRadii[li];
|
|
435
427
|
const val = levelValues[li];
|
|
436
|
-
const label = tickFormat ?
|
|
428
|
+
const label = tickFormat ? safeFormat(
|
|
429
|
+
() => tickFormat(val),
|
|
430
|
+
() => formatCompactValue(val),
|
|
431
|
+
"tick"
|
|
432
|
+
) : formatCompactValue(val);
|
|
437
433
|
const tx = center.x + 4;
|
|
438
434
|
const ty = center.y - r + 8;
|
|
439
|
-
ctx.strokeText(label, tx, ty);
|
|
440
435
|
ctx.fillText(label, tx, ty);
|
|
441
436
|
}
|
|
442
437
|
});
|
|
@@ -499,14 +494,15 @@ function renderRadialGridCanvas(ctx, layout, theme, axisIndex = 0) {
|
|
|
499
494
|
ctx.font = `${resolvedFontSize}px ${layout.fontFamily}`;
|
|
500
495
|
ctx.textAlign = "center";
|
|
501
496
|
ctx.textBaseline = "middle";
|
|
502
|
-
ctx.strokeStyle = theme.tickHalo;
|
|
503
|
-
ctx.lineWidth = 3;
|
|
504
|
-
ctx.lineJoin = "round";
|
|
505
497
|
for (let li = 1; li < entry.levelValues.length; li++) {
|
|
506
498
|
const r = entry.levelRadii[li];
|
|
507
499
|
if (r <= 0) continue;
|
|
508
500
|
const val = entry.levelValues[li];
|
|
509
|
-
const text = formatter ?
|
|
501
|
+
const text = formatter ? safeFormat(
|
|
502
|
+
() => formatter(val),
|
|
503
|
+
() => formatCompactValue(val),
|
|
504
|
+
"tick"
|
|
505
|
+
) : formatCompactValue(val);
|
|
510
506
|
const px = -dy * 4;
|
|
511
507
|
const py = dx * 4;
|
|
512
508
|
const cx = center.x + dx * r + px;
|
|
@@ -514,7 +510,6 @@ function renderRadialGridCanvas(ctx, layout, theme, axisIndex = 0) {
|
|
|
514
510
|
ctx.save();
|
|
515
511
|
ctx.translate(cx, cy);
|
|
516
512
|
ctx.rotate(toRad(rotation));
|
|
517
|
-
ctx.strokeText(text, 0, 0);
|
|
518
513
|
ctx.fillText(text, 0, 0);
|
|
519
514
|
ctx.restore();
|
|
520
515
|
}
|
|
@@ -579,14 +574,18 @@ function buildTooltipContent(data, isSharedMode, opts = {}) {
|
|
|
579
574
|
type: "multi-series",
|
|
580
575
|
label: data.label,
|
|
581
576
|
series: data.allSeriesHits.map((hit) => {
|
|
582
|
-
const formatted2 = valueFormatter ?
|
|
577
|
+
const formatted2 = valueFormatter ? safeFormat(
|
|
578
|
+
() => valueFormatter(hit.value, { label: data.label, color: hit.color, datasetId: hit.datasetId }),
|
|
579
|
+
() => void 0,
|
|
580
|
+
"tooltip value"
|
|
581
|
+
) : void 0;
|
|
583
582
|
return {
|
|
584
583
|
datasetId: hit.datasetId,
|
|
585
584
|
color: hit.color,
|
|
586
585
|
colorGradient: hit.colorGradient,
|
|
587
586
|
swatchColor: hit.swatchColor,
|
|
588
587
|
label: hit.name ?? hit.datasetId,
|
|
589
|
-
formattedValue: typeof formatted2 === "string" ? formatted2 : hit.formattedValue,
|
|
588
|
+
formattedValue: typeof formatted2 === "string" ? formatted2 : hit.formattedValue ?? formatTooltipValue(hit.value, locale),
|
|
590
589
|
ohlc: hit.ohlc
|
|
591
590
|
};
|
|
592
591
|
})
|
|
@@ -594,7 +593,11 @@ function buildTooltipContent(data, isSharedMode, opts = {}) {
|
|
|
594
593
|
}
|
|
595
594
|
const ctx = { label: data.label, color: data.color, datasetId: data.datasetId ?? "", percentage: data.percentage, index: data.index };
|
|
596
595
|
const primary = data.value ?? data.yValue ?? data.ohlc?.close ?? 0;
|
|
597
|
-
const formatted = valueFormatter ?
|
|
596
|
+
const formatted = valueFormatter ? safeFormat(
|
|
597
|
+
() => valueFormatter(primary, ctx),
|
|
598
|
+
() => void 0,
|
|
599
|
+
"tooltip value"
|
|
600
|
+
) : void 0;
|
|
598
601
|
if (Array.isArray(formatted)) {
|
|
599
602
|
return { type: "rows", color: data.color, colorGradient: data.colorGradient, swatchColor: data.swatchColor, label: data.label, rows: formatted };
|
|
600
603
|
}
|
|
@@ -607,20 +610,22 @@ function buildTooltipContent(data, isSharedMode, opts = {}) {
|
|
|
607
610
|
label: data.label,
|
|
608
611
|
rows: ["open", "high", "low", "close"].map((key) => ({
|
|
609
612
|
key,
|
|
610
|
-
value: data.ohlc[key]
|
|
613
|
+
value: formatTooltipValue(data.ohlc[key], locale)
|
|
611
614
|
}))
|
|
612
615
|
};
|
|
613
616
|
}
|
|
614
|
-
if (data.xValue !== void 0 && data.yValue !== void 0) {
|
|
617
|
+
if (!data.independentIsCategory && data.xValue !== void 0 && data.yValue !== void 0) {
|
|
615
618
|
return {
|
|
616
|
-
type: "
|
|
619
|
+
type: "xy",
|
|
617
620
|
color: data.color,
|
|
618
621
|
colorGradient: data.colorGradient,
|
|
619
622
|
swatchColor: data.swatchColor,
|
|
620
623
|
label: data.label,
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
+
xLabel: data.xAxisTitle ?? "x",
|
|
625
|
+
yLabel: data.yAxisTitle ?? "y",
|
|
626
|
+
xValue: formatTooltipValue(data.xValue, locale),
|
|
627
|
+
yValue: formatTooltipValue(data.yValue, locale),
|
|
628
|
+
bubbleValue: data.bubbleValue != null ? formatTooltipValue(data.bubbleValue, locale) : void 0
|
|
624
629
|
};
|
|
625
630
|
}
|
|
626
631
|
return {
|
|
@@ -629,7 +634,7 @@ function buildTooltipContent(data, isSharedMode, opts = {}) {
|
|
|
629
634
|
colorGradient: data.colorGradient,
|
|
630
635
|
swatchColor: data.swatchColor,
|
|
631
636
|
label: data.label,
|
|
632
|
-
value: typeof formatted === "string" ? formatted : data.formattedValue ?? data.value,
|
|
637
|
+
value: typeof formatted === "string" ? formatted : data.formattedValue ?? (typeof data.value === "number" ? formatTooltipValue(data.value, locale) : data.value),
|
|
633
638
|
percentage: data.percentage != null ? +data.percentage.toFixed(1) : void 0
|
|
634
639
|
};
|
|
635
640
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { toRad, generateNiceTicks } from './chunk-
|
|
1
|
+
import { toRad, generateNiceTicks } from './chunk-K7AGQTVK.mjs';
|
|
2
2
|
|
|
3
3
|
// src/renderers/radial-grid.geometry.ts
|
|
4
|
-
function valueToRadius(value, domain, outerRadius) {
|
|
4
|
+
function valueToRadius(value, domain, outerRadius, innerRadius = 0) {
|
|
5
5
|
const [min, max] = domain;
|
|
6
|
-
if (max === min) return
|
|
7
|
-
|
|
6
|
+
if (max === min) return innerRadius;
|
|
7
|
+
const available = outerRadius - innerRadius;
|
|
8
|
+
return Math.max(innerRadius, Math.min(outerRadius, innerRadius + (value - min) / (max - min) * available));
|
|
8
9
|
}
|
|
9
10
|
function buildCircleSvgPath(cx, cy, r) {
|
|
10
11
|
return `M ${cx},${cy - r} A ${r},${r} 0 1 1 ${cx},${cy + r} A ${r},${r} 0 1 1 ${cx},${cy - r} Z`;
|
|
@@ -40,12 +41,14 @@ function buildWedgePath(center, rInner, rOuter, angleStartDeg, angleEndDeg) {
|
|
|
40
41
|
}
|
|
41
42
|
function resolveBandGeometry(band, layout, yAxis) {
|
|
42
43
|
const outer = layout.radius;
|
|
44
|
+
const inner = layout.innerRadius ?? 0;
|
|
45
|
+
const frac = (f) => Math.max(inner, Math.min(outer, inner + f * (outer - inner)));
|
|
43
46
|
if (band.r1 != null || band.r2 != null) {
|
|
44
47
|
const f1 = band.r1 ?? 0;
|
|
45
48
|
const f2 = band.r2 ?? 1;
|
|
46
|
-
const rInner =
|
|
47
|
-
const rOuter =
|
|
48
|
-
return rOuter >
|
|
49
|
+
const rInner = frac(Math.min(f1, f2));
|
|
50
|
+
const rOuter = frac(Math.max(f1, f2));
|
|
51
|
+
return rOuter > inner ? { rInner, rOuter, mode: "annulus" } : null;
|
|
49
52
|
}
|
|
50
53
|
if (band.category != null) {
|
|
51
54
|
if (!yAxis || yAxis.mode !== "perSpoke") return null;
|
|
@@ -53,11 +56,11 @@ function resolveBandGeometry(band, layout, yAxis) {
|
|
|
53
56
|
if (ci < 0) return null;
|
|
54
57
|
const spokeDomain = yAxis.spokes[ci]?.domain;
|
|
55
58
|
if (!spokeDomain) return null;
|
|
56
|
-
const r1 = band.y1 != null ? valueToRadius(band.y1, spokeDomain, outer) :
|
|
57
|
-
const r2 = band.y2 != null ? valueToRadius(band.y2, spokeDomain, outer) : outer;
|
|
59
|
+
const r1 = band.y1 != null ? valueToRadius(band.y1, spokeDomain, outer, inner) : inner;
|
|
60
|
+
const r2 = band.y2 != null ? valueToRadius(band.y2, spokeDomain, outer, inner) : outer;
|
|
58
61
|
const rInner = Math.min(r1, r2);
|
|
59
62
|
const rOuter = Math.max(r1, r2);
|
|
60
|
-
if (rOuter <=
|
|
63
|
+
if (rOuter <= inner) return null;
|
|
61
64
|
const halfStep = layout.angleStep / 2;
|
|
62
65
|
const centerAngle = -90 + ci * layout.angleStep;
|
|
63
66
|
return {
|
|
@@ -69,19 +72,20 @@ function resolveBandGeometry(band, layout, yAxis) {
|
|
|
69
72
|
};
|
|
70
73
|
}
|
|
71
74
|
if ((band.y1 != null || band.y2 != null) && layout.domain && yAxis?.mode === "shared") {
|
|
72
|
-
const r1 = band.y1 != null ? valueToRadius(band.y1, layout.domain, outer) :
|
|
73
|
-
const r2 = band.y2 != null ? valueToRadius(band.y2, layout.domain, outer) : outer;
|
|
75
|
+
const r1 = band.y1 != null ? valueToRadius(band.y1, layout.domain, outer, inner) : inner;
|
|
76
|
+
const r2 = band.y2 != null ? valueToRadius(band.y2, layout.domain, outer, inner) : outer;
|
|
74
77
|
const rInner = Math.min(r1, r2);
|
|
75
78
|
const rOuter = Math.max(r1, r2);
|
|
76
|
-
return rOuter >
|
|
79
|
+
return rOuter > inner ? { rInner, rOuter, mode: "annulus" } : null;
|
|
77
80
|
}
|
|
78
81
|
return null;
|
|
79
82
|
}
|
|
80
83
|
function resolveLineGeometry(line, layout, yAxis) {
|
|
81
84
|
const outer = layout.radius;
|
|
85
|
+
const inner = layout.innerRadius ?? 0;
|
|
82
86
|
if (line.r != null) {
|
|
83
|
-
const r = Math.max(
|
|
84
|
-
return r >
|
|
87
|
+
const r = Math.max(inner, Math.min(outer, inner + line.r * (outer - inner)));
|
|
88
|
+
return r > inner ? { mode: "ring", r } : null;
|
|
85
89
|
}
|
|
86
90
|
if (line.category != null) {
|
|
87
91
|
if (line.y == null) return null;
|
|
@@ -90,8 +94,8 @@ function resolveLineGeometry(line, layout, yAxis) {
|
|
|
90
94
|
if (ci < 0) return null;
|
|
91
95
|
const spokeDomain = yAxis.spokes[ci]?.domain;
|
|
92
96
|
if (!spokeDomain) return null;
|
|
93
|
-
const r = valueToRadius(line.y, spokeDomain, outer);
|
|
94
|
-
if (r <=
|
|
97
|
+
const r = valueToRadius(line.y, spokeDomain, outer, inner);
|
|
98
|
+
if (r <= inner) return null;
|
|
95
99
|
const angleDeg = -90 + ci * layout.angleStep;
|
|
96
100
|
const angleRad = toRad(angleDeg);
|
|
97
101
|
const dx = Math.cos(angleRad);
|
|
@@ -110,16 +114,17 @@ function resolveLineGeometry(line, layout, yAxis) {
|
|
|
110
114
|
};
|
|
111
115
|
}
|
|
112
116
|
if (line.y != null && layout.domain && yAxis?.mode === "shared") {
|
|
113
|
-
const r = valueToRadius(line.y, layout.domain, outer);
|
|
114
|
-
return r >
|
|
117
|
+
const r = valueToRadius(line.y, layout.domain, outer, inner);
|
|
118
|
+
return r > inner ? { mode: "ring", r } : null;
|
|
115
119
|
}
|
|
116
120
|
return null;
|
|
117
121
|
}
|
|
118
|
-
function resolveSharedRadialGrid(grid, domain, rawDataMax, radius, tickCount) {
|
|
122
|
+
function resolveSharedRadialGrid(grid, domain, rawDataMax, radius, tickCount, innerRadius = 0) {
|
|
119
123
|
let levelValues = grid.levelValues.slice();
|
|
120
124
|
let levelRadii = grid.levelRadii.slice();
|
|
121
125
|
let outDomain = [domain[0], domain[1]];
|
|
122
|
-
const
|
|
126
|
+
const available = radius - innerRadius;
|
|
127
|
+
const place = (vals, d) => vals.map((v) => d[1] === d[0] ? innerRadius : innerRadius + (v - d[0]) / (d[1] - d[0]) * available);
|
|
123
128
|
if (tickCount != null && tickCount >= 2) {
|
|
124
129
|
const rawMax = rawDataMax ?? domain[1];
|
|
125
130
|
levelValues = generateNiceTicks(domain[0], rawMax, tickCount, true);
|
|
@@ -152,6 +157,8 @@ function buildRadialGridLayout(base, xAxisProps, yAxisProps, yAxesByCategory, ch
|
|
|
152
157
|
let domain = base.domain;
|
|
153
158
|
let yAxis = null;
|
|
154
159
|
const isPerSpokeMode = !!base.perSpokeDomains && base.perSpokeDomains.size > 0;
|
|
160
|
+
const innerRadius = base.innerRadius ?? 0;
|
|
161
|
+
const available = base.radius - innerRadius;
|
|
155
162
|
if (isPerSpokeMode && (yAxisProps || yAxesByCategory && yAxesByCategory.size > 0)) {
|
|
156
163
|
const spokes = [];
|
|
157
164
|
for (let ci = 0; ci < base.categories.length; ci++) {
|
|
@@ -165,7 +172,7 @@ function buildRadialGridLayout(base, xAxisProps, yAxisProps, yAxesByCategory, ch
|
|
|
165
172
|
const hi = ticks[ticks.length - 1] ?? spokeDomain[1];
|
|
166
173
|
const aligned = [Math.min(spokeDomain[0], lo), Math.max(spokeDomain[1], hi)];
|
|
167
174
|
const span = aligned[1] - aligned[0];
|
|
168
|
-
const radii = ticks.map((v) => span === 0 ?
|
|
175
|
+
const radii = ticks.map((v) => span === 0 ? innerRadius : innerRadius + (v - aligned[0]) / span * available);
|
|
169
176
|
const uniformTickStyle = declared?.tickStyle && typeof declared.tickStyle !== "function" ? declared.tickStyle : void 0;
|
|
170
177
|
const rawTickFormat = declared?.tickFormat;
|
|
171
178
|
spokes.push({
|
|
@@ -179,7 +186,7 @@ function buildRadialGridLayout(base, xAxisProps, yAxisProps, yAxesByCategory, ch
|
|
|
179
186
|
showLabels: propsForSpoke?.showLabels ?? true
|
|
180
187
|
});
|
|
181
188
|
}
|
|
182
|
-
const referenceRingRadii = [0.2, 0.4, 0.6, 0.8].map((f) => f *
|
|
189
|
+
const referenceRingRadii = [0.2, 0.4, 0.6, 0.8].map((f) => innerRadius + f * available);
|
|
183
190
|
const defaultUniformTickStyle = yAxisProps?.tickStyle && typeof yAxisProps.tickStyle !== "function" ? yAxisProps.tickStyle : void 0;
|
|
184
191
|
yAxis = {
|
|
185
192
|
mode: "perSpoke",
|
|
@@ -202,7 +209,7 @@ function buildRadialGridLayout(base, xAxisProps, yAxisProps, yAxesByCategory, ch
|
|
|
202
209
|
levelValues = base.grid.levelValues.slice();
|
|
203
210
|
levelRadii = base.grid.levelRadii.slice();
|
|
204
211
|
} else {
|
|
205
|
-
const resolved = resolveSharedRadialGrid(base.grid, domain, base.rawDataMax, base.radius, yAxisProps.tickCount);
|
|
212
|
+
const resolved = resolveSharedRadialGrid(base.grid, domain, base.rawDataMax, base.radius, yAxisProps.tickCount, innerRadius);
|
|
206
213
|
levelValues = resolved.levelValues;
|
|
207
214
|
levelRadii = resolved.levelRadii;
|
|
208
215
|
domain = resolved.domain;
|
|
@@ -230,6 +237,7 @@ function buildRadialGridLayout(base, xAxisProps, yAxisProps, yAxesByCategory, ch
|
|
|
230
237
|
return {
|
|
231
238
|
center: base.center,
|
|
232
239
|
radius: base.radius,
|
|
240
|
+
innerRadius,
|
|
233
241
|
categories: base.categories,
|
|
234
242
|
angleStep: base.angleStep,
|
|
235
243
|
spokeEndpoints: base.spokeEndpoints,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { clamp } from './chunk-RQ3CKQOX.mjs';
|
|
1
|
+
import { clamp } from './chunk-K7AGQTVK.mjs';
|
|
3
2
|
|
|
4
3
|
// src/animations/interpolation.ts
|
|
5
4
|
function lerp(start, end, t) {
|
|
@@ -15,24 +14,14 @@ function lerpValues(start, target, progress) {
|
|
|
15
14
|
}
|
|
16
15
|
return result;
|
|
17
16
|
}
|
|
18
|
-
function
|
|
19
|
-
const start = parseColorToRGB(startColor);
|
|
20
|
-
const end = parseColorToRGB(endColor);
|
|
21
|
-
if (!start || !end) {
|
|
22
|
-
return t < 0.5 ? startColor : endColor;
|
|
23
|
-
}
|
|
24
|
-
const r = Math.round(clamp(lerp(start.r, end.r, t), 0, 255));
|
|
25
|
-
const g = Math.round(clamp(lerp(start.g, end.g, t), 0, 255));
|
|
26
|
-
const b = Math.round(clamp(lerp(start.b, end.b, t), 0, 255));
|
|
27
|
-
return `#${r.toString(16).padStart(2, "0")}${g.toString(16).padStart(2, "0")}${b.toString(16).padStart(2, "0")}`;
|
|
28
|
-
}
|
|
29
|
-
function interpolateRadialGrid(prevDomain, targetDomain, target, radius, progress) {
|
|
17
|
+
function interpolateRadialGrid(prevDomain, targetDomain, target, radius, progress, innerRadius = 0) {
|
|
30
18
|
const interpMin = prevDomain[0] + (targetDomain[0] - prevDomain[0]) * progress;
|
|
31
19
|
const interpMax = prevDomain[1] + (targetDomain[1] - prevDomain[1]) * progress;
|
|
32
20
|
const domainSpan = interpMax - interpMin;
|
|
21
|
+
const available = radius - innerRadius;
|
|
33
22
|
const levelRadii = target.levelValues.map((v) => {
|
|
34
|
-
if (domainSpan === 0) return
|
|
35
|
-
return clamp((v - interpMin) / domainSpan *
|
|
23
|
+
if (domainSpan === 0) return innerRadius;
|
|
24
|
+
return clamp(innerRadius + (v - interpMin) / domainSpan * available, innerRadius, radius);
|
|
36
25
|
});
|
|
37
26
|
return { ...target, levelRadii };
|
|
38
27
|
}
|
|
@@ -133,7 +122,7 @@ function interpolatePolarLayout(prev, target, progress) {
|
|
|
133
122
|
}
|
|
134
123
|
return {
|
|
135
124
|
...target,
|
|
136
|
-
grid: interpolateRadialGrid(prev.domain, target.domain, target.grid, target.maxRadius, progress),
|
|
125
|
+
grid: interpolateRadialGrid(prev.domain, target.domain, target.grid, target.maxRadius, progress, target.innerRadiusRatio * target.maxRadius),
|
|
137
126
|
bars
|
|
138
127
|
};
|
|
139
128
|
}
|
|
@@ -146,4 +135,4 @@ function createPolarEntranceLayout(target) {
|
|
|
146
135
|
return { ...target, bars };
|
|
147
136
|
}
|
|
148
137
|
|
|
149
|
-
export { createPolarEntranceLayout, createRadarEntranceLayout, interpolateCartesianAxisLayout, interpolatePolarLayout, interpolateRadialGrid, lerp,
|
|
138
|
+
export { createPolarEntranceLayout, createRadarEntranceLayout, interpolateCartesianAxisLayout, interpolatePolarLayout, interpolateRadialGrid, lerp, lerpValues };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { warnChartDevOnce } from './chunk-K7AGQTVK.mjs';
|
|
2
|
+
|
|
3
|
+
// src/utils/safeRender.utils.ts
|
|
4
|
+
function safeRenderProp(render, label) {
|
|
5
|
+
try {
|
|
6
|
+
return render();
|
|
7
|
+
} catch (err) {
|
|
8
|
+
warnChartDevOnce(`render:${label}`, `A custom "${label}" render function threw and was skipped. ${err instanceof Error ? err.message : String(err)}`);
|
|
9
|
+
return void 0;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
function safeFormat(format, fallback, label) {
|
|
13
|
+
try {
|
|
14
|
+
return format();
|
|
15
|
+
} catch (err) {
|
|
16
|
+
warnChartDevOnce(`format:${label}`, `A custom "${label}" format function threw; falling back to the default. ${err instanceof Error ? err.message : String(err)}`);
|
|
17
|
+
return fallback();
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export { safeFormat, safeRenderProp };
|
|
@@ -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;
|