Skip to content

关系图里的layout为circular时,连线会重叠 #7415

@gitXiaoQing

Description

@gitXiaoQing

One-line summary [问题简述]

关系图里的layout为circular时,去掉data里的x、y坐标值,若有节点A→节点B,同时又节点B→节点A,这两条线会重叠

Version & Environment [版本及环境]

  • ECharts version [ECharts 版本]:
    当前版本
  • Browser version [浏览器类型和版本]:
    谷歌浏览器63.0.3239.108
  • OS Version [操作系统类型和版本]:
    win10

Expected behaviour [期望结果]

当layout改成circular后,显示连线(从节点A→节点B,和从节点B→节点A)可以区分开。

ECharts option [ECharts配置项]

option ={
    title: {
        text: 'Graph 简单示例'
    },
    tooltip: {},
    animationDurationUpdate: 1500,
    animationEasingUpdate: 'quinticInOut',
    series : [
        {
            type: 'graph',
            layout: 'circular',
            symbolSize: 50,
            roam: true,
            label: {
                normal: {
                    show: true
                }
            },
            edgeSymbol: ['circle', 'arrow'],
            edgeSymbolSize: [4, 10],
            edgeLabel: {
                normal: {
                    textStyle: {
                        fontSize: 20
                    }
                }
            },
            data: [{
                name: '节点1'
            }, {
                name: '节点2'
            }, {
                name: '节点3'
            }, {
                name: '节点4'
            }],
            // links: [],
            links: [{
                source: 0,
                target: 1,
                symbolSize: [5, 20],
                label: {
                    normal: {
                        show: true
                    }
                },
                lineStyle: {
                    normal: {
                        width: 5,
                        curveness: 0.2
                    }
                }
            }, {
                source: '节点2',
                target: '节点1',
                label: {
                    normal: {
                        show: true
                    }
                },
                lineStyle: {
                    normal: { curveness: 0.2 }
                }
            }, {
                source: '节点1',
                target: '节点3'
            }, {
                source: '节点2',
                target: '节点3'
            }, {
                source: '节点2',
                target: '节点4'
            }, {
                source: '节点1',
                target: '节点4'
            }],
            lineStyle: {
                normal: {
                    opacity: 0.9,
                    width: 2,
                    curveness: 0
                }
            }
        }
    ]
}

Other comments [其他信息]

对官方示例修改:http://echarts.baidu.com/demo.html#graph-simple
1、layout改成circular;
2、data里的x、y去掉;

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleInactive for a long time. Will be closed in 7 days.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions