Vega-lite: Add angle channel for symbols

Created on 10 Feb 2019  路  11Comments  路  Source: vega/vega-lite

I couldn't find any previous discussion on this, but apologies if I am repeating previous discussion.

Would it be practical / desirable to have an orientation channel? This seems one of Bertin's more straightforward retinal variables that is currently absent from Vega-Lite. Personally I would find this very helpful, especially for geographically embedded visualisations.

One use case: To create directional glyphs for representing vector fields. I have managed to simulate these programmatically by generating a set of SVG path custom shapes, but this is too cumbersome to be a routine approach and requires the data to encode with orientation to be categorical.

One could imagine a syntax consistent with other channel encodings, such as

    "shape": {"value": "triangle-up"},
    "size": {"field": "speed","type": "quantitative"},
    "orientation" : {"field": "direction", "type": "quantitative"}

leading to output such as

orientationexample

Area - Visual Encoding Enhancement Help Wanted P3

All 11 comments

Thanks for the issue.

It seems like you want an angle channel for the point marks and underlying symbol marks in Vega. (I think the name angle would be more consistent with the same property for text and arc mark.)

I think this makes sense, but we will need to support angle for symbol in Vega first. I'll move this issue to Vega for now.

Seems reasonable to me! Will add to my queue...

This was (partly) discussed before in https://github.com/vega/vega/issues/974

Thanks @jheer -- I'll re-open this and move it back to Vega-Lite so we don't forget to do it for VL.

@kanitw I would like to work on this issue.

can you provide me some starter file so that I can get started with this issue?

I'd look at https://github.com/vega/vega-lite/pull/4259 as a guideline for adding a new channel.

Note that unlike strokeWidth, angle is a quantitative scale.
It also should only be added to text mark and point mark compilers, using a mixins.nonPosition (see size in the point mark compiler).

As a part of this PR, it's probably nice to replicate https://vega.github.io/vega/examples/wind-vectors/ in VL.

Are there plans to implement the angle channel for the VL4.0 release? I note it listed in the Maybe 4.0 milestones, but not sure if that means most likely yes or no. Personally, I would find an angle encoding channel very useful for certain mapping tasks.

We won't have cycles to get this in for 4.0 (which we want to get out asap) but it makes sense for 4.1.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

paintdog picture paintdog  路  4Comments

mcnuttandrew picture mcnuttandrew  路  3Comments

kanitw picture kanitw  路  4Comments

ijlyttle picture ijlyttle  路  3Comments

mcadams92 picture mcadams92  路  3Comments