【发布时间】:2015-03-04 11:16:23
【问题描述】:
我将cytoscape.js 中的cola-layout 应用于一个包含500 个以上节点和边 的数据集。 布局呈现图表并需要 10 分钟 才能稳定为开放式图表。
我的问题是这是否是可乐显示如此复杂的图表所需的时间?
为了得到一个视觉上令人愉悦的(平衡)图表,像这样infinite:true
在我下载的 cytoscape.js 文件中from here。
我已经设置好了,
infinite: true; // for cola layout
没有它,它会变成这样一个纠缠图: infinite:false
这是 javascript 代码:
$(function()
{
$('#cy').cytoscape
({
style: cytoscape.stylesheet()
.selector('node').css({'content': 'data(name)'})
.selector('edge').css({'target-arrow-shape': 'triangle'})
.selector(':selected').css({'line-color': 'black'})
elements: {
nodes: [
{ data: { id: '2335', name: '2335' } },
//.
//. data from www.briandunning.com/sample-data/ca-500.zip
},
],
edges: [
{ data: { source:'2335', target:'Canton' }
//.
//. data from www.briandunning.com/sample-data/ca-500.zip
}]
},
layout: { name: 'cola'},
ready: function()
{
window.cy = this;
}
});
});
【问题讨论】:
-
在没有看到匿名数据集的情况下,该问题没有非基于意见的答案 (How to create a Minimal, Complete, and Verifiable example)
-
先生。如果它是您想要通过的数据集,那么您可以从Canada - 500 Records 下载相同的数据集。用于生成图表的列是 phone1 作为 source 和 phone2 作为 target。为了清楚起见,我将编辑并添加我的代码。谢谢
标签: cytoscape.js