aboutsummaryrefslogtreecommitdiff
path: root/templates/cytoscape.html
diff options
context:
space:
mode:
Diffstat (limited to 'templates/cytoscape.html')
-rw-r--r--templates/cytoscape.html46
1 files changed, 46 insertions, 0 deletions
diff --git a/templates/cytoscape.html b/templates/cytoscape.html
new file mode 100644
index 0000000..24c18c1
--- /dev/null
+++ b/templates/cytoscape.html
@@ -0,0 +1,46 @@
+{% extends "layout.html" %}
+{% block content %}
+
+<script type="text/javascript" src="{{ url_for('static', filename='cytoscape.min.js') }}"></script>
+
+
+ <div id="cy"></div>
+ <script>
+ var cy = cytoscape({
+ container: document.getElementById('cy'),
+
+ style: [
+ { selector: 'node',
+ css: {
+ 'content': 'data(id)',
+ 'text-valign': 'center',
+ 'text-halign': 'center',
+ 'background-color': 'data(nodecolor)',
+ 'font-weight': 'data(fontweight)'
+ }
+ },
+
+ { selector: 'edge',
+ css: {
+ 'content': 'data(sentCnt)',
+ 'curve-style': 'bezier',
+ "opacity": "0.4",
+ }
+ }
+ ],
+ elements:[ {{ elements | safe }} ],
+
+ layout: {
+ name: 'concentric',
+ concentric: function( node ){
+ return node.degree();
+ },
+ levelWidth: function( nodes ){
+ return 2;
+ }
+ },
+
+ });
+ </script>
+
+{% endblock %}