InitializeModelOptions
since v1.3.0Options for initializeModel and initializeModelAdapter.
Properties
Section titled “Properties”stripEdgeRuntimeProperties?
Section titled “stripEdgeRuntimeProperties?”
optionalstripEdgeRuntimeProperties:StripEdgeRuntimePropertiesFn
Replaces the function that strips runtime-computed properties from edges
during initialization (and, for the default model created by
initializeModel, during toJSON() serialization).
⚠️ Use at your own risk. The default (stripEdgeRuntimeProperties)
exists because stale runtime values (sourcePosition, targetPosition,
measuredLabels, computedZIndex, _internalId) loaded from persistence
can and probably will break the diagram — e.g. edges rendered at outdated
positions or duplicated internal ids. The default already preserves the
authored free-endpoint position of a dangling edge (empty source/target),
so keeping sourcePosition/targetPosition yourself is not needed for that.
Overriding this function and keeping such properties is unsupported
territory; prefer wrapping the default and re-adding only the properties
you know you need.
stripNodeRuntimeProperties?
Section titled “stripNodeRuntimeProperties?”
optionalstripNodeRuntimeProperties:StripNodeRuntimePropertiesFn
Replaces the function that strips runtime-computed properties from nodes
during initialization (and, for the default model created by
initializeModel, during toJSON() serialization).
⚠️ Use at your own risk. The default (stripNodeRuntimeProperties)
exists because stale runtime values (selected, measuredPorts,
measuredBounds, computedZIndex, _internalId) loaded from persistence
can and probably will break the diagram — e.g. skipped DOM measurements,
wrong z-ordering, or duplicated internal ids. Overriding this function and
keeping such properties is unsupported territory; prefer wrapping the
default and re-adding only the properties you know you need.