diff --git a/apps/webapp/app/components/stories/UsageCharts.stories.tsx b/apps/webapp/app/components/stories/UsageCharts.stories.tsx new file mode 100644 index 000000000..d14780183 --- /dev/null +++ b/apps/webapp/app/components/stories/UsageCharts.stories.tsx @@ -0,0 +1,133 @@ +import type { Meta, StoryObj } from "@storybook/react"; +import { + Bar, + BarChart, + CartesianGrid, + Legend, + Line, + LineChart, + ReferenceLine, + ResponsiveContainer, + Tooltip, + TooltipProps, + XAxis, + YAxis, +} from "recharts"; + +const meta: Meta = { + title: "Components/UsageCharts", + component: UsageCharts, +}; + +export default meta; + +type Story = StoryObj; + +export const ConcurrentRuns: Story = { + render: () => , +}; + +export const RunQueue: Story = { + render: () => , +}; + +const data = [ + { + name: "Nov 23", + "Concurrent Runs": 2, + }, + { + name: "Dec 23", + "Concurrent Runs": 4, + }, + { + name: "Jan 24", + "Concurrent Runs": 3, + }, + { + name: "Feb 24", + "Concurrent Runs": 5, + }, + { + name: "Mar 24", + "Concurrent Runs": 25, + }, + { + name: "Apr 24", + "Concurrent Runs": 10, + }, + { + name: "May 24", + "Concurrent Runs": null, + }, + { + name: "Jun 24", + "Concurrent Runs": null, + }, + { + name: "Jul 24", + "Concurrent Runs": null, + }, + { + name: "Aug 24", + "Concurrent Runs": null, + }, + { + name: "Sep 24", + "Concurrent Runs": null, + }, + { + name: "Oct 24", + "Concurrent Runs": null, + }, +]; + +function UsageCharts() { + return ( +
+ + + + + + + + + +
+ ); +} + +function RunQueueChart() { + return
Run Queue chart
; +} + +const CustomTooltip = ({ active, payload, label }: TooltipProps) => { + if (active && payload) { + return ( +
+

{label}:

+

{payload[0].value}

+
+ ); + } + + return null; +};