8

I have some cytoscape nodes with

  style: cytoscape.stylesheet()
    .selector('node')
      .css({
        'border-color': '#0266C8',
        'border-width' : '1px',
        'shape': 'data(faveShape)',
        'width': '80px',
        'font-family' : 'Consolas',
        'font-size' : '10px',
        'content': 'data(id)',
        'text-valign': 'center',
        'background-color': 'data(faveColor)',
        'color': 'data(textColor)'
      })
      ...

How can I have a content with two or more lines and 2 or more concatenated strings?

...
'content': 'data(id)' + '<br>' + data('name') + '<br>test123',
...

TIA

Magno C
  • 1,922
  • 4
  • 28
  • 53

1 Answers1

8

In your stylesheet:

text-wrap: wrap;
label: 'My multiline\nlabel';

See http://js.cytoscape.org/#style/labels

maxkfranz
  • 11,896
  • 1
  • 27
  • 36