Files
supabase/apps/design-system/registry/default/example/logs-bar-chart.tsx
kemal.earth ec6f55c00b feat(design-system): charts defrag (#41026)
* feat: remove unused chart files

* chore: regenerate registry

* fix: logs bar chart positioning

* feat: add charts page to ui patterns

* chore: alphabetise ui patterns nav

* feat: base composable chart components

* chore: prettier for charts.mdx

* chore: slowly putting example together

* feat: add chart header components

* feat: add chart content wrapper

* feat: add recharts to source

* feat: add empty state handling

* feat: add loading state for content area as well

* feat: starting on actual recharts pieces

* feat: add basic api to documentation

* feat: add disabled state too

* feat: couple of basic chart types

* chore: tidy up for now

* feat: modify eslint rules for our demo files

* fix: recharts logo colour on light mode

* feat: absorb metric card into chart

* feat: align prop for chart header

* feat: refactor chart content

* feat: example with table

* chore: format for prettier

* fix: pkg lock merge conflict

* fix: small bits from danny

* feat: add link in ui pattern intro to charts

* chore: remove charts link from atoms

* chore: update metric padding to saxon suggestion

* feat: table footer overrides by default

* feat: update api props in table

* chore: formating
2025-12-10 13:10:18 +00:00

24 lines
662 B
TypeScript

'use client'
import { LogsBarChart } from 'ui-patterns/LogsBarChart'
export default function LogsBarChartDemo() {
const data = Array.from({ length: 100 }, (_, i) => {
const date = new Date()
date.setMinutes(date.getMinutes() - i * 5) // Each point 5 minutes apart
return {
timestamp: date.toISOString(),
ok_count: Math.floor(Math.random() * 100), // Random value 0-99
error_count: Math.floor(Math.random() * 50), // Random value 0-50
warning_count: Math.floor(Math.random() * 50), // Random value 0-50
}
}).reverse()
return (
<div className="w-full h-24">
<LogsBarChart data={data} />
</div>
)
}