plotly.R icon indicating copy to clipboard operation
plotly.R copied to clipboard

sunburst and treemap plots aren't resized when displayed in subplot

Open ismirsehregal opened this issue 4 years ago • 2 comments

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)

image

First saw this issue here.

ismirsehregal avatar Oct 21 '20 08:10 ismirsehregal

just wondering if there is a fix by now?

YasinEl avatar Aug 23 '21 15:08 YasinEl

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.

ismirsehregal avatar Aug 25 '22 09:08 ismirsehregal