pydata / xarray

N-D labeled arrays and datasets in Python
https://xarray.dev
Apache License 2.0
3.56k stars 1.07k forks source link

Integrate Treescope into Xarray's interactive HTML repr #9324

Open shoyer opened 1 month ago

shoyer commented 1 month ago

Treescope is a interactive HTML pretty-printer for multi-dimensional arrays: https://github.com/google-deepmind/treescope

With Treescope, instead of looking at this: image

You could be looking at this: image

Could we integrate this into Xarray's HTML repr? This could be a big step-up over printing the NumPy repr for array values!

Illviljan commented 1 month ago

Can't we do this with xr.plot or hvplot.xarray?

shoyer commented 1 month ago

Can't we do this with xr.plot or hvplot.xarray?

Yes -- the exciting thing for me about Treescope is the focus on dynamic visualization of direct array values, rather than requiring you to make an opinionated choice about how to plot it.

Illviljan commented 1 month ago

I meant that ._html_repr_ would use xr.plot/hvplot interactively depending on if the user clicked a "plot"-icon. That wouldn't require any more choices for the user compared to Treescope, no?