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

[Bug]: The initialization is a collapsed combo, and the first time you drag it, it will flash directly to the upper left corner. #6722

Closed
2 of 10 tasks
huawei668 opened this issue Jan 13, 2025 · 0 comments

Comments

@huawei668
Copy link

Describe the bug / 问题描述

import { Graph } from '@antv/g6';

fetch('https://assets.antv.antgroup.com/g6/cluster.json')
.then((res) => res.json())
.then((data) => {
data.nodes.forEach(item=>{
if(item.data.cluster == 'd'){
item.combo = 'dd'
}
})
data.combos = [{id:'dd',style:{collapsed:true}}]
const graph = new Graph({
container: 'container',
data,
node: {
style: {
labelText: (d) => d.id,
labelBackground: true,
},
palette: {
type: 'group',
field: 'cluster',
},
},
layout: {
type: 'grid',
sortBy: 'id',
nodeSize: 32,
},
behaviors: ['zoom-canvas', 'drag-canvas', 'drag-element'],
});

graph.render();

window.addPanel((gui) => {
  gui.add({ sortBy: 'id' }, 'sortBy', ['id', 'cluster']).onChange((type) => {
    graph.setLayout({
      type: 'grid',
      sortBy: type,
    });
    graph.layout();
  });
});

});

Reproduction link / 复现链接

No response

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

上面代码是依据G6官网的示例改造。
复现步骤:
1、复制以上代码运行后
2、拖拽那个折叠的combo

G6 Version / G6 版本

🆕 5.x

OS / 操作系统

  • macOS
  • Windows
  • Linux
  • Others / 其他

Browser / 浏览器

  • Chrome
  • Edge
  • Firefox
  • Safari (Limited support / 有限支持)
  • IE (Nonsupport / 不支持)
  • Others / 其他
@huawei668 huawei668 added the status: waiting for maintainer These issues have not yet been reviewed by a maintainer label Jan 13, 2025
@github-actions github-actions bot changed the title [Bug]: 初始化就是折叠的combo,第一次拖拽会直接闪跳到最左上角。 [Bug]: The initialization is a collapsed combo, and the first time you drag it, it will flash directly to the upper left corner. Jan 13, 2025
@github-actions github-actions bot removed the status: waiting for maintainer These issues have not yet been reviewed by a maintainer label Jan 13, 2025
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

1 participant