{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "line-chart",
  "type": "registry:component",
  "title": "LineChart",
  "description": "A line chart whose path draws on left-to-right on the house easing, with an optional soft area fill and per-point dots that pop as the line reaches them. Deterministic via SVG pathLength normalization.",
  "dependencies": [
    "remotion",
    "zod",
    "react"
  ],
  "registryDependencies": [
    "lib-canvas",
    "lib-hooks"
  ],
  "files": [
    {
      "path": "registry/components/line-chart/LineChart.tsx",
      "type": "registry:component",
      "target": "components/onda/line-chart/LineChart.tsx",
      "content": "import React from 'react';\nimport { interpolate } from 'remotion';\nimport { PlacementBox } from '../../../lib/canvas';\nimport { useSceneProgress } from '../../../lib/hooks';\nimport { lineChartSchema, type LineChartProps } from './schema';\n\nexport { lineChartSchema, type LineChartProps };\n\n/**\n * A line chart whose path draws on left-to-right on the house easing, with an\n * optional soft area fill and per-point dots that pop as the line reaches\n * them. Deterministic — the draw uses SVG `pathLength` normalization keyed off\n * the frame, no DOM measurement.\n *\n * @example\n * <LineChart data={[12, 18, 15, 24, 31]} />\n */\nexport const LineChart: React.FC<LineChartProps> = ({\n  data, delay, duration, color, strokeWidth, width, height, fill, showDots, placement,\n}) => {\n  const progress = useSceneProgress({ delay, durationInFrames: duration, eased: true });\n\n  const n = data.length;\n  const padX = 24;\n  const padTop = 24;\n  const padBottom = 32;\n  const innerW = width - padX * 2;\n  const innerH = height - padTop - padBottom;\n  const min = Math.min(...data);\n  const max = Math.max(...data);\n  const xAt = (i: number) => padX + (n <= 1 ? 0 : (i / (n - 1)) * innerW);\n  const yAt = (v: number) => padTop + (max === min ? innerH / 2 : (1 - (v - min) / (max - min)) * innerH);\n\n  const pts = data.map((v, i) => [xAt(i), yAt(v)] as const);\n  const linePath = pts.map((p, i) => `${i === 0 ? 'M' : 'L'}${p[0]} ${p[1]}`).join(' ');\n  const baseline = padTop + innerH;\n  const areaPath = `${linePath} L${xAt(n - 1)} ${baseline} L${xAt(0)} ${baseline} Z`;\n  const gradId = 'onda-linechart-fill';\n\n  return (\n    <PlacementBox placement={placement}>\n      <svg width={width} height={height} viewBox={`0 0 ${width} ${height}`}>\n        <defs>\n          <linearGradient id={gradId} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n            <stop offset=\"0%\" stopColor={color} stopOpacity={0.28} />\n            <stop offset=\"100%\" stopColor={color} stopOpacity={0} />\n          </linearGradient>\n        </defs>\n\n        {fill && (\n          <path d={areaPath} fill={`url(#${gradId})`} opacity={interpolate(progress, [0, 1], [0, 1])} />\n        )}\n\n        <path\n          d={linePath}\n          fill=\"none\"\n          stroke={color}\n          strokeWidth={strokeWidth}\n          strokeLinecap=\"round\"\n          strokeLinejoin=\"round\"\n          pathLength={1}\n          strokeDasharray={1}\n          strokeDashoffset={1 - progress}\n        />\n\n        {showDots &&\n          pts.map((p, i) => {\n            const threshold = n <= 1 ? 0 : i / (n - 1);\n            const dotOpacity = interpolate(progress, [threshold - 0.02, threshold + 0.02], [0, 1], {\n              extrapolateLeft: 'clamp',\n              extrapolateRight: 'clamp',\n            });\n            return <circle key={i} cx={p[0]} cy={p[1]} r={strokeWidth + 2} fill={color} opacity={dotOpacity} />;\n          })}\n      </svg>\n    </PlacementBox>\n  );\n};\n"
    },
    {
      "path": "registry/components/line-chart/schema.ts",
      "type": "registry:component",
      "target": "components/onda/line-chart/schema.ts",
      "content": "import { z } from 'zod';\nimport { placementSchema } from '../../../lib/canvas-schemas';\n\n/** Zod schema for {@link LineChart} props. */\nexport const lineChartSchema = z.object({\n  /** Discriminator literal — matches this entry's registry slug. Auto-populated when omitted. */\n  kind: z.literal('line-chart').default('line-chart'),\n  /** The series values, left to right. */\n  data: z.array(z.number()).default([12, 18, 15, 24, 22, 31, 28, 38]),\n  /** Frames before the line starts drawing. */\n  delay: z.number().int().min(0).default(0),\n  /** Frames for the line to fully draw on. */\n  duration: z.number().int().min(1).default(40),\n  /** Line + dot color. The earned accent. */\n  color: z.string().default('var(--onda-accent, #D96B82)'),\n  /** Stroke width in px. */\n  strokeWidth: z.number().default(4),\n  /** Chart width in px. */\n  width: z.number().default(900),\n  /** Chart height in px. */\n  height: z.number().default(440),\n  /** Fill a soft gradient area under the line. */\n  fill: z.boolean().default(true),\n  /** Show a dot at each data point as the line reaches it. */\n  showDots: z.boolean().default(true),\n  /** Where on the canvas this sits. */\n  placement: placementSchema.optional(),\n});\n\n/** Inferred props for {@link LineChart}. */\nexport type LineChartProps = z.infer<typeof lineChartSchema>;\n"
    },
    {
      "path": "registry/components/line-chart/line-chart.meta.json",
      "type": "registry:file",
      "target": "components/onda/line-chart/line-chart.meta.json",
      "content": "{\n  \"name\": \"line-chart\",\n  \"title\": \"LineChart\",\n  \"description\": \"A line chart whose path draws on left-to-right on the house easing, with an optional soft area fill and per-point dots that pop as the line reaches them. Deterministic via SVG pathLength normalization.\",\n  \"pickWhen\": \"a trend over time — growth, drop, before/after curve. Use `bar-chart` for discrete comparisons, `count-up` for a single end value.\",\n  \"category\": \"data\",\n  \"tags\": [\n    \"chart\",\n    \"line\",\n    \"data\",\n    \"graph\",\n    \"trend\"\n  ],\n  \"dependencies\": [\n    \"remotion\",\n    \"zod\",\n    \"react\"\n  ]\n}\n"
    },
    {
      "path": "registry/components/line-chart/README.md",
      "type": "registry:file",
      "target": "components/onda/line-chart/README.md",
      "content": "# LineChart\n\nA line chart whose path draws on left-to-right on the house easing (`useSceneProgress`), with an optional soft gradient area fill and per-point dots that pop as the line reaches them. The draw is deterministic — it uses SVG `pathLength` normalization keyed off the frame, so there's no DOM measurement and frame N is reproducible. The line carries the earned accent.\n\n## Props\n\n| Prop | Type | Default | Notes |\n| --- | --- | --- | --- |\n| `data` | `number[]` | sample series | Values, left to right. |\n| `delay` | `number` | `0` | Frames before drawing. |\n| `duration` | `number` | `40` | Frames to fully draw. |\n| `color` | `string` | `#D96B82` | Line + dot color. |\n| `strokeWidth` | `number` | `4` | Line thickness. |\n| `width` / `height` | `number` | `900` / `440` | Chart size. |\n| `fill` | `boolean` | `true` | Soft area under the line. |\n| `showDots` | `boolean` | `true` | Dot per data point. |\n| `placement` | region or `{x,y,anchor}` | — | Canvas placement. |\n\n## Usage\n\n```tsx\nimport { LineChart } from './components/onda/line-chart/LineChart';\n\nexport const TrendScene = () => (\n  <LineChart data={[12, 18, 15, 24, 22, 31, 38]} placement=\"center\" />\n);\n```\n"
    }
  ]
}
