plotly / plotly/plotly.py

Sunburst plot not rendering without any error or warning message

Open
#4,418 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug P3
Dominant language
Python
Stars
18.8k
Forks
2.8k
Avg merge
16h 26m
Merged PRs (30d)
21

Description

I am trying the basic sunburst plot as given here:

import plotly.express as px
data = dict(
    character=["Eve", "Cain", "Seth", "Enos", "Noam", "Abel", "Awan", "Enoch", "Azura"],
    parent=["", "Eve", "Eve", "Seth", "Seth", "Eve", "Eve", "Awan", "Eve" ],
    value=[10, 14, 12, 10, 2, 6, 6, 4, 4])

fig = px.sunburst(
    data,
    names='character',
    parents='parent',
    values='value',
)
fig.show()

when I replace the data with the following:

['', 'Is', 'it', 'okay', 'to', 'Can', 'I', 'use', 'a', 'Show', 'me', 'how', 'to', 'do', 'this', 'skip', 'adding']
['', '', 'Is', 'it', 'okay', '', 'Can', 'I', 'use', '', 'Show', 'me', 'how', 'I', 'do', 'I', 'skip']
[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]

it works fine. But when I add only one more datapoint:

['', 'Is', 'it', 'okay', 'to', 'Can', 'I', 'use', 'a', 'Show', 'me', 'how', 'to', 'do', 'this', 'skip', 'adding', 'I', 'step']
['', '', 'Is', 'it', 'okay', '', 'Can', 'I', 'use', '', 'Show', 'me', 'how', 'I', 'do', 'I', 'skip', '', 'this']
[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]

there is no output. I do not see any warning or error message.

What can be the issue? And if so, there should be some error message raised.

Versions:

Python=3.11.4
Plotly=5.18.0
Pandas=2.1.2

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

Run the two supplied px.sunburst reproductions with Python 3.11.4, Plotly 5.18.0, and Pandas 2.1.2, comparing the 17-point and 19-point inputs. Trace the sunburst rendering path from fig.show() and determine why the larger input produces no output; done means the case renders or reports a clear error, with coverage for the reproduction.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-visualization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.