-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from mkali-personal/test_branch
html giles
- Loading branch information
Showing
6 changed files
with
19,676 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
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,123 @@ | ||
<html> | ||
<head> | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/vis/4.16.1/vis.css" type="text/css" /> | ||
<script type="text/javascript" src="vis-network.min.js"> </script> | ||
<center> | ||
<h1></h1> | ||
</center> | ||
|
||
<!-- <link rel="stylesheet" href="../node_modules/vis/dist/vis.min.css" type="text/css" /> | ||
<script type="text/javascript" src="../node_modules/vis/dist/vis.js"> </script>--> | ||
|
||
<style type="text/css"> | ||
|
||
#mynetwork { | ||
width: 500px; | ||
height: 500px; | ||
background-color: #ffffff; | ||
border: 1px solid lightgray; | ||
position: relative; | ||
float: left; | ||
} | ||
|
||
|
||
|
||
|
||
#config { | ||
float: left; | ||
width: 400px; | ||
height: 600px; | ||
} | ||
|
||
|
||
|
||
</style> | ||
|
||
</head> | ||
|
||
<body> | ||
<div id = "mynetwork"></div> | ||
|
||
|
||
<div id = "config"></div> | ||
|
||
<script type="text/javascript"> | ||
|
||
// initialize global variables. | ||
var edges; | ||
var nodes; | ||
var network; | ||
var container; | ||
var options, data; | ||
|
||
|
||
// This method is responsible for drawing the graph, returns the drawn network | ||
function drawGraph() { | ||
var container = document.getElementById('mynetwork'); | ||
|
||
|
||
|
||
// parsing and collecting nodes and edges from the python | ||
nodes = new vis.DataSet([{"id": "king", "label": "king", "shape": "dot", "size": 10}, {"id": "teenage", "label": "teenage", "shape": "dot", "size": 10}, {"id": "tomato", "label": "tomato", "shape": "dot", "size": 10}, {"id": "parrot", "label": "parrot", "shape": "dot", "size": 10}, {"id": "london", "label": "london", "shape": "dot", "size": 10}, {"id": "spiderman", "label": "spiderman", "shape": "dot", "size": 10}, {"id": "queen", "label": "queen", "shape": "dot", "size": 10}]); | ||
edges = new vis.DataSet([{"from": "king", "to": "teenage", "weight": 84.49924737215042}, {"from": "king", "to": "tomato", "weight": 98.66215633228421}, {"from": "king", "to": "parrot", "weight": 84.9640741944313}, {"from": "king", "to": "london", "weight": 86.19410693645477}, {"from": "king", "to": "spiderman", "weight": 77.46720165014267}, {"from": "king", "to": "queen", "weight": 1000}, {"from": "queen", "to": "teenage", "weight": 81.4121201634407}, {"from": "queen", "to": "tomato", "weight": 89.37589079141617}, {"from": "queen", "to": "parrot", "weight": 81.69017434120178}, {"from": "queen", "to": "london", "weight": 83.49483609199524}, {"from": "queen", "to": "spiderman", "weight": 85.08228361606598}, {"from": "teenage", "to": "tomato", "weight": 92.06119254231453}, {"from": "teenage", "to": "parrot", "weight": 90.12678936123848}, {"from": "teenage", "to": "london", "weight": 96.62791527807713}, {"from": "teenage", "to": "spiderman", "weight": 86.65822595357895}, {"from": "tomato", "to": "parrot", "weight": 81.95918500423431}, {"from": "tomato", "to": "london", "weight": 95.1681237667799}, {"from": "tomato", "to": "spiderman", "weight": 88.08446675539017}, {"from": "parrot", "to": "london", "weight": 86.41409426927567}, {"from": "parrot", "to": "spiderman", "weight": 77.1601751446724}, {"from": "london", "to": "spiderman", "weight": 69.29624676704407}]); | ||
|
||
// adding nodes and edges to the graph | ||
data = {nodes: nodes, edges: edges}; | ||
|
||
var options = { | ||
"configure": { | ||
"enabled": true, | ||
"filter": [ | ||
"physics" | ||
] | ||
}, | ||
"edges": { | ||
"color": { | ||
"inherit": true | ||
}, | ||
"smooth": { | ||
"enabled": false, | ||
"type": "continuous" | ||
} | ||
}, | ||
"interaction": { | ||
"dragNodes": true, | ||
"hideEdgesOnDrag": false, | ||
"hideNodesOnDrag": false | ||
}, | ||
"physics": { | ||
"enabled": true, | ||
"stabilization": { | ||
"enabled": true, | ||
"fit": true, | ||
"iterations": 1000, | ||
"onlyDynamicEdges": false, | ||
"updateInterval": 50 | ||
} | ||
} | ||
}; | ||
|
||
|
||
|
||
|
||
// if this network requires displaying the configure window, | ||
// put it in its div | ||
options.configure["container"] = document.getElementById("config"); | ||
|
||
|
||
network = new vis.Network(container, data, options); | ||
|
||
|
||
|
||
|
||
|
||
|
||
return network; | ||
|
||
} | ||
|
||
drawGraph(); | ||
|
||
</script> | ||
</body> | ||
</html> |
Oops, something went wrong.