Open DavZim opened 1 year ago
Using width like echarts4rOutput("plot1", width=999)
is not responsive, but helps.
It should be responsive I'm surprised it's not right. Shouldn't tabPanel call the resize event when a tab is toggled? That is implemented in echarts4r
You could use resize proxy but really should not have to
I tried the above code but used a static ggplot instead and the resizing issue does not appear.
Any updates on this issue? This behavior happens in Echarts4r Shiny demo as well.
In the Loading tab, click on "Generate" and then switch to a different tab while it renders in the background. When you return, this happens:
Hello, yeah that's a problem, I'm working on it but I think it has to do with htmlwidgets, ... gonna try to find the issue
Yes, I don't think it's on echarts4r's end. I suspect it's a combination of shiny and htmlwidgets.
The graph is initialised with the wrong width and the only way this gets redrawn is with if a resize event gets fired and it does not.
I don't fully understand why it gets initialised with the wrong width.
When the user clicks on a tab 1 with an echarts4r plot and then moves on to another tab 2 before tab 1 has finished rendering it, the plot on tab 1 will have an incorrect width.
MWE
Given the following app:
This is what I see:![image](https://user-images.githubusercontent.com/15910496/204455183-6abb6e5c-0e02-4aba-b1a4-7f49e0419657.png)
This is what I expect to see (which is what I see when I wait until plot1 is rendered before moving on or when I resize the window):![image](https://user-images.githubusercontent.com/15910496/204455314-6dc1601b-5a77-4e8d-a771-311c41ea34eb.png)