Skip to content
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

Support for trait _view_count #481

Open
bdch1234 opened this issue Aug 9, 2022 · 5 comments
Open

Support for trait _view_count #481

bdch1234 opened this issue Aug 9, 2022 · 5 comments

Comments

@bdch1234
Copy link

bdch1234 commented Aug 9, 2022

The trait _view_count does not seem to populate on the canvas (always None). Is it not supported for ipympl?

@ianhi
Copy link
Collaborator

ianhi commented Aug 9, 2022

Interesting. I didn't know that the existed. I don't see a strong reason not to support it. Though it may be hard to keep track of when a view is no longer displayed?

@martinRenou do you have any thoughts on this?

I'd say my current position is that I would be happy to review a PR implementing this so that we can decide if there are any tradeoffs - but suspect that there's no harm in implementing this.

@ianhi
Copy link
Collaborator

ianhi commented Aug 9, 2022

oh wait, is all we have to set it equal to 0?

@martinRenou
Copy link
Member

Thanks for opening an issue. I don't think this is specific to ipympl, it seems it has been added in ipywidgets in jupyter-widgets/ipywidgets#1232.

oh wait, is all we have to set it equal to 0?

Probably, there is a check for it to be a number here.

I'd personally say that users of ipympl shouldn't need to access this property (after all it starts with an underscore).

But I actually didn't know this was a thing. We can probably use this to cleanup figures on the backend. What do you think @ianhi ?

@bdch1234
Copy link
Author

But I actually didn't know this was a thing. We can probably use this to cleanup figures on the backend. What do you think @ianhi ?

That’s exactly the use-case I was going for here, but it that would be possible to do directly in ipympl then it would be even better of course

@martinRenou
Copy link
Member

Unfortunately such a logic would break if there are multiple clients.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants