{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "line",
  "type": "registry:component",
  "title": "Line",
  "description": "One value, read as a trend. Sample data: P95 latency, us-east, last 24 hours.",
  "registryDependencies": [
    "@chartory/core",
    "@chartory/plot-line"
  ],
  "files": [
    {
      "path": "registry/chartory/components/line.tsx",
      "type": "registry:component",
      "target": "components/chartory/line.tsx",
      "content": "// SPDX-License-Identifier: MIT · Copyright (c) 2026 BEY AGENCY LTD · Chartory, usechartory.com\n// Line (Chartory chart 010): sizes xs | s | m | l, laid out again from the data at each\n// size; collection \"hearth\" (default) or \"signal\" (with @chartory/signal, Code and Complete). Data in the type's shape (default: the sample). Docs:\n// https://usechartory.com/docs/charts/line\nimport { ChartView, type ChartViewProps } from \"@/lib/chartory/charts/chart-view\"\nimport { registerChart } from \"@/lib/chartory/charts/defs\"\nimport { data as sample } from \"@/lib/chartory/charts/types/010-line/data\"\nimport { def } from \"@/lib/chartory/charts/types/010-line/layout\"\n\nregisterChart(def, sample)\n\nexport type LineData = typeof sample\nexport type LineProps = Omit<ChartViewProps, \"def\" | \"data\" | \"states\"> & {\n  /** the data to draw (default: the sample) */\n  data?: LineData\n  /** further data states: the chart morphs to them (update) or ticks through them (live, with interval) */\n  states?: LineData[]\n}\n\nexport function Line(props: LineProps) {\n  return <ChartView def={def} {...props} />\n}\n"
    },
    {
      "path": "registry/chartory/charts/types/010-line/data.ts",
      "type": "registry:lib",
      "target": "lib/chartory/charts/types/010-line/data.ts",
      "content": "// SPDX-License-Identifier: MIT · Copyright (c) 2026 BEY AGENCY LTD · Chartory, usechartory.com\n// 010 Line · sample data (Figma chart/010-line, AI: p95 time to first token in us-east, hourly over the last 24 h).\nimport type { LineData } from \"../../plots/line\";\n\nexport const data: LineData = {\n  vals: [0.9, 1.1, 0.95, 1.2, 0.85, 1.0, 1.3, 1.05, 1.15, 0.9, 1.25, 1.4, 1.1, 1.0, 1.35, 1.2, 0.95, 1.1, 1.45, 1.15, 1.05, 1.3, 1.2, 1.3],\n  min: 0,\n  max: 1.8,\n  ticks: [\"1.8 S\", \"1.2 S\", \"0.6 S\", \"0\"],\n  area: \"flat\",\n  dots: \"all\",\n  xl: { 0: \"00:00\", 6: \"06:00\", 12: \"12:00\", 18: \"18:00\", 23: \"NOW\" },\n};\n"
    },
    {
      "path": "registry/chartory/charts/types/010-line/layout.ts",
      "type": "registry:lib",
      "target": "lib/chartory/charts/types/010-line/layout.ts",
      "content": "// SPDX-License-Identifier: MIT · Copyright (c) 2026 BEY AGENCY LTD · Chartory, usechartory.com\n// 010 Line (Figma chart/010-line): C.line with a flat area and a ringed point per hour; no legend (one series).\nimport type { ChartDef } from \"../../core/shell\";\nimport { line } from \"../../plots/line\";\nimport { tickSeries } from \"../../core/vary\";\nimport { data } from \"./data\";\n\n/** Deterministic wave in [-1, 1] per index and update step (no randomness: the same step gives the same period). */\nconst wave = (i: number, step: number, f = 1.7) => Math.sin(step * 2.3 + i * f + 0.5);\nconst clamp = (v: number, lo: number, hi: number) => Math.min(hi, Math.max(lo, v));\nconst r2 = (v: number) => Math.round(v * 100) / 100;\n\nconst hour = (i: number) => (i === data.vals.length - 1 ? \"Now\" : String(i).padStart(2, \"0\") + \":00\");\nconst s = (v: number) => v.toFixed(2) + \" s\";\n\nexport const def: ChartDef = {\n  no: 10,\n  slug: \"line\",\n  legend: null,\n  plot: (K, p, w, d) => line(K, p, w, (d as typeof data | undefined) ?? data),\n  // live: one point per tick\n  tick: (d, step) => { const o = d as typeof data; return { ...o, vals: tickSeries(o.vals, step + 1, o.min, o.max) }; },\n  update: (d, step) => {\n    const o = d as typeof data;\n    // later days: each hour moves ±12 % (to the cent of a second), inside the 1.8 s axis\n    return { ...o, vals: o.vals.map((v, i) => clamp(r2(v * (1 + 0.12 * wave(i, step))), 0.3, 1.75)) };\n  },\n  describe: {\n    title: \"P95 latency, us-east\",\n    summary: `P95 time to first token in us-east, hourly over the last 24 hours: ${s(data.vals[data.vals.length - 1])} now, peak ${s(Math.max(...data.vals))}, low ${s(Math.min(...data.vals))}.`,\n    table: { head: [\"Hour\", \"P95\"], rows: data.vals.map((v, i) => [hour(i), s(v)]) },\n  },\n};\n"
    }
  ],
  "categories": [
    "charts",
    "change-over-time"
  ],
  "meta": {
    "access": "free",
    "no": 10,
    "family": "Change over time"
  }
}
