Skip to content

Commit

Permalink
Merge pull request #1099 from ioam/plotly_trisurface_fix
Browse files Browse the repository at this point in the history
Fixed Trisurface plot in latest versions of plotly
  • Loading branch information
jlstevens authored Feb 5, 2017
2 parents 68c6af8 + d66cd78 commit 73cd421
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions holoviews/plotting/plotly/chart3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
from plotly.tools import FigureFactory as FF
from plotly.graph_objs import Scene, XAxis, YAxis, ZAxis

try:
from plotly.figure_factory._trisurf import trisurf as trisurface
except ImportError:
pass

import param

from ...core.spaces import DynamicMap
Expand Down Expand Up @@ -96,7 +101,7 @@ def get_data(self, element, ranges):
points2D = np.vstack([x, y]).T
tri = Delaunay(points2D)
simplices = tri.simplices
return (x, y, z, simplices, self.colorbar, 'black'), {}
return (x, y, z, simplices, self.colorbar, 'black', None), {}

def graph_options(self, element, ranges):
opts = self.style[self.cyclic_index]
Expand All @@ -110,5 +115,8 @@ def graph_options(self, element, ranges):
return opts

def init_graph(self, plot_args, plot_kwargs):
trisurf = FF._trisurf(*plot_args, **plot_kwargs)
if hasattr(FF, '_trisurf'):
trisurf = FF._trisurf(*plot_args[:-1], **plot_kwargs)
else:
trisurf = trisurface(*plot_args, **plot_kwargs)
return trisurf[0]

0 comments on commit 73cd421

Please sign in to comment.