A funnel is a bar chart whose order is meaningful: the trace pitches the
retention between adjacent stages rather than the raw counts, because the
drop-off is what the chart is drawn for. Stage order therefore comes
straight from the DOM — the binder keeps the elements in the order D3 joined
them, so draw the stages top-to-bottom (or left-to-right) in funnel order.
selector matches one element per stage, whichever mark you drew it with:
a trapezoid <path>, a centred <rect>, or a <g> per stage.
A funnel drawn the usual way, its stages down the page and each count a
band's width, is horizontal: orientation names the way the magnitude runs.
Pass orientation: Orientation.HORIZONTAL with x reading the count and
y the stage, both named, since the accessors inferred from the datum's
keys put the stage in x. Stages side by side, each count a height, are
the default vertical funnel.
Parameters
svg: Element
The SVG element (or container) containing the D3 funnel chart.
Binds a D3.js funnel chart to MAIDR.
A funnel is a bar chart whose order is meaningful: the trace pitches the retention between adjacent stages rather than the raw counts, because the drop-off is what the chart is drawn for. Stage order therefore comes straight from the DOM — the binder keeps the elements in the order D3 joined them, so draw the stages top-to-bottom (or left-to-right) in funnel order.
selectormatches one element per stage, whichever mark you drew it with: a trapezoid<path>, a centred<rect>, or a<g>per stage.A funnel drawn the usual way, its stages down the page and each count a band's width, is horizontal:
orientationnames the way the magnitude runs. Passorientation: Orientation.HORIZONTALwithxreading the count andythe stage, both named, since the accessors inferred from the datum's keys put the stage inx. Stages side by side, each count a height, are the default vertical funnel.