Funnel Area Plot

A funnel area plot is a data visualization that is typically used to represent data where values progressively decrease or “funnel” through stages or categories. It takes the form of a series of horizontally aligned trapezoids or polygons, with each stage’s area proportional to the quantity it represents, making it a useful tool for visualizing the attrition or progression of data through a sequential process. The data must be ordered by the response variable, or the “funnel” shape will not be guaranteed.

Funnel area plots differ from funnel plots in that they display the percentage of data points that belong to each category, while funnel plots display the absolute count of data points in each category. Funnel area plots also count each data point as belonging to exactly one category and display the categories as mutually exclusive. On the other hand, funnel plots count each data point as belonging to at least one category, so the categories are represented as subsets of each other rather than mutually exclusive.

Funnel area plots are appropriate when the data contain a categorical variable where the frequencies of each category can be computed, and the categories can be ordered. Additionally, funnel plots assume a particular relationship between levels of the categorical variable, where each category is a proper subset of the previous category. If the data contain an unordered categorical variable, or the categories are better conceptualized as parts of a whole, consider a pie plot instead of a funnel area plot.

What are funnel area plots useful for?

  • Visualizing sequential data: Data that are staged or sequential in some way are often visualized with funnel area plots, yielding insight on the rate of change from one stage to the next.
  • Analyzing data progression: Funnel area plots may be used for analyzing attrition, conversion rates, or transitions between stages.
  • Evaluating efficiency: Assessing the efficiency and effectiveness of a process or workflow is easy with funnel area plots.

Examples

A basic funnel plot

Visualize the trend in consecutive stages of a categorical variable by passing column names to the names and values arguments.

API Reference

Returns a funnel area chart

Returns: DeephavenFigure A DeephavenFigure that contains the funnel area chart

ParametersTypeDefaultDescription
tableTable |
DataFrame
A table to pull data from.
namesstr |
None
NoneThe column containing names of the sections
valuesstr |
None
NoneThe column containing values of the sections
colorstr |
list[str] |
None
NoneA column or list of columns that contain color values. If only one column is passed, and it contains numeric values, the value is used as a value on a continuous color scale. Otherwise, the value is used for a plot by on color. See color_discrete_map for additional behaviors.
hover_namestr |
None
NoneA column that contains names to bold in the hover tooltip.
labelsdict[str, str] |
None
NoneA dictionary of labels mapping columns to new labels.
color_discrete_sequencelist[str] |
None
NoneA list of colors to sequentially apply to the series. The colors loop, so if there are more series than colors, colors will be reused.
color_discrete_mapdict[str | tuple[str], str] |
None
NoneIf dict, the keys should be strings of the column values (or a tuple of combinations of column values) which map to colors.
titlestr |
None
NoneThe title of the chart
templatestr |
None
NoneThe template for the chart.
opacityfloat |
None
NoneOpacity to apply to all markers. 0 is completely transparent and 1 is completely opaque.
unsafe_update_figureCallable<function default_callback>An update function that takes a plotly figure as an argument and optionally returns a plotly figure. If a figure is not returned, the plotly figure passed will be assumed to be the return value. Used to add any custom changes to the underlying plotly figure. Note that the existing data traces should not be removed. This may lead to unexpected behavior if traces are modified in a way that break data mappings.
on_clickCallable[..., bool | None] |
None
NoneA callback function that is called when a point is clicked. The function receives a dict with 'points' (list of clicked point data) and 'modifiers' (keyboard state). On hierarchical charts (sunburst, treemap, icicle), return False to prevent drill-down. The return value is ignored on other chart types.
on_pressCallable[..., bool | None] |
None
NoneAlias for on_click.
on_double_clickCallable[..., None] |
None
NoneA callback function that is called on double-click. The function receives a dict with 'modifiers' (keyboard state). Fires in zoom/pan mode only; in select mode, on_deselect fires instead.
on_double_pressCallable[..., None] |
None
NoneAlias for on_double_click.
on_selectedCallable[..., None] |
None
NoneA callback function that is called when a box or lasso selection completes. The function receives a dict with 'points' (list of selected point data), 'range' (for box select), and 'modifiers'.
on_deselectCallable[..., None] |
None
NoneA callback function that is called when the selection is cleared (e.g., by double-clicking on an empty area).
on_relayoutCallable[..., None] |
None
NoneA callback function that is called when the chart layout changes due to user interaction (pan, zoom, axis reset, etc.). The function receives a dict of the layout keys that changed.
on_legend_clickCallable[..., bool | None] |
None
NoneA callback function that is called when a legend item is clicked. Return False to prevent the default trace visibility toggle. Return True or None to allow it.
on_legend_double_clickCallable[..., bool | None] |
None
NoneA callback function that is called when a legend item is double-clicked. Return False to prevent the default isolate/show-all toggle. Return True or None to allow it.
on_click_annotationCallable[..., None] |
None
NoneA callback function that is called when an annotation is clicked. The function receives a dict with 'index', 'annotation', and 'modifiers'.
on_web_gl_context_lostCallable[..., None] |
None
NoneA callback function that is called when the WebGL rendering context is lost (e.g., GPU reclaims resources).