Such as: the following statement generated structure
<meta name="viewport" content="width=device - width, initial - scale=1" & gt;
<meta HTTP - equiv="content-type" Content="text/HTML. Charset=gb2312 "& gt;
<script SRC="https://bbs.csdn.net/topics/js/go.js" & gt; </script>
<script>
Var RPS=[
{
Key: "001",
Title: "headline,"
Text: "this is a text description this is a description words this is a description words! ~ ",
"BgSrc" : "images/bg01. PNG,"
"IconSrc" : "images/icon01. PNG"
},
{
Key: "002",
Title: "headline,"
Text: "this is a text description this is a description words this is a description words",
"BgSrc" : "images/bg01. PNG,"
"IconSrc" : "images/icon02. PNG"
},
{
Key: "003",
Title: "headline,"
Text: "this is a text description this is a description words this is a description words",
"BgSrc" : "images/bg01. PNG,"
"IconSrc" : "images/icon03. PNG"
},
{
Key: "004",
Title: "headline,"
Text: "this is a text description this is a description words this is a description words",
"BgSrc" : "images/bg01. PNG,"
"IconSrc" : "images/icon04. PNG"
},
{
Key: "005",
Title: "headline,"
Text: "this is a text description this is a description words this is a description words",
"BgSrc" : "images/bg01. PNG,"
"IconSrc" : "images/icon05. PNG"
},
{
Key: "006",
Title: "headline,"
Text: "this is a text description this is a description words this is a description words",
"BgSrc" : "images/bg01. PNG,"
"IconSrc" : "images/icon06. PNG"
},
{
Key: "011",
Title: "headline,"
Text: "this is a text description this is a description words this is a description words",
"BgSrc" : "images/bg01. PNG,"
"IconSrc" : "images/icon07. PNG"
},
{
Key: "012",
Title: "headline,"
Text: "this is a text description this is a description words this is a description words",
"BgSrc" : "images/bg01. PNG,"
"IconSrc" : "images/icon08. PNG"
},
{
Key: "007",
Title: "headline,"
Text: "this is a text description this is a description words this is a description words",
"BgSrc" : "images/bg01. PNG,"
"IconSrc" : "images/icon09. PNG"
},
{
Key: "008",
Title: "headline,"
Text: "this is a text description this is a description words this is a description words",
"BgSrc" : "images/bg01. PNG,"
"IconSrc" : "images/icon10. PNG"
},
{
Key: "009",
Title: "headline,"
Text: "this is a text description this is a description words this is a description words",
"BgSrc" : "images/bg01. PNG,"
"IconSrc" : "images/icon11. PNG"
},
{
Key: "010",
Title: "headline,"
Text: "this is a text description this is a description words this is a description words",
"BgSrc" : "images/bg01. PNG,"
"IconSrc" : "images/icon12. PNG"
}
],
{the from: "001", "002"},
{the from: "002", "004"},
{the from: "001", "003"},
{the from: "003", "006"},
{the from: "004", "005"},
{the from: "004", "006"},
{the from: "005", "011"},
{the from: "006", "011"},
{the from: "006", "012"},
{the from: "007", "008"},
{the from: "008", "009"},
{the from: "009", "010"},
{the from: "010", "007"}
]
];
The function init {(RPS)
Var MAKE=go. GraphObject. MAKE;//build GoJS object
//parameter Settings https://gojs.net/latest/api/symbols/Diagram.html
MyDiagram=MAKE (go. Diagram, "J_chartArea,"
//chart the whole attribute set
{
InitialContentAlignment: go. Spot. Center,//set the position of the chart, in the container https://gojs.net/latest/api/symbols/Spot.html
AllowZoom: true,
"The grid. The visible" : false,//whether to show the background grid
"Grid. GridCellSize" : the new go. Size (5, 5),//grid Size
"CommandHandler. CopiesTree" : false,//disable replication shortcut keys
"CommandHandler. DeletesTree" : false,//disable delete shortcut keys
"ToolManager. MouseWheelBehavior" : go. ToolManager. WheelZoom,//enable view zoom
AllowLink: false,//is it allowed to drag and drop attachment
AllowRelink: false,//is it allowed to attachment
Padding: 10,
//layout Settings https://gojs.net/latest/api/symbols/Layout.html
//LayeredDigraphLayout layout https://gojs.net/latest/api/symbols/LayeredDigraphLayout.html
Layout: MAKE (go LayeredDigraphLayout,
{direction: 0, layeringOption: go. LayeredDigraphLayout. LayerLongestPathSource}),//0 to the right, down 90, 180, left 270 upwards, the default value is 0
"UndoManager. IsEnabled" : false//whether to enable undo the fallback Ctrl -z Ctrl - Y
});
MyDiagram. LinkTemplate=
//set the cable https://gojs.net/latest/intro/links.html
MAKE (go. Link,
//set cable properties
{
RelinkableFrom: true,
RelinkableTo: true,
Corner: 12,
Routing: go. Link. Orthogonal,
The curve: go. Link. JumpOver
},
MAKE (go) Shape, {stroke: "# 46 bee9 strokeWidth: 2}),
//set the arrow
MAKE (go) Shape, {toArrow: "Standard", the stroke: "# 46 bee9", the fill: "# 46 bee9"})
);
MyDiagram. NodeTemplate=
MAKE (go) Node, the "Horizontal",//multiple GraphObjects such as the following Panel and Button elements aligned vertical or Horizontal alignment
{portId: "", fromLinkable: true, toLinkable: true},
MAKE (go. A Panel, "Table",
{
DefaultAlignment: go. Spot. Left
},
//picture element set - background https://gojs.net/latest/intro/pictures.html
MAKE (go. Picture,
{width: 208, height: 102},
New to go. The Binding (" source ", "bgSrc")),
MAKE (go. A Panel, "Table",
{defaultAlignment: go. Spot. Left},
MAKE (go. RowColumnDefinition} {column: 0, width: 48),
//set the text block element - title
MAKE (go TextBlock,
{
Row: 0,//
Column: 1,//
ColumnSpan: 2,//merge column
FromLinkable: false,
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull