Added option to use "None" for adj in setData

This allows you to easily create code to toggle lines on or off by setting to the appropriate array if on, or None if off. Currently you have to have 2 seperate setData calls, one with adj and one without
This commit is contained in:
Tom Mudway 2020-12-07 17:55:51 -05:00 committed by GitHub
parent 00fd63e859
commit ca7b4580fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -55,7 +55,7 @@ class GraphItem(GraphicsObject):
"""
if 'adj' in kwds:
self.adjacency = kwds.pop('adj')
if self.adjacency.dtype.kind not in 'iu':
if self.adjacency.dtype.kind not in 'iu' and self.adjacency is not None:
raise Exception("adjacency array must have int or unsigned type.")
self._update()
if 'pos' in kwds: