Skip to main content
A funnel shows how many of a starting count reach each stage of a process. Each stage is a bar centerd on a common line, as long as its count, and a band joins each bar to the next so the narrowing reads as one shape.
The funnel ships as its own package, @graphysdk/geom-funnel, on a 0.x version line. While it is on 0.x, a minor release may change its aesthetics, style parts or look; pin a caret range (^0.1.0) to take only patches. Tell us what works and what doesn’t on Discord.

Install

Its only peer dependencies are @graphysdk/react and React. Register the plugin once with createGraphyKit, which adds kit.geom.funnel() and binds kit.GraphProvider to the same plugin:

One bar per stage

Pass one row per stage, in the order the funnel runs. Map the stage to x and its count to y:
coord.flip() gives the classic funnel, with the first stage at the top. Each bar runs from minus half its count to plus half, so the value axis is centerd on zero and its labels measure from the center line, which is not a figure anyone reads a funnel for. Hide it with config, as above, and print the counts as data labels. The geom hides the grid lines itself. A stage with no count, or a negative one, draws no bar, and the stages either side of it are joined across the gap.

Upright

Leave out kit.coord.flip(). The stages run left to right and the bars stand across the center line.

Conversion

The geom’s default funnel stat writes each stage’s shares, as fractions formatted as percentages, to two variables you can name like any column: Map label to one to print it in the bars:
A label sits in the middle of its bar, and moves past the bar’s end when the bar is too short to hold it. An explicit dataLabels.position is honored as written. The shares run in data order. If your data already carries conversion rates, turn the stat off and map them:

Bar width

params.width is the fraction of its band a bar spans, from just above 0 to 1, 0.7 by default. The rest of the band is the gap the connector crosses. A width above 1 is clamped to the full band, and one at or below 0 falls back to the default; the compiler warns in both cases.

Color per stage

Map color to the stage for a color each. Each band takes the color of the stage it leaves:

Styling

The bars are the observations, and the bands between them have a builder of their own: A chart-wide style.geom() reaches the bars too.
A connector is styled against the stage it leaves, so an entry’s where can pick connectors out by that stage’s values.

Hover and highlight

Hovering anywhere in a stage’s band emphasizes its bar, and the tooltip lists its count and both shares. A highlight raises each matched bar. The connectors stay with the dimmed layer:

Not yet supported

  • The editor’s chart-type picker and the chart agent. In annotate mode the funnel renders, hovers, selects and takes annotations on the end of each bar, but it is authored in code.
  • Several funnels side by side. Map group to split the data into funnels, each with its own shares, but they overlap on the same bands. A stage that appears twice in one funnel is an error.
  • Hiding the value axis from the geom. It takes the config line above.