-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Fix add_vline text annotation with dates #3731
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
base: main
Are you sure you want to change the base?
Conversation
cc: @nicolaskruchten this is a small bugfix that is useful for us, and it looks like people have been reporting it a few times (see PR description for issue) |
@marthacryan can you please have a look at this one (and if possible add a test when merging) thanks - @gvwilson |
As this comment (#3065 (comment)) mentions, I would suggest checking for types would be a better way than making workaround fixes to those methods. |
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.
This is just a simple typo fix and it looks good enogh
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.
Tested localy this solution and its fixes the issue in #3831 as described I am working on a pytest that will test this
Background
I would like to use add_vline with a text annotation.
Closes: #3065
The workaround presented in #3065 (comment) breaks if people view the plot in a difference timezone than where it was generated.
As mentioned in that ticket, here is the error when data is used for text annotations
TypeError: unsupported operand type(s) for +: 'int' and 'str'
The backtrace looks like:
For line annotations, the same x value is passed for both x1/x2, so the mean is trivial to compute.
Code PR
plotly.graph_objects
, my modifications concern thecodegen
files and not generated files.modified existing tests.
new tutorial notebook (please see the doc checklist as well).
Test Plan
I'm now able to use add_vline and text annotations with dates. The repro in #3065 works now