vega / react-vega

Convert Vega spec into React class conveniently
http://vega.github.io/react-vega/
Other
373 stars 67 forks source link

Setting height to "container" (i.e. responsive sizing) does not work as expected #544

Open zgottlieb opened 1 year ago

zgottlieb commented 1 year ago

I am trying to create a responsive chart with Vega Lite and react-vega. When I use the "container" setting for height and width in the spec, I am seeing that the width seems to work properly, taking up the width of the container and resizing as you resize the container. However, the height appears to be collapsed on initial load, and when resizing the window / container, the height seems to grow indefinitely, even when shrinking the window (which you'd expect to shrink the height of the chart).

The versions I am using are:

Here is a CodeSandbox that shows the issue I am having: https://codesandbox.io/s/react-vega-typescript-forked-9f42rv. I've also attached a gif here to make it more clear what issues I am seeing.

vega-lite-resize-issue

sim-uw commented 1 month ago

I've experienced a similar issue when VegaLite is a flex item