plotly.R
plotly.R copied to clipboard
sunburst and treemap plots aren't resized when displayed in subplot
Using plotly 4.9.2.9000 (latest GitHub) sunburst and treemap plots aren't resized when displayed in a subplot.
Furthermore a warning is given:
Warning message: 'layout' objects don't have these attributes: 'NA'
Example:
library(plotly)
p1 <- plot_ly(
labels = c("Eve", "Cain", "Seth", "Enos", "Noam", "Abel", "Awan", "Enoch", "Azura"),
parents = c("", "Eve", "Eve", "Seth", "Seth", "Eve", "Eve", "Awan", "Eve"),
values = c(10, 14, 12, 10, 2, 6, 6, 4, 4),
type = 'sunburst'
)
p2 <- plot_ly(
labels = c("Eve", "Cain", "Seth", "Enos", "Noam", "Abel", "Awan", "Enoch", "Azura"),
parents = c("", "Eve", "Eve", "Seth", "Seth", "Eve", "Eve", "Awan", "Eve"),
values = c(10, 14, 12, 10, 2, 6, 6, 4, 4),
type = 'treemap'
)
p4 <- p3 <- plot_ly(y = 1:10, type = "scatter", mode = "lines")
plotly::subplot(p1, p2, p3, p4)
First saw this issue here.
just wondering if there is a fix by now?
No - this is still the case.
Furthermore, it seems we can't have more than one sunburst plot in a subplot:
library(plotly)
p1 <- plot_ly(
labels = c("Eve", "Cain", "Seth", "Enos", "Noam", "Abel", "Awan", "Enoch", "Azura"),
parents = c("", "Eve", "Eve", "Seth", "Seth", "Eve", "Eve", "Awan", "Eve"),
values = c(10, 14, 12, 10, 2, 6, 6, 4, 4),
type = 'sunburst'
)
plotly::subplot(p1, p1)
However, crosstalk::bscols(p1, p1)
works.