Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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'
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()
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()