【发布时间】:2020-03-01 01:32:55
【问题描述】:
我在 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 - 测试用户做得很好” 放置在节点下方,但会像这样被切断:“- 测试用户正在做”
【问题讨论】:
-
嗨@Lasit,你能添加一个Minimal, Reproducible Example吗(添加一个工作的sn-p,我们可以看到你的问题)。回答这个问题时,不知道 mapData 的布局、数据结构和原因是具有挑战性的。谢谢;)
标签: css angular text width cytoscape.js