Fix for CollectionElements

This commit is contained in:
Cerberuser
2018-06-01 16:28:14 +07:00
parent 9fb3214e64
commit c67f9444e8
2 changed files with 15 additions and 2 deletions

View File

@@ -80,3 +80,17 @@ cy.on('zoom', (event) => {
cy.nodes('$node > node').style('opacity', 0);
}
});
cy.animate({
fit: {
padding: 10,
eles: cy.nodes()
},
duration: 500
});
const node = cy.nodes()[0];
cy.animate({
center: {eles: node},
duration: 500
});

View File

@@ -1127,8 +1127,7 @@ declare namespace cytoscape {
/**
* The output is a collection of node and edge elements OR single element.
*/
interface CollectionElements extends
EdgeCollection, NodeCollection, SingularElement { }
type CollectionElements = EdgeCollection | NodeCollection | SingularElement;
/**
* edges -> Cy.EdgeCollection