Conversation
|
@clewis7 notebook tests are failing due to a new change in |
clewis7
left a comment
There was a problem hiding this comment.
Had a couple of clarifying questions? Has been too long since I have looked at this. Otherwise, LGTM!
| def __init__(self, parent, value: bool): | ||
| super(Deleted, self).__init__(parent, value) | ||
|
|
||
| def _set(self, value: bool): |
There was a problem hiding this comment.
So, this will get triggered when __del__ is called and self.deleted = True is set?
There was a problem hiding this comment.
How are we preventing users from if a graphic has been deleted to still having reference to the graphic and trying to say something silly like graphic.deleted=False? Will this throw an error if the graphic has already been deleted? I would assume so because there will be no reference.
There was a problem hiding this comment.
So, this will get triggered when
__del__is called andself.deleted = Trueis set?
Yes, Graphic.__del__ sets self.deleted = True https://github.com/fastplotlib/fastplotlib/pull/404/files#diff-a57994ecff1cde4e05c8175265219f0b5200da144ce8733b9eb560c09bcea7ddR179
How are we preventing users from if a graphic has been deleted to still having reference to the graphic and trying to say something silly like
graphic.deleted=False? Will this throw an error if the graphic has already been deleted? I would assume so because there will be no reference.
Since users are only given acccess to weakreferences, it will throw a reference error if they try to do anything with a deleted Graphic.
|
|
||
| pick_info = { | ||
| "index": None, | ||
| "collection-index": self._collection_index, |
There was a problem hiding this comment.
What is the difference here between index vs collection-index? Also, collection-index could be None if the graphic is not a CollectionGraphic, no?
There was a problem hiding this comment.
It seems like index will always be None?
There was a problem hiding this comment.
index is buffer index, used for things like data and colors features. Not used here since it's not relevant
* start legends, not functional yet * add faq (#400) * fix bug when remove_graphic() is used (#405) * add 'Deleted' as a graphic feature (#404) * very basic adding line legends works * use OrderedDict for legend items * allow accessing legend items via Graphic, updating colors works * legend mesh resizes properly * remove legend items and reorder works * enforce all legend labels to be unique * add legends property to PlotArea * checks for Graphic name * highlight linegraphic when legend item is clicked * legend is moveable * remove weird characters that were committed for some reason * progress on legend grid placement, not yet working * max_rows works for legend * just allow max_rows kwarg for legends, no cols * line that snuck in from another branch * small changes
This makes it possible to create callbacks to do things when a
Graphicis deleted from aPlotArea.garbage collection is actinng wonky again so I need to fix that too...nevermind, I think was accessing stuff users wouldn't normally access in jupyter so ipython was clinging onto it, as usual 😄This also changes all
feature_eventsclass attributes to be aset.Useage:
