Initial prototype of triggering with stream parameter hooks #1740
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.
This is a prototype of an idea I had during the SciPy 2017 sprints that would let us relax the requirement for
constant=True
for stream parameters.The reason stream parameters should always be declared constant currently is that stream parameter should only be changed via the
event
andupdate
interfaces to ensure clean semantics regarding event triggering: the expectation is that changes to stream parameters trigger updates to the corresponding visualization.This PR is linked to PR 178 in param (holoviz/param#178) which allows parameter setting to always call trigger:
Note that this is a prototype and I still feel there are some open questions:
dmap.event
? Is this just syntactic sugar and is that a good justification?Having to keep a stream handle is annoying in particular, which is why I prefer
dmap.event
. What I can imagine doing is makingdmap.event
into an object with a__call__
method (behaves as normal) but that supports the same setting syntax for all stream parameters on the dynamicmap e.g:The fact that the new syntax is unbatched also worries me. Setting multiple parameter is best done using
dmap.event()
which batches the changes together. In other words, the proposed syntax is only a good replacement fordmap.event()
when setting a single parameter.