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

add geoRenderType optional paramter to geoscatter geoplot and geobubble functionalities #400

Conversation

gilbertogalvis
Copy link
Contributor

@gilbertogalvis gilbertogalvis commented Sep 28, 2021

This PR add a new optional parameter to fig2plotly which works for geoscatter, geoplot and geobubble functionalities. This optional parameter is called 'geoRenderType' and it allows us to set the type of rendering that we want for the geographic charts. Among the rendering types we have: 1) 'geo' (by default) which is based on D3.js and 2) 'mabox' which is tile-based. 'mapbox' is much more powerful in terms of visualization, but it has certain limitations regarding the configuration of markers and texts. The user can now choose the type of rendering they want.

This PR has been tested for all examples at https://github.com/plotly/ssim_baselines/tree/main/matlab/code-examples/geographic-plots.

I share below two examples (one for each type of rendering) using the geoplot functionality. However, both examples can be extended to the other two geographic chart functionalities (geoscatter and geobubble). Feel free to recreate these examples.

geo rendering:

latSeattle = 47.62;
lonSeattle = -122.33;
latAnchorage = 61.20;
lonAnchorage = -149.9;
geoplot([latSeattle latAnchorage],[lonSeattle lonAnchorage])
geolimits([45 62],[-149 -123]);
geobasemap colorterrain;

fig2plotly(gcf, 'offline', true, 'geoRenderType', 'geo');

mapbox rendering:

latSeattle = 47.62;
lonSeattle = -122.33;
latAnchorage = 61.20;
lonAnchorage = -149.9;
geoplot([latSeattle latAnchorage],[lonSeattle lonAnchorage])
geolimits([45 62],[-149 -123]);
geobasemap colorterrain;

fig2plotly(gcf, 'offline', true, 'geoRenderType', 'mapbox');

Attach bellow results all geographic charts as well as links to chart-studio for each redering type

geoscatter:

https://chart-studio.plotly.com/~galvisgilberto/4548/#/
https://chart-studio.plotly.com/~galvisgilberto/4550/#/
https://chart-studio.plotly.com/~galvisgilberto/4552/#/
https://chart-studio.plotly.com/~galvisgilberto/4554/#/

Screen Shot 2021-09-28 at 1 27 08 PM

Screen Shot 2021-09-28 at 1 31 07 PM

Screen Shot 2021-09-28 at 1 33 03 PM

Screen Shot 2021-09-28 at 1 33 36 PM

geoplot:

https://chart-studio.plotly.com/~galvisgilberto/4556/#/
https://chart-studio.plotly.com/~galvisgilberto/4558/#/
https://chart-studio.plotly.com/~galvisgilberto/4560/#/
https://chart-studio.plotly.com/~galvisgilberto/4564/#/
https://chart-studio.plotly.com/~galvisgilberto/4566/#/
https://chart-studio.plotly.com/~galvisgilberto/4568/#/

Screen Shot 2021-09-28 at 1 40 06 PM

Screen Shot 2021-09-28 at 1 40 41 PM

Screen Shot 2021-09-28 at 1 41 50 PM

Screen Shot 2021-09-28 at 1 46 44 PM

Screen Shot 2021-09-28 at 1 47 17 PM

Screen Shot 2021-09-28 at 1 47 54 PM

geobubble:

https://chart-studio.plotly.com/~galvisgilberto/4570/earthquake-earthquake-and-landslide-landslide-meteorological-unknown-cause-volca/#/
https://chart-studio.plotly.com/~galvisgilberto/4572/earthquake-earthquake-and-landslide-landslide-meteorological-unknown-cause-volca/#/

Screen Shot 2021-09-28 at 1 50 15 PM

Screen Shot 2021-09-28 at 1 50 49 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants