antvis / G6

♾ A Graph Visualization Framework in JavaScript.
https://g6.antv.antgroup.com/
MIT License
10.95k stars 1.3k forks source link

How to control the position of the nodes during the axpend process and the collapsed for the cilldren of node that is collapsed and the nodes that from both sides to the node that was clicked on #6014

Open Hamzah244 opened 3 weeks ago

Hamzah244 commented 3 weeks ago

Describe the bug / 问题描述

I am using indented layout and i want to control the collapse and expand behavior for the nodes position, like i want when the user clicked the collapse button the nodes from both sides not change the x and y position until I chang it by my condition, and the children position for the nodes that will be expand...

Reproduction link / 重现链接

Nothing

Steps to Reproduce the Bug or Issue / 重现步骤

Nothing

G6 Version / G6 版本

🆕 5.x

Operating System / 操作系统

Windows

Browser / 浏览器

Chrome, Edge, Firefox

Additional context / 补充说明

Test

Aarebecca commented 3 weeks ago

Based on your description, it would be better to customize an interaction to implement it. Essentially, you decide whether or not to call the graph API based on events and criteria you set

Hamzah244 commented 3 weeks ago

Based on your description, it would be better to customize an interaction to implement it. Essentially, you decide whether or not to call the graph API based on events and criteria you set

Thank you for your response..

How, I want to know how.! and thank you again

Hamzah244 commented 3 weeks ago

I want to know how can I control the node position in the Indented layout... when collapsed or expand the nodes children for the parent node...

Because I don't want the under nodes to be move under, if the upper node is expand, only if the under node is also expand it will move to under the upper node that is expand and expand the nodes children...

Is this details is understandable?

Aarebecca commented 3 weeks ago

I want to know how can I control the node position in the Indented layout... when collapsed or expand the nodes children for the parent node...

Because I don't want the under nodes to be move under, if the upper node is expand, only if the under node is also expand it will move to under the upper node that is expand and expand the nodes children...

Is this details is understandable?

If you want to control the animation during expanding and collapsing, it's actually determined by the position of the nodes before and after the operation.

If you want to control the placement of the nodes before and after expand and collapse (rather than during the animation), this will require you to customize the layout.