Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: iVis-at-Bilkent/cytoscape.js-expand-collapse
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 3.1.1
Choose a base ref
...
head repository: iVis-at-Bilkent/cytoscape.js-expand-collapse
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on Dec 22, 2017

  1. Copy the full SHA
    92b66f0 View commit details
  2. Rebuild

    hasanbalci committed Dec 22, 2017
    Copy the full SHA
    c9be16d View commit details

Commits on Feb 14, 2018

  1. Copy the full SHA
    24c394a View commit details
  2. Copy the full SHA
    bd0ca7f View commit details

Commits on Feb 22, 2018

  1. Copy the full SHA
    d70bba1 View commit details
  2. Copy the full SHA
    1dbe666 View commit details

Commits on May 15, 2018

  1. Performance improvement

    hasanbalci committed May 15, 2018
    Copy the full SHA
    bf7ad72 View commit details
  2. Performance improvement

    hasanbalci committed May 15, 2018
    Copy the full SHA
    c9b5f9c View commit details

Commits on Jun 1, 2018

  1. Update citation

    ugurdogrusoz authored Jun 1, 2018
    Copy the full SHA
    6d12b9f View commit details
  2. Update citation

    ugurdogrusoz authored Jun 1, 2018
    Copy the full SHA
    d7dea4a View commit details

Commits on Jun 18, 2018

  1. Merge branch 'unstable'

    kinimesi committed Jun 18, 2018
    Copy the full SHA
    5ad2f0b View commit details
  2. Copy the full SHA
    625cd6a View commit details

Commits on Jun 28, 2018

  1. Update README.md

    `getAllCollapsedChildrenRecursively` method does not take any arguments.
    kinimesi authored Jun 28, 2018
    Copy the full SHA
    3c4e015 View commit details
  2. Update README.md

    `getAllCollapsedChildrenRecursively` method does not take any arguments.
    kinimesi committed Jun 28, 2018
    Copy the full SHA
    8a2e415 View commit details

Commits on Jul 25, 2018

  1. Update Team

    ugurdogrusoz authored Jul 25, 2018
    Copy the full SHA
    fb03ae4 View commit details

Commits on Oct 17, 2018

  1. Update demo links

    hasanbalci authored Oct 17, 2018
    Copy the full SHA
    5039e4d View commit details

Commits on Nov 9, 2018

  1. Copy the full SHA
    6cdb11b View commit details
  2. fix typo

    asterixslashstar committed Nov 9, 2018
    Copy the full SHA
    8333303 View commit details

Commits on Dec 8, 2018

  1. Set a default value when collapsed children is undefined #62

    ideally, getCollapsedChildrenRecursively should be called only on collapsed node, this is just for sanity check
    kinimesi committed Dec 8, 2018
    Copy the full SHA
    319e6bc View commit details

Commits on Dec 17, 2018

  1. Copy the full SHA
    7b6ae3e View commit details

Commits on Mar 22, 2019

  1. Fixing #69

    kinimesi committed Mar 22, 2019
    Copy the full SHA
    4b94483 View commit details

Commits on Apr 29, 2019

  1. Remove jQuery dependency

    kinimesi committed Apr 29, 2019
    Copy the full SHA
    2d0ec3c View commit details

Commits on May 28, 2019

  1. Rebuild...

    kinimesi committed May 28, 2019
    Copy the full SHA
    743dd08 View commit details

Commits on May 29, 2019

  1. Copy the full SHA
    b4a09b8 View commit details

Commits on Jun 25, 2019

  1. Fix #77

    hasanbalci committed Jun 25, 2019
    Copy the full SHA
    753adc7 View commit details

Commits on Jul 25, 2019

  1. Fix #69

    Keep parent information of nodes in scratch so that we can reach it even if the nodes don't exist.
    hasanbalci committed Jul 25, 2019
    Copy the full SHA
    edcfd50 View commit details

Commits on Jul 26, 2019

  1. Fix #73 #79

    Expose parent of a node via api. It is useful to reach parent of a node removed because of collapse operation
    hasanbalci committed Jul 26, 2019
    Copy the full SHA
    cdde6f6 View commit details
  2. Fix #69

    Instead of keeping parent info of all children at initialization, we keep info of only removed ones.
    This fixes the error on the newly added nodes.
    hasanbalci committed Jul 26, 2019
    Copy the full SHA
    5385d84 View commit details

Commits on Jul 29, 2019

  1. Copy the full SHA
    c0f0d8a View commit details
  2. Copy the full SHA
    da642f3 View commit details

Commits on Jul 30, 2019

  1. Copy the full SHA
    17c1a97 View commit details
  2. Fix #61

    hasanbalci committed Jul 30, 2019
    Copy the full SHA
    cdc8750 View commit details
  3. Copy the full SHA
    54c71ef View commit details

