Skip to content

feat(viz): funnel --area draws a funnel area - #4842

Merged
jqnatividad merged 5 commits into
masterfrom
feat/viz-funnelarea
Oct 18, 2026
Merged

jqnatividad merged 5 commits into
masterfrom
feat/viz-funnelarea

Conversation

@jqnatividad

Copy link
Copy Markdown
Collaborator

Stacked on #4841 (ternary), which is stacked on #4840 (barpolar). Retarget to master once those merge; this branch will need the same rebase onto master.

What's new

  • viz funnel --area draws the funnel as a plotly.js funnelarea: stacked sections sized by each stage's share of the total, labeled with its value and percent of the total. The bar funnel labels the conversion from the previous stage instead, which has no meaning on a share-sized section.
    • Stage order (first appearance in the file), aggregation (--y sum, or row counts without it) and the negative-total check are shared with the bar funnel.
    • Growth warning: a funnel area's outline always narrows, so a stage larger than the one before it can't show as growth, which the bar funnel shows as a wider bar. --area still draws, but names the first such stage on stderr ("stage Renewed (260) is larger than Subscribed (200) before it … drop --area to see it as a wider bar"). The --area help says so too.
  • --area and --degrees are rejected on every other chart, viz smart included. Both checks now run in run() before dispatch. Previously they lived in build_plot, which viz smart never reaches, so viz smart --area/--degrees silently ignored the flag (roborev 5472; --degrees comes from feat(viz): barpolar wind rose; clock-face polar bars for the smart seasonality panel #4840).
  • Regenerated docs/help/viz.md and qsv-viz.json (--area, a usage example).

Gallery

A funnel --area figure next to the bar funnel, on the same signup data. On data this skewed, the last stages are thin slivers with crowded labels, which is why the bar funnel stays the default.

Verification

  • cargo t viz -F all_features: 485 unit and 660 integration tests pass. New: viz_funnel_area_sizes_sections_by_share, viz_funnel_area_warns_when_a_stage_grows, viz_area_only_applies_to_funnel (pie and smart), plus smart --degrees in viz_barpolar_usage_errors.
  • Mutation-checked: ignoring --area, changing its labels, removing the non-funnel check, suppressing the growth warning, warning on every pipeline, and exempting smart from either flag check each fails a test.
  • scripts/double-run-check.py --check OK; cargo +nightly fmt; clippy reports no warnings on added lines.
  • In Chrome: the gallery figure beside the bar funnel.

The wiki Visualization page update is staged locally and will be pushed after merge.

🤖 Generated with Claude Code

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

Base automatically changed from feat/viz-ternary to master October 18, 2026 23:33
jqnatividad and others added 5 commits October 18, 2026 19:34
`viz funnel --area` emits a plotly funnelarea instead of the bar funnel:
stacked sections sized by each stage's share of the total, labeled with
value and percent of the total (the bar funnel's conversion from the
previous stage has no meaning on a share-sized section). Stage order,
aggregation and the negative-total check are shared; --area on any
other chart is a usage error.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A funnel area's outline narrows regardless of the data, so a stage
larger than its predecessor reads as an ordinary drop-off. --area now
names the first such stage on stderr (and the help says why); the bar
funnel, which shows growth as a wider bar, is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both checks lived in build_plot, which `viz smart` never reaches, so
`viz smart --area` and `viz smart --degrees` silently ignored the flag.
Move them into run() before dispatch; tests now cover smart.

Addresses roborev 5472.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jqnatividad
jqnatividad merged commit 5f5485a into master Oct 18, 2026
30 checks passed
@jqnatividad
jqnatividad deleted the feat/viz-funnelarea branch October 18, 2026 23:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant