Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Trisurface plot in latest versions of plotly #1099

Merged
merged 1 commit into from
Feb 5, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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]