GoJS中go.Model和go.GraphLinksModel分别如何使用

demo1中代码 链接描述

myDiagram.model = new go.GraphLinksModel(

    [

      { key: "Alpha", color: "lightblue" },

      { key: "Beta", color: "orange" },

      { key: "Gamma", color: "lightgreen" },

      { key: "Delta", color: "pink" }

    ],

    [

      { from: "Alpha", to: "Beta" },

      { from: "Alpha", to: "Gamma" },

      { from: "Beta", to: "Beta" },

      { from: "Gamma", to: "Delta" },

      { from: "Delta", to: "Alpha" }

    ]);

demo2中代码 链接描述

myDiagram.model = go.Model.fromJson(document.getElementById("mySavedModel").value);

请问这两种用法究竟是如何使用


BIG阳
浏览 1953回答 1
1回答
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript