hi,
i have a node, i want to auto resize node when user type a large name for that.
here is my template :
myDiagram.nodeTemplateMap.add("SubProc",
GD(go.Node, "Auto", nodeStyle(),
{
selectionAdorned: true
},
GD(go.Shape, "RoundedRectangle",
{
name: "NodeShape",
fill: GD(go.Brush, "Linear", { 0: diagramStyle.SubProcessNode_GradiantColor1, 1: diagramStyle.SubProcessNode_GradiantColor2 }),
strokeWidth: diagramStyle.SubProcessNode_BorderWidth, stroke: diagramStyle.SubProcessNode_BorderColor,
height: diagramStyle.SubProcessNode_Height
},
new go.Binding("figure", "figure")),
GD(go.Panel, "Horizontal",
GD(go.Panel, "Table",
{
maxSize: new go.Size(diagramStyle.SubProcessNode_MaxWidth, NaN),
minSize: new go.Size(diagramStyle.SubProcessNode_MinWidth, NaN),
margin: new go.Margin(
diagramStyle.SubProcessNodeTable_MarginTop,
diagramStyle.SubProcessNodeTable_MarginRight,
diagramStyle.SubProcessNodeTable_MarginBottom,
diagramStyle.SubProcessNodeTable_MarginLeft),
defaultAlignment: go.Spot.Right
},
GD(go.TextBlock, taskTextStyle(),
{
wrap: go.TextBlock.WrapFit,
editable: true,
minSize: new go.Size(10, 16)
},
new go.Binding("text").makeTwoWay()),
GD(go.Picture,
{
cursor: "pointer",
source: diagramStyle.SubProcessNodeIcon_Src,
background: "transparent",
desiredSize: new go.Size(24, 24),
margin: new go.Margin(
diagramStyle.SubProcessNodeIcon_MarginTop,
diagramStyle.SubProcessNodeIcon_MarginRight,
diagramStyle.SubProcessNodeIcon_MarginBottom,
diagramStyle.SubProcessNodeIcon_MarginLeft),
click: openPropDialog
})
)
),
// four named ports, one on each side:
makePort("T", go.Spot.Top, go.Spot.TopSide, true, true),
makePort("L", go.Spot.Left, go.Spot.LeftSide, true, true),
makePort("R", go.Spot.Right, go.Spot.RightSide, true, true),
makePort("B", go.Spot.Bottom, go.Spot.BottomSide, true, true)
));
now when i’m typing large name, rectangle not resize and text display over my icon
i want to be like this :