Skip to content

Commit

Permalink
Remove accidental addition from last commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Huite committed Jan 26, 2024
1 parent ffa2854 commit e74fbc1
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions xugrid/plot/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -673,31 +673,3 @@ def surface(self, *args, **kwargs):
@functools.wraps(tripcolor)
def tripcolor(self, *args, **kwargs):
return tripcolor(self.grid, self.darray, *args, **kwargs)

def to_holoviews(self):
import holoviews
import pandas as pd

grid = self.grid
da = self.darray
(_, _, triangles), index = grid.triangulation
name = getattr(da, "name", "data")

vertices = pd.DataFrame(
data=grid.node_coordinates,
columns=("x", "y"),
)
triangles = pd.DataFrame(
data=triangles,
columns=("v0", "v1", "v2"),
)

dim = get_ugrid_dim(grid, da)
if dim == NODE:
vertices[name] = da
elif dim == FACE:
triangles[name] = da.isel({grid.face_dimension: index})
else:
raise ValueError("only supports data on nodes or faces")

return holoviews.TriMesh((triangles, vertices))

0 comments on commit e74fbc1

Please sign in to comment.