We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
使用fromJson进行数据的前端展示时,发现自定义节点图片Image无法显示。例如 data.nodes.forEach((item) => { model.nodes?.push({ id: item.id, shape: 'circle', width: item.size>100?item.size:100, height: item.size>100?item.size:100, x: item.x, y: item.y, attrs: { body: { fill: '#5F95FF', stroke: 'transparent', }, image: { 'xlink:href': 'https://gw.alipayobjects.com/os/s/prod/antv/assets/image/logo-with-text-73b8a.svg', } }, ports: { groups: { po: { position: { name: "ellipseSpread", args: { start: 0 }, }, label: { position: "left" }, attrs: { circle: { r: 10, magnet: true, stroke: "#31d0c6", strokeWidth: 2, fill: "#fff" } } } }, items://... }, }) }) const forceLayout = new ForceLayout({ type: 'force', center: [369, 180], preventOverlap: true, linkDistance: () => { return 100 }, nodeStrength: () => { return -10 }, edgeStrength: () => { return 0.1 }, tick: () => { const model = getModelFromOriginData(data) graph.fromJSON(model) }, }) forceLayout.layout(data) 此时image无法在前端显示
无
页面展示时
希望可以显示自定义image
No response
The text was updated successfully, but these errors were encountered:
image 配置只有在 image 节点才有效果,参考 demo。
image
Sorry, something went wrong.
请问上面的回答有解决你的问题吗,为了高效沟通,我们暂时关闭这个 issue,如果有必要,请重新开一个新的 issue。
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.
No branches or pull requests
问题描述
使用fromJson进行数据的前端展示时,发现自定义节点图片Image无法显示。例如
data.nodes.forEach((item) => {
model.nodes?.push({
id: item.id,
shape: 'circle',
width: item.size>100?item.size:100,
height: item.size>100?item.size:100,
x: item.x,
y: item.y,
attrs: {
body: {
fill: '#5F95FF',
stroke: 'transparent',
},
image: {
'xlink:href': 'https://gw.alipayobjects.com/os/s/prod/antv/assets/image/logo-with-text-73b8a.svg',
}
},
ports: {
groups: {
po: {
position: {
name: "ellipseSpread",
args: {
start: 0
},
},
label: {
position: "left"
},
attrs: {
circle: {
r: 10,
magnet: true,
stroke: "#31d0c6",
strokeWidth: 2,
fill: "#fff"
}
}
}
},
items://...
},
})
})
const forceLayout = new ForceLayout({
type: 'force',
center: [369, 180],
preventOverlap: true,
linkDistance: () => {
return 100
},
nodeStrength: () => {
return -10
},
edgeStrength: () => {
return 0.1
},
tick: () => {
const model = getModelFromOriginData(data)
graph.fromJSON(model)
},
})
forceLayout.layout(data)
此时image无法在前端显示
重现链接
无
重现步骤
页面展示时
预期行为
希望可以显示自定义image
平台
屏幕截图或视频(可选)
No response
补充说明(可选)
No response
The text was updated successfully, but these errors were encountered: