Skip to content
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

Refactor legend draw to make input/output and optional arguments clear #5579

Merged
merged 10 commits into from
Apr 6, 2021

Conversation

archmoj
Copy link
Contributor

@archmoj archmoj commented Apr 5, 2021

#4620 reused legend.draw to display unified hovers which is great improvement.
But with an unresolved #4620 (comment) it is now difficult to understand what exactly is going on with the optional argument (opts) passing to draw function and downstream.

Also opts is in fact essential (not optional) to most functions in legend.draw while different sizes are computed and stashed into this object (with the intent IN & OUT).

This PR is an attempt to address these internal issues before more progress on legends and unified hovers.

@plotly/plotly_js

@archmoj archmoj added this to the NEXT milestone Apr 5, 2021
Copy link
Collaborator

@alexcjohnson alexcjohnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a nice improvement. Personally I don't see the point of the extra level of indirection (draw -> _draw) but if you prefer it fine. 💃

@archmoj archmoj merged commit dbf9364 into master Apr 6, 2021
@archmoj archmoj deleted the legend-draw-refactor branch April 6, 2021 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants