add()
Beschreibung
Fügt einen neuen Zustand hinzu
Info
Das Hinzufügen des neuen Zustands erfolgt automatisch. Daher wird diese Methode nicht für die manuelle Verwendung empfohlen.
Verwendung
add(newState: array): void;
Parameter
newState- (erforderlich) ein Array von JSON-Objekten des aktuellen Zustands des Diagramms
Beispiel
const editor = new dhx.DiagramEditor("editor_container", {
type: "default"
});
// ...
editor.history.add([
{ "id": "shape_1", "type": "start", "x": 200, y: 0, "text": "Start" },
{ "id": "shape_2", "type": "process", "x": 200, y: 120, "text": "Call the client" },
{ "id": "line_1", "type": "line", "from": "shape_1", "to": "shape_2" }
]);
Changelog: Hinzugefügt in v4.1