Implements support for Jupyter COMM objects which is the mechanism for synchronizing state between Jupyter clients (Notebook, Lab, others) and kernels such as Clojupyter. COMM objects serve as the basis for interactive controls such as ipywidgets.
Implements support for Jupyter COMM objects which is the mechanism for synchronizing state between Jupyter clients (Notebook, Lab, others) and kernels such as Clojupyter. COMM objects serve as the basis for interactive controls such as ipywidgets.
(comm-id comm-atom)
The Jupyter protocol ID of the COMM-ATOM.
The Jupyter protocol ID of the COMM-ATOM.
(model-ref comm-atom)
The COMM-ATOM's Jupyter Model reference identifier (a string).
The COMM-ATOM's Jupyter Model reference identifier (a string).
(origin-message comm-atom)
The message that caused the COMM-ATOM to be created.
The message that caused the COMM-ATOM to be created.
(state-set! comm-atom comm-state)
Sets the value comm-atom
to be comm-state
by updating the global state and sending COMM update
message. comm-state
must be a map serializable to JSON. Returns comm-atom
.
Sets the value `comm-atom` to be `comm-state` by updating the global state and sending COMM `update` message. `comm-state` must be a map serializable to JSON. Returns `comm-atom`.
(state-update! comm-atom comm-state)
Merges comm-state
into current value of comm-atom
.
Merges `comm-state` into current value of `comm-atom`.
(target comm-atom)
The Jupyter target name to which the COMM-ATOM belongs.
The Jupyter target name to which the COMM-ATOM belongs.
(unwatch comm-atom key)
Remove watch added with key key
from comm-atom
. Returns comm-atom
.
Remove watch added with key `key` from `comm-atom`. Returns `comm-atom`.
(watch comm-atom key fn)
Add watch to comm-atom
which will subsequently be called when the value of comm-atom
is
updated. The observer fn
fn must be a fn of 4 args: a key, the reference, its old-state, its
new-state, identical to those for watch
functions (internally CommAtom uses an agent for
update notification), cf. add-watch
for details. Returns comm-atom
.
Add watch to `comm-atom` which will subsequently be called when the value of `comm-atom` is updated. The observer `fn` fn must be a fn of 4 args: a key, the reference, its old-state, its new-state, identical to those for `watch` functions (internally CommAtom uses an agent for update notification), cf. `add-watch` for details. Returns `comm-atom`.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close