Open
Description
The logic to check for non-leaves is dubious, e.g. a leaf whose name is a suffix of another leaf triggers an error.
The check also depends on the alphabetical ordering on the leaves.
As suggested by #3589, I wonder whether this non-leaf detection is really meaningful.
I'd be happy to write a PR to remove this check. Thoughts?
minimal working example
import pandas as pd
import plotly.express as px
df = pd.DataFrame(
{
"status": ["NOT_YET_COMPLETED", "COMPLETED"],
"next_step": ["Wrapup", None],
"count": [1, 2],
}
)
# no error
px.sunburst(df, path=["status", "next_step"], values="count")
df.loc[0, "status"] = "ACTIVE_NOT_YET_COMPLETED"
# error (spurious)
px.sunburst(df, path=["status", "next_step"], values="count")
Activity
gvwilson commentedon Oct 1, 2024
@archmoj does this belong here or in plotly.js?
archmoj commentedon Oct 1, 2024
@LiamConnors would you please create a codepen and transfer it to plotly.js?
EpigeneMax commentedon Oct 1, 2024
I think the dubious check in on the Python side,
plotly/express/_core.py
lines 1637 -- 1644.LiamConnors commentedon Oct 1, 2024
The logic is in plotly.express and prevents the figure from being generated so it's not possible to create a codepen for plotly.js
remove check for non-leaf node
remove check for non-leaf node
remove check for non-leaf node
remove check for non-leaf node
remove check for non-leaf node