plotly / plotly/plotly.R

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

Open
#1,867 2 comments 1 reaction 0 assignees View on GitHub

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)

image

First saw this issue here.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.