Skip to content

Arrows at line ends - #597

Open
teunbrand wants to merge 20 commits into
posit-dev:mainfrom
teunbrand:arrows
Open

teunbrand wants to merge 20 commits into
posit-dev:mainfrom
teunbrand:arrows

Conversation

@teunbrand

Copy link
Copy Markdown
Collaborator

This PR aims to fix an entry in #530.

Briefly this allows SETTING arrow => 'open' in line, path and segment geometries.
By default, this sets the end arrow and when using length-2 array e.g. ['open', 'open'] it sets the start and end arrows.
We take hephaestus arrows, but omit the arrow- prefix.
Arrow size by default is hephaestus' default (3x linewidth), but size can also be set by using a numeric suffix, e.g. 'open:10'.

Comment on lines +173 to +175
/// Constant channels from layer parameters, scale-bypassing (e.g.
/// `start_marker`/`end_marker` from the `arrow` SETTING).
pub constants: Vec<(&'static str, HValue)>,

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there is already a pre-existing path parameters should take, we should use that instead.

Comment thread src/validate.rs Outdated
Comment on lines +278 to +286
// Same rationale as the aggregate check above: surface `arrow`
// vocabulary errors without executing.
if let Err(e) = crate::plot::layer::geom::types::validate_arrow_param(&layer.parameters)
{
errors.push(ValidationError {
message: format!("{}: {}", context, e),
location: None,
});
}

This comment was marked as resolved.

@thomasp85

Copy link
Copy Markdown
Collaborator

I'd actually argue that line-ends should be a proper aesthetic (line-start and line-end separately)

@teunbrand

Copy link
Copy Markdown
Collaborator Author

I'm not ideologically opposed to that, that is also what I did in ggarrow. But it needs some discussion around palettes, discrete vs continuous and how it interplays with sizing.

@thomasp85

Copy link
Copy Markdown
Collaborator

I'm honestly only interested in a shape like scale for the look of it - I'm fine for now with letting the size follow the linewidth

@teunbrand

Copy link
Copy Markdown
Collaborator Author

I've made them proper aesthetics now. Current behaviour is best captured in scale/aesthetic/arrow.qmd doc.

@teunbrand

Copy link
Copy Markdown
Collaborator Author

Current test failure repeats in main (signal: 11, SIGSEGV: invalid memory reference), so probably this PR isn't to blame.

This branch has not been deployed

No deployments
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.

2 participants