Skip to content
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

circle-node 部分label 无法显示 #5625

Closed
luckysnowy opened this issue Apr 7, 2024 · 3 comments
Closed

circle-node 部分label 无法显示 #5625

luckysnowy opened this issue Apr 7, 2024 · 3 comments

Comments

@luckysnowy
Copy link

luckysnowy commented Apr 7, 2024

graphData定义如下:

const data = {
    nodes: [
        {
            id: 'n1',
            data: {
                x: 15,
                y: 150,
                type: 'circle-node',
                keyShape: {//定义圆的属性
                    r: 16,
                    fill: '#fff',
                },
                labelShape: {
                    text: 'A',
                    position: 'bottom',
                    fill: '#ffffff',
                },
            }
        },
        {
            id: 'n2',
            data: {
                x: 100,
                y: 150,
                type: 'circle-node',
                keyShape: {//定义圆的属性
                    r: 16,
                    fill: '#fff',
                },
                labelShape: {
                    text: 'B',
                    position: 'bottom',
                    fill: '#ffffff',
                },
            }
        },
        {
            id: 'n3',
            data: {
                x: 150,
                y: 50,
                type: 'circle-node',
                keyShape: {//定义圆的属性
                    r: 16,
                    fill: '#fff',
                },
                labelShape: {
                    text: 'C',
                    position: 'top',
                    fill: '#ffffff',
                },
            }
        },
        {
            id: 'n4',
            data: {
                x: 180,
                y: 150,
                type: 'circle-node',
                keyShape: {//定义圆的属性
                    r: 16,
                    fill: '#fff',
                },
                labelShape: {
                    text: 'D',
                    position: 'top',
                    fill: '#ffffff',
                },
            }
        },
        {
            id: 'n5',
            data: {
                x: 190,
                y: 230,
                type: 'circle-node',
                keyShape: {//定义圆的属性
                    r: 16,
                    fill: '#fff',
                },
                labelShape: {
                    text: 'E',
                    position: 'bottom',
                    fill: '#ffffff',
                },
            }
        },
        {
            id: 'n6',
            data: {
                x: 290,
                y: 50,
                type: 'circle-node',
                keyShape: {//定义圆的属性
                    r: 16,
                    fill: '#fff',
                },
                labelShape: {
                    text: 'F',
                    position: 'bottom',
                    fill: '#ffffff',
                },
            }
        },
        {
            id: 'n7',
            data: {
                x: 290,
                y: 150,
                type: 'circle-node',
                keyShape: {//定义圆的属性
                    r: 16,
                    fill: '#fff',
                },
                labelShape: {
                    text: 'G',
                    position: 'bottom',
                    fill: '#ffffff',
                },
            }
        },
        {
            id: 'n8',
            data: {
                x: 290,
                y: 230,
                type: 'circle-node',
                keyShape: {//定义圆的属性
                    r: 16,
                    fill: '#fff',
                },
                labelShape: {
                    text: 'H',
                    position: 'bottom',
                    fill: '#ffffff',
                },
            }
        },
    ],
    edges: [
        {
            id: 'e1',
            source: 'n2',
            target: 'n1',
        },
        {
            id: 'e2',
            source: 'n3',
            target: 'n2',
        },
        {
            id: 'e3',
            source: 'n6',
            target: 'n3',
        },
        {
            id: 'e4',
            source: 'n4',
            target: 'n2',
        },
        {
            id: 'e5',
            source: 'n7',
            target: 'n4',
        },
        {
            id: 'e6',
            source: 'n5',
            target: 'n2',
        },
        {
            id: 'e7',
            source: 'n4',
            target: 'n5',
        },
        {
            id: 'e8',
            source: 'n5',
            target: 'n8',
        }
    ],
}

基于上述data,图绘制时,第二、三、四、七个节点的label无法显示,使用版本5.0.0-beta.28
图片绘制结果

@Aarebecca
Copy link
Contributor

使用的版本是什么

@mhfe123
Copy link

mhfe123 commented Apr 8, 2024

使用的版本是什么

5.0beta.28里边树图有些数据会默认把labelShape里边attribute的visibility设置为hidden是啥情况,有的又是visible,啥也没改,就莫名其妙给设置hidden了,drawLabelShape打印的shapemap里边

@Aarebecca
Copy link
Contributor

beta.28 之后的版本已经修正该问题

@hustcc hustcc closed this as completed May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants