-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Upgrade d3 geo projections #5112
Conversation
This looks like a good idea, but I think we need to be more careful about each projection we add: (1) does it work well in the simple case? In your demo codepen a number of them fall look pretty bad either immediately or easily as you zoom / pan around so should probably not be included without some adjustment. (2) maybe you've already done this, do they support all the same parameters as the existing ones? |
- note upgrading to latest versions is not possible atm - due to ES2015 syntax and drop of IE support
package.json
Outdated
@@ -57,7 +57,7 @@ | |||
] | |||
}, | |||
"dependencies": { | |||
"@plotly/d3": "^3.5.18", | |||
"@plotly/d3": "git://github.com/plotly/d3.git#e792de9ae52d956d18582cac8a49ea6a03c7e010", |
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.
Thanks for the notes @alexcjohnson. |
test/jasmine/tests/geo_test.js
Outdated
@@ -1353,46 +1353,6 @@ describe('Test geo interactions', function() { | |||
.then(done, done.fail); | |||
}); | |||
|
|||
it('should clear hover label when cursor slips off subplot', function(done) { |
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.
Why did these 2 tests get removed?
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.
If I recall (as mentioned in the commit message) there used to be a bug in d3.geo where a function returned NaN
positions. And we guarded against it.
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.
But these tests are just using the high-level API, not d3 geo itself. If they started failing, that means something changed about the user-facing behavior. What changed? Are we comfortable with that change? I'd much prefer if we can adapt the tests to the new version so we can see the difference.
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.
Good question. Pointing to the fact that rebase somehow forgot to remove geo/projections
.
It is now fixed in 557ebde.
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 test should still be able to pass though. Perhaps the exact pixel positions need to change because there's some small change in how the projection is applied? If I try to manually follow what's going on in the test (I believe it's hovering on the point off the coast of Africa, then slowly mousing off the edge of the globe) the behavior looks identical before/after the change. So we should be able to bring the test back, but if the exact values need to change a little (px = 390
, py = 290
and if(px < 402)
that's fine.
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.
Good call. Adjusted in 647b0dc.
In fact with previous positions the tests didn't pass locally. But now the test now passes both locally and on the CI.
We don't strictly speaking need to merge this PR for v2, so let's leave it alone for now? |
That's what we may end up doing. But it is worth having the conversion going before committing to v2 IMHO. |
… functions" This reverts commit a7735e6.
Co-authored-by: Alex Johnson <johnson.alex.c@gmail.com>
Conflicts are resolved here and the plotly/d3 PR. |
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.
Looks good, thanks for making the new issue.
💃 after publishing the updated @plotly/d3
Replace old
d3.geo
functions with upgradedd3-geo
modules (that support IE) as part ofd3 bump
cc: #424.Some new
geo
projections e.g.satelite
could potentially be added as listed in 8dd4ba0 to address #4781.This would also result in reducing the size of various partial bundles that do not need
geo
trace.@plotly/plotly_js