본문으로 건너뛰기

parse()

설명

로컬 데이터 소스에서 에디터로 데이터를 로드합니다

사용법

parse(data: array): void;

매개변수

  • data - (필수) 에디터로 파싱할 데이터

지원되는 모든 데이터 형식으로 데이터를 로드할 수 있습니다. 자세한 내용은 parse() 문서를 참고하세요.

예제

const data = [
// 도형
{
"id": "a",
"x": 50,
"y": 53,
"type": "triangle",
"text": "Shape 1",
"height": 50,
"width": 50
},
{
"id": "b",
"x": 367,
"y": 158,
"type": "rectangle",
"text": "Shape 2"
},

// 연결선
{
"id": "ab",
"from":"a",
"to":"b",
"type": "line"
},
];

const editor = new dhx.DiagramEditor("editor_container");
editor.parse(data);

관련 예제: