GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||
GeezerVison is showing github.com — Fix geo fitbounds to choose a compact range across the antimeridian by SharadhNaidu · Pull Request #7837 · plotly/plotly.js Conversation
|
|
can any of the maintainer please review the fix for the issue please ? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Hello @SharadhNaidu! Thanks for the PR. I'll try to review this, but it might take a bit to get to. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
In the meantime, could you provide some examples that this fixes and some testing steps? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Give me some time please , i'll provide you with few examples with before and after , also the testing steps . |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
here's the repro from the issue , before/after, and how to test. example (the case from #7844) Plotly.newPlot('graph', [{ type: 'scattergeo', mode: 'markers', lat: [43.1155, 32.7157], lon: [131.8855, -179] }], { geo: { fitbounds: 'locations', projection: { type: 'equirectangular' } } }); the two points sit either side of ±180° before, before (v3.6.0) points squashed against opposite edges:
after (this PR) compact view across the antimeridian, framed like any other fitbounds map:
for reference, the eastern-most
what changed: testing
Manual: swap i'll attach a few more examples and tests . |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
When `fitbounds` point data straddles +/-180 degrees longitude, the naive [min, max] range from getAutoRange includes the large empty span the long way round the globe, so the map zooms out far more than necessary (plotly/plotly.py#5539). Add getFitboundsLonRange, which finds the widest gap between consecutive longitudes and returns the complementary, antimeridian-crossing range when it is more compact. The override is scoped to longitude point data: it is skipped when a choropleth or location-based scattergeo trace is present (whose region extents are not captured here) and when the data spans the whole globe.
The antimeridian fix replaced the padded naive range with a tight [min, max], so markers ended up flush against the frame on straddling maps while every other fitbounds map leaves a margin. Scale the padding getAutoRange already applied to the naive range down to the narrower crossing range and apply it. The padding is symmetric, so the mid-longitude the projection centers on is unchanged. Loosen the integration test's range assertion to match.
8575782 to
8fd0ab1
Compare
|
I dont why the one CI run failed , its an animation/transition test , I dont think i have touch any path/file which required "test/jasmine/tests/transition_test.js" , dont know why it failed but just in case I rebased , to the recent changes . |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This is great! Thanks for the fix. It works well from my testing. I requested a few changes. Once those are done, this can be merged.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
- Guard against an empty locations array (truthy [] should not count as region data) - Clarify the comment on why the compact-range path is restricted to fitbounds='locations' with no region-bearing traces - Tighten the projection rotation assertion in the straddling test
|
@camdecoster the requested reviews are applied , please let me know if any. Also i have an issue please look into it when free (/issues/7835) I am willing to spend more time on it. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
The test failures are unrelated to this PR, so I'm going to merge. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Thanks @camdecoster . |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
[BUG]: fitbounds="locations" thinks the world is flat and goes through longitude zero when dealing with positive and negative longitudes
There was an error while loading. Please reload this page.