How to use the napari._vispy.markers.Markers function in napari

To help you get started, we’ve selected a few napari examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github napari / napari / napari / _vispy / vispy_points_layer.py View on Github external
def _on_data_change(self):
        # Check if ndisplay has changed current node type needs updating
        if (
            self.layer.dims.ndisplay == 3
            and not isinstance(self.node, Markers)
        ) or (
            self.layer.dims.ndisplay == 2
            and not isinstance(self.node, Compound)
        ):
            self._on_display_change()
            self._on_highlight_change()

        if len(self.layer._data_view) > 0:
            edge_color = [
                self.layer.edge_colors[i] for i in self.layer._indices_view
            ]
            face_color = [
                self.layer.face_colors[i] for i in self.layer._indices_view
            ]
        else:
            edge_color = 'white'
github napari / napari / napari / _vispy / vispy_points_layer.py View on Github external
def _on_display_change(self):
        parent = self.node.parent
        self.node.transforms = ChainTransform()
        self.node.parent = None

        if self.layer.dims.ndisplay == 2:
            self.node = Compound([Markers(), Markers(), Line()])
        else:
            self.node = Markers()
        self.node.parent = parent
        self._reset_base()
github napari / napari / napari / _vispy / vispy_points_layer.py View on Github external
def _on_display_change(self):
        parent = self.node.parent
        self.node.transforms = ChainTransform()
        self.node.parent = None

        if self.layer.dims.ndisplay == 2:
            self.node = Compound([Markers(), Markers(), Line()])
        else:
            self.node = Markers()
        self.node.parent = parent
        self._reset_base()