{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "explainer",
  "type": "registry:component",
  "title": "Explainer",
  "description": "Turns an explainer spec (plain JSON: scenes of a title, any chart, a map, a 3D model, a then-and-now comparison, a quote or a caption) into a film on film-stage: playable, scrubbable, with captions, narration in step, a provenance label on every scene that says how it was made, and frames drawn on request for export.",
  "categories": [
    "motion"
  ],
  "dependencies": [],
  "registryDependencies": [
    "@rivier-ui/theme",
    "@rivier-ui/area-chart",
    "@rivier-ui/bar-chart",
    "@rivier-ui/box-plot",
    "@rivier-ui/bullet-chart",
    "@rivier-ui/calendar-heatmap",
    "@rivier-ui/candlestick-chart",
    "@rivier-ui/captions",
    "@rivier-ui/chord-diagram",
    "@rivier-ui/choropleth",
    "@rivier-ui/circle-pack",
    "@rivier-ui/cn",
    "@rivier-ui/compare-slider",
    "@rivier-ui/density-chart",
    "@rivier-ui/donut-chart",
    "@rivier-ui/dot-plot",
    "@rivier-ui/explainer-spec",
    "@rivier-ui/fan-chart",
    "@rivier-ui/film-stage",
    "@rivier-ui/funnel-chart",
    "@rivier-ui/gantt-chart",
    "@rivier-ui/geo-hexbin",
    "@rivier-ui/geo-map",
    "@rivier-ui/geo-markers",
    "@rivier-ui/geo-routes",
    "@rivier-ui/heatmap",
    "@rivier-ui/histogram",
    "@rivier-ui/line-chart",
    "@rivier-ui/model-viewer",
    "@rivier-ui/network-graph",
    "@rivier-ui/parallel-coordinates",
    "@rivier-ui/provenance-label",
    "@rivier-ui/radar-chart",
    "@rivier-ui/sankey-chart",
    "@rivier-ui/scatter-chart",
    "@rivier-ui/slope-chart",
    "@rivier-ui/small-multiples",
    "@rivier-ui/stream-chart",
    "@rivier-ui/sunburst",
    "@rivier-ui/treemap",
    "@rivier-ui/waterfall-chart"
  ],
  "files": [
    {
      "path": "registry/motion/explainer.tsx",
      "type": "registry:component",
      "target": "components/motion/explainer.tsx",
      "content": "\"use client\";\n/**\n * @name explainer\n * @category motion\n * @description Turns an explainer spec (plain JSON: scenes of a title, any chart, a map, a 3D model, a then-and-now comparison, a quote or a caption) into a film on film-stage: playable, scrubbable, with captions, narration in step, a provenance label on every scene that says how it was made, and frames drawn on request for export.\n * @when An assistant or a project describes a short explanatory film as data and wants it played: a story with numbers, a report as a film, a change on a map. Validate the spec with lib/explainer-spec first; a spec with faults shows them in words instead of a film. For a film drawn by hand use film-stage; for a video file use video-player.\n * @example\n * <Explainer spec={spec} />\n *\n * // Arranged by the project, and exported frame by frame by scripts/export-film.ts\n * <Explainer spec={spec} deterministic exportName=\"main\">\n *   <FilmStageFrame aspect={16 / 9}>\n *     <ExplainerProvenance />\n *     <ExplainerCaptions />\n *   </FilmStageFrame>\n * </Explainer>\n */\nimport { createContext, use, useEffect, useMemo, useSyncExternalStore, type ComponentProps, type ComponentType, type ReactNode } from \"react\";\nimport {\n  FilmStage,\n  FilmStageAudio,\n  FilmStageCaptionsButton,\n  FilmStageControls,\n  FilmStageControlsRow,\n  FilmStageFrame,\n  FilmStageMute,\n  FilmStageNextScene,\n  FilmStagePlay,\n  FilmStagePreviousScene,\n  FilmStageRate,\n  FilmStageScrubber,\n  FilmStageSceneStrip,\n  FilmStageTime,\n  useFilmClock,\n  type FilmScene,\n  type FilmSceneTime,\n  type FilmStageProps,\n} from \"@/components/motion/film-stage\";\nimport { Captions } from \"@/components/ui/captions\";\nimport { CompareSlider, CompareSliderFirst, CompareSliderLabels, CompareSliderSecond } from \"@/components/ui/compare-slider\";\nimport { ProvenanceLabel } from \"@/components/ui/provenance-label\";\nimport { ModelViewer } from \"@/components/three/model-viewer\";\nimport { AreaChart } from \"@/components/viz/area-chart\";\nimport { BarChart } from \"@/components/viz/bar-chart\";\nimport { BoxPlot } from \"@/components/viz/box-plot\";\nimport { BulletChart } from \"@/components/viz/bullet-chart\";\nimport { CalendarHeatmap } from \"@/components/viz/calendar-heatmap\";\nimport { CandlestickChart } from \"@/components/viz/candlestick-chart\";\nimport { ChordDiagram } from \"@/components/viz/chord-diagram\";\nimport { Choropleth, choroplethScale } from \"@/components/viz/choropleth\";\nimport { CirclePack } from \"@/components/viz/circle-pack\";\nimport { DensityChart } from \"@/components/viz/density-chart\";\nimport { DonutChart } from \"@/components/viz/donut-chart\";\nimport { DotPlot } from \"@/components/viz/dot-plot\";\nimport { FanChart } from \"@/components/viz/fan-chart\";\nimport { FunnelChart } from \"@/components/viz/funnel-chart\";\nimport { GanttChart } from \"@/components/viz/gantt-chart\";\nimport { GeoFeatures, GeoMap, type GeoView } from \"@/components/viz/geo-map\";\nimport { GeoHexbin } from \"@/components/viz/geo-hexbin\";\nimport { GeoMarkers } from \"@/components/viz/geo-markers\";\nimport { GeoRoutes } from \"@/components/viz/geo-routes\";\nimport { Heatmap } from \"@/components/viz/heatmap\";\nimport { Histogram } from \"@/components/viz/histogram\";\nimport { LineChart } from \"@/components/viz/line-chart\";\nimport { NetworkGraph } from \"@/components/viz/network-graph\";\nimport { ParallelCoordinates } from \"@/components/viz/parallel-coordinates\";\nimport { RadarChart } from \"@/components/viz/radar-chart\";\nimport { SankeyChart } from \"@/components/viz/sankey-chart\";\nimport { ScatterChart } from \"@/components/viz/scatter-chart\";\nimport { SlopeChart } from \"@/components/viz/slope-chart\";\nimport { SmallMultiples } from \"@/components/viz/small-multiples\";\nimport { StreamChart } from \"@/components/viz/stream-chart\";\nimport { Sunburst } from \"@/components/viz/sunburst\";\nimport { Treemap } from \"@/components/viz/treemap\";\nimport { WaterfallChart } from \"@/components/viz/waterfall-chart\";\nimport { cn } from \"@/lib/cn\";\nimport {\n  explainerCues,\n  explainerTimeline,\n  validateExplainer,\n  type ExplainerChart,\n  type ExplainerFault,\n  type ExplainerProvenanceKind,\n  type ExplainerScene,\n  type ExplainerSpec,\n} from \"@/lib/explainer-spec\";\n\n/** A chart scene's props are plain data from the spec; each chart checks its own at run time. */\ntype AnyChart = ComponentType<Record<string, unknown>>;\n\nconst CHARTS: Record<ExplainerChart, AnyChart> = {\n  \"line-chart\": LineChart as unknown as AnyChart,\n  \"area-chart\": AreaChart as unknown as AnyChart,\n  \"bar-chart\": BarChart as unknown as AnyChart,\n  \"donut-chart\": DonutChart as unknown as AnyChart,\n  heatmap: Heatmap as unknown as AnyChart,\n  \"scatter-chart\": ScatterChart as unknown as AnyChart,\n  histogram: Histogram as unknown as AnyChart,\n  \"box-plot\": BoxPlot as unknown as AnyChart,\n  \"fan-chart\": FanChart as unknown as AnyChart,\n  \"small-multiples\": SmallMultiples as unknown as AnyChart,\n  treemap: Treemap as unknown as AnyChart,\n  sunburst: Sunburst as unknown as AnyChart,\n  \"circle-pack\": CirclePack as unknown as AnyChart,\n  \"sankey-chart\": SankeyChart as unknown as AnyChart,\n  \"network-graph\": NetworkGraph as unknown as AnyChart,\n  \"calendar-heatmap\": CalendarHeatmap as unknown as AnyChart,\n  \"gantt-chart\": GanttChart as unknown as AnyChart,\n  \"density-chart\": DensityChart as unknown as AnyChart,\n  \"radar-chart\": RadarChart as unknown as AnyChart,\n  \"waterfall-chart\": WaterfallChart as unknown as AnyChart,\n  \"funnel-chart\": FunnelChart as unknown as AnyChart,\n  \"bullet-chart\": BulletChart as unknown as AnyChart,\n  \"candlestick-chart\": CandlestickChart as unknown as AnyChart,\n  \"chord-diagram\": ChordDiagram as unknown as AnyChart,\n  \"parallel-coordinates\": ParallelCoordinates as unknown as AnyChart,\n  \"dot-plot\": DotPlot as unknown as AnyChart,\n  \"stream-chart\": StreamChart as unknown as AnyChart,\n  \"slope-chart\": SlopeChart as unknown as AnyChart,\n};\n\n/** Every word the explainer adds. Pass `labels` to translate. */\nexport type ExplainerLabels = {\n  /** The statement of each kind of provenance. */\n  provenance: Record<ExplainerProvenanceKind, string>;\n  /** Said after the statement in the label's button. */\n  details: string;\n  /** The heading over a spec's faults. */\n  faults: string;\n};\n\nconst LABELS: ExplainerLabels = {\n  provenance: { measured: \"Measured\", reconstructed: \"Reconstruction\", generated: \"Made by a model\", invented: \"Invented for illustration\" },\n  details: \"how this was made\",\n  faults: \"This explainer cannot be played:\",\n};\n\n/** What a picture renderer is given: a framework's image component can stand in for the plain element. */\nexport type ExplainerPictureProps = { src: string; alt: string; className: string };\n\ntype ExplainerContextValue = { spec: ExplainerSpec; labels: ExplainerLabels; renderPicture?: ((picture: ExplainerPictureProps) => ReactNode) | undefined };\nconst ExplainerContext = createContext<ExplainerContextValue | null>(null);\n\nfunction useExplainer(part: string): ExplainerContextValue {\n  const context = use(ExplainerContext);\n  if (!context) throw new Error(`${part} must be inside an Explainer.`);\n  return context;\n}\n\nexport type ExplainerProps = Omit<FilmStageProps, \"scenes\" | \"children\" | \"labels\"> & {\n  /** The film as plain data. Checked with validateExplainer; a spec with faults shows them instead. */\n  spec: ExplainerSpec;\n  /** Words for provenance and faults; the stage's own words go in `stageLabels`. */\n  labels?: Partial<Omit<ExplainerLabels, \"provenance\">> & { provenance?: Partial<ExplainerLabels[\"provenance\"]> };\n  stageLabels?: FilmStageProps[\"labels\"];\n  /** Draws a picture of a caption or comparison scene: pass the framework's image component. */\n  renderPicture?: (picture: ExplainerPictureProps) => ReactNode;\n  /** Called with the spec's faults whenever they change (an empty list when it is sound). */\n  onFaults?: (faults: ExplainerFault[]) => void;\n  /** The parts, arranged by the project. Left out: a frame with the provenance and captions, the controls and the scene strip. */\n  children?: ReactNode;\n};\n\nexport function Explainer({ spec, labels: given, stageLabels, renderPicture, onFaults, children, className, ...props }: ExplainerProps) {\n  const labels: ExplainerLabels = { ...LABELS, ...given, provenance: { ...LABELS.provenance, ...given?.provenance } };\n  const faults = useMemo(() => validateExplainer(spec), [spec]);\n  const reduced = useSyncExternalStore(subscribeReduced, readReduced, () => false);\n  useEffect(() => {\n    onFaults?.(faults);\n  }, [faults, onFaults]);\n  const scenes = useMemo<FilmScene[]>(\n    () =>\n      faults.length > 0\n        ? []\n        : spec.scenes.map((scene) => ({\n            id: scene.id,\n            duration: scene.duration,\n            label: scene.label ?? sceneName(scene),\n            transition: scene.transition ?? spec.transition ?? \"crossfade\",\n            render: (local: FilmSceneTime) => <ExplainerSceneView scene={scene} local={local} still={reduced} />,\n          })),\n    [spec, faults, reduced],\n  );\n  if (faults.length > 0) {\n    return (\n      <div data-slot=\"explainer-faults\" role=\"alert\" className={cn(\"rounded-surface border border-destructive p-4 text-sm\", className)}>\n        <p className=\"font-medium\">{labels.faults}</p>\n        <ul className=\"mt-2 list-disc space-y-1 ps-5\">\n          {faults.map((item, index) => (\n            <li key={index}>\n              {item.path ? <code className=\"font-mono text-xs text-muted-foreground\">{item.path}</code> : null} {item.message}\n            </li>\n          ))}\n        </ul>\n      </div>\n    );\n  }\n  return (\n    <ExplainerContext value={{ spec, labels, renderPicture }}>\n      <FilmStage data-slot=\"explainer\" data-film-export={props.exportName} scenes={scenes} aria-label={spec.title} lang={spec.lang ?? \"en\"} labels={stageLabels} className={className} {...props}>\n        {children ?? (\n          <>\n            <FilmStageFrame aspect={spec.aspect ?? 16 / 9}>\n              <ExplainerProvenance />\n              <ExplainerCaptions />\n            </FilmStageFrame>\n            <ExplainerAudio />\n            <FilmStageControls>\n              <FilmStageScrubber />\n              <FilmStageControlsRow>\n                <FilmStagePreviousScene />\n                <FilmStagePlay />\n                <FilmStageNextScene />\n                <FilmStageMute />\n                <FilmStageTime />\n                <FilmStageCaptionsButton className=\"ms-auto\" />\n                <FilmStageRate />\n              </FilmStageControlsRow>\n            </FilmStageControls>\n            <FilmStageSceneStrip />\n          </>\n        )}\n      </FilmStage>\n    </ExplainerContext>\n  );\n}\n\n/** The narration of every scene, each from its own start: for a project that arranges the parts itself. */\nexport function ExplainerAudio() {\n  const { spec } = useExplainer(\"ExplainerAudio\");\n  const timeline = explainerTimeline(spec);\n  return (\n    <>\n      {spec.bed ? <FilmStageAudio src={spec.bed.src} volume={spec.bed.volume ?? 0.3} /> : null}\n      {spec.scenes.map((scene, index) =>\n        scene.narration ? (\n          <FilmStageAudio\n            key={scene.id}\n            src={scene.narration.src}\n            start={(timeline.scenes[index]?.start ?? 0) + (scene.narration.start ?? 0)}\n            duration={scene.narration.duration}\n            volume={scene.narration.volume}\n          />\n        ) : null,\n      )}\n    </>\n  );\n}\n\n/** The captions of every scene, on the stage's clock, over the bottom of the frame. */\nexport function ExplainerCaptions(props: Omit<ComponentProps<typeof Captions>, \"cues\" | \"lang\">) {\n  const { spec } = useExplainer(\"ExplainerCaptions\");\n  const cues = useMemo(() => explainerCues(spec), [spec]);\n  return <Captions cues={cues} lang={spec.lang ?? \"en\"} {...props} />;\n}\n\n/** The provenance of the scene on stage, over a top corner of the frame, with its note and sources in a popover. */\nexport function ExplainerProvenance({ position = \"top-start\", ...props }: Omit<ComponentProps<typeof ProvenanceLabel>, \"children\" | \"details\">) {\n  const { spec, labels } = useExplainer(\"ExplainerProvenance\");\n  const { sceneIndex } = useFilmClock();\n  const provenance = spec.scenes[sceneIndex]?.provenance;\n  if (!provenance) return null;\n  const statement = provenance.note ? `${labels.provenance[provenance.kind]}: ${provenance.note}` : labels.provenance[provenance.kind];\n  const details =\n    provenance.sources && provenance.sources.length > 0 ? (\n      <ul className=\"list-disc space-y-1 ps-4\">\n        {provenance.sources.map((source, index) => (\n          <li key={index}>{source}</li>\n        ))}\n      </ul>\n    ) : undefined;\n  return (\n    <ProvenanceLabel data-provenance={provenance.kind} position={position} details={details} detailsLabel={labels.details} {...props}>\n      {statement}\n    </ProvenanceLabel>\n  );\n}\n\nfunction sceneName(scene: ExplainerScene): string {\n  switch (scene.kind) {\n    case \"title\":\n      return scene.title;\n    case \"chart\":\n      return scene.title ?? (typeof scene.props[\"label\"] === \"string\" ? scene.props[\"label\"] : scene.chart);\n    case \"map\":\n      return scene.title ?? scene.label;\n    case \"model\":\n      return scene.title ?? scene.alt;\n    case \"compare\":\n      return scene.label;\n    case \"quote\":\n      return scene.attribution ?? scene.text.slice(0, 40);\n    case \"caption\":\n      return scene.text.slice(0, 40);\n  }\n}\n\n/** Whether the person asks for less motion, followed as it changes. */\nconst REDUCED = \"(prefers-reduced-motion: reduce)\";\nconst subscribeReduced = (change: () => void): (() => void) => {\n  const query = window.matchMedia(REDUCED);\n  query.addEventListener(\"change\", change);\n  return () => query.removeEventListener(\"change\", change);\n};\nconst readReduced = (): boolean => window.matchMedia(REDUCED).matches;\n\n/** Eases a fraction in and out, so a camera or a divider starts and stops gently. */\nconst smooth = (t: number): number => {\n  const x = Math.max(0, Math.min(1, t));\n  return x * x * (3 - 2 * x);\n};\n\n/** How far a scene's entrance has got, from its own time: drawn the same at any moment, final under reduced motion. */\nfunction entrance(local: FilmSceneTime, still: boolean): { opacity: number; transform: string } {\n  if (still) return { opacity: 1, transform: \"none\" };\n  const t = smooth(local.time / 0.6);\n  return { opacity: t, transform: `translateY(${((1 - t) * 12).toFixed(2)}px)` };\n}\n\nfunction ExplainerSceneView({ scene, local, still }: { scene: ExplainerScene; local: FilmSceneTime; still: boolean }) {\n  const { spec, renderPicture } = useExplainer(\"Explainer\");\n  const enter = entrance(local, still);\n  const picture = (src: string, alt: string, className: string): ReactNode =>\n    renderPicture ? (\n      renderPicture({ src, alt, className })\n    ) : (\n      // eslint-disable-next-line @next/next/no-img-element -- The library is not tied to one framework: the default is the plain element, and `renderPicture` takes the framework's image component.\n      <img src={src} alt={alt} className={className} draggable={false} />\n    );\n  const heading = (text: string | undefined): ReactNode =>\n    text ? (\n      <h3 className=\"text-lg font-medium @2xl:text-2xl\" style={enter}>\n        {text}\n      </h3>\n    ) : null;\n\n  switch (scene.kind) {\n    case \"title\":\n      return (\n        <div data-slot=\"explainer-title\" className=\"flex h-full flex-col items-center justify-center gap-3 bg-background p-[6cqi] text-center\" style={enter}>\n          <h2 className=\"text-2xl font-medium @xl:text-4xl @4xl:text-6xl\">{scene.title}</h2>\n          {scene.subtitle ? <p className=\"text-base text-muted-foreground @xl:text-xl\">{scene.subtitle}</p> : null}\n        </div>\n      );\n    case \"quote\":\n      return (\n        <figure data-slot=\"explainer-quote\" className=\"m-0 flex h-full flex-col justify-center gap-4 bg-background p-[8cqi]\" style={enter}>\n          <blockquote className=\"text-xl @xl:text-3xl @4xl:text-4xl\" dir=\"auto\">\n            “{scene.text}”\n          </blockquote>\n          {scene.attribution ? <figcaption className=\"text-sm text-muted-foreground @xl:text-base\">{scene.attribution}</figcaption> : null}\n        </figure>\n      );\n    case \"caption\":\n      return (\n        <div data-slot=\"explainer-caption\" className=\"relative flex h-full items-end bg-background\">\n          {scene.picture ? picture(scene.picture.src, scene.picture.alt, \"absolute inset-0 size-full object-cover\") : null}\n          <p className=\"relative m-[4cqi] max-w-[70cqi] rounded-surface border bg-background px-4 py-3 text-base @xl:text-xl\" style={enter} dir=\"auto\">\n            {scene.text}\n          </p>\n        </div>\n      );\n    case \"chart\": {\n      const Chart = CHARTS[scene.chart];\n      const props = { ...scene.props, label: typeof scene.props[\"label\"] === \"string\" ? scene.props[\"label\"] : (scene.title ?? scene.chart) };\n      // The chart is wider than the frame so that it fits under the title.\n      const aspect = (spec.aspect ?? 16 / 9) * (scene.title ? 1.3 : 1.12);\n      return (\n        <div data-slot=\"explainer-chart\" className=\"flex h-full flex-col gap-2 bg-background px-[4cqi] pb-[3cqi] pt-[7cqi]\">\n          {heading(scene.title)}\n          <div className=\"min-h-0 flex-1 overflow-hidden\" style={{ opacity: enter.opacity }}>\n            <Chart aspect={aspect} {...props} />\n          </div>\n        </div>\n      );\n    }\n    case \"map\": {\n      const from: GeoView = scene.camera?.from ?? { k: 1, x: 0, y: 0 };\n      const to: GeoView = scene.camera?.to ?? from;\n      const t = still ? 1 : smooth(local.progress);\n      const view: GeoView = { k: from.k + (to.k - from.k) * t, x: from.x + (to.x - from.x) * t, y: from.y + (to.y - from.y) * t };\n      const geojson = scene.geojson as unknown as ComponentProps<typeof GeoFeatures>[\"data\"];\n      return (\n        <div data-slot=\"explainer-map\" className=\"flex h-full flex-col bg-background\">\n          {scene.title ? <div className=\"px-[4cqi] pt-[6cqi]\">{heading(scene.title)}</div> : null}\n          <GeoMap\n            label={scene.label}\n            fit={geojson}\n            projection={scene.projection ?? \"equal-earth\"}\n            rotate={scene.rotate}\n            view={view}\n            minZoom={1}\n            maxZoom={64}\n            wheel=\"never\"\n            showControls={false}\n            className=\"min-h-0 flex-1 rounded-none border-0\"\n            style={{ aspectRatio: \"auto\" }}\n            locale={spec.lang}\n          >\n            <GeoFeatures data={geojson} />\n            {(scene.layers ?? []).map((layer, index) => {\n              if (layer.type === \"choropleth\") {\n                const features: readonly { properties?: Record<string, unknown> | null }[] = scene.geojson.features ?? [];\n                const values = features.map((feature) => {\n                  const value = feature.properties?.[layer.valueProperty];\n                  return typeof value === \"number\" ? value : null;\n                });\n                return (\n                  <Choropleth\n                    key={index}\n                    label={layer.label}\n                    data={geojson as ComponentProps<typeof Choropleth>[\"data\"]}\n                    value={(feature) => {\n                      const value = feature.properties?.[layer.valueProperty];\n                      return typeof value === \"number\" ? value : null;\n                    }}\n                    name={(feature) => String(feature.properties?.[layer.nameProperty] ?? \"\")}\n                    scale={choroplethScale(values, layer.thresholds ? { thresholds: layer.thresholds } : {})}\n                    valueLabel={layer.valueLabel}\n                  />\n                );\n              }\n              if (layer.type === \"markers\") return <GeoMarkers key={index} label={layer.label} points={layer.points} variant={layer.variant} valueLabel={layer.valueLabel} />;\n              if (layer.type === \"routes\") return <GeoRoutes key={index} label={layer.label} routes={layer.routes} variant={layer.variant} valueLabel={layer.valueLabel} />;\n              return <GeoHexbin key={index} label={layer.label} points={layer.points} valueLabel={layer.valueLabel} />;\n            })}\n          </GeoMap>\n        </div>\n      );\n    }\n    case \"model\":\n      return (\n        <div data-slot=\"explainer-model\" className=\"flex h-full flex-col bg-background\">\n          {scene.title ? <div className=\"px-[4cqi] pt-[6cqi]\">{heading(scene.title)}</div> : null}\n          <ModelViewer\n            src={scene.src}\n            alt={scene.alt}\n            poster={scene.poster}\n            view={{ azimuth: (still ? 1 : local.progress) * (scene.turn ?? 60), polar: 15, zoom: 1 }}\n            className=\"min-h-0 flex-1 rounded-none border-0\"\n            aspect=\"auto\"\n          />\n        </div>\n      );\n    case \"compare\": {\n      const [start, end] = scene.sweep ?? [100, 0];\n      const split = still ? end : start + (end - start) * smooth(local.progress);\n      return (\n        <CompareSlider data-slot=\"explainer-compare\" value={split} labels={{ first: scene.before.label, second: scene.after.label }} aria-label={scene.label} className=\"h-full rounded-none border-0\">\n          <CompareSliderFirst>{picture(scene.before.src, scene.before.alt, \"size-full object-cover\")}</CompareSliderFirst>\n          <CompareSliderSecond>{picture(scene.after.src, scene.after.alt, \"size-full object-cover\")}</CompareSliderSecond>\n          <CompareSliderLabels side=\"bottom\" />\n        </CompareSlider>\n      );\n    }\n  }\n}\n"
    }
  ],
  "meta": {
    "category": "motion",
    "when": "An assistant or a project describes a short explanatory film as data and wants it played: a story with numbers, a report as a film, a change on a map. Validate the spec with lib/explainer-spec first; a spec with faults shows them in words instead of a film. For a film drawn by hand use film-stage; for a video file use video-player.",
    "example": "<Explainer spec={spec} />\n\n// Arranged by the project, and exported frame by frame by scripts/export-film.ts\n<Explainer spec={spec} deterministic exportName=\"main\">\n  <FilmStageFrame aspect={16 / 9}>\n    <ExplainerProvenance />\n    <ExplainerCaptions />\n  </FilmStageFrame>\n</Explainer>",
    "client": true
  }
}
