Docs

Search documentation

Shared docs and current release

Loading search…

日本語

@shumoku/core · 0.4.2 · function

applyGraphEdits

Source

Writes the edits made to a drawn graph back into the model it was drawn from. `drawn` is the graph as it was before the edits and `edited` as it is after; only what differs between them is written. The configuration keeps what the graph cannot say, such as a node's software or the host a VM runs on, and a field the graph draws from another (a product's name, a link's speed) is kept as written until that field is edited. The layers of an edited element are replaced, as the graph says all of them. Without an edit, the model itself is returned.

applyGraphEdits(model: NetworkModel, drawn: NetworkGraph, edited: NetworkGraph): NetworkModel

Parameters

Parameter Type Description Default
model NetworkModel No additional description. —
drawn NetworkGraph No additional description. —
edited NetworkGraph No additional description. —

Returns

NetworkModel

libs/@shumoku/core/src/libs/@shumoku/core/src/models/network-model-edit.ts:24