-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Remove the performance overhead of showLink property #1557
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
Conversation
Error: "Trailing spaces not allowed"
src/plots/plots.js
Outdated
@@ -257,6 +257,8 @@ plots.previousPromises = function(gd) { | |||
* Add source links to your graph inside the 'showSources' config argument. | |||
*/ | |||
plots.addLinks = function(gd) { | |||
if(gd._context.showLink === false) return; |
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 could break graphs that have the showSources
config option set as it is called below.
So, replacing this line with something like:
if(!gd._context.showLink || !gd._context.showSources) return;
would be safer.
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.
Got it. Thanks!
Made changes according to code review feedback.
Code updated according to the review feedback. |
Em, Interesting...I will take a look. Did not run the test locally as I thought it is just a trivial change. |
I changed the OR condition into AND: if(!gd._context.showLink && !gd._context.showSources) return; It seems to make sense to me logically, and all tests pass. But please review. Thanks! |
CI uses an older version of Chrome (54, the latest is 57 I think), so maybe that's the issue. Otherwise, have you tried running all the test suites at once with |
Run all the test cases locally again. All 1850 cases passed this time. So I add some comments to re-trigger the CI check. |
@hy9be tests are passing. Looks like the CI failure was intermittent. Our apologies. Great PR. Thanks againg 🎉 Merging. |
A fix for: #1554. Do nothing if showLink is set to be false, to avoid performance overhead caused by measuring and reflows.