datatree
datatree copied to clipboard
Graph-like visualization
It would be cool to be able to visualize the structure of the tree as a diagram, similar to how you can visualize dask graphs.
What would be even cooler is if you could see the contents of each node by mousing over them in the repr. Dask has a lot of discussion about that, and so far they implemented an interactive version using ipycytoscape in addition to their non-interactive version using graphviz.
For an implementation of plotting a tree (not a general graph) using graphviz also see here.
Using graphviz with tooltips in SVG like dask did is probably the quickest way to get something helpful.
Seen in the zarr docs: https://github.com/QuantStack/ipytree
https://zarr.readthedocs.io/en/stable/tutorial.html#array-and-group-diagnostics
I recently wrote a PySide/PyQt interactive widget for viewing and editing a zarr hierarchy as a tree (https://github.com/zarr-developers/zarr-python/discussions/1488, https://github.com/marcel-goldschen-ohm/zarr-view) that might be of use. You would either have to first serialize to zarr, or else edit my code to handle an xarray-datatree (seems like it wouldn't be that different).
closed Follow up on https://github.com/pydata/xarray/issues/9338