Exemple #1
0
 def _init_stream(self):
     name = param_name(self.name)
     self._stream = self._stream_type(source=self.plot,
                                      data={},
                                      num_objects=self.num_objects,
                                      tooltip='%s Tool' % name,
                                      empty_value=self.empty_value)
Exemple #2
0
 def _update_table(self):
     object = self.object
     for transform in self.table_transforms:
         object = transform(object)
     self._table = Table(object, label=param_name(self.name)).opts(
         show_title=False, **self.table_opts)
     self._update_links()
     self._table_row[:] = [self._table]
Exemple #3
0
 def _init_stream(self):
     name = param_name(self.name)
     self._stream = PolyDraw(
         source=self.plot, data={}, num_objects=self.num_objects,
         show_vertices=self.show_vertices, tooltip='%s Tool' % name,
         vertex_style=self.vertex_style, empty_value=self.empty_value
     )
     if self.edit_vertices:
         self._vertex_stream = PolyEdit(
             source=self.plot, tooltip='%s Edit Tool' % name,
             vertex_style=self.vertex_style,
         )
Exemple #4
0
 def _init_stream(self):
     name = param_name(self.name)
     style_kwargs = dict(node_style=self.node_style,
                         feature_style=self.feature_style)
     self._stream = PolyVertexDraw(source=self.plot,
                                   data={},
                                   num_objects=self.num_objects,
                                   show_vertices=self.show_vertices,
                                   tooltip='%s Tool' % name,
                                   **style_kwargs)
     if self.edit_vertices:
         self._vertex_stream = PolyVertexEdit(source=self.plot,
                                              tooltip='%s Edit Tool' % name,
                                              **style_kwargs)
Exemple #5
0
 def __init__(self, object=None, **params):
     super(Annotator, self).__init__(None, **params)
     self.object = self._process_element(object)
     self._table_row = Row()
     self.editor = Tabs(('%s' % param_name(self.name), self._table_row))
     self.plot = DynamicMap(Callable(self._get_plot, inputs=[self.object]))
     self._tables = []
     self._init_stream()
     self._stream.add_subscriber(self._update_object, precedence=0.1)
     self._selection = Selection1D(source=self.plot)
     self._update_table()
     self._update_links()
     self.param.watch(self._update, self._triggers)
     self.layout[:] = [self.plot, self.editor]
Exemple #6
0
 def _update_table(self):
     name = param_name(self.name)
     annotations = list(self.annotations)
     table = self.object
     for transform in self.table_transforms:
         table = transform(table)
     table_data = {a: list(table.dimension_values(a, expanded=False))
                   for a in annotations}
     self._table = Table(table_data, annotations, [], label=name).opts(
         show_title=False, **self.table_opts)
     self._vertex_table = Table(
         [], table.kdims, list(self.vertex_annotations), label='%s Vertices' % name
     ).opts(show_title=False, **self.table_opts)
     self._update_links()
     self._table_row[:] = [self._table]
     self._vertex_table_row[:] = [self._vertex_table]
Exemple #7
0
 def __init__(self, object=None, **params):
     self._vertex_table_row = Row()
     super(PathAnnotator, self).__init__(object, **params)
     self.editor.append(
         ('%s Vertices' % param_name(self.name), self._vertex_table_row))
Exemple #8
0
 def _init_stream(self):
     name = param_name(self.name)
     self._stream = self._stream_type(source=self.plot,
                                      data={},
                                      tooltip='%s Tool' % name,
                                      style=self.vertex_style)
Exemple #9
0
 def _init_stream(self):
     name = param_name(self.name)
     self._stream = PointDraw(source=self.plot,
                              data={},
                              num_objects=self.num_objects,
                              tooltip='%s Tool' % name)