aboutsummaryrefslogtreecommitdiff
path: root/templates/network.html
blob: 24c18c15155a842575b85d945404c765e9b8fc64 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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 %}