如何使用transform:使用Cytoscape.js在CSS中旋转?

时间:2013-06-12 09:55:03

标签: css css3 cytoscape-web cytoscape.js cytoscape

如何使用CSS的属性设置饼图样式,例如12

.pie {
          position: absolute;
          width: 100px;
          height: 100px;
          -moz-border-radius: 50px;
          -webkit-border-radius: 50px;
          -o-border-radius: 50px;
          border-radius: 50px;
          clip: rect(0px, 50px, 100px, 0px);
     }
     .hold {
          position: absolute;
          width: 100px;
          height: 100px;
          -moz-border-radius: 50px;
          -webkit-border-radius: 50px;
          -o-border-radius: 50px;
          border-radius: 50px;
          clip: rect(0px, 100px, 100px, 50px);
     }
     #pieSlice1 .pie {
          background-color: #1b458b;
          -webkit-transform:rotate(50deg);
          -moz-transform:rotate(50deg);
          -o-transform:rotate(50deg);
          transform:rotate(50deg);
     } 
CSS3中的

是由Cytoscape.js构建的样式节点吗?

我已经尝试过以下代码..

style: cytoscape.stylesheet()
.selector("node")
.css({
"content": "data(name)", 
"shape": "data(shape)",
"border-width": 1,
"background-color": "data(color)",
"-webkit-transform":"rotate(140deg)",
"-moz-transform":"rotate(140deg)",
"-o-transform":"rotate(140deg)",
"transform":"rotate(140deg)",
"border-color": "#555",
"height": "data(weight)",
"width": "data(weight)"
})
...

但由于cytoscpe.js document

,它似乎不兼容

所以我需要以某种方式在每个节点中创建饼图有没有可用的解决方案? 提前谢谢。

1 个答案:

答案 0 :(得分:1)

正如我在另一个问题中提到的,这是一个有计划的功能:

https://github.com/cytoscape/cytoscape.js/issues/283