Skip to content

Can't set longitude range between [160, -160] #1698

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

Closed
chriddyp opened this issue May 18, 2017 · 3 comments
Closed

Can't set longitude range between [160, -160] #1698

chriddyp opened this issue May 18, 2017 · 3 comments
Assignees
Labels
bug something broken

Comments

@chriddyp
Copy link
Member

chriddyp commented May 18, 2017

Trying to center a scatter map around Fiji. I want the longitude to be between 140 and -140, like this image (I manually zoomed and panned to focus here)

image

Setting the longitude range to [140, -140] does not seem to work. I've also tried rolling over with [140, 220] to no avail. Here is a Codepen: https://codepen.io/chriddyp/pen/OmovzL?editors=1010. Here is a graph in the chart editor: https://plot.ly/create/?fid=chris:18383

🎩 tip to @jackparmer who originally discovered this.

@etpinard etpinard added the bug something broken label May 18, 2017
@etpinard
Copy link
Contributor

Looks like all custom lonaxis ranges that cross the antimeridian (where lon = -180 = 360) are broken.

This might be a good reason to start using d3 v4's d3-geo module which ships with a fitExtent method that probably does a better job than my ad hoc attempt.

@etpinard etpinard self-assigned this Sep 14, 2017
@etpinard
Copy link
Contributor

etpinard commented Sep 18, 2017

@chriddyp I found a way to make this work without waiting for a patch:

@chriddyp
Copy link
Member Author

cc @jackparmer in case you still need to make this example ^^

etpinard added a commit that referenced this issue Sep 19, 2017
- correctly handle rangeBox computations for
  lon range that cross anitmeridian
- improve projection.rotation.lon default such that
  custom lonaxis.range get a reasonable default projection
- add `geo_across-antimeridian` mock
- fixup `geo_fill` mock for new projection.rotation.lon dflt
etpinard added a commit that referenced this issue Sep 20, 2017
- correctly handle rangeBox computations for
  lon range that cross anitmeridian
- improve projection.rotation.lon default such that
  custom lonaxis.range get a reasonable default projection
- add `geo_across-antimeridian` mock
- fixup `geo_fill` mock for new projection.rotation.lon dflt
etpinard added a commit that referenced this issue Sep 21, 2017
- correctly handle rangeBox computations for
  lon range that cross anitmeridian
- improve projection.rotation.lon default such that
  custom lonaxis.range get a reasonable default projection
- add `geo_across-antimeridian` mock
- fixup `geo_fill` mock for new projection.rotation.lon dflt
etpinard added a commit that referenced this issue Sep 22, 2017
- `geo.center` was required for persistent map interactions
- make `projection.rotation.lon` default value depend
  on lonaxis range (to get correct view for e.g. #1698)
- use lonaxis range OR rotation lon to determine
  the `geo.center.lon` default
- use lataxis range to determine `geo.center.lat` default
etpinard added a commit that referenced this issue Sep 22, 2017
- while #1698 was fixed by the improve geo defaults,
  this 🔒 it down.
etpinard added a commit that referenced this issue Sep 22, 2017
- while #1698 was fixed by the improve geo defaults,
  this 🔒 it down.
etpinard added a commit that referenced this issue Sep 22, 2017
- `geo.center` was required for persistent map interactions
- make `projection.rotation.lon` default value depend
  on lonaxis range (to get correct view for e.g. #1698)
- use lonaxis range OR rotation lon to determine
  the `geo.center.lon` default
- use lataxis range to determine `geo.center.lat` default
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

No branches or pull requests

2 participants