Skip to content

enh: Add offset to Area.stack for streamgraphs - #6961

Open
ghostiee-11 wants to merge 1 commit into
holoviz:mainfrom
ghostiee-11:feat/area-stack-offset
Open

enh: Add offset to Area.stack for streamgraphs#6961
ghostiee-11 wants to merge 1 commit into
holoviz:mainfrom
ghostiee-11:feat/area-stack-offset

Conversation

@ghostiee-11

@ghostiee-11 ghostiee-11 commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Description

Adds offset to Area.stack, mirroring stackplot's baseline={'zero', 'sym', 'wiggle', 'weighted_wiggle'}. wiggle gives a streamgraph.

Before

pr_before
hv.Area.stack(overlay, offset="wiggle")

After

pr_after

AI Disclosure

  • Tool & Model: Claude Code + Opus 4.8

  • Usage: scaffolded the tests and the matplotlib comparison script

  • I have tested all AI-generated content in my PR.

  • I take responsibility for all AI-generated content in my PR.

Checklist

  • Pull request title follows the conventional format
  • Tests added and are passing
  • Added documentation

Area.stack could only produce a flat zero baseline, so there was no way
to draw a streamgraph in HoloViews. Add an offset argument accepting
'zero', 'sym', 'wiggle' and 'weighted_wiggle', reusing the baseline
vocabulary and formulas from matplotlib.stackplot.

No backend changes are needed. All three AreaPlot implementations
already fill between the two value dimensions without clamping at zero,
so a shifted baseline renders correctly on bokeh, matplotlib and plotly.
@ghostiee-11
ghostiee-11 marked this pull request as ready for review July 21, 2026 11:00
@ghostiee-11

Copy link
Copy Markdown
Contributor Author
babynames_after_streamgraph

@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.35%. Comparing base (1824dd3) to head (ba0344e).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6961   +/-   ##
=======================================
  Coverage   89.34%   89.35%           
=======================================
  Files         344      344           
  Lines       74650    74696   +46     
=======================================
+ Hits        66696    66742   +46     
  Misses       7954     7954           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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