Commits on Aug 2, 2019

  1. Update README.md #80

    hasanbalci authored Aug 2, 2019
    Copy the full SHA
    e3890e5 View commit details

Commits on Aug 7, 2019

  1. Copy the full SHA
    7f9a67b View commit details

Commits on Aug 8, 2019

  1. Copy the full SHA
    5ea430e View commit details
  2. Updated README

    metincansiper committed Aug 8, 2019
    Copy the full SHA
    db0751d View commit details
  3. Copy the full SHA
    1daf2fd View commit details
  4. Fixed bug of using outdated options upon clicking visual cues. Also, …

    …removed remaining jQuery references.
    metincansiper committed Aug 8, 2019
    Copy the full SHA
    e444e4d View commit details
  5. Merge pull request #63 from iVis-at-Bilkent/enable-disable-cue

    Implemented api.enableCue(), api.disableCue() and api.extendOptions().
    hasanbalci authored Aug 8, 2019
    Copy the full SHA
    0986a7f View commit details

Commits on Aug 9, 2019

  1. Replaced let with var

    ahmedfouzan authored Aug 9, 2019
    Copy the full SHA
    b5374db View commit details

Commits on Aug 28, 2019

  1. Copy the full SHA
    79d1a91 View commit details
  2. Copy the full SHA
    22ef373 View commit details

Commits on Sep 5, 2019

  1. #83 #82

    nasimsaleh committed Sep 5, 2019
    Copy the full SHA
    df5312e View commit details
  2. Update README.md

    nasimsaleh authored Sep 5, 2019
    Copy the full SHA
    6ddee5f View commit details

Commits on Sep 7, 2019

  1. Copy the full SHA
    e74b9ec View commit details

Commits on Sep 9, 2019

  1. Update demo files

    to use the latest cose-bilkent and undo-redo from npm
    hasanbalci committed Sep 9, 2019
    Copy the full SHA
    91fcd1c View commit details
  2. Update README.md

    hasanbalci authored Sep 9, 2019
    Copy the full SHA
    aa85cfa View commit details

Commits on Sep 10, 2019

  1. Partially fix #84

    hasanbalci committed Sep 10, 2019
    Copy the full SHA
    e2e7e10 View commit details
  2. Copy the full SHA
    94345ae View commit details
49 changes: 49 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Dogrusoz"
given-names: "Ugur"
orcid: "https://orcid.org/0000-0002-7153-0784"
- family-names: "Karacelik"
given-names: "Alper"
orcid: "https://orcid.org/0000-0000-0000-0000"
- family-names: "Safarli"
given-names: "Ilkin"
- family-names: "Balci"
given-names: "Hasan"
orcid: "https://orcid.org/0000-0001-8319-7758"
- family-names: "Dervishi"
given-names: "Leonard"
- family-names: "Siper"
given-names: "Metin Can"
title: "cytoscape-expand-collapse"
version: 4.1.0
date-released: 2021-06-16
url: "https://github.com/iVis-at-Bilkent/cytoscape.js-expand-collapse"
preferred-citation:
type: article
authors:
- family-names: "Dogrusoz"
given-names: "Ugur"
orcid: "https://orcid.org/0000-0002-7153-0784"
- family-names: "Karacelik"
given-names: "Alper"
orcid: "https://orcid.org/0000-0000-0000-0000"
- family-names: "Safarli"
given-names: "Ilkin"
- family-names: "Balci"
given-names: "Hasan"
orcid: "https://orcid.org/0000-0001-8319-7758"
- family-names: "Dervishi"
given-names: "Leonard"
- family-names: "Siper"
given-names: "Metin Can"
doi: "10.1371/journal.pone.0197238"
journal: "PLOS ONE"
month: 5
start: 1 # First page number
end: 18 # Last page number
title: "Efficient methods and readily customizable libraries for managing complexity of large networks"
issue: 5
volume: 13
year: 2018
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2017 iVis@Bilkent
Copyright (c) 2017 - present, iVis@Bilkent.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
128 changes: 109 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,37 @@
cytoscape-expand-collapse
================================================================================

**We are in the process of developing a new unified framework for complexity management of graphs. Thus this repositoy is no longer being maintained**

## 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 and edges 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)
<p align="center">
<img src="expand-collapse-extension-demo.gif" height="240"/>
&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;
<img src="expand-collapse-extension-edge-demo.gif" height="240"/>
</p>

Until a publication on this is available, please cite the following paper when using this extension:
Please cite the following paper when using this extension:

U. Dogrusoz and B. Genc, "A Multi-Graph Approach to Complexity Management in Interactive Graph Visualization", Computers & Graphics, 30(1), pp. 86-97, 2006.
U. Dogrusoz , A. Karacelik, I. Safarli, H. Balci, L. Dervishi, and M.C. Siper, "[Efficient methods and readily customizable libraries for managing complexity of large networks](https://doi.org/10.1371/journal.pone.0197238)", PLoS ONE, 13(5): e0197238, 2018.

