# Funnel chart

Funnel shows a total narrowing down, stage by stage. Use it when each step is a part of the one before it: everything, then commits, then reviews.

> Live preview: see the chart playing at https://bettertyped.github.io/react-wrapped/docs/charts/funnel/
>
> A flow narrowing, stage by stage.

## Installation

```bash
pnpm add @react-wrapped/charts @react-wrapped/core gsap
```

## Usage

A chart is data, not markup. Hand a scene an object with `type` set and the numbers to draw, and the scene draws it and plays its entrance on the video's timeline.

```tsx
import { chartScene } from "@react-wrapped/scenes";

export const scene = chartScene(
  {
    eyebrow: "Your year",
    title: ["Funnel."],
    lede: "A flow narrowing, stage by stage.",
    chart: {
      type: "funnel",
      steps: [
        { label: "Contributions", value: 2052 },
        { label: "Commits", value: 1527 },
        { label: "Reviews", value: 65 },
      ],
    },
  },
  { key: "funnel", label: "Funnel" },
);
```

## Props

| Prop | Type | What it does |
| --- | --- | --- |
| `type` | `"funnel"` | Picks this chart. |
| `steps` | `readonly { label: string; value: number }[]` | The stages, widest first. |

## How it comes in

Every chart plays in the order it is read: what it is made of stands first, the numbers arrive with a direction, and the one thing the chart is about lands last with its pill. Nothing is on screen before its own entrance. See [how charts animate](https://bettertyped.github.io/react-wrapped/docs/charts/) for the shared rules.

## Related

- [Charts](https://bettertyped.github.io/react-wrapped/docs/charts/)
- [Bars chart](https://bettertyped.github.io/react-wrapped/docs/charts/bars/)
- [Pulse chart](https://bettertyped.github.io/react-wrapped/docs/charts/ticks/)
- [Pixel area chart](https://bettertyped.github.io/react-wrapped/docs/charts/pixels/)
- [Transitions](https://bettertyped.github.io/react-wrapped/docs/transitions/)

Source: https://bettertyped.github.io/react-wrapped/docs/charts/funnel/
