bump recharts to 2.5.0

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2023-03-27 17:35:49 +02:00
parent 66b6cfc571
commit 55a969fe57
10 changed files with 141 additions and 160 deletions
+1 -1
View File
@@ -51,7 +51,7 @@
"luxon": "^3.0.0",
"prop-types": "^15.7.2",
"react-use": "^17.3.1",
"recharts": "^2.1.5"
"recharts": "^2.5.0"
},
"peerDependencies": {
"react": "^16.13.1 || ^17.0.0",
@@ -109,7 +109,7 @@ export function StatusChart(props: StatusChartProps) {
const tooltipFormatter = useMemo(() => {
const reasonSet = new Set(analysis.daily.triggerReasons);
return (percentOrCount: number, name: string) => {
return (percentOrCount: number, name: string): [any, any] => {
const label = reasonSet.has(name)
? humanTriggerReason(name)
: capitalize(name);
@@ -118,6 +118,7 @@ export function StatusChart(props: StatusChartProps) {
: percentOrCount;
return [
// TODO(Rugvip): Types don't allow returning elements, but it was here before so presumably works
<Typography component="span">
{label}: {valueText}
</Typography>,
@@ -95,8 +95,12 @@ export function tickFormatterY(duration: number) {
.replace(/year.*/, 'y');
}
export function tooltipValueFormatter(durationOrCount: number, name: string) {
export function tooltipValueFormatter(
durationOrCount: number,
name: string,
): [any, any] {
return [
// TODO(Rugvip): Types don't allow returning elements, but it was here before so presumably works
<Typography component="span" style={infoText}>
{capitalize(name)}:{' '}
{name.endsWith(' count')