lets-plot
lets-plot copied to clipboard
Support `xarray.DataArray` from the Xarray library
from discussion
(https://docs.xarray.dev/en/stable/user-guide/data-structures.html). Xarray is a very powerful library that can be used to create dataframe for 2D grids. It is very similar to Pandas and if Lets-Plot could (maybe it already can, but I have not succeeded yet) handle dictionary of grids the way it handles Dataframes it could be used to handle xarray objects, which I think could benefit Lets-Plot. There is one library that handle xarray object in a interactive way, it is hvplot (https://hvplot.holoviz.org/). For exemple it can generate a figure showing different grids using an interactive slider.
Xarray has an interesting structure. It is 3D dataframe like a 3D array, in another word a dataframe of grids. The 2 first grids are grids containing Xs, and Ys, and the following are bands like grids at different dates. It is basically the same structure as NetCDF files, very common in climatology. With such a structure I feel like you can easily be faceting but... it would mean to plot every grid value at the x and y position which is, if I understand well, the equivalent of the former geom_image() which takes a lot of ressources.