I'm using Cytoscape.js to render a dagre layout graph.
When styling the node, I use the property width: label as you can see in the following code:
const cy = cytoscape({
container: document.getElementById('cyGraph'),
maxZoom: 3,
minZoom: 0.3,
elements: dataForCytoscape,
style: [
{
selector: 'node',
style: {
'shape': 'round-rectangle',
'background-color': '#fff',
'label': 'data(name)',
'text-valign': 'center',
'color': '#333333',
'border-width': 1,
'border-color': '#2E1A61',
'width': 'label',
'font-size': '10px',
"padding-left": '5px',
"padding-right": '5px',
"padding-top": '5px',
"padding-bottom": '5px'
}
},
{
selector: 'edge',
style: {
...
}
}
],
layout: {
name: 'dagre'
}
});
Code is working and nodes get the same width of the inner labels, but I get the following warning in console:
The style value of `label` is deprecated for `width`
Question: Is there another way to let Cytoscape nodes to have a width that is the same of the inner label?