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

Setting the combo size does not take effect #6446

Open
lvsheshamo opened this issue Oct 28, 2024 · 2 comments
Open

Setting the combo size does not take effect #6446

lvsheshamo opened this issue Oct 28, 2024 · 2 comments
Labels
element Issue about elements v5

Comments

@lvsheshamo
Copy link

lvsheshamo commented Oct 28, 2024

Describe the bug / 问题描述

使用官网例子,设置combo size不生效

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

const data = {
nodes: [
{ id: 'node1', combo: 'combo1', style: { x: 250, y: 150,size:100 } },
{ id: 'node2', combo: 'combo1', style: { x: 350, y: 150 } },
{ id: 'node3', combo: 'combo2', style: { x: 250, y: 300 } },
],
edges: [],
combos: [{ id: 'combo1', combo: 'combo2' }, { id: 'combo2',style:{size:[400,200]} }],
};

const graph = new Graph({
container: 'container',
data,
node: {
style: {
labelText: (d) => d.id,
},
},
combo: {
type: 'rect',
fixSize:[200,800],
style: {
padding: 20,

},

},
behaviors: ['drag-element', 'collapse-expand'],
});

graph.render();

Reproduction link / 重现链接

No response

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

No response

G6 Version / G6 版本

🆕 5.0.26

Operating System / 操作系统

Windows

Browser / 浏览器

Chrome

Additional context / 补充说明

No response

@github-actions github-actions bot changed the title 设置combo size不生效 Setting the combo size does not take effect Oct 28, 2024
@yvonneyx yvonneyx added v5 element Issue about elements labels Oct 29, 2024
@yvonneyx
Copy link
Contributor

Combo 有收起态和展开态两种状态。展开态的大小会根据子节点的大小和布局自动计算,而收起态的大小可以通过属性 collapsedSize 指定。

目前,内置功能不支持指定展开态的大小,但可以通过自定义 combo 并复写 getExpandedKeySize 方法来实现。

@lvsheshamo
Copy link
Author

Combo 有收起态和展开态两种状态。展开态的大小会根据子节点的大小和布局自动计算,而收起态的大小可以通过属性 collapsedSize 指定。

目前,内置功能不支持指定展开态的大小,但可以通过自定义 combo 并复写 getExpandedKeySize 方法来实现。
谢谢解答,可以给一个示例吗?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
element Issue about elements v5
Projects
None yet
Development

No branches or pull requests

2 participants