vega-lite icon indicating copy to clipboard operation
vega-lite copied to clipboard

Fit chart size to content for repeated charts to remove empty space

Open joelostblom opened this issue 2 years ago • 0 comments

When I create a repeated chart, the width and height is kept constant for all charts instead of dynamically adapted to the content of the chart. This can create a lot of whitespace between charts, which doesn't look very good. Here is a small example where I think it would make more sense if B was made into a narrower chart.

image Open the Chart in the Vega Editor

I think it would be a sensible default to have the dimensions fit the chart content, and also more expected since this is consistent with how Vega-Lite behaves for single figures. If there is an intended use case for the current behavior that I am missing, I think it could also make sense to introduce a resolve option (or repeat parameter) for width/height similar to how it works for facets:

Shared x-scale: image Open the Chart in the Vega Editor

Independent x-scale: image Open the Chart in the Vega Editor

joelostblom avatar Mar 24 '22 06:03 joelostblom