Skip to content
This repository has been archived by the owner on Nov 28, 2019. It is now read-only.

View parameters store callback per Parameterized instance #43

Merged
merged 1 commit into from
May 9, 2017

Conversation

philippjfr
Copy link
Member

@philippjfr philippjfr commented May 9, 2017

This bug took me ages to figure out. The View parameters have a callback attribute which allows them to be called in response to a __set__ event. Since a Parameter is instantiated once per Parameterized class all the instances of the Parameterized class will share the same view parameters and therefore the callback will be overridden for each set of widgets that is displayed. This means if you use param.Widgets on the same class or a subclass any previous displayed plots will update the newly displayed viewing area rather than the old one. This PR adds a callbacks dictionary, which allows registering callbacks by the id of the Parameterized instance so widgets for multiple instances can be displayed and updated independently.

@philippjfr philippjfr added the bug label May 9, 2017
@philippjfr philippjfr requested a review from jbednar May 9, 2017 02:21
@philippjfr
Copy link
Member Author

Going to need another release once this is merged.

Copy link
Member

@jbednar jbednar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense; looks good. Thanks.

@jbednar jbednar merged commit 170cbf0 into master May 9, 2017
@jbednar jbednar deleted the view_param_fix branch May 9, 2017 02:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants