Altair: custom image as Mark

Created on 16 May 2018  Â·  9Comments  Â·  Source: altair-viz/altair

Hi!

I stumbled upon your pycon2018 talk and it's brought me here. SUPER cool project, very powerful looking library. I was instantly intrigued! I have as much knowledge of Vega and your project as I could muster in the past couple of hours.

Is it possible to use a custom image (PNG, SVG, etc) as a marker? Ideally as a local path, but optionally a URL resource would work as well. This would go a LONG way in customizing visualizations along with the storytelling aspect you can build via selections.

I was reading through the source, but got lost pretty easily as there's a good amount of abstraction to make the declarative style work. Was naively hoping I might be able to hack it together myself :~)

ala matplotlib

Thanks for your work on all this, it's very exciting stuff!
- SN

question vega-lite-related

Most helpful comment

https://github.com/vega/vega-lite/pull/5060 has not yet made it into a Vega-Lite release. Once Vega-Lite 4.0 is released, we will work on releasing Altair 4.0, which will support image marks.

All 9 comments

Hi – no, custom markers are not currently possible.

If you're interested in contributing this feature to the underlying Vega-Lite library, please feel free to file an issue and discuss more there. :)

@kanitw I just realized, you're a main contributor to Vega-Lite. Super cool that you're so active in this project as well. Unfortunately, I have no experience with ts, so I probably wouldn't be the best help here. I will keep an eye on both projects though as it's exciting work!

The ease of creation of interactive viz here is great stuff.

No worries. I will create an issue in VL anyway: https://github.com/vega/vega-lite/issues/3758.

Just as a side note, Vega-Lite supports paths as shapes. Elm-Vega has an example: https://github.com/gicentre/elm-vega/blob/master/vlExamples/isotype.html

It will look like this
screen shot 2018-05-31 at 17 54 02

It seems like custom image marks have recently been added in vega/vega-lite#5060. I've been searching for a way to do this in Altair as well, but I don't think it's possible yet?

https://github.com/vega/vega-lite/pull/5060 has not yet made it into a Vega-Lite release. Once Vega-Lite 4.0 is released, we will work on releasing Altair 4.0, which will support image marks.

@jakevdp and @kanitw, thanks for the discussion! I've spent time reviewing docs, and while I see this issue open, I also see:

I am correct that this issue can be closed? Just making sure I'm not missing something?!

Yes, I believe this can be closed now. Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pabloinsente picture pabloinsente  Â·  3Comments

bmcfee picture bmcfee  Â·  3Comments

DentonGentry picture DentonGentry  Â·  3Comments

firasm picture firasm  Â·  3Comments

tonylee3399 picture tonylee3399  Â·  3Comments