react-pivottable icon indicating copy to clipboard operation
react-pivottable copied to clipboard

Resizing plot area?

Open hjf opened this issue 7 years ago • 3 comments

I'm using this component in Vue thanks Vuera, a vue package that lets me use React components within Vue. This is working fine, except for plots. I can't find a way to resize plots. With CSS, table views automatically resize to width in %, but plots don't seem to.

I've tried everything from the plotlyOptions object to Plotly.Plots.resize()

The plotlyOptions object works the first time: if I pass this as a prop, plotly receives it and draws a chart in the specified size), but if I change the value of plotlyOptions.width nothing happens (the property is reactive, as changing the data object works fine)

hjf avatar May 24 '18 17:05 hjf

In the demo app this is done via plotlyOptions ... https://github.com/plotly/react-pivottable/blob/master/examples/App.jsx#L61

nicolaskruchten avatar May 25 '18 20:05 nicolaskruchten

But is this property reactive? It works for me the first time, but not when I change it.

hjf avatar May 28 '18 12:05 hjf

It is "reactive", yes, in an immutable context. You can't just mutate plotlyOptions.width, you have to reassign plotlyOptions in order for the immutability check to work.

nicolaskruchten avatar May 28 '18 13:05 nicolaskruchten