Quantcast
Channel: GoJS - Northwoods Software
Viewing all articles
Browse latest Browse all 7069

Resizing, draw Links

$
0
0

@ilyakut wrote:

Hello, I have a Node
This Node is resizable only in horizontal direction.

How can I make only the Red line from/to Linkable. The Red line should change its size with the whole Node.
Here the code:
myPalette.nodeTemplateMap.add("B",
$(go.Node, "Auto",
{
resizable: true, resizeObjectName: "SHAPE", locationObjectName: "SHAPE",
resizeAdornmentTemplate: // specify what resize handles there are and how they look
$(go.Adornment, "Spot",
$(go.Placeholder), // takes size and position of adorned object
$(go.Shape, "Circle", // left resize handle
{
alignment: go.Spot.Left, cursor: "col-resize",
desiredSize: new go.Size(9, 9), fill: "lightblue", stroke: "dodgerblue"
}),
$(go.Shape, "Circle", // right resize handle
{
alignment: go.Spot.Right, cursor: "col-resize",
desiredSize: new go.Size(9, 9), fill: "lightblue", stroke: "dodgerblue"
})
),
selectionAdorned: false
}, // don't show selection Adornment, a rectangle
$(go.Shape, "RoundedRectangle",
{ name: "SHAPE", fill: "#333745", width: 50, height: 10, minSize: new go.Size(10, 10) }),
$(go.Shape, "RoundedRectangle",
{
fill: "RED",
stroke: null, // this is changed to "white" in the showPorts function
desiredSize: new go.Size(100, 3)
}
)
));

sorry, can't do correct syntax highlighting
here more comfortable:

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 7069

Trending Articles