-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
fixing hover_data and hover_name bugs in path API #2524
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -171,6 +171,23 @@ def test_sunburst_treemap_with_path_and_hover(): | |
) | ||
assert "smoker" in fig.data[0].hovertemplate | ||
|
||
df = px.data.gapminder().query("year == 2007") | ||
fig = px.sunburst( | ||
df, path=["continent", "country"], color="lifeExp", hover_data=df.columns | ||
) | ||
assert fig.layout.coloraxis.colorbar.title.text == "lifeExp" | ||
|
||
df = px.data.tips() | ||
fig = px.sunburst(df, path=["sex", "day", "time", "smoker"], hover_name="smoker") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this actually errors out on master (because |
||
assert "smoker" not in fig.data[0].hovertemplate # represented as '%{hovertext}' | ||
assert "%{hovertext}" in fig.data[0].hovertemplate # represented as '%{hovertext}' | ||
|
||
df = px.data.tips() | ||
fig = px.sunburst(df, path=["sex", "day", "time", "smoker"], custom_data=["smoker"]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this also errors out on master (because |
||
assert fig.data[0].customdata[0][0] in ["Yes", "No"] | ||
assert "smoker" not in fig.data[0].hovertemplate | ||
assert "%{hovertext}" not in fig.data[0].hovertemplate | ||
|
||
|
||
def test_sunburst_treemap_with_path_color(): | ||
vendors = ["A", "B", "C", "D", "E", "F", "G", "H"] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on master this appears as
lifeExpadditional_col_for_hover
because we rewriteargs["color"]