sunburst and treemap plots aren't resized when displayed in subplot
Open
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 2.7k
- Forks
- 641
- PR merge metrics
- No merged PRs in 30d
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the provided R example with plotly::subplot() and compare the sunburst and treemap panels with the scatter panels. Investigate the subplot sizing behavior and the reported 'layout' warning; done means sunburst and treemap plots resize correctly without that warning.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100