antvis / X6

🚀 JavaScript diagramming library that uses SVG and HTML for rendering.
https://x6.antv.antgroup.com
MIT License
5.78k stars 1.71k forks source link

2.X 使用fromJSON方法 节点和线的visible属性不起作用 #2999

Closed natsul closed 1 year ago

natsul commented 1 year ago

Describe the bug

import { Graph } from '@antv/x6'

const graph = new Graph({ container: document.getElementById('container'), grid: true, })

const node = graph.addNode({ x: 160, y: 120, width: 360, height: 120, shape: 'text-block', text: There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable., attrs: { body: { fill: '#efdbff', stroke: '#9254de', rx: 4, ry: 4, }, }, })

node.hide()

graph.fromJSON(graph.toJSON())

如代码所示,通过toJSON在fromJSON node会显示

Your Example Website or App

https://x6.antv.antgroup.com/examples/node/native-node#text-block

Steps to Reproduce the Bug or Issue

如上述代码所述

Expected behavior

应当隐藏节点

Screenshots or Videos

No response

Platform

Additional context

No response

NewByVector commented 1 year ago

/cib

x6-bot[bot] commented 1 year ago

@natsul

Branch issue/issue-2999 was created for this issue. We will investigate into the matter and get back to you as soon as possible.

感谢反馈问题或提供改进建议,我们创建了 issue/issue-2999 分支来处理这个问题,你可以继续跟进后续的解决方案。

x6-bot[bot] commented 11 months ago

This thread has been automatically locked because it has not had recent activity.

Please open a new issue for related bugs and link to relevant comments in this thread.