refactor(dashboard): the chart component is now cleaned up and easier to extend

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-09-12 09:30:48 +02:00
parent 3e19f90e51
commit 558761ca9d
76 changed files with 2910 additions and 2475 deletions

View File

@@ -1,4 +1,4 @@
import { ChartRoot } from '@/components/report/chart';
import { ReportChart } from '@/components/report-chart';
import { ScrollArea } from '@/components/ui/scroll-area';
import type { IChartProps } from '@openpanel/validation';
@@ -15,7 +15,13 @@ const OverviewChartDetails = (props: Props) => {
<ModalHeader title={props.chart.name} />
<ScrollArea className="-m-6 max-h-[calc(100vh-200px)]">
<div className="p-6">
<ChartRoot {...props.chart} limit={999} chartType="bar" />
<ReportChart
report={{
...props.chart,
limit: 999,
chartType: 'bar',
}}
/>
</div>
</ScrollArea>
</ModalContent>

View File

@@ -1,4 +1,4 @@
import { ChartRootShortcut } from '@/components/report/chart';
import { ReportChartShortcut } from '@/components/report-chart/shortcut';
import { KeyValue } from '@/components/ui/key-value';
import { useAppParams } from '@/hooks/useAppParams';
import {
@@ -193,7 +193,7 @@ export default function EventDetails({ id }: Props) {
Show all
</button>
</div>
<ChartRootShortcut
<ReportChartShortcut
projectId={event.projectId}
chartType="histogram"
events={[