## Demo

Click [here](https://rawgit.com/iVis-at-Bilkent/cytoscape.js-expand-collapse/master/demo.html) (no undo) or [here](https://rawgit.com/iVis-at-Bilkent/cytoscape.js-expand-collapse/master/demo-undoable.html) (undoable) for a demo
Here are some demos: **no undo and with custom cue image**, **undoable**, and **collapsing edges and nodes**, respectively:
<p align="center">
<a href="https://ivis-at-bilkent.github.io/cytoscape.js-expand-collapse/demo/demo.html" title="No undo and with custom cue image"><img src="https://www.cs.bilkent.edu.tr/~ivis/images/demo1.png" height=42px></a> &emsp;
<a href="https://ivis-at-bilkent.github.io/cytoscape.js-expand-collapse/demo/demo-undoable.html" title="Undoable"><img src="https://www.cs.bilkent.edu.tr/~ivis/images/demo2.png" height=42px></a> &emsp;
<a href="https://ivis-at-bilkent.github.io/cytoscape.js-expand-collapse/demo/demo-compounds-collapsed.html" title="Collapsing edges and nodes"><img src="https://www.cs.bilkent.edu.tr/~ivis/images/demo3.png" height=42px></a>
</p>

## API

* Note that compounds are nodes.

`cy.expandCollapse(options)`
To initialize/set options whenever you want.
To initialize the extension with given options.

`var api = cy.expandCollapse('get')`
To get the extension instance after initialization.
@@ -64,18 +74,54 @@ Resets the options to the given parameter.
`api.setOption(name, value)`
Sets the value of the option given by the name to the given value.

`api.extendOptions(options)`
Extend the current options with the given options.

`api.getCollapsedChildren(node)`
Get the children of the given collapsed node which are removed during collapse operation

`api.getCollapsedChildrenRecursively(node)`
Get collapsed children recursively including nested collapsed children. Returned value includes edges and nodes, use selector to get edges or nodes.

`api.getAllCollapsedChildrenRecursively(node)`
`api.getAllCollapsedChildrenRecursively()`
Get collapsed children of all collapsed nodes recursively. Returned value includes edges and nodes, use selector to get edges or nodes.

`api.clearVisualCue()`
Forces the visual cue to be cleared. It is to be called in extreme cases.

`api.enableCue()`
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.

`api.collapseEdges(edges,options)`
Collapse the given edges if all the given edges are between same two nodes and number of edges passed is at least 2. Does nothing otherwise.

` api.expandEdges(edges){ `
Expand the given collapsed edges

`api.collapseEdgesBetweenNodes(nodes, options)`
Collapse all edges between the set of given nodes.

`api.expandEdgesBetweenNodes(nodes)`
Expand all collapsed edges between the set of given nodes

`api.collapseAllEdges(options)`
Collapse all edges in the graph.

`api.expandAllEdges()`
Expand all edges in the graph.

`api.loadJson(jsonStr)`
Load elements from JSON string.

`api.saveJson(elems, filename)`
Return elements in JSON format and saves them to a file if a file name is provided via `filename` parameter. Default value for `elems` is all the elements.

## 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.

@@ -87,6 +133,18 @@ Notice that following events are performed for *each* node that is collapsed/exp

`cy.nodes().on("expandcollapse.afterexpand", function(event) { var node = this; ... })` Triggered after a node is expanded

`cy.edges().on("expandcollapse.beforecollapseedge", function(event) { var edge = this; ... })` Triggered before an edge is collapsed

`cy.edges().on("expandcollapse.aftercollapseedge", function(event) { var edge = this; ... })` Triggered after an edge is collapsed

`cy.edges().on("expandcollapse.beforeexpandedge", function(event) { var edge = this; ... })` Triggered before an edge is expanded

`cy.edges().on("expandcollapse.afterexpandedge", function(event) { var edge = this; ... })` Triggered after an edge is expanded

All these events can also be listened as [cytoscape.js core events](https://js.cytoscape.org/#cy.on)
e.g.

`cy.on("expandcollapse.afterexpandedge", function(event) { var elem = event.target; ... })`

## Default Options
```javascript
@@ -95,6 +153,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,

@@ -104,7 +163,11 @@ Notice that following events are performed for *each* node that is collapsed/exp
expandCollapseCueLineSize: 8, // size of lines used for drawing plus-minus icons
expandCueImage: undefined, // image of expand icon if undefined draw regular expand cue
collapseCueImage: undefined, // image of collapse icon if undefined draw regular collapse cue
expandCollapseCueSensitivity: 1 // sensitivity of expand-collapse cues
expandCollapseCueSensitivity: 1, // sensitivity of expand-collapse cues
edgeTypeInfo: "edgeType", // the name of the field that has the edge type, retrieved from edge.data(), can be a function, if reading the field returns undefined the collapsed edge type will be "unknown"
groupEdgesOfSameTypeOnCollapse : false, // if true, the edges to be collapsed will be grouped according to their types, and the created collapsed edges will have same type as their group. if false the collapased edge will have "unknown" type.
allowNestedEdgeCollapse: true, // when you want to collapse a compound edge (edge which contains other edges) and normal edge, should it collapse without expanding the compound first
zIndex: 999 // z-index value of the canvas in which cue ımages are drawn
};
```

@@ -121,17 +184,37 @@ Notice that following events are performed for *each* node that is collapsed/exp

`ur.do("expandAll", { options: opts })` Equivalent of cy.expandAll(opts)

`ur.do("collapseEdges", { edges: eles, options: opts})` Equivalent of eles.collapseEdges(opts)

`ur.do("expandEdges", { edges: eles})` Equivalent of eles.expandEdges()

`ur.do("collapseEdgesBetweenNodes", { nodes: eles, options: opts})` Equivalent of eles.collapseEdgesBetweenNodes(opts)

`ur.do("expandEdgesBetweenNodes", { nodes: eles})` Equivalent of eles.expandEdgesBetweenNodes()

`ur.do("collapseAllEdges", {options: opts)}` Equivalent of cy.collapseAllEdges(opts)

`ur.do("expandAllEdges")`Equivalent of cy.expandAllEdges()


## Elements Style

* Collapsed nodes have 'cy-expand-collapse-collapsed-node' class.
* Meta edges have 'cy-expand-collapse-meta-edge' class.
* Meta edges (edges from/to collapsed nodes) have 'cy-expand-collapse-meta-edge' class.
* Collapsed edges have 'cy-expand-collapse-collapsed-edge' class.
* Collapsed edges data have 'directionType' field which can be either:
- 'unidirection' if all the edges that are collapsed into this edge have the same direction (all have same source and same target)
or
- 'bidirection' if the edges that are collapsed into this edge have different direction (different target and/or source)
* Collapsed edges data have a field that holds the type, the field name is as defined in options but if it is not defined in options or was defined as a function it will be named 'edgeType'



## Dependencies

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


## Usage instructions
@@ -146,10 +229,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:
@@ -162,19 +244,27 @@ require(['cytoscape', 'cytoscape-expand-collapse'], function( cytoscape, expandC
Plain HTML/JS has the extension registered for you automatically, because no `require()` is needed.


## Build targets

* `npm run build` : Build `./src/**` into `cytoscape-expand-collapse.js` in production environment and minimize the file.
* `npm run build:dev` : Build `./src/**` into `cytoscape-expand-collapse.js` in development environment without minimizing the file.

## Publishing instructions

This project is set up to automatically be published to npm and bower. To publish:

1. Set the version number environment variable: `export VERSION=1.2.3`
1. Publish: `gulp publish`
1. Build the extension : `npm run build`
1. Commit the build : `git commit -am "Build for release"`
1. Bump the version number and tag: `npm version major|minor|patch`
1. Push to origin: `git push && git push --tags`
1. Publish to npm: `npm publish .`
1. If publishing to bower for the first time, you'll need to run `bower register cytoscape-expand-collapse https://github.com/iVis-at-Bilkent/cytoscape.js-expand-collapse.git`


## Team

* [Ilkin Safarli](https://github.com/kinimesi), [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)
* [Hasan Balci](https://github.com/hasanbalci), [Yusuf Canbaz](https://github.com/canbax), [Ugur Dogrusoz](https://github.com/ugurdogrusoz) of [i-Vis at Bilkent University](http://www.cs.bilkent.edu.tr/~ivis) and [Metin Can Siper](https://github.com/metincansiper) of the Demir Lab at [OHSU](http://www.ohsu.edu/)

## Alumni

* [Selim Firat Yilmaz](https://github.com/mrsfy)
* [Alper Karacelik](https://github.com/alperkaracelik), [Ilkin Safarli](https://github.com/kinimesi), [Nasim Saleh](https://github.com/nasimsaleh), [Selim Firat Yilmaz](https://github.com/mrsfy)
14 changes: 14 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Security Policy

## Supported Versions

| Version | Supported |
| ------- | ------------------ |
| 4.1.1 | :white_check_mark: |
| 4.1.0 | :x: |
| 4.0.x | :x: |
| < 4.0.0 | :x: |

## Reporting a Vulnerability

To report a vulnerability, either open an issue or send an email to i-Vis Research Lab ivis@cs.bilkent.edu.tr.
Loading