-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Update hover-text-and-formatting.md #4557
Conversation
1) added an example that formats the elements of custom_data in plotly express 2) fixed a bug in the "advanced hovertemplate" example which caused it to display the square root of population. Modified that example to follow the main dataframe is called "df" convention. Added a country name field to that example and comments about the usage of key parameters. 3) I did not remove the "Adding other data to the hover with customdata and a hovertemplate" example, but I believe it is now redundant and that the revised ### Advanced Hover Template example is more compliant with expectations like using meaningful data over random data. If you removed it, it would make sense to rename "Advanced Hover Template" to include the phrase: "Adding other data to the hover with customdata and a hovertemplate"
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.
nice catch with the square root population displaying.
This new code example is much better, @rl-utility-man . Thank you.
Although redundant, I think it's ok to keep the section on "Adding other data to the hover with customdata and a hovertemplate". Having an example with a different graph type can be helpful to some.
@LiamConnors are you ok with these suggested commits? |
@LiamConnors is there anything I can do to help finish this up and get it merged? Thanks! |
Co-authored-by: Adam <adam@plot.ly>
Co-authored-by: Adam <adam@plot.ly>
Co-authored-by: Adam <adam@plot.ly>
"<b>%{customdata[0]}</b><br>" + | ||
"<b>%{customdata[1]}</b><br><br>" + | ||
"GDP per Capita: %{x:$,.0f}<br>" + | ||
"Life Expectation: %{y:.0f}<br>" + |
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.
"Life Expectation: %{y:.0f}<br>" + | |
"Life Expectancy: %{y:.0f}<br>" + |
Thanks for this PR @rl-utility-man ! |
Documentation PR
doc/README.md
filedoc-prod
branch OR it targets themaster
branchpx
example if at all possibleplotly.graph_objects as go
/plotly.express as px
/plotly.io as pio
df
fig = <something>
call is high up in each new/modified example (eitherpx.<something>
ormake_subplots
orgo.Figure
)fig.add_*
andfig.update_*
rather thango.Figure(data=..., layout=...)
in every new/modified examplefig.add_shape
andfig.update_xaxes
are used instead of bigfig.update_layout
calls in every new/modified examplefig.show()
is at the end of each new/modified exampleplotly.plot()
andplotly.iplot()
are not used in any new/modified example