在应用布局后有没有办法导出png / jpg?
这足以获得初始网格布局:
var png64 = cy.png();
$('#downloadPNG').attr('href', png64);
但有没有办法在应用cose布局后获取png?
修改
感谢以下回答,找到了一种方法:
cy.layout({
name: 'cose',
animateThreshold: 1,
nodeOverlap: 100,
gravity: 1000,
componentSpacing: 50,
edgeElasticity: 1000,
minTemp: 1,
initialTemp: 10000,
stop: function() {
//generate PNG image to display from "id = downloadPNG"
var png64 = cy.png();
$('#downloadPNG').attr('href', png64);
}
});