Skip to content

Centralize transform functions #5254

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

Merged
merged 2 commits into from
Nov 5, 2020
Merged

Centralize transform functions #5254

merged 2 commits into from
Nov 5, 2020

Conversation

archmoj
Copy link
Contributor

@archmoj archmoj commented Nov 5, 2020

@plotly/plotly_js

@archmoj archmoj added this to the v1.58.0 milestone Nov 5, 2020
@@ -1195,6 +1195,18 @@ lib.isHidden = function(gd) {
return !display || display === 'none';
};

lib.strTranslate = function(x, y) {
return (x || y) ? 'translate(' + x + ',' + y + ')' : '';
};
Copy link
Collaborator

Choose a reason for hiding this comment

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

Might be able to simplify even more with an optional 3rd argument which is the number of digits to round to - would remove the Math.round and toFixed you have in a few places.

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.

Nice simplification! 💃

@archmoj archmoj merged commit c09fe29 into master Nov 5, 2020
@archmoj archmoj deleted the lib-transform-funcs branch November 5, 2020 21:20
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