[英]How can I create a AlloyUI DiagramBuilder from the JSON returned by DiagramBuilder.toJSON()?
DiagramBuilder.toJSON()
returns a JSON representation of the diagram. DiagramBuilder.toJSON()
返回该图的JSON表示形式。 How can I use this JSON object to create a new DiagramBuilder
with the same diagram? 如何使用此JSON对象创建具有相同图的新
DiagramBuilder
?
You can pass the result of DiagramBuilder.toJSON() to the fields parameter of the DiagramBuilder. 您可以将DiagramBuilder.toJSON()的结果传递给DiagramBuilder的fields参数。 See the example below.
请参见下面的示例。
jsonData = DiagramBuilder.toJSON();
new Y.DiagramBuilder({
fields : jsonData.nodes,
availableFields: availableFields,
boundingBox: '#diagram-builder-container',
srcNode: '#diagramBuilder',
render: true
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.