Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 cytoscape.js 中,我可以使用
style: [ { selector: 'node', style: { 'content': 'data(id)', } },
当我将内容更改为 时'content': 'data(id), data(id)',它只是将其解释为字符串。
'content': 'data(id), data(id)'
是否可以将变量作为变量而不是字符串来处理?
使用一个函数:
content: function( ele ){ return 'foo' + ele.data('bar') + 'baz'; }
http://js.cytoscape.org/#style/mappers