cytoscape.js - How to wrap the text inside a shape using Cytoscape? -
i'm trying build tiles using cytoscape. basically, each rectangle (tile) has title , want written within limits of rectangle.
my code is:
var cy = cytoscape({ container: document.getelementbyid('cy'), style: [ { selector: 'node', css: { 'shape': 'rectangle', 'width': '200', 'height': '150', 'content': 'data(name)', 'text-wrap': 'wrap', 'text-valign': 'center', 'text-halign': 'center', 'text-transform': 'uppercase' } }, ///
and:
elements: { nodes: [ { data: { id: 'f1', name: 'this long text long text long text long text long text long text long text'} }, { data: { id: 'f2' } }, { data: { id: 'c', parent: 'b' } }, { data: { id: 'd' } }, { data: { id: 'e' } }, { data: { id: 'f', parent: 'e' } } ],///
but seems text-wrap value isn't being read. get:
can this?
thanks in advance!
you've set text-wrap: wrap
text wrapping enabled. haven't specified rules how want text wrapped. options:
(1) use manual newlines (i.e. '\n'
)
(2) set text-max-width
maximum line length, desired
Comments
Post a Comment