-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
remove bug in sunburst / treemap when passing a column named "parent" #2639
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
So when import plotly.express as px
import pandas as pd
vendors = ["A", "B", "C", "D", None, "E", "F", "G", "H", None]
sectors = ["Tech", "Tech", "Finance", "Finance", "Other",
"Tech", "Tech", "Finance", "Finance", "Other"]
regions = ["North", "North", "North", "North", "North",
"South", "South", "South", "South", "South"]
sales = [1, 3, 2, 4, 1, 2, 2, 1, 4, 1]
df = pd.DataFrame(
dict(parent=vendors, sectors=sectors, regions=regions)
)
fig = px.sunburst(df, path=['regions', 'sectors'], color='parent')
fig.show() The problem is that the column names passed in color, hover_data etc. are displayed in the hover_data. Should we give another arbitrary name like |
Closes #2607
[x] check what happens when 'parent' is passed for a column not in the path (color, hover, etc.)
[x] add tests