如何在vis js中设置内部可以有标签的形状的大小? 例如
代码1:
shape: 'circle',
color: {
border: 'black',
background: 'white'
},
borderWidth: 1,
borderWidthSelected: 2,
在上面的代码1中,如果标签中没有任何内容可以放入形状圆中,那么我如何增加/减少其大小。
如果形状是放置在标签外面的任何东西,我们可以增加和减少图标的大小。例如
代码2:
shape: 'icon',
icon: {
face: 'FontAwesome',
code: '\uf1db',
size: 100,
color: '#000000'
}
如上面的代码2所示,图标“大小”选项可用。
有没有办法在代码1中使用“大小”选项?
最佳答案
文档说明
"...The size is used to determine the size of node shapes that do not have the label inside of them. These shapes are: image, circularImage, diamond, dot, star, triangle, triangleDown, square and icon..."
所以答案是不。 (详细信息可以在此处找到 https://visjs.github.io/vis-network/docs/network/nodes.html )
但是作为一种解决方法,你可以这样做:
shape: 'circle',
scaling: {
label: {
enabled: true,
min: 50,
max: 50
}
},
value: 1
与 scaling.label.min
和 scaling.label.max
属性一样,您可以更改节点的大小。 (但您需要一个节点的值
)我希望这会有所帮助。
关于javascript - 调整 vis js 中带有标签的节点的大小,例如圆形、方框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43344239/