我使用JSON来指定我的图形的“样式”。我需要创建一个节点来拥有像this这样的背景。在CSS中,它将是:
background: repeating-linear-gradient(
45deg,
white,
white 10px,
red 10px,
red 20px
)如何才能在cytoscape.js的JSON格式“风格”中做到这一点呢?我尝试了下面这样的方法:
{
selector: '.someClass',
style: {
'background-image': 'repeating-linear-gradient(45deg, white, white 10px, red 10px, red 20px)',
},
}但这并不管用。有什么建议要怎么做吗?谢谢!
发布于 2018-01-17 06:20:51
我在文档里没看到repeating-linear-gradient。你仔细看过文档了吗?
如果要以编程方式创建映像,请尝试使用background-image的数据uri。
http://js.cytoscape.org/#style/background-image
https://stackoverflow.com/questions/48057332
复制相似问题