css - 文本宽度截断 cytoscape

标签 css angular text width cytoscape.js

我在 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/

相关文章:

javascript - 每个旁边都有一个 Div,但有一个出现在页面之外

angular - 错误 : Can't resolve 'rxjs/add/operator/map'

angular - 创建angular2模块时

text - 如何在 Golang 中创建固定长度的文本文件?

linux - 在工作目录(及其子目录)中搜索包含同一行字符串的文件

javascript - 如何在下拉列表的 anchor 标记上触发鼠标悬停事件

javascript - 在 HTML5 Canvas 上旋转图像

jquery - 使用 Checkbox 激活 CSS Pseudo

javascript - 无法读取未定义的属性 'MyProperty'

Java - 快速正则表达式在文本中查找单词