Group里的Link.curve属性

{
   curve: go.Link.Bezier,
   curviness: 1500,
   adjusting: go.Link.Stretch,
   toShortLength: 3,
}

this.myDiagram.groupTemplate =
   this.$(go.Group, 'Vertical',
      {
         layout: this.$(go.TreeLayout,
            {
               angle: 90,
               arrangement: go.TreeLayout.ArrangementHorizontal,
               isRealtime: false,
            }),
         isSubGraphExpanded: true,
      },
      this.$(go.Panel, 'Auto',
         this.$(go.Shape, 'RoundedRectangle',  // surrounds the Placeholder
            {
               parameter1: 14,
               fill: 'rgba(128,128,128,0)',
               stroke: 'rgba(1, 1, 1, 0)',
            }),
         this.$(go.Placeholder,    // represents the area of all member parts,
            { padding: 5 }),  // with some extra padding around them
      ),
      this.$(go.Panel, 'Horizontal'),
   );

如上组里的链接关系设置了Bezier曲线方式却无效,将组中的布局方式改变也同样无效,请问如何才能正确设置呢?

你是需要针对不同的组设置不同的 link Bezier 属性吗?

你提供的代码不清楚说的什么意思,group 用于放置 node 的,和 link 无关

你好,首先感谢你的回复。我这边再阐述下我的意思,我通过linktemplate设置了处于group里面node的link,然后这个linktemplate的Bezier属性不起作用。

this.myDiagram.linkTemplateMap.add('gray', this.$(go.Link, // the whole link panel       
   {
      curve: go.Link.Bezier,
      curviness: 1500,
      adjusting: go.Link.Stretch,
      toShortLength: 3,
   },
   this.$(go.Shape,  // the link shape
      {
         stroke: '#717171', strokeWidth: 2.5, fill: 'red',
         strokeDashArray: [3, 2],
      }),
   new go.Binding('points').makeTwoWay(),
   new go.Binding('curviness', 'curviness').makeTwoWay(),
));
public renderGroup(): void {
   if (this.myDiagram) {
      this.myDiagram.groupTemplate =
         this.$(go.Group, 'Vertical',
            {
               layout: this.$(go.LayeredDigraphLayout, {
                  direction: 90, // 方向为选择90°,即垂直布局
                  linkSpacing: 0, // 连线间隔 没起作用
                  columnSpacing: 0, // 图元之间列间隔
                  layerSpacing: 0, // 图元之间的间隔
                  setsPortSpots: false,
               }),
               selectionAdornmentTemplate: this.$(go.Adornment, 'Auto', this.$(go.Shape, 'Rectangle', { fill: 'white', stroke: null }),),
               isSubGraphExpanded: true,
            },
            this.$(go.Panel, 'Auto',
               this.$(go.Shape, 'RoundedRectangle',  // surrounds the Placeholder
                  {
                     parameter1: 14,
                     fill: 'rgba(128,128,128,0)',
                     stroke: 'rgba(1, 1, 1, 0)',
                  }),
               this.$(go.Placeholder,    // represents the area of all member parts,
                  { padding: 5 }),  // with some extra padding around them
            ),
            this.$(go.Panel, 'Horizontal'),
         );
   }
}

这是我的代码。数据结构可能相当于

nodeDataArray=[
{key:“1”,isGroup:true},
{key:“2”,isGroup:false,group:“1”},
{key:“3”,isGroup:false, group:“1”},
{key:“4”,isGroup:false,group:“1”},
{key:“5”,isGroup:false,group:“1”},
{key:“6”, isGroup:false,group:“1”}]
linkDataArray=[
{from:“3”,to:“2”category:'gray'},
{from:“4”,to:“2”,category:'gray '},
{from:“5”,to:“2”,category:'gray'},
{ from:“6”,to:“2”,category:'gray' }
].

我测试正常,例子:LinkTemplate | JShare

你好,我看了您提供的例子。这个例子中确实curve起作用了,但是giagram的布局以及group的布局和我的情况不一样。以下是我关于布局的代码:
this.myDiagram = this.$(go.Diagram, ‘diagram’,

            {

                'isReadOnly': read,

                'toolManager.mouseWheelBehavior': go.ToolManager.WheelZoom, // 鼠标控制放大缩小

                'initialAutoScale': go.Diagram.Uniform, // 初始化缩放为内容块儿缩放

                'linkingTool.direction': go.LinkingTool.ForwardsOnly, // 连接方向

                'layout': this.$(go.LayeredDigraphLayout, {

                    isInitial: false,

                    isOngoing: false,

                    direction: 90, // 方向为选择90°,即垂直布局

                    linkSpacing: 150, // 连线间隔 没起作用

                    columnSpacing: 120, // 图元之间列间隔

                    layerSpacing: 200, // 图元之间的间隔

                    setsPortSpots: false,

                }),

                'undoManager.isEnabled': true, // 是否可撤销

                'nodeSelectionAdornmentTemplate':

                    this.$(go.Adornment, 'Auto',

                        this.$(go.Shape, 'Rectangle', { fill: 'white', stroke: null }),

                    ),

            });

this.myDiagram.groupTemplate =

            this.$(go.Group, 'Vertical',

                {

                    layout: this.$(go.LayeredDigraphLayout, {

                        isInitial: false,

                        isOngoing: false,

                        direction: 90, // 方向为选择90°,即垂直布局

                        linkSpacing: 0, // 连线间隔 没起作用

                        columnSpacing: 0, // 图元之间列间隔

                        layerSpacing: 0, // 图元之间的间隔

                        setsPortSpots: false,

                    },

                    ),

                    selectionAdornmentTemplate: this.$(go.Adornment, 'Auto', this.$(go.Shape, 'Rectangle', { fill: 'white', stroke: null }),),

                    // isSubGraphExpanded: true,

                },

                this.$(go.Panel, 'Auto',

                    this.$(go.Shape, 'RoundedRectangle',  // surrounds the Placeholder

                        {

                            parameter1: 14,

                            fill: 'rgba(128,128,128,0)',

                            stroke: 'rgba(1, 1, 1, 0)',

                        }),

                    this.$(go.Placeholder,    // represents the area of all member parts,

                        { padding: 5 }),  // with some extra padding around them

                ),

                this.$(go.Panel, 'Horizontal'),

            );