Skip to content

Add ScatterGeo trace support #301

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

Merged
merged 2 commits into from
Jun 5, 2025
Merged

Add ScatterGeo trace support #301

merged 2 commits into from
Jun 5, 2025

Conversation

andrei-ng
Copy link
Collaborator

Fixes #300

@andrei-ng andrei-ng marked this pull request as ready for review June 4, 2025 21:59
@andrei-ng
Copy link
Collaborator Author

@G0rocks , I have squashed your commits and added the Geo you pushed in the latest commit with some modifications into the Layout struct. Now I can generate the shape as in the example you posted in #300 , except the traces as I didn't spend time into writing the for loop to replicate this example exactly.

image

The example is in examples/maps and you can generate the same as in the screenshot when you run cargo run and open the generated output/scatter_geo.html

The Geo Layout we have added in this PR does not have all the fields listed in the API https://plotly.com/javascript/reference/layout/geo/ , but I would rather merge this in and add the rest per a need basis.

Try it out and let me know if it is good enough to merge or you need more to have a functional ScatterGeo.

@G0rocks
Copy link
Contributor

G0rocks commented Jun 5, 2025

Thank you very much!
It looks great!
image

@andrei-ng
Copy link
Collaborator Author

@G0rocks , happy to hear it works.

One more request before I merge this in. Can you add the line traces to the example plot in examples/maps like in the picture you shared. Then the example will be very similar to the JS example :)

@andrei-ng andrei-ng force-pushed the main branch 2 times, most recently from 0ab68b0 to abee94c Compare June 5, 2025 20:54
 - add all projection types enum variants
 - add rotation field to Projection
 - replicate scatter_geo example 1-to-1 in examples/maps/src/main.rs

Signed-off-by: Andrei Gherghescu <[email protected]>
@andrei-ng
Copy link
Collaborator Author

Had a bit of time and added the full example as in the JS example I shared. I am going to merge this.
@G0rocks Thank you very much for the PR and for the contribution!

@andrei-ng andrei-ng merged commit 75797e4 into plotly:main Jun 5, 2025
22 of 24 checks passed
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.

Feature request: Add ScatterGeo to draw lines on maps
2 participants