1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-09-01 13:47:27 +02:00

Remove ratio graph & column to the right (#10529)

This PR removes the flags archived / flags created trend line as well as
the right-hand column.

Before:
<img width="1107" height="459" alt="image"
src="https://github.com/user-attachments/assets/f6bcbef0-7b71-44c1-b8a0-db5ebaff01ed"
/>


After:
<img width="1128" height="450" alt="image"
src="https://github.com/user-attachments/assets/e55bd335-cc8c-4b88-8e3c-dafecf134742"
/>

I'm not deleting the tooltip yet, because I think we'll want to re-use
that for the group tooltip.
This commit is contained in:
Thomas Heartman 2025-08-25 14:27:07 +02:00 committed by GitHub
parent 2ee92d8c78
commit 0223437f49
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -25,7 +25,6 @@ import {
} from 'component/insights/components/LineChart/ChartTooltip/ChartTooltip';
import { createTooltip } from 'component/insights/components/LineChart/createTooltip';
import { CreationArchiveTooltip } from './CreationArchiveTooltip.tsx';
import { CreationArchiveRatioTooltip } from './CreationArchiveRatioTooltip.tsx';
import { getFlagTypeColors } from './flagTypeColors.ts';
import type { WeekData, RawWeekData } from './types.ts';
@ -153,19 +152,6 @@ export const CreationArchiveChart: FC<ICreationArchiveChartProps> = ({
order: 2,
},
...flagTypeDatasets,
{
label: 'Flags archived / Flags created',
data: weeks,
borderColor: theme.palette.primary.light,
backgroundColor: theme.palette.primary.light,
type: 'line' as const,
parsing: {
yAxisKey: 'archivePercentage',
xAxisKey: 'date',
},
yAxisID: 'y1',
order: 1,
},
],
flagTypeNames,
};
@ -256,38 +242,15 @@ export const CreationArchiveChart: FC<ICreationArchiveChartProps> = ({
text: 'Number of flags',
},
},
y1: {
type: 'linear',
display: true,
position: 'right',
beginAtZero: true,
title: {
display: true,
text: 'Ratio',
},
grid: {
drawOnChartArea: false,
},
ticks: {
callback: (value) => `${value}%`,
},
},
},
}}
height={100}
width={250}
/>
{tooltip?.dataPoints?.some(
(point) =>
point.dataset.label !== 'Archived flags' &&
point.dataset.label !== 'Flags archived / Flags created',
(point) => point.dataset.label !== 'Archived flags',
) ? (
<CreationArchiveTooltip tooltip={tooltip} />
) : tooltip?.dataPoints?.some(
(point) =>
point.dataset.label === 'Flags archived / Flags created',
) ? (
<CreationArchiveRatioTooltip tooltip={tooltip} />
) : (
<ChartTooltip tooltip={tooltip} />
)}