I’ve already done that but not working.
Here is my node & link template:
myDiagram.nodeTemplate =
$(go.Node, "Auto",
{
fromSpot: go.Spot.BottomSides,
toSpot: go.Spot.TopSides,
},
{ selectionAdorned: false },
{ // show the Adornment when a mouseHover event occurs
mouseHover: function (e, obj) {
var node = obj.part;
nodeHoverAdornment.adornedObject = node;
node.addAdornment("mouseHover", nodeHoverAdornment);
}
},
new go.Binding("text", "question"),
new go.Binding("layerName", "isSelected", function (sel) { return sel ? "Foreground" : ""; }).ofObject(),
$(go.Shape, "Rectangle",
{
name: "SHAPE", fill: "white", stroke: null,
// set the port properties:
fromLinkable: true, toLinkable: true, cursor: "pointer"
},
new go.Binding("fill", "isSelected", function (sel) {
if (sel) return "#007bff"; else return "#669cf2";
}).ofObject("")),
$(go.Panel, "Horizontal",
$(go.Panel, "Table",
{
maxSize: new go.Size(250, 999),
margin: new go.Margin(6, 10, 0, 3),
defaultAlignment: go.Spot.Left
},
$(go.RowColumnDefinition, { column: 1, width: 4 }),
$(go.TextBlock, textStyle(), // the name
{
row: 0, column: 0, columnSpan: 4,
font: "bold 12pt Segoe UI,sans-serif",
editable: true, isMultiline: true,
minSize: new go.Size(10, 16)
},
new go.Binding("text", "question").makeTwoWay()),
$(go.TextBlock, textStyle(),
{
row: 1, column: 0, columnSpan: 4,
editable: true, isMultiline: true,
minSize: new go.Size(10, 14),
margin: new go.Margin(0, 0, 0, 3)
},
new go.Binding("text", "answer").makeTwoWay()),
$(go.TextBlock, textStyle(),
{ row: 2, column: 0 },
new go.Binding("text", "alternateQuestions", function (v) { return []; })),
$(go.TextBlock, textStyle(),
{ row: 2, column: 0 },
new go.Binding("text", "key", function (v) { return "" }))//,
) // end Table Panel
) // end Horizontal Panel
); // end Node
// replace the default Link template in the linkTemplateMap
myDiagram.linkTemplate =
$(go.Link,
{
routing: go.Link.AvoidsNodes,
corner: 5, relinkableFrom: true, relinkableTo: true
},
new go.Binding("points").makeTwoWay(),
$(go.Shape, // the link shape
{ strokeWidth: 2, stroke: "#00a4a4" }),
$(go.Shape, // the arrowhead
{ toArrow: "Standard", fill: "#00a4a4", stroke: null, scale: 2 })
);