Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support option for getting arrows at the end of rules #4270

Open
davidanthoff opened this issue Nov 20, 2018 · 8 comments
Open

Support option for getting arrows at the end of rules #4270

davidanthoff opened this issue Nov 20, 2018 · 8 comments
Labels

Comments

@davidanthoff
Copy link
Contributor

Then one could use rule marks to create nice quiver plots. I think it would really be two styling options: one for the beginning, and one for the end of the rule, and then a selection of arrows or other symbols.

@domoritz
Copy link
Member

Yeah, that would be nice. I can imagine that we support symbols at the beginning and end of rule marks. I can imagine that this is a property of the rule mark.

We don't have the bandwidth to add this right now but would be happy to guide someone.

@davidanthoff
Copy link
Contributor Author

Just FYI, this came up here. In that case one can actually achieve what the original question hoped to do with the shipping version, but I can also see that people will want proper quiver plots. No rush :) Wrap faceting is what I really have my fingers crossed for ;)

@kanitw
Copy link
Member

kanitw commented Nov 20, 2018 via email

@domoritz
Copy link
Member

The simplest way is probably to just add support for symbol angles and then you could use layer to add the arrow ends. Angle would be a new channel that only works with point marks (and only make sense for symbols).

Wrap faceting is what I really have my fingers crossed for ;)

Me too!

@davidanthoff
Copy link
Contributor Author

I can see the two layer approach working, but on the other hand, it would be much easier for users if this was just a property of rules. Also, I'm just wondering whether something that is stitched together might have some visual "breaks". Things like, does the rule end exactly within the arrow, or is there some overlap/space might be quite tricky if it is just a layered story. Also, would be nice if things like line width would flow to the arrow as well...

@domoritz
Copy link
Member

I completely agree but we could support both or treat the arrows in rule marks as a macro.

@lovettchris
Copy link

I would love to see "angle' get added for symbols too, I can get so close to what I need with a triangle mark in a second layer, just need to be able to rotate it...

image

@kanitw kanitw added this to the x.x Visual Encoding Patches milestone Jun 8, 2019
@kanitw kanitw added the P3 Should be fixed at some point label Jun 9, 2019
@kanitw kanitw removed this from the x.x Visual Encoding milestone Dec 4, 2019
@pierre-haessig
Copy link

For the reference, an arrow annotation example has been merged in Altair doc by vega/altair#3236: see Examples/Line Chart with Arrows.

However, about the previous comments about the possibility of using mark angles (which have been implemented in the mean time, see e.g. Wind Vector Map example), there is a catch. Indeed, as pointed out by @ChiaLingWeng (vega/altair#3236 (comment)), the arrow angles in a vector plot depend on the aspect ratio of that plot. I guess this is difficult to implement with the mark angles.

So in the end, having the option to add arrow heads at one or both ends of rule marks would still be a useful contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants