Skip to content
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

mapbox-gl@1.0.0 + improvements #3987

Merged
merged 49 commits into from
Jul 4, 2019
Merged

mapbox-gl@1.0.0 + improvements #3987

merged 49 commits into from
Jul 4, 2019

Conversation

etpinard
Copy link
Contributor

@etpinard etpinard commented Jun 26, 2019

This PR will serve as a base for all v1.49.0 mapbox-related improvements.


In brief, this PR:

cc @plotly/plotly_js

etpinard added 10 commits June 26, 2019 11:59
... navigation menu is now not included by default
- update no-access-token error msg
- fixup click mocking action
- fix relayouting cnt
- add TODOs about new (and annoying) mapbox-gl warn msg
- add info atlas-server logic and test
- that is if all mapbox subplots on graph do not use Mapbox styles,
  DO NOT error when mapbox access token isn't set
- moreover, add helpful log when multiple distinct tokens are set
  in same layout
... to avoid console warning on subplot instantiation
@etpinard etpinard added this to the v1.49.0 milestone Jun 26, 2019
staticPlot: gd._context.staticPlot
});

mapbox = new Mapbox(gd, id);
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice clean up here 👍

@antoinerg
Copy link
Contributor

I am a bit surprised that the markers in the legend are now smaller in test/image/baselines/mapbox_0.png. Can you tell me what changes introduced in this PR are causing this?

@etpinard
Copy link
Contributor Author

etpinard commented Jun 26, 2019

Can you tell me what changes introduced in this PR are causing this?

I forgot to update the mapbox baselines in #3732 or #2840

@antoinerg
Copy link
Contributor

Thanks @etpinard for the very nice PR! I also noticed that mapbox_fill now renders properly the fillcolor 👍

💃

etpinard added 13 commits June 26, 2019 16:18
- valid choropleth datum must have a valid location AND `z` value
- set calcdata[i][j].index during calc
  so that choroplethmapbox can use it in its convert.js
... and update choropleth baselines that
    didn't show the "correct" default "black"
for geo AND mapbox base plot modules

... that way we do this only once when geo and mapbox modules
    are registered
- reusing choropleth calc, hover, select, eventData and
  feature2polygon
- use `PlotlyGeoAssets` to stash fetched geojson url data
- use two layers, one fill (to filled choropleth polygon), one
  line to draw `marker.line` styles
- add mockAxis on mapbox subplot instances,
  used to format choroplethmapbox 'z' on hover
... similar to how we do things on geo subplots
- use _rehover wrapper similar to cartesian subplots and
  call it on moveend
- split fx init code into prototype.initFx
- where by default chroroplethmapbox traces are placed
  above the top most "water" layer
- N.B. we need to remove/add again layers when *below* is updated
@etpinard
Copy link
Contributor Author

etpinard commented Jul 3, 2019

@plotly/plotly_js I'm looking for a final review.

This PR now includes:

  • mapbox-gl@v1.1.0
  • support for custom non-mapbox base styles
  • new open-street-map base style
  • new trace type choroplethmabpox
  • new trace type densitymapbox
  • support for raster and image layout mapbox layers
  • choropleth marker.line.color dflt fix

@archmoj
Copy link
Contributor

archmoj commented Jul 3, 2019

So @nicolaskruchten , the only parameters we need to agree on are:

  • tileSize - which is the minimum visual size to display tiles for this layer. The default is 512, we could lower it to 256 (like mapbox does in their docs). But all in all this should not be a big deal.
  • minzoom / maxzoom - which I thought of setting for a max range of 0 to 22

According to https://blog.mapbox.com/512-map-tiles-cb5bfd6e72ba, it looks they suggested using 512 resolution.
Also that may help reduce the number of requests to the server in addition to less i/o process for caching.

@etpinard
Copy link
Contributor Author

etpinard commented Jul 3, 2019

Also that may help reduce the number of requests to the server in addition to less i/o process for caching.

How? I'm curious.

@archmoj
Copy link
Contributor

archmoj commented Jul 3, 2019

Also that may help reduce the number of requests to the server in addition to less i/o process for caching.

How? I'm curious.

I have rather limited experience on this.
Anyway regarding i/o caching more tiles means more files to seek for.
I think one advantage of tiles of 256 x 256 was that the integer index could simply fit in an unsigned short integers (0-65535). That may be one reason it is used in bucket rendering engines. On the other hand requesting for a tile of 512 x 512 may reduce the number of requests by four; plus they may have done other optimisations e.g. related to clipping text printed close the tile boundaries.

@etpinard
Copy link
Contributor Author

etpinard commented Jul 3, 2019

@archmoj so, I'm assuming you'd vote for having tileSize:512? I don't have a strong opinion. I can't notice a performance different between the two (on my laptop using the plotly wifi)

@archmoj
Copy link
Contributor

archmoj commented Jul 3, 2019

@archmoj so, I'm assuming you'd vote for having tileSize:512? I don't have a strong opinion. I can't notice a performance different between the two (on my laptop using the plotly wifi)

Yes in the case of mapbox.

@etpinard
Copy link
Contributor Author

etpinard commented Jul 3, 2019

Upon further inspection, tileSize:256 (top subplot) looks a lot better then tileSize:512 (bottom subplot):

image

What do you think @archmoj ?

@archmoj
Copy link
Contributor

archmoj commented Jul 3, 2019

Upon further inspection, tileSize:256 (top subplot) looks a lot better then tileSize:512 (bottom subplot):

image

What do you think @archmoj ?

@etpinard
Just to double check:
Did you clean the cache?

@etpinard

This comment has been minimized.

@archmoj
Copy link
Contributor

archmoj commented Jul 3, 2019

Confirmed. Let's use 256.

@archmoj
Copy link
Contributor

archmoj commented Jul 4, 2019

This is likely the first time ever that multiple new trace types were added in one PR!
Brilliant work @etpinard
🥇
💃

@etpinard etpinard merged commit c1ef691 into master Jul 4, 2019
@etpinard etpinard deleted the mapbox-v1 branch July 4, 2019 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature something new
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] use own style.json instead of mapbox access token
3 participants