Skip to content

feat: add optional coastline layer to 3D visualization - #126

Closed
Prince637-boo wants to merge 2 commits into
mllam:mainfrom
Prince637-boo:feat/coastline-layer
Closed

feat: add optional coastline layer to 3D visualization#126
Prince637-boo wants to merge 2 commits into
mllam:mainfrom
Prince637-boo:feat/coastline-layer

Conversation

@Prince637-boo

Copy link
Copy Markdown

Summary of the changes :

This PR introduces an optional coastline layer for the 3D interactive visualization using Plotly.

Created a new geo_data.py module containing a simplified, low-resolution dataset of global coastlines to ensure the package remains lightweight.

Added a new add_coastlines boolean parameter to the render_with_plotly function.

Implemented _build_coastline_trace to convert geographic coordinates into 3D Cartesian space on a sphere, using efficient line-batching (None-separated arrays) to optimize performance.

Integrated the coastline layer within the concentric layout mode.

Motivation and context:

Visualizing weather model graphs on a blank sphere can make it difficult for users to orient themselves geographically. Adding a coastline background provides essential spatial context, allowing users to immediately identify which parts of the globe the graph nodes and edges represent. This was inspired by discussions in #118 regarding the need for better spatial cues in 3D plots.

Dependencies:
No new external dependencies were added. The feature uses existing plotly, numpy, and networkx requirements.
Issue Link

Solves #118 (or "Relates to #118" if the issue is still open for other 3D tasks)
Type of change

[ ] 🐛 Bug fix

[x] ✨ New feature

[ ] 💥 Breaking change

[ ] 📖 Documentation

Checklist before requesting a review

[x] My branch is up-to-date with the target branch

[x] I have performed a self-review of my code

[x] For any new/modified functions/classes I have added docstrings

[x] I have placed in-line comments to clarify the intent

[x] I have updated the documentation (docstrings)

[x] I have added tests that prove my feature works

[x] I have given the PR a name: feat: add optional coastline layer to 3D visualization

[x] I have requested a reviewer

@Prince637-boo Prince637-boo changed the title Feat/coastline layer feat: add optional coastline layer to 3D visualization Mar 30, 2026
@Prince637-boo
Prince637-boo marked this pull request as draft March 30, 2026 19:00
@Prince637-boo

Copy link
Copy Markdown
Author
Capture d’écran du 2026-03-30 18-24-02

Visual Representation:

Here is a preview of the new coastline layer enabled on a concentric 3D layout. The coastlines are rendered slightly below the grid level (radius ~0.99) to provide context without obstructing the data points.

@Prince637-boo
Prince637-boo marked this pull request as ready for review March 30, 2026 19:02
@yuvraajnarula

Copy link
Copy Markdown
Contributor
Capture d’écran du 2026-03-30 18-24-02 # Visual Representation: Here is a preview of the new coastline layer enabled on a concentric 3D layout. The coastlines are rendered slightly below the grid level (radius ~0.99) to provide context without obstructing the data points.

@Prince637-boo
Thank you for putting this together! 🙌

Since #118 already includes a basic add_coastlines parameter and the concentric layout, your coastline data and modularisation would be a perfect enhancement. To keep things clean, I’d suggest we either:

Either way, I’m happy to help coordinate and review. Let me know what works best for you. Great to see the 3D visualisation growing with community input!

@Prince637-boo

Copy link
Copy Markdown
Author

Hi @yuvraajnarula,

That's a great idea! I'm perfectly fine with the second option.

Please feel free to integrate my coastline improvements and the geo_data.py module directly into #118. I think it’s much more efficient to have a single, solid PR for the 3D visualization.

I'm happy to help with any adjustments needed to make the integration smooth. Once you’ve moved the code, I’ll close #126.

Thanks for the warm welcome and for the proper credit, I'm glad to contribute to this!

yuvraajnarula added a commit to yuvraajnarula/weather-model-graphs that referenced this pull request Mar 31, 2026
yuvraajnarula added a commit to yuvraajnarula/weather-model-graphs that referenced this pull request Mar 31, 2026
@Prince637-boo

Copy link
Copy Markdown
Author

Closing this as the features have been integrated into #118.

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