vega / vega-lite

A concise grammar of interactive graphics, built on Vega.
https://vega.github.io/vega-lite/
BSD 3-Clause "New" or "Revised" License
4.7k stars 617 forks source link

Allow images to be sized and rotated via the size channel #5365

Open jwoLondon opened 5 years ago

jwoLondon commented 5 years ago

I think it would be useful to have data-driven image mark sizes via the size channel, much as we have for many of the other marks. This would open out the design space for image embellishments to a range of standard chart types without expanding the API surface area.

If an image mark is encoded with size, this could allow width and height not to be specified. If only one of width and height was specified, the image could be sized by the unspecified dimension. This would, for example, allow the generation of the kinds of bar charts discussed here

domoritz commented 3 years ago

Adding https://github.com/vega/vega-lite/issues/7258 to this issue.

lassepe commented 3 years ago

An alternative would be to allow images as shapes for point marks. Currently, point marks support SVG image path strings as shape but not an image url.

domoritz commented 3 years ago

Currently, point marks support SVG image path strings as shape but not an image url.

I think that's a limitation of https://vega.github.io/vega/docs/marks/symbol/.

jonfroehlich commented 1 year ago

Hi Team,

Just came here to say that I'd also love to dynamically size the image mark based on a field. For example, I'm working on an scatterplot where each point is an image mark. I'd love to add in another dimensions that sizes the mark based on another quantitative field in my dataset.

In this particular case, I have SVGs for my marks, so I was going to try the symbol mark approach but looks like these are not supported by Vega-Lite?