Following is my node template -
gojsDiagram.nodeTemplate =
$$(go.Node, "Vertical",
{ opacity : 0.5 /*, background:"#c9c9c9"*/ },
{ selectable: true, selectionAdornmentTemplate: nodeSelectionAdornment }, // Node is selectable but the rectanglar shape is not visible
{ contextMenu: myContextMenu }, // to make node start and accept link drag drop
new go.Binding("location", "loc", go.Point.parse).makeTwoWay(go.Point.stringify),// stores the location of node, and renders at the same postion if the model is loaded
$$(go.Panel, "Auto",
{ background: "white" },
{ portId: "" }, // this whole panel acts as the only port for the node
$$(go.Shape, // the border
{ fill: "transparent", stroke: "transparent"/*, strokeWidth:0.3*/ }),
$$(go.Panel, "Vertical",
$$(go.Picture,
{
source: "icons/table.png",
width: 40,
height: 40,
margin: 2,
background: "transparent",
cursor: "pointer",
alignment: go.Spot.Center,
imageStretch: go.GraphObject.UniformToFill
},
new go.Binding("source", "imgPath"))
),// end Vertical Panel
// to display predicate badge
$$(go.Shape, "circle",
{
alignment: go.Spot.TopRight,
strokeWidth : 0.3,
fill: "yellow",
width: 14,
height: 14,
visible: true,
toolTip:
$$(go.Adornment, "Auto",
$$(go.Shape, { fill: "transparent", strokeWidth : 0 },
new go.Binding("visible", "predicate", function(i) { return !!i })),
$$(go.TextBlock, { margin: 4 },
new go.Binding("text", "predicate"))
)
},
new go.Binding("visible", "predicate", function(i) { return !!i }))
), // end Auto Panel
// node name
$$(go.TextBlock, { margin: 4 },
new go.Binding("text", "id"))
);
Now I am trying to use fromLinkable: true, toLinkable: true
property so that I can add links between nodes, but when I use this property in my Auto panel, I loose the node draggable feature ( I mean I cannot move the node ).
What am I missing ? Can you please point me in a direction ?