Optional
init: numberWhat to initialize the input to. Defaults to random sampling, and
can be overridden from within a diagram. See DiagramBuilder.prototype.sharedInput
.
Whether the shared input should be optimized. This cannot be changed later, and
cannot be overridden from within a diagram. Defaults to false
.
Optional
name: stringOptional name for the shared input. If provided, the value can also be retrieved
from each diagram using the input with DiagramBuilder.prototype.getInput
.
Hook for creating a shared input. The result is a
SharedInput
object that can be used to create shared inputs between diagrams, as well as an interface between the diagram and the rest of the app. You should use this hook rather thannew SharedInput
to ensure that the calling component is re-rendered when the input changes.A
SharedInput
can be used within a diagram by callingDiagramBuilder.prototype.addSharedInput
.Shared inputs can also be
set
andget
from outside the diagram: