Skip to main content
Version: 4.3

TransactionOptions

Options for a Transaction.

Properties

deferPaint?

readonly optional deferPaint?: boolean;

Defer paint on every paper bound to the graph for the duration, so all views repaint once when the transaction closes instead of on every edit. Disabled by default; pass true to coalesce the repaint (hides intermediate frames).


name?

readonly optional name?: string;

Name of the JointJS batch used to group the edits — drives undo grouping and identifies the batch on batch:start / batch:stop. Defaults to 'transaction'.


rollbackOnError?

readonly optional rollbackOnError?: boolean;

Restore the graph to its pre-transaction state when the callback throws or its promise rejects. Disabled by default; pass true to roll back on error (otherwise partial edits are kept). The error is always re-thrown.

Comes with an up-front overhead: enabling it snapshots the full cells array at transaction start (an O(n) shallow copy over every cell in the graph), even when the callback succeeds and no rollback is needed. Leave off for large graphs where the callback is trusted not to throw.

Stay in the know

Be where thousands of diagramming enthusiasts meet

Star us on GitHub