Ejemplo n.º 1
0
    def init_graph(self, datum, options, index=0):

        # Pop colorbar options since these aren't accepted by the trisurf
        # figure factory.
        colorbar = options.pop('colorbar', None)
        trisurface_traces = trisurface(**dict(datum, **options))

        # Find colorbar to set colorbar options. Colorbar is associated with
        # a `scatter3d` scatter trace.
        if colorbar:
            marker_traces = [trace for trace in trisurface_traces
                             if trace.type == 'scatter3d' and
                             trace.mode == 'markers']
            if marker_traces:
                marker_traces[0].marker.colorbar = colorbar

        return {'traces': [t.to_plotly_json() for t in trisurface_traces]}
Ejemplo n.º 2
0
    def init_graph(self, data, options, index=0):
        trisurf_kwargs = super(TriSurfacePlot, self).init_graph(
            data, options, index)[0]

        # Pop colorbar options since these aren't accepted by the trisurf
        # figure factory.
        colorbar = trisurf_kwargs.pop('colorbar', None)
        trisurface_traces = trisurface(**trisurf_kwargs)

        # Find colorbar to set colorbar options. Colorbar is associated with
        # a `scatter3d` scatter trace.
        if colorbar:
            marker_traces = [trace for trace in trisurface_traces
                             if trace.type == 'scatter3d' and
                             trace.mode == 'markers']
            if marker_traces:
                marker_traces[0].marker.colorbar = colorbar

        return [t.to_plotly_json() for t in trisurface_traces]
Ejemplo n.º 3
0
 def init_graph(self, 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]
Ejemplo n.º 4
0
 def init_graph(self, data, options, index=0):
     trace = super(TriSurfacePlot, self).init_graph(data, options, index)
     return trisurface(**trace)[0].to_plotly_json()
Ejemplo n.º 5
0
 def init_graph(self, 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]
Ejemplo n.º 6
0
 def init_graph(self, data, options, index=0):
     trace = super(TriSurfacePlot, self).init_graph(data, options, index)
     return trisurface(**trace)[0].to_plotly_json()