TotalRequestsChartRenderer() — supabase Function Reference
Architecture documentation for the TotalRequestsChartRenderer() function in ApiRenderers.tsx from the supabase codebase.
Entity Profile
Relationship Graph
Source Code
apps/studio/components/interfaces/Reports/renderers/ApiRenderers.tsx lines 115–160
export const TotalRequestsChartRenderer = (
props: ReportWidgetProps<{
timestamp: string
count: number
}>
) => {
const total = props.data.reduce((acc, datum) => {
return acc + datum.count
}, 0)
const { data, error, isError } = useFillTimeseriesSorted({
data: props.data,
timestampKey: 'timestamp',
valueKey: 'count',
defaultValue: 0,
startDate: props.params?.iso_timestamp_start,
endDate: props.params?.iso_timestamp_end,
})
if (!!props.error) {
const error = (
typeof props.error === 'string' ? { message: props.error } : props.error
) as ResponseError
return <AlertError subject="Failed to retrieve total requests" error={error} />
} else if (isError) {
return (
<Alert_Shadcn_ variant="warning">
<WarningIcon />
<AlertTitle_Shadcn_>Failed to retrieve total requests</AlertTitle_Shadcn_>
<AlertDescription_Shadcn_>{error?.message ?? 'Unknown error'}</AlertDescription_Shadcn_>
</Alert_Shadcn_>
)
}
return (
<BarChart
size="small"
minimalHeader
highlightedValue={total}
className="w-full"
data={data}
yAxisKey="count"
xAxisKey="timestamp"
displayDateInUtc
/>
)
}
Domain
Subdomains
Source
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free