forked from WestHealth/pyvis
-
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 WestHealth#212 from WestHealth/write_html_rewrite
Lib directory rewrite handling
- Loading branch information
Showing
20 changed files
with
5,379 additions
and
4,280 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,4 +23,7 @@ pyvis/make.bat | |
|
||
# vscode specific | ||
.vscode/ | ||
venv | ||
venv | ||
|
||
# intellij specific | ||
.idea/ |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,84 +1,125 @@ | ||
<html> | ||
<head> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/vis-network@latest/styles/vis-network.css" type="text/css" /> | ||
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/vis-network@latest/dist/vis-network.min.js"> </script> | ||
<head> | ||
<meta charset="utf-8"> | ||
|
||
<script src="lib/bindings/utils.js"></script> | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/vis-network/9.1.2/dist/dist/vis-network.min.css" integrity="sha512-WgxfT5LWjfszlPHXRmBWHkV2eceiWTOBvrKCNbdgDYTHrT2AeLCGbF4sZlZw3UMN3WtL0tGUoIAKsu8mllg/XA==" crossorigin="anonymous" referrerpolicy="no-referrer" /> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/vis-network/9.1.2/dist/vis-network.min.js" integrity="sha512-LnvoEWDFrqGHlHmDD2101OrLcbsfkrzoSpvtSQtxK3RMnRV0eOkhhBN2dXHKRrUU8p2DGRTk35n4O8nWSVe1mQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></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>--> | ||
<link | ||
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" | ||
rel="stylesheet" | ||
integrity="sha384-eOJMYsd53ii+scO/bJGFsiCZc+5NDVN2yr8+0RDqr0Ql0h+rP48ckxlpbzKgwra6" | ||
crossorigin="anonymous" | ||
/> | ||
<script | ||
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" | ||
integrity="sha384-JEW9xMcG8R+pH31jmWH6WWP0WintQrMb4s7ZOdauHnUtxwoG2vI5DkLtS3qm9Ekf" | ||
crossorigin="anonymous" | ||
></script> | ||
|
||
|
||
<center> | ||
<h1></h1> | ||
</center> | ||
<style type="text/css"> | ||
|
||
#mynetwork { | ||
width: 100%; | ||
height: 600px; | ||
background-color: #ffffff; | ||
border: 1px solid lightgray; | ||
position: relative; | ||
float: left; | ||
} | ||
|
||
|
||
|
||
|
||
|
||
|
||
</style> | ||
</head> | ||
|
||
|
||
<body> | ||
<div class="card" style="width: 100%"> | ||
|
||
|
||
<div id="mynetwork" class="card-body"></div> | ||
</div> | ||
|
||
<style type="text/css"> | ||
|
||
|
||
|
||
#mynetwork { | ||
width: 500px; | ||
height: 500px; | ||
background-color: #ffffff; | ||
border: 1px solid lightgray; | ||
position: relative; | ||
float: left; | ||
} | ||
<script type="text/javascript"> | ||
|
||
|
||
// initialize global variables. | ||
var edges; | ||
var nodes; | ||
var allNodes; | ||
var allEdges; | ||
var nodeColors; | ||
var originalNodes; | ||
var network; | ||
var container; | ||
var options, data; | ||
var filter = { | ||
item : '', | ||
property : '', | ||
value : [] | ||
}; | ||
|
||
|
||
|
||
|
||
</style> | ||
|
||
|
||
</head> | ||
// This method is responsible for drawing the graph, returns the drawn network | ||
function drawGraph() { | ||
var container = document.getElementById('mynetwork'); | ||
|
||
<body> | ||
<div id = "mynetwork"></div> | ||
|
||
|
||
var DOTstring = "digraph { a [label=12, entity_id=12, entity_class=\"truck\"]; b [label=7, entity_id=7,entity_class=\"bike\"]; c [label=3, entity_id=3, entity_class=\"car\"]; a -> b[label=\"solid edge\"]; a -> b [label=\"dashed edge\", style=dashed]; a -> c [label=\"dashed edge\", style=dashed]; a -> c [label=\"dotted edge\", style=dotted]; }"; | ||
var parsedData = vis.network.convertDot(DOTstring); | ||
|
||
<script type="text/javascript"> | ||
data = { | ||
nodes: parsedData.nodes, | ||
edges: parsedData.edges | ||
} | ||
|
||
// initialize global variables. | ||
var edges; | ||
var nodes; | ||
var network; | ||
var container; | ||
var options, data; | ||
var options = parsedData.options; | ||
options.nodes = { | ||
shape: "dot" | ||
} | ||
|
||
|
||
// This method is responsible for drawing the graph, returns the drawn network | ||
function drawGraph() { | ||
var container = document.getElementById('mynetwork'); | ||
|
||
|
||
|
||
|
||
var DOTstring = "digraph { a [label=12, entity_id=12, entity_class=\"truck\"]; b [label=7, entity_id=7,entity_class=\"bike\"]; c [label=3, entity_id=3, entity_class=\"car\"]; a -> b[label=\"solid edge\"]; a -> b [label=\"dashed edge\", style=dashed]; a -> c [label=\"dashed edge\", style=dashed]; a -> c [label=\"dotted edge\", style=dotted]; }"; | ||
data = vis.network.dotparser.DOTToGraph(DOTstring); | ||
|
||
var options = data.options; | ||
options = Object.assign(options, { | ||
nodes: { | ||
shape: "dot" | ||
}, | ||
}); | ||
|
||
options = Object.assign(options, {"physics": {"enabled": true, "barnesHut": {"theta": 0.5, "gravitationalConstant": -2000, "centralGravity": 0.3, "springLength": 200, "springConstant": 0.04, "damping": 0.09, "avoidOverlap": 0}, "maxVelocity": 50, "minVelocity": 0.1, "solver": "barnesHut", "stabilization": {"enabled": true, "iterations": 1000, "updateInterval": 100, "onlyDynamicEdges": false, "fit": true}}}) | ||
|
||
|
||
|
||
|
||
|
||
|
||
network = new vis.Network(container, data, options); | ||
|
||
network = new vis.Network(container, data, options); | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
return network; | ||
|
||
} | ||
|
||
drawGraph(); | ||
return network; | ||
|
||
</script> | ||
</body> | ||
} | ||
drawGraph(); | ||
</script> | ||
</body> | ||
</html> |
Oops, something went wrong.