SigmaJS: Get node labels to wrap

101 Views Asked by At

I'd like to know how to get node labels in SigmaJS to wrap. Adding \n to the labels doesn't work. For example, in the image below, I'd like the text to wrap to a new line after "double-strand"

Here's an example of adding nodes to a SigmaJS graph (version 1.2), where NODES is an array of node attributes:

let graph = {nodes: []};

NODES.forEach(function (node) {
    graph.nodes.push({ 
        id:  node.id,
        label: node.label,
        x: node.x * nodeXAdj,
        y: -node.y * nodeYAdj,
        size: node.size,
        type: node.type,
        color: node.color,
        borderColor: node.borderColor,
    });
});

let s = new sigma({graph: graph});

enter image description here

0

There are 0 best solutions below