Skip to content

Arrows at line ends - #597

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

teunbrand wants to merge 12 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
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,
});
}

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.

Ideally this should be validated along with other parameters, but it doesn't quite fit into the constraint system due to the numeric suffixes e.g. 'closed:10'. Perhaps a constraint of the constraint system...

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.

1 participant