Forum Discussion
Deneb Faceted Chart Size
- 4 years ago
Hey mahoneypat,
I'm not 100% across what the final look should be as I assume you're looking to data-drive the widths? I'm not sure that this is possible in Vega-Lite currently, as it would appear that there is no expression support for height and width properties outside the special cases.
I believe that when you use the facet channel, you aren't able to have things dynamically size; manual heights/widths are needed for the spec to drive how each facet should resolve. I believe there are some ideas being discussed for Vega-Lite (here and here), although this may not be appropriate for your case.
It's quite fascinating that you've been able to dynamically set width with the independent x-axis though 🙂
From a quick look, the closest I could manage is by using the height at a fixed value, and width having a given step value, e.g.:
I get that this might not work well as more (or less) categories are introduced, but does this get you closer towards where you need to go?
I think that anything else might need a change to Vega-Lite. It might be possible to switch your language to Vega and use signals to calculate everything though there though. This might take a bit more figuring out if it's a path you want to go down.
Daniel
Hey mahoneypat,
I'm not 100% across what the final look should be as I assume you're looking to data-drive the widths? I'm not sure that this is possible in Vega-Lite currently, as it would appear that there is no expression support for height and width properties outside the special cases.
I believe that when you use the facet channel, you aren't able to have things dynamically size; manual heights/widths are needed for the spec to drive how each facet should resolve. I believe there are some ideas being discussed for Vega-Lite (here and here), although this may not be appropriate for your case.
It's quite fascinating that you've been able to dynamically set width with the independent x-axis though 🙂
From a quick look, the closest I could manage is by using the height at a fixed value, and width having a given step value, e.g.:
I get that this might not work well as more (or less) categories are introduced, but does this get you closer towards where you need to go?
I think that anything else might need a change to Vega-Lite. It might be possible to switch your language to Vega and use signals to calculate everything though there though. This might take a bit more figuring out if it's a path you want to go down.
Daniel
Thank you, dm-p . I've used "step" before, and should have thought to try that. I think your approach will get me there.
Pat