css - 如何使用 transform :rotate in CSS with Cytoscape. js?

标签 css cytoscape-web cytoscape.js cytoscape

如何使用 CSS 属性为饼图设置样式,例如 1 , 2

.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 似乎不兼容

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

最佳答案

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

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

关于css - 如何使用 transform :rotate in CSS with Cytoscape. js?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17062563/

相关文章:

javascript - cytoscapejs - 在节点主体内嵌入 html

css - 基于内容的 Cytoscape.js 样式节点

javascript - CytoscapeJS 实现上下文菜单和菜单栏?

javascript - 细胞景观中的折叠/扩展复合节点

html - css 自定义下拉菜单的宽度为 "matching"

javascript - 类似于 Google Analytics 日期范围选择器的日期范围选择器?

jquery - 下拉菜单项分布在空白区域

javascript - 响应式布局的图像延迟加载?

javascript - react Cytoscape JS : All nodes are accumulated in one position

javascript - 是否有可能将 react 上下文注入(inject) react 中根外的div(在 body 下方)