- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
作为 cytoscapeweb 2 的新手,我正在按照提供的示例之一学习如何使用 API。我无法让它工作, Firebug 报告以下消息:
Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) var n = this.nodesGroup.getBBox();
在我的 html 文档中,cytoscapeweb div 嵌入在一个 jquery 选项卡小部件中(只是为了提供上下文)
my.html 中的某处
<div id="tabs">
<ul>
<li><a href="#tabs-1">Interactors Selection</a></li>
<li><a href="#tabs-2">Interactome Builder</a></li>
</ul>
<div id="tabs-1">
<p>Tab 1 content</p>
</div>
<div id="tabs-2">
<p>Tab 2 content</p>
<div id="cy"></div>
</div>
</div>
在 foo.js 中
function cytoscapeInit() {
alert ("intializing cytoscape");
// create a mapper for node size
var nodeSizeMapper = {
continuousMapper: {
attr: {
name: "weight",
min: 0,
max: 100
},
mapped: {
min: 15,
max: 30
}
}
};
// call cytoscape web on the `cy` div
$("#cy").cytoscapeweb({
// define the elements in the graph
elements: {
nodes: [
{ data: { id: "a", weight: 43 }, classes: "foo" },
{ data: { id: "b", weight: 2 }, classes: "bar" },
{ data: { id: "c", weight: 88 }, classes: "foo bar" }
],
edges: [
{ data: { id: "ab", source: "a", target: "b", weight: 32 }, classes: "foo" },
{ data: { id: "bc", source: "b", target: "c", weight: 12 }, classes: "bar baz" },
{ data: { id: "ca", source: "c", target: "a", weight: 96 }, classes: "baz foo" },
{ data: { id: "ac", source: "a", target: "c", weight: 65 }, classes: "bar" }
]
},
// define the layout to use
layout: {
name: "preset",
positions: {
"a": { x: 30, y: 30 },
"b": { x: 125, y: 131 },
"c": { x: 200, y: 50 }
},
fit: false,
stop: function(){
cy.reset();
cy.center();
}
},
// define the visual style (like css) of the graph
style: {
selectors: {
"node":{
shape: "ellipse",
fillColor: "#888",
height: nodeSizeMapper,
width: nodeSizeMapper,
labelText: {
passthroughMapper: "id"
}
},
".yay": {
fillColor: "red",
lineColor: "red",
targetArrowColor: "red"
},
"edge": {
lineColor: "#ccc",
targetArrowColor: "#ccc",
width: {
continuousMapper: {
attr: {
name: "weight"
},
mapped: {
min: 2,
max: 5
}
}
},
targetArrowShape: "triangle"
},
"node:selected": {
fillColor: "#333"
},
"edge:selected":{
lineColor: "#666",
targetArrowColor: "#666"
}
}
},
// define the callback for when cytoscape web is ready
ready: function( cy ){
window.cy = cy;
}
});
我是否遗漏了一些明显的东西?
如果是这样,我们深表歉意。
最佳答案
(1) 即使在测试时也不要像那样在代码中放置警报。它可以破坏异步代码,例如初始化 Cytoscape Web 或执行 AJAX 调用。请改用 console.log()
。
(2) 您可能用选项卡隐藏了 Cytoscape Web div,cy
。您不应该使用 display: none;
,因为 Cytoscape Web 视口(viewport)将是 0x0 像素。尝试类似 position: absolute; left: -9999px;
或类似的隐藏。这需要修改 jQuery 用于隐藏选项卡的任何类名(可能是 .ui-state-hidden
或类似的东西)。
(3) 我将研究使渲染器代码更能容忍隐藏的 Cytoscape Web div。
关于cytoscape-web - 初始化细胞景观,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10740269/
我想知道是否有任何方法可以将单元格“提供”给 Google 电子表格中的某人?我有一个电子表格,任何人都可以编写他们想要的内容,任何人都可以编辑他们想要的内容。我想添加一个功能,使得只有单元格的“作者
我如何根据一个输入的最大长度设置单元格的自动调整大小。 using (rng = workSheet.Cells["A1:G1"]) { rng.Style.Font.Bold = true;
如果我想在 Objective-C 中创建一个 TableView ,每个单元格都以不同的方式定制,我会创建多个原型(prototype)单元格,对其进行定制,然后为每个单元格设置自己的标识符。然后我
我正在使用平板电脑 View 并且我的表格 View 是分组的。我使用单个原型(prototype)单元格。在我的单元格中,我使用 UIView 并且只想将第一个单元格 View 设置为顶部,最后一个
如何让特定的 TD 不继承表格的 CSS 样式? 我应该如何使最右边的列完全没有任何背景? table { font-family:Arial, Helvetica, sans-serif;
我目前正在开发一个小项目 (Python 3.6.2),用于根据我从大学网站上抓取的输入自动创建时间表。为了创建时间表和存储约会(以及稍后重新组织它们,以找到“更好”的时间表),我目前使用 Panda
我想使用 python 数组模拟基本的细胞 split 。我有 u,它是一个数组,定义如下: n=2 #number of elements that can describe each cell N
渲染 Markdown 单元格时,在 latex 部分之后会显示垂直条。有什么办法可以去掉这些吗? 例如,markdown 单元格中的以下代码: $\left[ \begin{array}{cccc}
我正在使用 Yosys综合我的 RTL 设计,其中包括几个文字常量,例如绑定(bind)输出端口,如下代码所示: module my_module ( input a, input b
如何在 igGrid 更新中的 igTextEditor 上使用正则表达式? 我尝试使用验证选项,但它没有用。 $("#schedulerTable").igGrid({
我的问题是关于如何构建 LSTM 层,例如在 keras 中: keras.layers.LSTM(units,... other options) 这些单位是单个细胞还是细胞状态的维度? 我读过有关
我寻找将 selectedInputs 放入 renderDataTable 单元格的解决方案。我找到了 js 解决方案:https://datatables.net/examples/api/for
我是一名优秀的程序员,十分优秀!