-
Notifications
You must be signed in to change notification settings - Fork 53
add Deleted
as a graphic feature
#404
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@clewis7 notebook tests are failing due to a new change in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, this will get triggered when __del__
is called and self.deleted = True
is set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, this will get triggered when
__del__
is called andself.deleted = True
is 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like index
will always be None
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
Graphic
is 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_events
class attributes to be aset
.Useage:
