Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

chore(deps): upgrade to recharts v3.8.0 (#12770)

Nimar7e15aa30ab1c
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 457bd1ab5b..a653fc3e62 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -61,7 +61,7 @@ importers:
next-auth:
specifier: ^4.24.13
zod:
specifier: 4.3.6
version: 4.3.6
@@ -241,7 +241,7 @@ importers:
version: 4.1.1
next-auth:
specifier: ^4.24.13
nodemailer:
specifier: ^7.0.11
version: 7.0.11
@@ -626,7 +626,7 @@ importers:
next-auth:
specifier: ^4.24.13
next-query-params:
specifier: ^5.1.0
@@ -691,8 +691,8 @@ importers:
specifier: ^0.2.8-canary.6
version: 0.2.8-canary.6([email protected])
recharts:
- specifier: ^2.15.2
+ specifier: ^3.8.0
remark-gfm:
specifier: ^4.0.1
version: 4.0.1
@@ -4334,6 +4334,17 @@ packages:
peerDependencies:
react: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1
+ '@reduxjs/[email protected]':
+ resolution: {integrity: sha512-Kd6kAHTA6/nUpp8mySPqj3en3dm0tdMIgbttnQ1xFMVpufoj+ADi8pXLBsd4xzTRHQa7t/Jv8W5UnCuW4kuWMQ==}
+ peerDependencies:
+ react: ^16.9.0 || ^17.0.0 || ^18 || ^19
+ react-redux: ^7.2.1 || ^8.1.3 || ^9.0.0
+ peerDependenciesMeta:
+ react:
+ optional: true
+ react-redux:
+ optional: true
+
'@release-it/[email protected]':
resolution: {integrity: sha512-HCFMqDHreLYg4jjTWL//pW1GzZZMn3p7HDbwS2y7y5m0L6p8hEaOEixC3tEzwyVV7VP1VGjqxMvxfa360q8+Tg==}
engines: {node: ^20.9.0 || >=22.0.0}
@@ -5205,8 +5216,8 @@ packages:
resolution: {integrity: sha512-8CGDvrBj1zgo2qE+oS3pOCyYNqCPryMWY2bGfwA0dcfopWGgxs+78df0Rs3rc9THP4JkOhLsAa+15VdpAqkcUA==}
- '@types/[email protected]':
- resolution: {integrity: sha512-Y2Jn2idRrLzUfAKV2LyRImR+y4oa2AntrgID95SHJxuMUrkNXmanDSed71sRNZysveJVt1hLLemQZIady0FpEg==}
+ '@types/[email protected]':
+ resolution: {integrity: sha512-hOLWVbm7uRza0BYXpIIW5pxfrKe0W+D5lrFiAEYR+pb6w3N2SwSMaJbXdUfSEv+dT4MfHBLtn5js0LAWaO6otw==}
resolution: {integrity: sha512-iO90scth9WAbmgv7ogoq57O9YpKmFBbmoEoCHDB2xMBY0+/KVrqAaCDyCE16dUspeOvIxFFRI+0sEtqDqy2b4A==}
@@ -5217,17 +5228,17 @@ packages:
resolution: {integrity: sha512-mgLPETlrpVV1YRJIglr4Ez47g7Yxjl1lj7YKsiMCb27VJH9W8NVM6Bb9d8kkpG/uAQS5AmbA48q2IAolKKo1MA==}
- '@types/[email protected]':
- resolution: {integrity: sha512-P2dlU/q51fkOc/Gfl3Ul9kicV7l+ra934qBFXCFhrZMOL6du1TM0pm1ThYvENukyOn5h9v+yMJ9Fn5JK4QozrQ==}
+ '@types/[email protected]':
+ resolution: {integrity: sha512-VMZBYyQvbGmWyWVea0EHs/BwLgxc+MKi1zLDCONksozI4YJMcTt8ZEuIR4Sb1MMTE8MMW49v0IwI5+b7RmfWlg==}
- '@types/[email protected]':
- resolution: {integrity: sha512-gkK1VVTr5iNiYJ7vWDI+yUFFlszhNMtVeneJ6lUTKPjprsvLLI9/tgEGiXJOnlINJA8FyA88gfnQsHbybVZrYQ==}
+ '@types/[email protected]':
+ resolution: {integrity: sha512-dLmtwB8zkAeO/juAMfnV+sItKjlsw2lKdZVVy6LRr0cBmegxSABiLEpGVmSJJ8O08i4+sGR6qQtb6WtuwJdvVw==}
- '@types/[email protected]':
- resolution: {integrity: sha512-5KKk5aKGu2I+O6SONMYSNflgiP0WfZIQvVUMan50wHsLG1G94JlxEVnCpQARfTtzytuY0p/9PXXZb3I7giofIA==}
+ '@types/[email protected]':
+ resolution: {integrity: sha512-lae0iWfcDeR7qt7rA88BNiqdvPS5pFVPpo5OfjElwNaT2yyekbM0C9vK+yqBqEmHr6lDkRnYNoTBYlAgJa7a4w==}
- '@types/[email protected]':
- resolution: {integrity: sha512-2p6olUZ4w3s+07q3Tm2dbiMZy5pCDfYwtLXXHUnVzXgQlZ/OyPtUz6OL382BkOuGlLXqfT+wqv8Fw2v8/0geBw==}
+ '@types/[email protected]':
+ resolution: {integrity: sha512-yuzZug1nkAAaBlBBikKZTgzCeA+k1uy4ZFwWANOfKw5z5LRhV0gNA7gNkKm7HoK+HRN0wX3EkxGk0fpbWhmB7g==}
resolution: {integrity: sha512-Ps3T8E8dZDam6fUyNiMkekK3XUsaUEik+idO9/YjPtfj2qruF8tFBXS7XhtE4iIXBLxhmLjP3SXpLhVf21I9Lw==}
@@ -5438,6 +5449,9 @@ packages:
resolution: {integrity: sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==}
+ '@types/[email protected]':
+ resolution: {integrity: sha512-zFDAD+tlpf2r4asuHEj0XH6pY6i0g5NeAHPn+15wk3BV6JA69eERFXC1gyGThDkVa1zCyKr5jox1+2LbV/AMLg==}
+
resolution: {integrity: sha512-7gqG38EyHgyP1S+7+xomFtL+ZNHcKv6DwNaCZmJmo1vgMugyF3TCnXVg4t1uk89mLNwnLtnY3TpOpCOyp1/xHQ==}
@@ -6517,8 +6531,8 @@ packages:
resolution: {integrity: sha512-wR/XK3D3XcLIZwpbvQwQ5fK+8Ykds1ip7A2Txe0yxncXSdq1L9skcG7blcedkOX+ZcgxGAmLX1FrRGbADwzi0w==}
engines: {node: '>=12'}
- resolution: {integrity: sha512-YyUI6AEuY/Wpt8KWLgZHsIU86atmikuoOmCfommt0LYHiQSPjvX2AcFc38PX0CBpr2RCyZhjex+NS/LPOv6YqA==}
+ resolution: {integrity: sha512-AJDdYOdnyRDV5b6ArilzCPPwc1ejkHcoyFarqlPqT7zRYjhavcT3uSrqcMvsgh2CgoPbK3RCwyHaVyxYcP2Arg==}
engines: {node: '>=12'}
@@ -6923,6 +6937,9 @@ packages:
resolution: {integrity: sha512-w+5mJ3GuFL+NjVtJlvydShqE1eN3h3PbI7/5LAsYJP/2qtuMXjfL2LpHSRqo4b4eSF5K/DH1JXKUAHSB2UW50g==}
engines: {node: '>= 0.4'}
+ resolution: {integrity: sha512-/jhoOj/Fx+A+IIyDNOvO3TItGmlMKhtX8ISAHKE90c4b/k1tqaqEZ+uUqfpU8DMnW5cgNJv606zS55jGvza0Xw==}
+
resolution: {integrity: sha512-daJB0q2dmTzo90L9NjRaohhRWrCzYxWNFTjEi72/h+p5DcY3yn4MacWfDakHmaBaDzDiuLJsCh0+6LK/iX+c+Q==}
engines: {node: '>=18'}
@@ -7154,6 +7171,9 @@ packages:
resolution: {integrity: sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==}
+ resolution: {integrity: sha512-mlsTRyGaPBjPedk6Bvw+aqbsXDtoAyAzm5MO7JgU+yVRyMQ5O8bD4Kcci7BS85f93veegeCPkL8R4GLClnjLFw==}
+
resolution: {integrity: sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==}
engines: {node: '>=0.8.x'}
@@ -7235,10 +7255,6 @@ packages:
resolution: {integrity: sha512-G3BSX9cfKttjr+2o1O22tYMLq0DPluZnYtq1rXumE1SpL/F/SLIfHx08WYQoWSIpeMYf8sRbJ8++71+v6Pnxfg==}
- resolution: {integrity: sha512-V7/RktU11J3I36Nwq2JnZEM7tNm17eBJz+u25qdxBZeCKiX6BkVSZQjwWIr+IobgnZy+ag73tTZgZi7tr0LrBw==}
- engines: {node: '>=6.0.0'}
-
resolution: {integrity: sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ==}
@@ -7725,6 +7741,12 @@ packages:
resolution: {integrity: sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==}
engines: {node: '>= 4'}
+ resolution: {integrity: sha512-d/+XTN3zfODyjr89gM3mPq1WNX2B8pYsu7eORitdwyA2sBubnTl3laYlBk4sXY5FUa5qTZGBDPJICVbvqzjlbw==}
+
+ resolution: {integrity: sha512-XREFCPo6ksxVzP4E0ekD5aMdf8WMwmdNaz6vuvxgI40UaEiu6q3p8X52aU6GdyvLY3XXX/8R7JOTXStz/nBbRw==}
+
resolution: {integrity: sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==}
engines: {node: '>=6'}
@@ -9839,6 +9861,18 @@ packages:
resolution: {integrity: sha512-I42jl7L3Ze6kZaq+7zXWSunBa3b1on5yfvUW6Eo/3fFOj6dZ5Bqmcd264nJbTK/gn1HjjILAjSwnZbV4RpSaNQ==}
+ resolution: {integrity: sha512-ROY9fvHhwOD9ySfrF0wmvu//bKCQ6AeZZq1nJNtbDC+kk5DuSuNX/n6YWYF/SYy7bSba4D4FSz8DJeKY/S/r+g==}
+ peerDependencies:
+ '@types/react': ^18.2.25 || ^19
+ react: ^18.0 || ^19
+ redux: ^5.0.0
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ redux:
+ optional: true
+
resolution: {integrity: sha512-9r+yi9+mgU33AKcj6IbT9oRCO78WriSj6t/cF8DWBZJ9aOGPOTEDvdUDz1FwKim7QXWwmHqtdHnRJfhAxEG46Q==}
engines: {node: '>=10'}
@@ -9887,12 +9921,6 @@ packages:
peerDependencies:
react: '>=16.8.0'
- resolution: {integrity: sha512-gnGKTpYwqL0Iii09gHobNolvX4Kiq4PKx6eWBCYYix+8cdw+cGo3do906l1NBPKkSWx1DghC1dlWG9L2uGd61Q==}
- peerDependencies:
- react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0
- react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0
-
resolution: {integrity: sha512-b6jSvxvVnyptAiLjbkWLE/lOnR4lfTtDAl+eUC7RZy+QQWc6wRzIV2CE6xBuMmDxc2qIihtDCZD5NPOFl7fRBQ==}
engines: {node: '>=10'}
@@ -9930,15 +9958,13 @@ packages:
resolution: {integrity: sha512-9u/XQ1pvrQtYyMpZe7DXKv2p5CNvyVwzUB6uhLAnQwHMSgKMBR62lc7AHljaeteeHXn11XTAaLLUVZYVZyuRBQ==}
engines: {node: '>= 20.19.0'}
- resolution: {integrity: sha512-kivNFO+0OcUNu7jQquLXAxz1FIwZj8nrj+YkOKc5694NbjCvcT6aSZiIzNzd2Kul4o4rTto8QVR9lMNtxD4G1w==}
-
- resolution: {integrity: sha512-xv9lVztv3ingk7V3Jf05wfAZbM9Q2umJzu5t/cfnAK7LUslNrGT7LPBr74G+ok8kSCeFMaePmWMg0rcYOnczTw==}
- engines: {node: '>=14'}
+ resolution: {integrity: sha512-Z/m38DX3L73ExO4Tpc9/iZWHmHnlzWG4njQbxsF5aSjwqmHNDDIm0rdEBArkwsBvR8U6EirlEHiQNYWCVh9sGQ==}
+ engines: {node: '>=18'}
peerDependencies:
- react: ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0
+ react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0
react-dom: ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0
+ react-is: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0
resolution: {integrity: sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==}
@@ -9952,6 +9978,14 @@ packages:
resolution: {integrity: sha512-DJnGAeenTdpMEH6uAJRK/uiyEIH9WVsUmoLwzudwGJUwZPp80PDBWPHXSAGNPwNvIXAbe7MSUB1zQFugFml66A==}
engines: {node: '>=4'}
+ resolution: {integrity: sha512-NW2r5T6ksUKXCabzhL9z+h206HQw/NJkcLm1GPImRQ8IzfXwRGqjVhKJGauHirT0DAuyy6hjdnMZaRoAcy0Klw==}
+ peerDependencies:
+ redux: ^5.0.0
+
+ resolution: {integrity: sha512-M9/ELqF6fy8FwmkpnF0S3YKOqMyoWJ4+CS5Efg2ct3oY9daQvd/Pc71FpGZsVsbl3Cpb+IIcjBDUnnyBdQbq4w==}
+
resolution: {integrity: sha512-00o4I+DVrefhv+nX0ulyi3biSHCPDe+yLv5o/p6d/UVlirijB8E16FtfwSAi4g3tcqrQ4lRAqQSoFEZJehYEcw==}
engines: {node: '>= 0.4'}
@@ -10562,6 +10596,10 @@ packages:
resolution: {integrity: sha512-g9ljZiwki/LfxmQADO3dEY1CbpmXT5Hm2fJ+QaGKwSXUylMybePR7/67YW7jOrrvjEgL1Fmz5kzyAjWVWLlucg==}
engines: {node: '>=6'}
+ resolution: {integrity: sha512-1MOpMXuhGzGL5TTCZFItxCc0AARf1EZFQkGqMm7ERKj8+Hgr5oLvJOVFcC+lRmR8hCe2S3jC4T5D7Vg/d7/fhA==}
+ engines: {node: '>=6'}
+
resolution: {integrity: sha512-resvxdc6Mgb7YEThw6G6bExlXKkv6+YbuzGg9xuXxSgxJF7Ozs+o8Y9+2R3sArdWdW8nOokoQb1yrpFB0pQK2g==}
engines: {node: '>=14'}
@@ -10975,8 +11013,8 @@ packages:
resolution: {integrity: sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q==}
- resolution: {integrity: sha512-PnpQQMuxlwYdocC8fIJqVXvkeViHYzotI+NJrCuav0ZYFoq912ZHBk3mCeuj+5/VpodOjPe1z0Fk2ihgzlXqjQ==}
+ resolution: {integrity: sha512-SbPDPdDBYp+5MJHhBCAyI7wKM3d5ivekigc2Dk2s7pgbZ9wIgIBYGVw4zGHBml/qTFbexrofXW6Gu4noGxrOwQ==}
resolution: {integrity: sha512-COQsxlVrmcRIbZMMTYwD+C2bxYCFDNQ2EHESklPiInbD/Pk3JZ6qNL84Bp9wWjYjAzXfSlsNaFtRk+hO9yBPWA==}
@@ -13928,7 +13966,7 @@ snapshots:
dependencies:
'@next/[email protected]': {}
@@ -15497,6 +15535,18 @@ snapshots:
dependencies:
react: 19.2.4
+ dependencies:
+ '@standard-schema/spec': 1.1.0
+ '@standard-schema/utils': 0.3.0
+ immer: 11.1.4
+ redux: 5.0.1
+ redux-thunk: 3.1.0([email protected])
+ reselect: 5.1.1
+ optionalDependencies:
+ react: 19.2.4
+
dependencies:
'@iarna/toml': 3.0.0
@@ -16498,7 +16548,7 @@ snapshots:
dependencies:
'@types/node': 24.3.0
- '@types/[email protected]': {}
+ '@types/[email protected]': {}
'@types/[email protected]': {}
@@ -16508,17 +16558,17 @@ snapshots:
dependencies:
'@types/d3-color': 3.1.3
- '@types/[email protected]': {}
+ '@types/[email protected]': {}
- '@types/[email protected]':
+ '@types/[email protected]':
dependencies:
- '@types/d3-time': 3.0.3
+ '@types/d3-time': 3.0.4
- '@types/[email protected]':
+ '@types/[email protected]':
dependencies:
- '@types/d3-path': 3.1.0
+ '@types/d3-path': 3.1.1
- '@types/[email protected]': {}
+ '@types/[email protected]': {}
'@types/[email protected]': {}
@@ -16767,6 +16817,8 @@ snapshots:
'@types/[email protected]': {}
+ '@types/[email protected]': {}
+
'@types/[email protected]': {}
'@types/[email protected]': {}
@@ -17969,7 +18021,7 @@ snapshots:
dependencies:
@@ -17980,7 +18032,7 @@ snapshots:
dependencies:
d3-array: 3.2.4
- d3-format: 3.1.0
+ d3-format: 3.1.2
d3-interpolate: 3.0.1
d3-time: 3.1.0
d3-time-format: 4.1.0
@@ -18300,7 +18352,7 @@ snapshots:
dependencies:
graceful-fs: 4.2.11
- tapable: 2.3.0
+ tapable: 2.3.2
@@ -18413,6 +18465,8 @@ snapshots:
is-date-object: 1.1.0
is-symbol: 1.1.1
+
optionalDependencies:
'@esbuild/aix-ppc64': 0.25.7
@@ -18531,7 +18585,7 @@ snapshots:
tinyglobby: 0.2.15
unrs-resolver: 1.11.1
optionalDependencies:
+ eslint-plugin-import: 2.32.0([email protected])([email protected]([email protected]))
transitivePeerDependencies:
- supports-color
@@ -18779,6 +18833,8 @@ snapshots:
+
@@ -18894,8 +18950,6 @@ snapshots:
-
@@ -19443,6 +19497,10 @@ snapshots:
+
+
dependencies:
parent-module: 1.0.1
@@ -21214,7 +21272,7 @@ snapshots:
dependencies:
type-fest: 2.19.0
dependencies:
'@babel/runtime': 7.28.4
'@panva/hkdf': 1.2.1
@@ -21530,7 +21588,7 @@ snapshots:
dependencies:
- eventemitter3: 5.0.1
+ eventemitter3: 5.0.4
p-timeout: 7.0.1
@@ -22036,6 +22094,15 @@ snapshots:
dependencies:
fast-deep-equal: 2.0.1
+ dependencies:
+ '@types/use-sync-external-store': 0.0.6
+ react: 19.2.4
+ use-sync-external-store: 1.6.0([email protected])
+ optionalDependencies:
+ '@types/react': 19.2.14
+ redux: 5.0.1
+
dependencies:
react: 19.2.4
@@ -22086,14 +22153,6 @@ snapshots:
react: 19.2.4
shallow-equal: 3.1.0
- dependencies:
- fast-equals: 5.2.2
- prop-types: 15.8.1
- react: 19.2.4
- react-dom: 19.2.4([email protected])
- react-transition-group: 4.4.5([email protected]([email protected]))([email protected])
-
dependencies:
get-nonce: 1.0.1
@@ -22127,22 +22186,25 @@ snapshots:
- dependencies:
- decimal.js-light: 2.5.1
-
dependencies:
clsx: 2.1.1
- eventemitter3: 4.0.7
- lodash: 4.17.23
+ decimal.js-light: 2.5.1
+ es-toolkit: 1.45.1
+ eventemitter3: 5.0.4
+ immer: 10.2.0
react: 19.2.4
react-dom: 19.2.4([email protected])
- react-is: 18.3.1
- recharts-scale: 0.4.5
+ react-is: 19.2.0
+ reselect: 5.1.1
tiny-invariant: 1.3.3
- victory-vendor: 36.9.2
+ use-sync-external-store: 1.6.0([email protected])
+ victory-vendor: 37.3.6
+ transitivePeerDependencies:
+ - '@types/react'
+ - redux
dependencies:
@@ -22155,6 +22217,12 @@ snapshots:
dependencies:
redis-errors: 1.2.0
+ dependencies:
+ redux: 5.0.1
+
+
dependencies:
call-bind: 1.0.8
@@ -22910,6 +22978,8 @@ snapshots:
+
dependencies:
http-proxy-agent: 5.0.0
@@ -23345,14 +23415,14 @@ snapshots:
'@types/unist': 3.0.3
vfile-message: 4.0.3
dependencies:
- '@types/d3-array': 3.2.1
+ '@types/d3-array': 3.2.2
'@types/d3-ease': 3.0.2
'@types/d3-interpolate': 3.0.4
- '@types/d3-scale': 4.0.8
- '@types/d3-shape': 3.1.6
- '@types/d3-time': 3.0.3
+ '@types/d3-scale': 4.0.9
+ '@types/d3-shape': 3.1.8
+ '@types/d3-time': 3.0.4
'@types/d3-timer': 3.0.2
d3-array: 3.2.4
d3-ease: 3.0.1
@@ -23523,7 +23593,7 @@ snapshots:
mime-types: 2.1.35
neo-async: 2.6.2
schema-utils: 3.3.0
- tapable: 2.3.0
+ tapable: 2.3.2
terser-webpack-plugin: 5.4.0([email protected])
watchpack: 2.5.1
webpack-sources: 3.3.4
diff --git a/web/package.json b/web/package.json
index 477d0d3c3b..65deee8759 100644
--- a/web/package.json
+++ b/web/package.json
@@ -153,7 +153,7 @@
"react-resizable-panels": "^4.6.5",
"react-responsive": "^10.0.1",
"react18-json-view": "^0.2.8-canary.6",
- "recharts": "^2.15.2",
+ "recharts": "^3.8.0",
"remark-gfm": "^4.0.1",
"remark-math": "^6.0.0",
"remark-parse": "^11.0.0",
diff --git a/web/src/components/ui/chart.tsx b/web/src/components/ui/chart.tsx
index 4a06a34fb4..07356a5be4 100644
--- a/web/src/components/ui/chart.tsx
+++ b/web/src/components/ui/chart.tsx
@@ -2,6 +2,11 @@
import * as React from "react";
import * as RechartsPrimitive from "recharts";
+import type {
+ TooltipContentProps,
+ TooltipPayloadEntry,
+ TooltipValueType,
+} from "recharts";
import { cn } from "@/src/utils/tailwind";
@@ -52,13 +57,19 @@ const ChartContainer = React.forwardRef<
data-chart={chartId}
ref={ref}
className={cn(
- "[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border h-full w-full flex-1 justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden",
+ "[&_.recharts-cartesian-axis-tick-value]:fill-muted-foreground/90 [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground/90 [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border relative h-full w-full flex-1 justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden",
className,
)}
{...props}
>
<ChartStyle id={chartId} config={config} />
- <RechartsPrimitive.ResponsiveContainer>
+ <RechartsPrimitive.ResponsiveContainer
+ width="100%"
+ height="100%"
+ minWidth={0}
+ minHeight={1}
+ initialDimension={{ width: 1, height: 1 }}
+ >
{children}
</RechartsPrimitive.ResponsiveContainer>
</div>
@@ -100,12 +111,36 @@ ${colorConfig
);
};
-const ChartTooltip = RechartsPrimitive.Tooltip;
+type ChartTooltipProps = React.ComponentProps<typeof RechartsPrimitive.Tooltip>;
+
+function ChartTooltip({
+ allowEscapeViewBox = { x: false, y: false },
+ isAnimationActive = false,
+ offset = 12,
+ useTranslate3d = true,
+ wrapperStyle,
+ ...props
+}: ChartTooltipProps) {
+ return (
+ <RechartsPrimitive.Tooltip
+ allowEscapeViewBox={allowEscapeViewBox}
+ isAnimationActive={isAnimationActive}
+ offset={offset}
+ useTranslate3d={useTranslate3d}
+ wrapperStyle={{
+ pointerEvents: "none",
+ zIndex: 50,
+ ...wrapperStyle,
+ }}
+ {...props}
+ />
+ );
+}
const ChartTooltipContent = React.forwardRef<
HTMLDivElement,
- React.ComponentProps<typeof RechartsPrimitive.Tooltip> &
- React.ComponentProps<"div"> & {
+ React.ComponentProps<"div"> &
+ Partial<TooltipContentProps<TooltipValueType, string | number>> & {
hideLabel?: boolean;
hideIndicator?: boolean;
indicator?: "line" | "dot" | "dashed";
@@ -203,18 +238,22 @@ const ChartTooltipContent = React.forwardRef<
{displayPayload.map((item, index) => {
const key = `${nameKey || item.name || item.dataKey || "value"}`;
const itemConfig = getPayloadConfigFromPayload(config, item, key);
- const indicatorColor = color || item.payload.fill || item.color;
+ const indicatorColor =
+ color ||
+ getFillColor(item.payload) ||
+ item.color ||
+ "currentColor";
return (
<div
- key={item.dataKey}
+ key={String(item.dataKey ?? item.name ?? index)}
className={cn(
"[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5",
indicator === "dot" && "items-center",
)}
>
- {formatter && item?.value !== undefined && item.name ? (
- formatter(item.value, item.name, item, index, item.payload)
+ {formatter && item?.value !== undefined && item.name != null ? (
+ formatter(item.value, item.name, item, index, displayPayload)
) : (
<>
{itemConfig?.icon ? (
@@ -277,65 +316,41 @@ const ChartTooltipContent = React.forwardRef<
);
ChartTooltipContent.displayName = "ChartTooltip";
-const ChartLegend = RechartsPrimitive.Legend;
+type ChartLegendProps = React.ComponentProps<typeof RechartsPrimitive.Legend>;
-const ChartLegendContent = React.forwardRef<
- HTMLDivElement,
- React.ComponentProps<"div"> &
- Pick<RechartsPrimitive.LegendProps, "payload" | "verticalAlign"> & {
- hideIcon?: boolean;
- nameKey?: string;
- }
->(
- (
- { className, hideIcon = false, payload, verticalAlign = "bottom", nameKey },
- ref,
- ) => {
- const { config } = useChart();
+function ChartLegend({ itemSorter = null, ...props }: ChartLegendProps) {
+ return <RechartsPrimitive.Legend itemSorter={itemSorter} {...props} />;
+}
- if (!payload?.length) {
- return null;
- }
+function ChartActiveReferenceLine({
+ stroke = "hsl(var(--border))",
+ strokeDasharray = "4 4",
+ strokeOpacity = 0.8,
+ zIndex = 350,
+}: {
+ stroke?: string;
+ strokeDasharray?: string;
+ strokeOpacity?: number;
+ zIndex?: number;
+}) {
+ const activeLabel = RechartsPrimitive.useActiveTooltipLabel();
+ const isTooltipActive = RechartsPrimitive.useIsTooltipActive();
+
+ if (!isTooltipActive || activeLabel === undefined || activeLabel === null) {
+ return null;
+ }
- return (
- <div
- ref={ref}
- className={cn(
- "flex items-center justify-center gap-4",
- verticalAlign === "top" ? "pb-3" : "pt-3",
- className,
- )}
- >
- {payload.map((item) => {
- const key = `${nameKey || item.dataKey || "value"}`;
- const itemConfig = getPayloadConfigFromPayload(config, item, key);
-
- return (
- <div
- key={item.value}
- className={cn(
- "[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3",
- )}
- >
- {itemConfig?.icon && !hideIcon ? (
- <itemConfig.icon />
- ) : (
- <div
- className="h-2 w-2 shrink-0 rounded-[2px]"
- style={{
- backgroundColor: item.color,
- }}
- />
- )}
- {itemConfig?.label}
- </div>
- );
- })}
- </div>
- );
- },
-);
-ChartLegendContent.displayName = "ChartLegend";
+ return (
+ <RechartsPrimitive.ReferenceLine
+ x={activeLabel}
+ stroke={stroke}
+ strokeDasharray={strokeDasharray}
+ strokeOpacity={strokeOpacity}
+ ifOverflow="extendDomain"
+ zIndex={zIndex}
+ />
+ );
+}
// Helper to extract item config from a payload.
function getPayloadConfigFromPayload(
@@ -376,13 +391,27 @@ function getPayloadConfigFromPayload(
: config[key as keyof typeof config];
}
+function getFillColor(
+ payload: TooltipPayloadEntry<TooltipValueType, string | number>["payload"],
+): string | undefined {
+ if (
+ typeof payload === "object" &&
+ payload !== null &&
+ "fill" in payload &&
+ typeof payload.fill === "string"
+ ) {
+ return payload.fill;
+ }
+
+ return undefined;
+}
+
export {
ChartContainer,
ChartTooltip,
ChartTooltipContent,
ChartLegend,
- ChartLegendContent,
- ChartStyle,
+ ChartActiveReferenceLine,
useChart,
getPayloadConfigFromPayload,
};
diff --git a/web/src/features/score-analytics/components/charts/ScoreChartLegendContent.tsx b/web/src/features/score-analytics/components/charts/ScoreChartLegendContent.tsx
index ef674ea745..b4ef7b9593 100644
--- a/web/src/features/score-analytics/components/charts/ScoreChartLegendContent.tsx
+++ b/web/src/features/score-analytics/components/charts/ScoreChartLegendContent.tsx
@@ -1,5 +1,5 @@
import React, { useState, useRef, useLayoutEffect, useMemo } from "react";
-import { type LegendProps } from "recharts";
+import type { DefaultLegendContentProps, LegendPayload } from "recharts";
import { MoreVertical } from "lucide-react";
import { Button } from "@/src/components/ui/button";
import {
@@ -14,7 +14,7 @@ import {
} from "@/src/components/ui/chart";
export interface ScoreChartLegendContentProps extends Pick<
- LegendProps,
+ DefaultLegendContentProps,
"payload" | "verticalAlign"
> {
/** Enable interactive click-to-toggle functionality */
@@ -24,9 +24,7 @@ export interface ScoreChartLegendContentProps extends Pick<
/** Callback when visibility changes */
onVisibilityChange?: (key: string, visible: boolean) => void;
/** Optional function to format labels */
- formatLabel?: (label: string, item: unknown) => string;
- /** Hide the color indicator icon */
- hideIcon?: boolean;
+ formatLabel?: (label: string, item: LegendPayload) => string;
/** Custom className */
className?: string;
/** Name key to use for legend items */
@@ -304,7 +302,7 @@ export const ScoreChartLegendContent = React.forwardRef<
return {};
}
- const groups: Record<string, typeof payload> = {};
+ const groups: Record<string, LegendPayload[]> = {};
payload.forEach((item) => {
const key = `${nameKey || item.dataKey || "value"}`;
@@ -373,7 +371,7 @@ export const ScoreChartLegendContent = React.forwardRef<
};
// Format label for display
- const getFormattedLabel = (item: (typeof payload)[0]): string => {
+ const getFormattedLabel = (item: LegendPayload): string => {
const key = `${nameKey || item.dataKey || "value"}`;
// Try to get label from ChartConfig first
diff --git a/web/src/features/score-analytics/components/charts/ScoreDistributionBooleanChart.tsx b/web/src/features/score-analytics/components/charts/ScoreDistributionBooleanChart.tsx
index 14399a052e..73bacf1b37 100644
--- a/web/src/features/score-analytics/components/charts/ScoreDistributionBooleanChart.tsx
+++ b/web/src/features/score-analytics/components/charts/ScoreDistributionBooleanChart.tsx
@@ -1,7 +1,8 @@
import { useMemo, useState, useCallback } from "react";
-import { Bar, BarChart, XAxis, YAxis, Legend } from "recharts";
+import { Bar, BarChart, XAxis, YAxis } from "recharts";
import {
ChartContainer,
+ ChartLegend,
ChartTooltip,
type ChartConfig,
} from "@/src/components/ui/chart";
@@ -221,6 +222,7 @@ export function ScoreDistributionBooleanChart({
fontSize={12}
tickLine={false}
axisLine={false}
+ niceTicks="auto"
tickFormatter={(value) => value.toLocaleString()}
/>
<ChartTooltip
@@ -246,7 +248,7 @@ export function ScoreDistributionBooleanChart({
/>
)}
- <Legend
+ <ChartLegend
content={
<ScoreChartLegendContent
interactive={isComparisonMode}
diff --git a/web/src/features/score-analytics/components/charts/ScoreDistributionCategoricalChart.tsx b/web/src/features/score-analytics/components/charts/ScoreDistributionCategoricalChart.tsx
index b85f39ff64..56e36d9942 100644
--- a/web/src/features/score-analytics/components/charts/ScoreDistributionCategoricalChart.tsx
+++ b/web/src/features/score-analytics/components/charts/ScoreDistributionCategoricalChart.tsx
@@ -1,7 +1,8 @@
import { useMemo, useState, useCallback } from "react";
-import { Bar, BarChart, XAxis, YAxis, Legend } from "recharts";
+import { Bar, BarChart, XAxis, YAxis } from "recharts";
import {
ChartContainer,
+ ChartLegend,
ChartTooltip,
type ChartConfig,
} from "@/src/components/ui/chart";
@@ -284,7 +285,7 @@ export function ScoreDistributionCategoricalChart({
/>
)}
- <Legend
+ <ChartLegend
content={
<ScoreChartLegendContent
interactive={hasStackedData}
diff --git a/web/src/features/score-analytics/components/charts/ScoreDistributionNumericChart.tsx b/web/src/features/score-analytics/components/charts/ScoreDistributionNumericChart.tsx
index 84614f91b7..01fe6a71e4 100644
--- a/web/src/features/score-analytics/components/charts/ScoreDistributionNumericChart.tsx
+++ b/web/src/features/score-analytics/components/charts/ScoreDistributionNumericChart.tsx
@@ -1,7 +1,8 @@
import { useMemo, useState, useCallback } from "react";
-import { Bar, BarChart, XAxis, YAxis, Legend } from "recharts";
+import { Bar, BarChart, XAxis, YAxis } from "recharts";
import {
ChartContainer,
+ ChartLegend,
ChartTooltip,
type ChartConfig,
} from "@/src/components/ui/chart";
@@ -128,6 +129,7 @@ export function ScoreDistributionNumericChart({
fontSize={12}
tickLine={false}
axisLine={false}
+ niceTicks="auto"
tickFormatter={(value) => compactNumberFormatter(value)}
/>
<ChartTooltip
@@ -155,7 +157,7 @@ export function ScoreDistributionNumericChart({
/>
)}
- <Legend
+ <ChartLegend
content={
<ScoreChartLegendContent
interactive={isComparisonMode}
diff --git a/web/src/features/score-analytics/components/charts/ScoreTimeSeriesBooleanChart.tsx b/web/src/features/score-analytics/components/charts/ScoreTimeSeriesBooleanChart.tsx
index adcbb7b46b..de91639f48 100644
--- a/web/src/features/score-analytics/components/charts/ScoreTimeSeriesBooleanChart.tsx
+++ b/web/src/features/score-analytics/components/charts/ScoreTimeSeriesBooleanChart.tsx
@@ -1,7 +1,9 @@
import { useMemo, useState, useCallback } from "react";
-import { Line, LineChart, XAxis, YAxis, Legend } from "recharts";
+import { Line, LineChart, XAxis, YAxis } from "recharts";
import {
+ ChartActiveReferenceLine,
ChartContainer,
+ ChartLegend,
ChartTooltip,
type ChartConfig,
} from "@/src/components/ui/chart";
@@ -165,6 +167,7 @@ export function ScoreTimeSeriesBooleanChart({
tickLine={false}
axisLine={false}
label={{ value: "Count", angle: -90, position: "insideLeft" }}
+ niceTicks="auto"
tickFormatter={(value) => value.toLocaleString()}
/>
{categories.map((category) => {
@@ -183,6 +186,7 @@ export function ScoreTimeSeriesBooleanChart({
/>
);
})}
+ <ChartActiveReferenceLine />
<ChartTooltip
content={
<ScoreChartTooltip
@@ -192,7 +196,7 @@ export function ScoreTimeSeriesBooleanChart({
/>
}
/>
- <Legend
+ <ChartLegend
content={
<ScoreChartLegendContent
interactive={true}
diff --git a/web/src/features/score-analytics/components/charts/ScoreTimeSeriesCategoricalChart.tsx b/web/src/features/score-analytics/components/charts/ScoreTimeSeriesCategoricalChart.tsx
index 6601fe95f5..b67f861e66 100644
--- a/web/src/features/score-analytics/components/charts/ScoreTimeSeriesCategoricalChart.tsx
+++ b/web/src/features/score-analytics/components/charts/ScoreTimeSeriesCategoricalChart.tsx
@@ -1,7 +1,9 @@
import { useMemo, useState, useCallback } from "react";
-import { Line, LineChart, XAxis, YAxis, Legend } from "recharts";
+import { Line, LineChart, XAxis, YAxis } from "recharts";
import {
+ ChartActiveReferenceLine,
ChartContainer,
+ ChartLegend,
ChartTooltip,
type ChartConfig,
} from "@/src/components/ui/chart";
@@ -164,6 +166,7 @@ export function ScoreTimeSeriesCategoricalChart({
tickLine={false}
axisLine={false}
label={{ value: "Count", angle: -90, position: "insideLeft" }}
+ niceTicks="auto"
tickFormatter={(value) => value.toLocaleString()}
/>
{categories.map((category) => {
@@ -182,6 +185,7 @@ export function ScoreTimeSeriesCategoricalChart({
/>
);
})}
+ <ChartActiveReferenceLine />
<ChartTooltip
content={
<ScoreChartTooltip
@@ -191,7 +195,7 @@ export function ScoreTimeSeriesCategoricalChart({
/>
}
/>
- <Legend
+ <ChartLegend
content={
<ScoreChartLegendContent
interactive={true}
diff --git a/web/src/features/score-analytics/components/charts/ScoreTimeSeriesNumericChart.tsx b/web/src/features/score-analytics/components/charts/ScoreTimeSeriesNumericChart.tsx
index 01e142adef..c67d85c607 100644
--- a/web/src/features/score-analytics/components/charts/ScoreTimeSeriesNumericChart.tsx
+++ b/web/src/features/score-analytics/components/charts/ScoreTimeSeriesNumericChart.tsx
@@ -1,7 +1,9 @@
import { useMemo, useState, useCallback } from "react";
-import { Line, LineChart, XAxis, YAxis, Legend } from "recharts";
+import { Line, LineChart, XAxis, YAxis } from "recharts";
import {
+ ChartActiveReferenceLine,
ChartContainer,
+ ChartLegend,
ChartTooltip,
type ChartConfig,
} from "@/src/components/ui/chart";
@@ -158,6 +160,7 @@ export function ScoreTimeSeriesNumericChart({
fontSize={12}
tickLine={false}
axisLine={false}
+ niceTicks="auto"
tickFormatter={(value) => compactNumberFormatter(value)}
/>
<Line
@@ -186,6 +189,7 @@ export function ScoreTimeSeriesNumericChart({
connectNulls
/>
)}
+ <ChartActiveReferenceLine />
<ChartTooltip
content={
<ScoreChartTooltip
@@ -195,7 +199,7 @@ export function ScoreTimeSeriesNumericChart({
/>
}
/>
- <Legend
+ <ChartLegend
content={
<ScoreChartLegendContent
interactive={isComparisonMode}
diff --git a/web/src/features/score-analytics/lib/ScoreChartTooltip.tsx b/web/src/features/score-analytics/lib/ScoreChartTooltip.tsx
index 1a13c37fa0..b0d6e22d20 100644
--- a/web/src/features/score-analytics/lib/ScoreChartTooltip.tsx
+++ b/web/src/features/score-analytics/lib/ScoreChartTooltip.tsx
@@ -5,20 +5,15 @@ import {
} from "@/src/utils/date-range-utils";
import { formatChartTooltipTimestamp } from "./chart-formatters";
import { useChart } from "@/src/components/ui/chart";
+import type { TooltipContentProps, TooltipValueType } from "recharts";
/**
* Props for the ScoreChartTooltip component.
* Compatible with Recharts tooltip API.
*/
export interface ScoreChartTooltipProps {
- active?: boolean;
- payload?: Array<{
- name?: string;
- value?: number | string;
- color?: string;
- dataKey?: string;
- payload?: any;
- }>;
+ active?: TooltipContentProps<TooltipValueType, string | number>["active"];
+ payload?: TooltipContentProps<TooltipValueType, string | number>["payload"];
label?: string | number;
interval?: IntervalConfig;
timeRange?: TimeRange;
@@ -67,7 +62,9 @@ export function ScoreChartTooltip({
// Filter out duplicates
const uniquePayload = Array.from(
- new Map(payload.map((item) => [item.name ?? item.dataKey, item])).values(),
+ new Map(
+ payload.map((item) => [String(item.name ?? item.dataKey ?? ""), item]),
+ ).values(),
);
// Sort payload by config key order for stable tooltip across columns
@@ -76,8 +73,8 @@ export function ScoreChartTooltip({
// Falls back to value-based sorting if config keys not available
const configKeys = Object.keys(config);
const sortedPayload = uniquePayload.sort((a, b) => {
- const keyA = a.name ?? a.dataKey ?? "";
- const keyB = b.name ?? b.dataKey ?? "";
+ const keyA = String(a.name ?? a.dataKey ?? "");
+ const keyB = String(b.name ?? b.dataKey ?? "");
// If both keys exist in config, sort by config order (reversed)
const indexA = configKeys.indexOf(keyA);
@@ -127,7 +124,7 @@ export function ScoreChartTooltip({
<div className={cn("space-y-1 px-3 py-1.5")}>
{sortedPayload.map((entry, index) => {
// Get series label from config using the Bar's dataKey
- const seriesKey = entry.name || entry.dataKey || "";
+ const seriesKey = String(entry.name ?? entry.dataKey ?? "");
const seriesLabel = config[seriesKey]?.label || seriesKey;
return (
diff --git a/web/src/features/widgets/chart-library/AreaChartTimeSeries.tsx b/web/src/features/widgets/chart-library/AreaChartTimeSeries.tsx
index 2593280fb4..06187bf37b 100644
--- a/web/src/features/widgets/chart-library/AreaChartTimeSeries.tsx
+++ b/web/src/features/widgets/chart-library/AreaChartTimeSeries.tsx
@@ -1,5 +1,6 @@
import React, { useMemo, useState } from "react";
import {
+ ChartActiveReferenceLine,
ChartContainer,
ChartTooltip,
ChartTooltipContent,
@@ -97,6 +98,7 @@ export const AreaChartTimeSeries: React.FC<ChartProps> = ({
fontSize={12}
tickLine={false}
axisLine={false}
+ niceTicks="auto"
tickFormatter={(value) => tooltipFormatter(Number(value))}
/>
{dimensions.map((dimension, index) => {
@@ -117,6 +119,7 @@ export const AreaChartTimeSeries: React.FC<ChartProps> = ({
/>
);
})}
+ <ChartActiveReferenceLine />
<ChartTooltip
contentStyle={{ backgroundColor: "hsl(var(--background))" }}
content={({ active, payload, label }) => (
@@ -124,6 +127,7 @@ export const AreaChartTimeSeries: React.FC<ChartProps> = ({
active={active}
payload={payload}
label={label}
+ indicator="line"
valueFormatter={tooltipFormatter}
sortPayloadByValue="desc"
/>
diff --git a/web/src/features/widgets/chart-library/HistogramChart.tsx b/web/src/features/widgets/chart-library/HistogramChart.tsx
index d4f5e35629..6982b35d60 100644
--- a/web/src/features/widgets/chart-library/HistogramChart.tsx
+++ b/web/src/features/widgets/chart-library/HistogramChart.tsx
@@ -90,6 +90,7 @@ const HistogramChart = ({
fontSize={12}
tickLine={false}
axisLine={false}
+ niceTicks="auto"
/>
<Bar
dataKey="count"
diff --git a/web/src/features/widgets/chart-library/HorizontalBarChart.tsx b/web/src/features/widgets/chart-library/HorizontalBarChart.tsx
index 560fba762f..b45776965e 100644
--- a/web/src/features/widgets/chart-library/HorizontalBarChart.tsx
+++ b/web/src/features/widgets/chart-library/HorizontalBarChart.tsx
@@ -4,7 +4,14 @@ import {
ChartTooltip,
ChartTooltipContent,
} from "@/src/components/ui/chart";
-import { Bar, BarChart, LabelList, XAxis, YAxis } from "recharts";
+import {
+ Bar,
+ BarChart,
+ LabelList,
+ type RenderableText,
+ XAxis,
+ YAxis,
+} from "recharts";
import { type ChartProps } from "@/src/features/widgets/chart-library/chart-props";
import { formatAxisLabel } from "@/src/features/widgets/chart-library/utils";
import { compactNumberFormatter } from "@/src/utils/numbers";
@@ -72,6 +79,7 @@ export const HorizontalBarChart: React.FC<ChartProps> = ({
fontSize={12}
tickLine={false}
axisLine={false}
+ niceTicks="auto"
tickFormatter={(value) => valueFormatter(Number(value))}
/>
<YAxis
@@ -115,7 +123,9 @@ export const HorizontalBarChart: React.FC<ChartProps> = ({
<LabelList
dataKey="metric"
position="right"
- formatter={(value: number) => valueFormatter(value)}
+ formatter={(value: RenderableText) =>
+ valueFormatter(Number(value ?? 0))
+ }
className="fill-muted-foreground"
style={{ fontSize: 12 }}
/>
diff --git a/web/src/features/widgets/chart-library/LineChartTimeSeries.tsx b/web/src/features/widgets/chart-library/LineChartTimeSeries.tsx
index 631439b30a..e2076f67b4 100644
--- a/web/src/features/widgets/chart-library/LineChartTimeSeries.tsx
+++ b/web/src/features/widgets/chart-library/LineChartTimeSeries.tsx
@@ -1,5 +1,6 @@
import React, { useMemo, useState } from "react";
import {
+ ChartActiveReferenceLine,
ChartContainer,
ChartTooltip,
ChartTooltipContent,
@@ -103,6 +104,7 @@ export const LineChartTimeSeries: React.FC<ChartProps> = ({
fontSize={12}
tickLine={false}
axisLine={false}
+ niceTicks="auto"
tickFormatter={(value) => tooltipFormatter(Number(value))}
/>
{dimensions.map((dimension, index) => {
@@ -127,6 +129,7 @@ export const LineChartTimeSeries: React.FC<ChartProps> = ({
/>
);
})}
+ <ChartActiveReferenceLine />
<ChartTooltip
contentStyle={{ backgroundColor: "hsl(var(--background))" }}
content={({ active, payload, label }) => (
@@ -134,6 +137,7 @@ export const LineChartTimeSeries: React.FC<ChartProps> = ({
active={active}
payload={payload}
label={label}
+ indicator="line"
valueFormatter={tooltipFormatter}
sortPayloadByValue="desc"
/>
diff --git a/web/src/features/widgets/chart-library/PieChart.tsx b/web/src/features/widgets/chart-library/PieChart.tsx
index 6dcdbc2029..9a446d40e2 100644
--- a/web/src/features/widgets/chart-library/PieChart.tsx
+++ b/web/src/features/widgets/chart-library/PieChart.tsx
@@ -4,7 +4,13 @@ import {
ChartTooltip,
ChartTooltipContent,
} from "@/src/components/ui/chart";
-import { Cell, Label, Pie, PieChart as PieChartComponent } from "recharts";
+import {
+ Label,
+ Pie,
+ PieChart as PieChartComponent,
+ Sector,
+ type PieSectorShapeProps,
+} from "recharts";
import { type ChartProps } from "@/src/features/widgets/chart-library/chart-props";
import { compactNumberFormatter, numberFormatter } from "@/src/utils/numbers";
@@ -42,6 +48,24 @@ export const PieChart: React.FC<ChartProps> = ({
}));
}, [data]);
+ const renderSector = (props: PieSectorShapeProps) => {
+ const outerRadius =
+ typeof props.outerRadius === "number" ? props.outerRadius : 0;
+ const expandedOuterRadius = props.isActive ? outerRadius + 10 : outerRadius;
+
+ return (
+ <Sector
+ {...props}
+ outerRadius={expandedOuterRadius}
+ opacity={
+ subtleFill ? (props.isActive ? 0.9 : 0.45) : props.isActive ? 1 : 0.82
+ }
+ stroke="hsl(var(--background))"
+ strokeWidth={props.isActive ? 4 : 3}
+ />
+ );
+ };
+
return (
<ChartContainer config={config}>
<PieChartComponent accessibilityLayer={accessibilityLayer}>
@@ -66,14 +90,8 @@ export const PieChart: React.FC<ChartProps> = ({
outerRadius={120}
paddingAngle={2}
strokeWidth={5}
+ shape={renderSector}
>
- {chartData.map((entry) => (
- <Cell
- key={entry.name}
- fill={entry.fill}
- fillOpacity={subtleFill ? 0.3 : 1}
- />
- ))}
{/* Label in the center of the donut */}
{data.length > 0 && (
<Label
diff --git a/web/src/features/widgets/chart-library/VerticalBarChart.tsx b/web/src/features/widgets/chart-library/VerticalBarChart.tsx
index 2f2354eb12..85fa1330f4 100644
--- a/web/src/features/widgets/chart-library/VerticalBarChart.tsx
+++ b/web/src/features/widgets/chart-library/VerticalBarChart.tsx
@@ -41,6 +41,7 @@ export const VerticalBarChart: React.FC<ChartProps> = ({
fontSize={12}
tickLine={false}
axisLine={false}
+ niceTicks="auto"
/>
<YAxis
type="number"
diff --git a/web/src/features/widgets/chart-library/VerticalBarChartTimeSeries.tsx b/web/src/features/widgets/chart-library/VerticalBarChartTimeSeries.tsx
index 7bd33e07f1..ebf3aa2d17 100644
--- a/web/src/features/widgets/chart-library/VerticalBarChartTimeSeries.tsx
+++ b/web/src/features/widgets/chart-library/VerticalBarChartTimeSeries.tsx
@@ -1,5 +1,6 @@
import React, { useMemo } from "react";
import {
+ ChartActiveReferenceLine,
ChartContainer,
ChartTooltip,
ChartTooltipContent,
@@ -56,6 +57,7 @@ export const VerticalBarChartTimeSeries: React.FC<ChartProps> = ({
fontSize={12}
tickLine={false}
axisLine={false}
+ niceTicks="auto"
/>
{dimensions.map((dimension, index) => (
<Bar
@@ -67,6 +69,7 @@ export const VerticalBarChartTimeSeries: React.FC<ChartProps> = ({
stackId={dimensions.length > 1 ? "stack" : undefined}
/>
))}
+ <ChartActiveReferenceLine />
<ChartTooltip
cursor={false}
contentStyle={{ backgroundColor: "hsl(var(--background))" }}