{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "chart-area-oxygen",
  "title": "Oxygen weaning area chart",
  "description": "Oxygen flow rate over time, as a step area chart.",
  "dependencies": [
    "recharts@^3.8.0"
  ],
  "registryDependencies": [
    "card",
    "badge",
    "chart"
  ],
  "files": [
    {
      "path": "registry/base-nova/charts/chart-area-oxygen.tsx",
      "content": "\"use client\"\n\nimport { Area, AreaChart, CartesianGrid, XAxis } from \"recharts\"\n\nimport {\n  Card,\n  CardAction,\n  CardContent,\n  CardDescription,\n  CardFooter,\n  CardHeader,\n  CardTitle,\n} from \"@/components/ui/card\"\nimport { Badge } from \"@/components/ui/badge\"\nimport {\n  ChartContainer,\n  ChartTooltip,\n  ChartTooltipContent,\n  type ChartConfig,\n} from \"@/components/ui/chart\"\nimport { IconPlaceholder } from \"@/icons/icon-placeholder\"\n\nexport const description = \"Oxygen flow rate over time, as a step area chart\"\n\n// Flow is changed in steps, so the chart holds each value until the next.\nconst chartData = [\n  { time: \"00:00\", flow: 4 },\n  { time: \"02:00\", flow: 4 },\n  { time: \"04:00\", flow: 3 },\n  { time: \"06:00\", flow: 3 },\n  { time: \"08:00\", flow: 2 },\n  { time: \"10:00\", flow: 2 },\n  { time: \"12:00\", flow: 1 },\n  { time: \"14:00\", flow: 1 },\n  { time: \"16:00\", flow: 0 },\n]\n\nconst chartConfig = {\n  flow: {\n    label: \"Oxygen (L/min)\",\n    color: \"var(--chart-2)\",\n  },\n} satisfies ChartConfig\n\nconst latest = chartData.at(-1)!\nconst onRoomAir = latest.flow === 0\n\nconst first = chartData[0]!\nconst offAt = chartData.find(({ flow }) => flow === 0)?.time\n\nexport function ChartAreaOxygen() {\n  return (\n    <Card>\n      <CardHeader>\n        <CardTitle>Oxygen weaning</CardTitle>\n        <CardDescription>Nasal cannula flow, litres per minute</CardDescription>\n        <CardAction className=\"flex flex-col items-end gap-1.5\">\n          <div className=\"text-2xl leading-none font-semibold\">\n            {latest.flow}{\" \"}\n            <span className=\"text-sm font-normal text-muted-foreground\">\n              L/min\n            </span>\n          </div>\n          <Badge variant=\"outline\">\n            {onRoomAir ? (\n              <IconPlaceholder\n                lucide=\"CheckIcon\"\n                tabler=\"IconCheck\"\n                hugeicons=\"Tick02Icon\"\n                phosphor=\"CheckIcon\"\n                remixicon=\"RiCheckLine\"\n                data-icon=\"inline-start\"\n              />\n            ) : (\n              <IconPlaceholder\n                lucide=\"TriangleAlertIcon\"\n                tabler=\"IconAlertTriangle\"\n                hugeicons=\"Alert02Icon\"\n                phosphor=\"WarningIcon\"\n                remixicon=\"RiAlertLine\"\n                data-icon=\"inline-start\"\n              />\n            )}\n            {onRoomAir ? \"Room air\" : \"On oxygen\"}\n          </Badge>\n        </CardAction>\n      </CardHeader>\n      <CardContent>\n        <ChartContainer config={chartConfig}>\n          <AreaChart\n            accessibilityLayer\n            data={chartData}\n            margin={{ left: 12, right: 12 }}\n          >\n            <CartesianGrid vertical={false} />\n            <XAxis\n              dataKey=\"time\"\n              tickLine={false}\n              axisLine={false}\n              tickMargin={8}\n            />\n            <ChartTooltip cursor={false} content={<ChartTooltipContent />} />\n            <Area\n              dataKey=\"flow\"\n              type=\"step\"\n              fill=\"var(--color-flow)\"\n              fillOpacity={0.4}\n              stroke=\"var(--color-flow)\"\n            />\n          </AreaChart>\n        </ChartContainer>\n      </CardContent>\n      <CardFooter className=\"flex-col items-start gap-2 text-sm\">\n        <div className=\"flex items-center gap-2 leading-none font-medium\">\n          {offAt ? `Off oxygen by ${offAt}` : `On ${latest.flow} L/min`}{\" \"}\n          {latest.flow < first.flow ? (\n            <IconPlaceholder\n              lucide=\"TrendingDownIcon\"\n              tabler=\"IconTrendingDown\"\n              hugeicons=\"ChartDownIcon\"\n              phosphor=\"TrendDownIcon\"\n              remixicon=\"RiArrowDownLine\"\n              className=\"size-4\"\n            />\n          ) : (\n            <IconPlaceholder\n              lucide=\"TrendingUpIcon\"\n              tabler=\"IconTrendingUp\"\n              hugeicons=\"ChartUpIcon\"\n              phosphor=\"TrendUpIcon\"\n              remixicon=\"RiArrowUpLine\"\n              className=\"size-4\"\n            />\n          )}\n        </div>\n        <div className=\"leading-none text-muted-foreground\">\n          Started at {first.flow} L/min; a fictional patient\n        </div>\n      </CardFooter>\n    </Card>\n  )\n}\n",
      "type": "registry:block"
    }
  ],
  "docs": "Oxygen weaning area chart: https://organui.com/charts/area#chart-area-oxygen",
  "categories": [
    "charts",
    "charts-area"
  ],
  "type": "registry:block"
}