Skip to content

Commit

Permalink
Merge branch 'unstable' into enable-disable-cue
Browse files Browse the repository at this point in the history
  • Loading branch information
metincansiper committed Aug 8, 2019
2 parents 7f9a67b + e3890e5 commit 5ea430e
Show file tree
Hide file tree
Showing 9 changed files with 246 additions and 174 deletions.
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cytoscape-expand-collapse

## Description

This extension provides an interface to expand/collapse nodes for better management of complexity of Cytoscape.js compound graphs, distributed under [The MIT License](https://opensource.org/licenses/MIT).
This extension provides an interface to expand/collapse nodes for better management of complexity of Cytoscape.js compound graphs, distributed under [The MIT License](https://opensource.org/licenses/MIT).

![](https://github.com/iVis-at-Bilkent/cytoscape.js-expand-collapse/blob/master/expand-collapse-extension-demo.gif)

Expand Down Expand Up @@ -82,6 +82,9 @@ Enable rendering of visual cue.
`api.disableCue()`
Disable rendering of visual cue.

`api.getParent(nodeId)`
Get the parent of a node given its node id. Useful to reach parent of a node removed because of collapse operation.

## Events
Notice that following events are performed for *each* node that is collapsed/expanded. Also, notice that any post-processing layout is performed *after* the event.

Expand All @@ -101,6 +104,7 @@ Notice that following events are performed for *each* node that is collapsed/exp
// recommended usage: use cose-bilkent layout with randomize: false to preserve mental map upon expand/collapse
fisheye: true, // whether to perform fisheye view after expand/collapse you can specify a function too
animate: true, // whether to animate on drawing changes you can specify a function too
animationDuration: 1000, // when animate is true, the duration in milliseconds of the animation
ready: function () { }, // callback when expand/collapse initialized
undoable: true, // and if undoRedoExtension exists,

Expand All @@ -113,6 +117,7 @@ Notice that following events are performed for *each* node that is collapsed/exp
expandCollapseCueSensitivity: 1 // sensitivity of expand-collapse cues
};
```
*Note that this extension creates a new canvas on the viewport with z-index value '999' to render the visual cue. If your application uses any other canvas, please arrange its z-index value accordingly.*

## Default Undo/Redo Actions
`ur.do("collapse", { nodes: eles, options: opts)` Equivalent of eles.collapse(opts)
Expand All @@ -135,7 +140,6 @@ Notice that following events are performed for *each* node that is collapsed/exp
## Dependencies

* Cytoscape.js ^1.7.0
* jQuery ^1.7.0 || ^2.0.0 || ^3.0.0
* cytoscape-undo-redo.js(optional) ^1.0.1
* cytoscape-cose-bilkent.js(optional/suggested for layout after expand/collapse) ^1.3.6

Expand All @@ -152,10 +156,9 @@ Download the library:
CommonJS:
```js
var cytoscape = require('cytoscape');
var jquery = require('jquery');
var expandCollapse = require('cytoscape-expand-collapse');

expandCollapse( cytoscape, jquery ); // register extension
expandCollapse( cytoscape ); // register extension
```

AMD:
Expand All @@ -180,7 +183,7 @@ This project is set up to automatically be published to npm and bower. To publi
## Team

* [Metin Can Siper](https://github.com/metincansiper), [Alper Karacelik](https://github.com/alperkaracelik), [Ugur Dogrusoz](https://github.com/ugurdogrusoz) of [i-Vis at Bilkent University](http://www.cs.bilkent.edu.tr/~ivis)

## Alumni

* [Ilkin Safarli](https://github.com/kinimesi), [Selim Firat Yilmaz](https://github.com/mrsfy)
Loading

0 comments on commit 5ea430e

Please sign in to comment.