Skip to content

Commit

Permalink
Simplified TriMesh edgepaths code
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Nov 23, 2017
1 parent 598ceb8 commit 4973de3
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions holoviews/element/graphs.py
Expand Up @@ -410,14 +410,9 @@ def edgepaths(self):
if self._edgepaths:
return self._edgepaths

paths = []
simplices = self.array([0, 1, 2])
pts = self.nodes.array([0, 1])
empty = np.array([np.NaN, np.NaN])
for tri in pts[simplices]:
paths.append(np.vstack([tri[[0, 1], :], empty,
tri[[1, 2], :], empty,
tri[[2, 1], :]]))
paths = [tri[[0, 1, 2, 0], :] for tri in pts[simplices]]
edgepaths = EdgePaths(paths, kdims=self.nodes.kdims[:2])
self._edgepaths = edgepaths
return edgepaths

0 comments on commit 4973de3

Please sign in to comment.