-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Panelsets displaying html widgets (echarts4r) weirdly #197
Comments
Can you try with the dev version of xaringanExtra? I did a bunch of panelset work (that I need to release, thanks for the reminder) and I remember fixing this kind of issue. See Installation for two ways to install the dev version. |
@gadenbuie |
I don't think this is a panelset problem, I can reproduce the issue with two echarts on separate slides. I think you should report the issue upstream. ---
output:
xaringan::moon_reader:
lib_dir: libs
nature:
highlightStyle: github
highlightLines: true
countIncrementalSlides: false
self_contained: true
---
```{r, include=F}
library(dplyr)
library(xaringan)
library(xaringanExtra)
library(echarts4r)
xaringanExtra::use_panelset()
```
```{r echo=F}
df <- data.frame(
x = seq(50),
y = rnorm(50, 10, 3),
z = rnorm(50, 11, 2),
w = rnorm(50, 9, 2)
)
df |>
e_charts(x) |>
e_line(z) |>
e_area(w) |>
e_title("Line and area charts")
```
---
```{r, echo=F}
df |>
e_charts(x) |>
e_scatter(y, z) |>
e_visual_map(z, scale = e_scale) |> # scale color
e_legend(FALSE) # hide legend
``` |
@gadenbuie It works as expected for me when it's on separate slides and not part of panelsets Included session info at the bottom in case that could help
|
I also see what appear to be normal-looking plots... until the browser is resized. Kapture.2024-05-10.at.12.13.46.mp4xaringan (well remarkjs, really) use CSS scaling to adjust the size of the slides to fit the screen, this causes issues with some htmlwidgets (there are more than a few issues in the xaringan repo about this). The fix, if there is one, would have to come from echarts4r. |
Ah i see... |
Hi,
I am trying to use panelsets to present some echarts4r charts on the same page.
The issue seems similar to #64 where the html widget doesn't resize properly when switching tabs.
The first chart (default tab) displays properly but second one doesn't and only gets fixed when browser is refreshed but this then breaks the first chart when tab is switched back.
I really do think panelsets are a great way to break up the page into more digestible sections... is there a way for this to work with echarts4r?
Reprex and screenshots included below
The first chart displays correctly
But the second displays weirdly
The second chart gets fixed only when I refresh the browser but this then makes the first chart display weirdly when tab is switched back to first chart
The text was updated successfully, but these errors were encountered: