blob: 83c7b3ab66b071991394f11cc5457c47fe725539 [file] [log] [blame]
/*
title: NPM Dependencies
category: graph
titleCN: NPM 依赖关系图
difficulty: 9
*/
myChart.showLoading();
$.getJSON(ROOT_PATH + '/data/asset/data/npmdepgraph.min10.json', function (json) {
myChart.hideLoading();
myChart.setOption(option = {
title: {
text: 'NPM Dependencies'
},
animationDurationUpdate: 1500,
animationEasingUpdate: 'quinticInOut',
series: [{
type: 'graph',
layout: 'none',
// progressiveThreshold: 700,
data: json.nodes.map(function (node) {
return {
x: node.x,
y: node.y,
id: node.id,
name: node.label,
symbolSize: node.size,
itemStyle: {
color: node.color
}
};
}),
edges: json.edges.map(function (edge) {
return {
source: edge.sourceID,
target: edge.targetID
};
}),
emphasis: {
focus: 'adjacency',
label: {
position: 'right',
show: true
}
},
roam: true,
lineStyle: {
width: 0.5,
curveness: 0.3,
opacity: 0.7
}
}]
}, true);
});