Skip to main content

import()

Description

Imports data from an existing diagram into the editor

Usage

import(diagram: object): void;

Parameters

  • diagram - (required) the diagram object

Example

// initializing Diagram
const diagram = new dhx.Diagram("diagram", {
type: "org"
});
// loading data into Diagram
diagram.data.parse(data);

// initializing Editor
const editor = new dhx.DiagramEditor("editor_container");

// importing data from Diagram into Editor
editor.import(diagram);

You can load data in any supported data format. See the details in the parse() article.

Related sample: Diagram editor. Org chart mode. Live editor