Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When prototyping the streams system, one thing we were wondering about was how to easily access streams from a DynamicMap in order to call
update
. The problem is you either need to keep a handle on the stream object or would need to use some mechanism to access the stream via some (optional) assigned name or by index. This poses some difficult problems and this PR suggests an alternative approach that bypasses this issue completely.The
event
method on aDynamicMap
does not deal with stream objects, just stream parameters. The appropriate streams that require updating are computed behind the scenes which works well as the identity of the streams is often of less interest to the user than the set of stream parameters (these are the keyword arguments passed to theDynamicMap
callback).If nothing else, the
event
method is is useful for debugging it will always allow print statements to appear in the notebook. Note that this isn't true for direct Bokeh interaction streams which sends such print statements to the web console:Earlier on, I proposed that the
update
method of streams could also be renamed toevent
for consistency - unfortunatelyupdate
already exists onDynamicMap
as it inherits the method fromHoloMap
otherwise I would have called this methodupdate
too.I no longer feel this is particularly important. This PR will mean that users rarely use an
update
method in any context: it is rarely used by users onHoloMaps
orDynamicMaps
and this newevent
method means users won't have to use theupdate
method on streams either. That said, I'm still open to renamingupdate
on streams toevent
if we feel this is better for overall consistency.Lastly, I will want to have a tutorial demonstrating the
event
method as a way of building visualizations with streams. In particular, I will want a notebook demonstrating it with a visualization using a mix of kdims and dimensioned streams.