-
Notifications
You must be signed in to change notification settings - Fork 10
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
3D plots for graphs #20
Comments
Would this also be the case if using panel to create a python application within which the serialisation into the HTML to allow plotly to do the rendering is handle by panel? It might be that they have worked out some smart way of doing this :) I think they don't actually create a static rendering into html, but instead the webpage directly requests the data from the running python application which exposes a webserver. I.e. I am suggesting to not generate static html, but instead create a visualisation application which can be started with for example: python -m weather_model_graphs.viz --interactive graph_file.pickle obviously this require writing the graph to some serialised format which we can't currently do, but we could start by pickling the |
A note about this challenge: The standard behavior in plotly, and used in the neural-lam script linked, is to set up a web server that serves an interactive plotting application. I do however not know if this just creates a static html somewhere and serves that or it is doing something smarter. I just know that I have never had any issues with opening these interactive plots in a browser, but perhaps that could be the case if you have a very large amount of nodes/edges. You can also save the whole thing to an html file, and those can indeed become very large. |
I wonder if this might be useful here: https://hvplot.holoviz.org/ |
It would be really nice to also actually add the earth (textured) to the 3d plot, rather than just a bunch of grid nodes. Going by this post https://community.plotly.com/t/applying-full-color-image-texture-to-create-an-interactive-earth-globe/60166 it looks fairly simple 😄 |
Posting another library that might be useful here: https://github.com/benbovy/spherely |
Ooh, nice! This might actually be super useful for LAM graph creation in lat-lons. Me and @TomasLandelius discussed a bit back on how to implement convex hulls on the surface of a sphere and check which points lay inside it. This might be straightforward with something like https://spherely.readthedocs.io/en/latest/_api_generated/spherely.convex_hull.html#spherely.convex_hull + https://spherely.readthedocs.io/en/latest/_api_generated/spherely.contains.html#spherely.contains . |
I did it with
from spherical_geometry.polygon import SphericalPolygon
...
chull_lam = SphericalPolygon.convex_hull(pts_lam_x)
msk_in = np.array([chull_lam.contains_lonlat(x[1], x[0]) for x in points_bnd])
but the spherely package should be fine as well I think
…________________________________________
From: Joel Oskarsson ***@***.***>
Sent: Wednesday, November 6, 2024 3:53:51 PM
To: mllam/weather-model-graphs
Cc: Landelius Tomas; Mention
Subject: Re: [mllam/weather-model-graphs] 3D plots for graphs (Issue #20)
Ooh, nice! This might actually be super useful for LAM graph creation in lat-lons. Me and @TomasLandelius<https://github.com/TomasLandelius> discussed a bit back on how to implement convex hulls on the surface of a sphere and check which points lay inside it. This might be straightforward with something like https://spherely.readthedocs.io/en/latest/_api_generated/spherely.convex_hull.html#spherely.convex_hull + https://spherely.readthedocs.io/en/latest/_api_generated/spherely.contains.html#spherely.contains .
—
Reply to this email directly, view it on GitHub<#20 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AY7HJCKHOSHDEW67FAJDNXDZ7IUP7AVCNFSM6AAAAABNVVK62KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINJZHE3DKMJRGU>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Title: Add 3D Graph Plotting Functionality Using Plotly
Description:
We should add functionality to visualize the graph structures in 3D using Plotly. This will help in better understanding the spatial relationships between nodes and edges in our graph-based neural weather prediction models.
Tasks:
Example:
https://github.com/mllam/neural-lam/blob/5b71be3c68d815e0e376ee651c14f09d801f86de/plot_graph.py
Challenges:
The html files can easily be >100MB in size, crashing most browsers. We might need to implement some performance/size tricks to prevent this.
Surplus:
3D objects could be rendered for Blender, which supports a Python-like DSL as a backend. This would allows us to benefit from all the 3D modeling techniques (e.g. shaders) for even nicer looking graphs.
The text was updated successfully, but these errors were encountered: