-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Open
Labels
question 💬This issue is just a question. It will be converted into discussion automaticallyThis issue is just a question. It will be converted into discussion automatically
Description
Describe the bug / 问题描述
import { Graph } from '@antv/g6';
const data = {
nodes: [
{ id: 'node1', combo: 'combo1', style: { x: 250, y: 150 } },
{ 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' }],
};
const graph = new Graph({
container: 'container',
data,
node: {
style: {
labelText: (d) => d.id,
},
},
combo: {
type: 'circle',
},
behaviors: ['drag-element', 'collapse-expand'],
plugins: [
{
type: 'tooltip',
enable:({targetType})=>targetType==='node',
getContent: ({ targetType }, items) => {
let result = `<h4>Custom Content</h4>`;
items.forEach((item) => {
result += `<p>Type: ${item.id}</p>`;
});
return result;
},
},
],
});
graph.render();
Reproduction link / 复现链接
https://g6.antv.antgroup.com/examples/element/combo/#circle
Steps to Reproduce the Bug or Issue / 重现步骤
官网combo示例中,添加以下代码能够复现
plugins: [
{
type: 'tooltip',
enable:({targetType})=>targetType==='node',
getContent: ({ targetType }, items) => {
let result = `<h4>Custom Content</h4>`;
items.forEach((item) => {
result += `<p>Type: ${item.id}</p>`;
});
return result;
},
},
],
Version / 版本
🆕 5.x
OS / 操作系统
- macOS
- Windows
- Linux
- Others / 其他
Browser / 浏览器
- Chrome
- Edge
- Firefox
- Safari (Limited support / 有限支持)
- IE (Nonsupport / 不支持)
- Others / 其他
Metadata
Metadata
Assignees
Labels
question 💬This issue is just a question. It will be converted into discussion automaticallyThis issue is just a question. It will be converted into discussion automatically