echarts icon indicating copy to clipboard operation
echarts copied to clipboard

力向导图 数据过大 显示问题。

Open Lily-Jian opened this issue 9 years ago • 4 comments

One-line summary [问题简述]

力向导图当节点数为600,边数为7000左右时,加载会出现以下问题: 1.“节点”最开始不会显示,直到图形抖动完成才显示; 2.显示时间超级长,40秒以上。 3.图形抖动幅度特别大,属于“晃瞎眼”级别

Version & Environment [版本及环境]

  • ECharts version [ECharts 版本]: 官网最新版
  • Browser version [浏览器类型和版本]: Firefox 54.0.1
  • OS Version [操作系统类型和版本]: win7 64位

Expected behaviour [期望结果]

数据过大时能正常快速显示

ECharts option [ECharts配置项]

myChart.showLoading();

		$.get('../data/天龙八部.txt', function (xml) {
			console.log(1111);
		    myChart.hideLoading();

		    var graph = echarts.dataTool.gexf.parse(xml);
		    var categories = [];
		    for (var i = 0; i < 9; i++) {
		        categories[i] = {
		            name: '类目' + i
		        };
		    }
		    graph.nodes.forEach(function (node) {
		        node.itemStyle = null;
		        node.value = node.symbolSize;
		        node.symbolSize /= 1.5;
		        node.label = {
		            normal: {
		                show: node.symbolSize > 0,
		                // textStyle:{
		                //     fontSize:node.symbolSize>30?node.symbolSize/3:(node.symbolSize>10?node.symbolSize/2:node.symbolSize*2)
		                // }
		            }
		        };
		        node.category = node.attributes.modularity_class;
				node.draggable = true;
		    });
		    option = {
		        title: {
		            text: 'Les Miserables',
		            subtext: 'Default layout',
		            top: 'bottom',
		            left: 'right'
		        },
		        tooltip: {},
		        legend: [{
		            // selectedMode: 'single',
		            data: categories.map(function (a) {
		                return a.name;
		            })
		        }],
		        animationDuration: 1500,
		        animationEasingUpdate: 'quinticInOut',
		        series : [
		            {
		                name: 'Les Miserables',
		                type: 'graph',
		                layout: 'force',
		                data: graph.nodes,
		                links: graph.links,
		                categories: categories,
		                focusNodeAdjacency: true,
		                roam: true,
		                label: {
		                    normal: {
		                        position: 'right',
		                        formatter: '{b}'
		                    }
		                },
		                lineStyle: {
		                    normal: {
		                        color: 'source',
		                        curveness: 0.3
		                    }
		                },
		                force: {
		                    repulsion: 650,
		                    gravity: 0.25,
		                    edgeLength: [100,150]
		                }
		            }
		        ]
		    };

		    myChart.setOption(option);
		}, 'xml');

Other comments [其他信息]

default

Lily-Jian avatar Jul 04 '17 08:07 Lily-Jian

你可以试试用 graphGL 组件,可以参考这个 1w 个节点,2w7 条边的 npm 依赖关系图的例子, http://gallery.echartsjs.com/editor.html?c=xHkhwiCuVW

pissang avatar Jul 04 '17 09:07 pissang

首先,谢谢大神的快速指导。 能否给一下"/asset/get/s/data-1499158774602-BJ1ZYC_4W.json"这个数据里面的具体格式。

Lily-Jian avatar Jul 04 '17 09:07 Lily-Jian

你不用管加载的数据格式是怎么样的,最后传入 graphGL 的数据格式跟 graph 相同,

pissang avatar Jul 05 '17 03:07 pissang

请问: graphGL-Large Internet实例中测试数据中,node和edge是如何建立联系的? nodes数据项中node[0]和node[1]:怎么理解呢? (如:[249, -33, 4, 4])?

研究很久没有看懂,还请指点迷津~ 谢谢

reffselom avatar Jul 16 '19 09:07 reffselom