【问题标题】:Text width cut off cytoscape文本宽度切断 cytoscape
【发布时间】: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


【解决方案1】:

我的错,不得不在样式中对文本使用“换行”,它完成了这项工作

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-12-29
    • 1970-01-01
    • 2017-05-17
    • 2010-10-28
    • 1970-01-01
    • 2022-10-07
    • 1970-01-01
    • 2022-06-12
    相关资源
    最近更新 更多