Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update demo to use the same example graph as the other FD layouts. Move
the old demo to demo-proteins.html.
- Loading branch information
Showing
5 changed files
with
91 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
<!DOCTYPE> | ||
|
||
<html> | ||
|
||
<head> | ||
<title>cytoscape-spread.js demo (proteins)</title> | ||
|
||
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1, maximum-scale=1"> | ||
|
||
<script src="https://cdnjs.cloudflare.com/ajax/libs/fetch/2.0.3/fetch.min.js"></script> | ||
<script src="https://unpkg.com/cytoscape/dist/cytoscape.min.js"></script> | ||
<script src="https://unpkg.com/weaverjs@1.2.0/dist/weaver.min.js"></script> | ||
|
||
<!-- for testing with local version of cytoscape.js --> | ||
<!-- <script src="../cytoscape.js/build/cytoscape.js"></script> --> | ||
|
||
<script src="cytoscape-spread.js"></script> | ||
|
||
<style> | ||
body { | ||
font-family: helvetica; | ||
font-size: 14px; | ||
} | ||
|
||
#cy { | ||
width: 100%; | ||
height: 100%; | ||
position: absolute; | ||
left: 0; | ||
top: 0; | ||
z-index: 999; | ||
} | ||
|
||
h1 { | ||
opacity: 0.5; | ||
font-size: 1em; | ||
} | ||
</style> | ||
|
||
<script> | ||
window.addEventListener('DOMContentLoaded', function(){ | ||
|
||
var cy = window.cy = cytoscape({ | ||
container: document.getElementById('cy'), | ||
|
||
layout: { | ||
name: 'spread', | ||
minDist: 40 | ||
}, | ||
|
||
style: [ | ||
{ | ||
selector: 'node', | ||
style: { | ||
'background-color': '#ea8a31' | ||
} | ||
}, | ||
|
||
{ | ||
selector: 'edge', | ||
style: { | ||
'curve-style': 'haystack', | ||
'haystack-radius': 0, | ||
'width': 3, | ||
'opacity': 0.666, | ||
'line-color': '#fcc694' | ||
} | ||
} | ||
], | ||
elements: fetch('./example-graphs/proteins.json').then(function( res ){ return res.json(); }) | ||
}); | ||
}); | ||
</script> | ||
</head> | ||
|
||
<body> | ||
<h1>cytoscape-spread demo (proteins)</h1> | ||
|
||
<div id="cy"></div> | ||
|
||
</body> | ||
|
||
</html> |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.