Skip to content

0.14.2-1 - #33

Merged
pwwang merged 2 commits into
masterfrom
fix/stream-linewidth-scale
Nov 9, 2026
Merged

pwwang merged 2 commits into
masterfrom
fix/stream-linewidth-scale

Conversation

@pwwang

@pwwang pwwang commented Nov 9, 2026

Copy link
Copy Markdown
Owner
  • fix(VelocityPlot): scale linewidth, not size, for stream plot type

The stream branch maps the streamline thickness as an aesthetic,
`linewidth = after_stat(step)`, but the accompanying scale was
`scale_size(range = range(streamline_width), guide = "none")`. A `size` scale cannot
act on a `linewidth` mapping, so:

  - `streamline_width` had no effect at all -- c(0, 0.1) rendered identically to the
    default c(0, 0.8), byte for byte;
  - ggplot's default continuous linewidth scale (roughly 1-6) applied instead, which is
    why streamlines rendered as thick ribbons that covered the cells underneath;
  - the `guide = "none"` was attached to the wrong scale, so an unhelpful "step" legend
    appeared next to the plot.

Use `scale_linewidth(range = range(streamline_width), guide = "none")` instead. The
default range c(0, 0.8) now really is the maximum stroke width, so streams are thin by
default and `streamline_width` tunes them.

Adds a regression test that compares the scaled layer's line width at two widths. The
previous test only asserted `expect_s3_class(p, "ggplot")`, which passed throughout.
@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.

@pwwang
pwwang merged commit 786bc84 into master Nov 9, 2026
1 of 2 checks passed
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