我在 cytoscape 中的节点下方面临文本截断问题。
我已经尝试过使用 css,但文本仍然被切断。
export const styles = [
{
selector: 'node',
style: {
label: 'data(label)',
width: 'mapData(weight, 40, 80, 20, 60)',
height: 'mapData(weight, 40, 80, 20, 60)',
content: 'data(name)',
'background-color': 'data(colorCode)',
color: '#262626',
'font-size': 15
}
},
{
selector: ':selected',
style: {
'border-width': 1,
'border-color': 'black',
'font-size': 17
}
},
{
selector: '.bottom-center',
style: {
'text-valign': 'bottom',
'text-halign': 'center'
}
}
示例:
文本“12 - 测试用户做得很好”放置在节点下方,但像这样被切断:“- 测试用户做得很好”
最佳答案
我的错,必须在样式中使用“wrap”作为文本,它完成了工作
关于css - 文本宽度截断 cytoscape,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58698425/