Difference between revisions of "Block Editor"
Jump to navigation
Jump to search
(10 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
== How to Use in Articles == | == How to Use in Articles == | ||
The following elements have been given an id (view in the source) that can then be passed to a diagram using an iframe tag. | The following two elements have been given an id (view in the source) that can then be passed to a diagram using an iframe tag. | ||
The second element has also been hidden from view. | |||
<pre id="example1"> | This way it is possible to create a design on this page and then include it into articles using pure JSON. | ||
<pre> | |||
<div id="example1" style="display:none"> | |||
{ "class": "GraphLinksModel", | { "class": "GraphLinksModel", | ||
"nodeDataArray": [ | "nodeDataArray": [ | ||
Line 26: | Line 29: | ||
{"from":-6,"to":-2,"points":[-390,20,-380,20,-290,20,-290,-6.666666666666664,-200,-6.666666666666664,-190,-6.666666666666664]} | {"from":-6,"to":-2,"points":[-390,20,-380,20,-290,20,-290,-6.666666666666664,-200,-6.666666666666664,-190,-6.666666666666664]} | ||
]} | ]} | ||
</div> | |||
</pre> | </pre> | ||
<pre id="example1" style="display:none"> | |||
{ "class": "GraphLinksModel", | { "class": "GraphLinksModel", | ||
"nodeDataArray": [ | "nodeDataArray": [ | ||
{"text":"Block 1","key":-1,"loc":"210 - | {"text":"Block 1","key":-1,"loc":"210 -120"}, | ||
{"text":"Buffer Store","key":-2,"loc":"- | {"text":"Buffer Store","key":-2,"loc":"-160 -30","figure":"Cylinder1","size":"60 140"}, | ||
{"text":"Pump","key":-3,"loc":" | {"text":"Pump","key":-3,"loc":"-10 -30","figure":"Ellipse","size":"60 60"}, | ||
{"text":"Block 2","key":-4,"loc":"210 | {"text":"Block 2","key":-4,"loc":"210 10"}, | ||
{"text":"Boiler 1","key":-5,"loc":"- | {"text":"Boiler 1","key":-5,"loc":"-430 -80","figure":"Procedure","size":"80 80"}, | ||
{"text":"Boiler 2","key":-6,"loc":"-430 20","figure":"Procedure","size":"80 80"} | |||
{"text":"Boiler | |||
], | ], | ||
"linkDataArray": [ | "linkDataArray": [ | ||
{"from":-2,"to":-3,"points":[- | {"from":-2,"to":-3,"points":[-130,-30,-120,-30,-85,-30,-85,-30,-50,-30,-40,-30]}, | ||
{"from":-3,"to":-1,"points":[ | {"from":-3,"to":-1,"points":[20,-40,30,-40,85,-40,85,-120,140,-120,150,-120]}, | ||
{"from":-3,"to":-4,"points":[ | {"from":-3,"to":-4,"points":[20,-20,30,-20,85,-20,85,10,140,10,150,10]}, | ||
{"from":-5,"to":-2,"points":[-390,-80,-380,-80,-290,-80,-290,-53.33333333333333,-200,-53.33333333333333,-190,-53.33333333333333]}, | |||
{"from":-6,"to":-2,"points":[-390,20,-380,20,-290,20,-290,-6.666666666666664,-200,-6.666666666666664,-190,-6.666666666666664]} | |||
{"from":- | |||
{"from":- | |||
]} | ]} | ||
</pre> | </pre> | ||
< | <pre id="example2" style="display:none"> | ||
{ "class": "GraphLinksModel", | |||
"nodeDataArray": [ | |||
{"key":1, "loc":"0 0", "text":"Alpha", "details":"some information about Alpha and its importance"}, | |||
{"key":2, "loc":"170 0", "text":"Beta", "color":"blue", "thickness":2, "figure":"Procedure"}, | |||
{"key":3, "loc":"0 100", "text":"Gamma", "color":"green", "figure":"Cylinder1"}, | |||
{"key":4, "loc":"80 180", "text":"Delta", "color":"red", "figure":"Terminator", "size":"80 40"}, | |||
{"key":5, "loc":"350 -50", "text":"Zeta", "group":7, "color":"blue", "figure":"CreateRequest"}, | |||
{"key":6, "loc":"350 50", "text":"Eta", "group":7, "figure":"Document", "fill":"lightyellow"}, | |||
{"key":7, "isGroup":true, "text":"Theta", "color":"green", "fill":"lightgreen"}, | |||
{"key":8, "loc":"520 50", "text":"Iota", "fill":"pink"} | |||
], | |||
"linkDataArray": [ | |||
{"from":1, "to":2, "dash":[ 6,3 ], "thickness":4}, | |||
{"from":1, "to":3, "dash":[ 2,4 ], "color":"green", "text":"label"}, | |||
{"from":3, "to":4, "color":"red", "text":"a red label", "fromSpot":"RightSide"}, | |||
{"from":2, "to":1}, | |||
{"from":5, "to":6, "text":"in a group"}, | |||
{"from":2, "to":7}, | |||
{"from":6, "to":8, "dir":0}, | |||
{"from":6, "to":8, "dir":1}, | |||
{"from":6, "to":8, "dir":2} | |||
]} | |||
</pre> | |||
{{gojs|width=49% |height=300 |src=wikiBlockEditorFrame| id=example1}} | |||
{{gojs|width=49% |height=300 |src=wikiBlockEditorFrame| id=example2}} | |||
[[Category:Calculators]] | [[Category:Calculators]] |
Latest revision as of 17:38, 10 June 2022
How to Use in Articles
The following two elements have been given an id (view in the source) that can then be passed to a diagram using an iframe tag.
The second element has also been hidden from view.
This way it is possible to create a design on this page and then include it into articles using pure JSON.
<div id="example1" style="display:none"> { "class": "GraphLinksModel", "nodeDataArray": [ {"text":"Block 1","key":-1,"loc":"210 -120"}, {"text":"Buffer Store","key":-2,"loc":"-160 -30","figure":"Cylinder1","size":"60 140"}, {"text":"Pump","key":-3,"loc":"-10 -30","figure":"Ellipse","size":"60 60"}, {"text":"Block 2","key":-4,"loc":"210 10"}, {"text":"Boiler 1","key":-5,"loc":"-430 -80","figure":"Procedure","size":"80 80"}, {"text":"Boiler 2","key":-6,"loc":"-430 20","figure":"Procedure","size":"80 80"} ], "linkDataArray": [ {"from":-2,"to":-3,"points":[-130,-30,-120,-30,-85,-30,-85,-30,-50,-30,-40,-30]}, {"from":-3,"to":-1,"points":[20,-40,30,-40,85,-40,85,-120,140,-120,150,-120]}, {"from":-3,"to":-4,"points":[20,-20,30,-20,85,-20,85,10,140,10,150,10]}, {"from":-5,"to":-2,"points":[-390,-80,-380,-80,-290,-80,-290,-53.33333333333333,-200,-53.33333333333333,-190,-53.33333333333333]}, {"from":-6,"to":-2,"points":[-390,20,-380,20,-290,20,-290,-6.666666666666664,-200,-6.666666666666664,-190,-6.666666666666664]} ]} </div>