How to decorate a parent node with background coloured title like a panel style with cytoscape.js
我正在使用复合图形库cytoscape.js几天,并且熟悉其演示和基本API。
但是我不知道是否可以使用如下屏幕截图所示的样式来装饰父节点。
父节点的默认样式只是一个矩形框架。是否可以使用背景色标题来渲染它?
非常感谢您的帮助。
我终于用以下代码片段解决了我的问题。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | { selector: ':parent', style: { 'background-image': function(){ return"title.jpg"; }, 'padding-top' : '25px', 'background-position-x' : '0', 'background-position-y' : '0', 'background-width' : '100%', 'background-height' : '25px', 'background-fit' : 'contain', } } |
为彩色标题使用背景图像。