I have a problem. I know, that this problem is solved here, but I don't know how show it in JS code. I have
style: cytoscape.stylesheet()
.selector('node')
.css({
'shape': 'data(faveShape)',
'background-color': 'data(faveColor)',
'content': 'data(name)',
'text-valign': 'center',
'color': 'white',
'text-outline-width': 2,
'text-outline-color': '#888',
'width': 100,
'height':65
})
and I create nodes by this code
elements: {
nodes: [
{ data: { id: 'k', name: 'Kramer','faveColor': '#6FB1FC', 'faveShape' : 'roundrectangle'} },
{ data: { id: 'g', name: 'George','faveColor': '#6FB1FC', 'faveShape' : 'roundrectangle'} }
],
Error: Do not assign mappings to elements without corresponding data (e.g. ele ele3
for property shape
with data field faveShape
); try a [faveShape]
selector to limit scope to elements with faveShape
defined