Open shoyer opened 3 months ago
Can't we do this with xr.plot
or hvplot.xarray
?
Can't we do this with
xr.plot
orhvplot.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.
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?
Another advantage of Treescope is that is seems to only depend on numpy. For the interactive array visualization it injects vanilla JavaScript code via Python in a way that appears to work with notebook front-end environments? I haven't tried it yet, though.
Not sure but it also looks like it injects the whole (sandboxed) JavaScript code for each displayed array, which might impact performance if we use Treescope in the pure HTML/CSS Xarray reprs of datasets with many variables. Perhaps it is more reasonable to use it only for DataArrays. Or alternatively we can try using it on-demand via an interactive widget repr (e.g., https://github.com/benbovy/xarray-fancy-repr).
Would it make sense to add it as an optional dependency and keep a "classical" fallback repr?
Treescope is a interactive HTML pretty-printer for multi-dimensional arrays: https://github.com/google-deepmind/treescope
Could we integrate this into Xarray's HTML repr? This could be a big step-up over printing the NumPy repr for array values!