New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sankey图links中存在循环数据导致页面卡死并且无异常信息提示 #8117

Closed
hyZhang0701 opened this Issue Apr 9, 2018 · 5 comments

Comments

Projects
None yet
2 participants
@hyZhang0701

hyZhang0701 commented Apr 9, 2018

One-line summary [问题简述]

sankey图links中存在循环数据导致页面卡死并且无异常信息提示

Version & Environment [版本及环境]

  • ECharts version [ECharts 版本]: v4.0.4
  • Browser version [浏览器类型和版本]: 版本 65.0.3325.181(正式版本) (64 位)
  • OS Version [操作系统类型和版本]:macOS Sierra 版本10.12.4

Expected behaviour [期望结果]

sankey图links中存在循环数据时给出异常提示信息

ECharts option [ECharts配置项]

option = {
series: {
        type: 'sankey',
        layout:'none',
        data: [{
            name: 'a'
        }, {
            name: 'b'
        }],
        links: [{
            source: 'a',
            target: 'b',
            value: 5
        },{
            source: 'b',
            target: 'a',
            value: 5
        }]
    }
}

Other comments [其他信息]

@hyZhang0701 hyZhang0701 changed the title from sankey to sankey图links中存在循环数据导致页面卡死并且无异常信息提示 Apr 9, 2018

@hyZhang0701

This comment has been minimized.

hyZhang0701 commented Apr 9, 2018

希望能给予支持

@deqingli

This comment has been minimized.

Member

deqingli commented Apr 9, 2018

你好,这个问题我现在在跟进会尽快处理的

@hyZhang0701

This comment has been minimized.

hyZhang0701 commented Apr 9, 2018

@deqingli 赞,辛苦辛苦

@deqingli

This comment has been minimized.

Member

deqingli commented Apr 11, 2018

你好,这个问题是由于原始输入数据中存在环导致的。sankey 图理论上只支持有向无环图(DAG, Directed Acyclic Graph),所以原先的布局算法是默认输入数据是有向无环的,当有环的时候就会陷入死循环,当然这主要是我前期开发的时候欠考虑导致的,我会好好反思的。修改后的布局算法是按拓扑顺序遍历计算布局的,如果判断有环就会报错,不再绘制。

@deqingli

This comment has been minimized.

Member

deqingli commented Apr 11, 2018

修改后的功能会随下个版本一起发布,欢迎验证,如果有问题可以 reopen 这个 issue. ~ 祝好

@deqingli deqingli closed this Apr 11, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment