Skip to content

Commit

Permalink
add 2 new cytoscape layouts
Browse files Browse the repository at this point in the history
  • Loading branch information
vincent-peugnet committed Oct 17, 2024
1 parent 9b2be8b commit 55f4253
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions app/class/Modelhome.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ class Modelhome extends Model
{
public const GRAPH_LAYOUTS = [
'cose' => 'cose',
'fcose' => 'fcose',
'cose-bilkent' => 'cose-bilkent',
'euler' => 'euler',
'circle' => 'circle',
'breadthfirst' => 'breadthfirst',
'concentric' => 'concentric',
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
"codemirror": "^5.63.3",
"cytoscape": "^3.20.0",
"cytoscape-cose-bilkent": "^4.1.0",
"cytoscape-euler": "^1.2.3",
"cytoscape-fcose": "^2.2.0",
"leaflet": "^1.9.3"
},
"devDependencies": {
Expand Down
8 changes: 6 additions & 2 deletions src/graph.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import cytoscape from 'cytoscape';
import coseBilkent from 'cytoscape-cose-bilkent';
import fcose from 'cytoscape-fcose';
import euler from 'cytoscape-euler';

cytoscape.use(euler);
cytoscape.use(fcose);
cytoscape.use(coseBilkent);

let options = {
Expand All @@ -14,10 +18,10 @@ let cy = cytoscape(options);
cy.on('tap', 'node', function() {
try {
// your browser may block popups
window.open(this.data('id'));
window.open(this.data('leftclick'));
} catch (e) {
// fall back on url change
window.location.href = this.data('id');
window.location.href = this.data('leftclick');
}
});

Expand Down

0 comments on commit 55f4253

Please sign in to comment.