Spaces:
Sleeping
Sleeping
| <html> | |
| <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/bootstrap@5.0.0-beta3/dist/css/bootstrap.min.css" | |
| rel="stylesheet" | |
| integrity="sha384-eOJMYsd53ii+scO/bJGFsiCZc+5NDVN2yr8+0RDqr0Ql0h+rP48ckxlpbzKgwra6" | |
| crossorigin="anonymous" | |
| /> | |
| <script | |
| src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta3/dist/js/bootstrap.bundle.min.js" | |
| integrity="sha384-JEW9xMcG8R+pH31jmWH6WWP0WintQrMb4s7ZOdauHnUtxwoG2vI5DkLtS3qm9Ekf" | |
| crossorigin="anonymous" | |
| ></script> | |
| <center> | |
| <h1></h1> | |
| </center> | |
| <style type="text/css"> | |
| #mynetwork { | |
| width: 1500px; | |
| height: 1000px; | |
| background-color: #222222; | |
| border: 1px solid lightgray; | |
| position: relative; | |
| float: left; | |
| } | |
| #config { | |
| float: left; | |
| width: 400px; | |
| height: 600px; | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <div class="card" style="width: 100%"> | |
| <div id="mynetwork" class="card-body"></div> | |
| </div> | |
| <div id="config"></div> | |
| <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 : [] | |
| }; | |
| // 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([{"font": {"color": "white"}, "group": 4, "id": "Dudley", "label": "Dudley", "shape": "dot", "size": 4}, {"font": {"color": "white"}, "group": 4, "id": "Harry", "label": "Harry", "shape": "dot", "size": 48}, {"font": {"color": "white"}, "group": 4, "id": "Marge", "label": "Marge", "shape": "dot", "size": 3}, {"font": {"color": "white"}, "group": 4, "id": "Petunia", "label": "Petunia", "shape": "dot", "size": 4}, {"font": {"color": "white"}, "group": 4, "id": "Vernon", "label": "Vernon", "shape": "dot", "size": 3}, {"font": {"color": "white"}, "group": 1, "id": "Snape", "label": "Snape", "shape": "dot", "size": 16}, {"font": {"color": "white"}, "group": 2, "id": "Ron", "label": "Ron", "shape": "dot", "size": 27}, {"font": {"color": "white"}, "group": 0, "id": "Hermione", "label": "Hermione", "shape": "dot", "size": 20}, {"font": {"color": "white"}, "group": 4, "id": "Hedwig", "label": "Hedwig", "shape": "dot", "size": 6}, {"font": {"color": "white"}, "group": 5, "id": "Lily", "label": "Lily", "shape": "dot", "size": 3}, {"font": {"color": "white"}, "group": 5, "id": "Voldemort", "label": "Voldemort", "shape": "dot", "size": 9}, {"font": {"color": "white"}, "group": 4, "id": "Errol", "label": "Errol", "shape": "dot", "size": 4}, {"font": {"color": "white"}, "group": 2, "id": "Bill", "label": "Bill", "shape": "dot", "size": 3}, {"font": {"color": "white"}, "group": 2, "id": "Ginny", "label": "Ginny", "shape": "dot", "size": 5}, {"font": {"color": "white"}, "group": 0, "id": "Hagrid", "label": "Hagrid", "shape": "dot", "size": 14}, {"font": {"color": "white"}, "group": 4, "id": "Stan", "label": "Stan", "shape": "dot", "size": 4}, {"font": {"color": "white"}, "group": 4, "id": "Ernie", "label": "Ernie", "shape": "dot", "size": 2}, {"font": {"color": "white"}, "group": 1, "id": "Neville", "label": "Neville", "shape": "dot", "size": 11}, {"font": {"color": "white"}, "group": 2, "id": "Scabbers", "label": "Scabbers", "shape": "dot", "size": 8}, {"font": {"color": "white"}, "group": 2, "id": "Percy", "label": "Percy", "shape": "dot", "size": 9}, {"font": {"color": "white"}, "group": 3, "id": "Fred", "label": "Fred", "shape": "dot", "size": 14}, {"font": {"color": "white"}, "group": 4, "id": "Molly", "label": "Molly", "shape": "dot", "size": 1}, {"font": {"color": "white"}, "group": 4, "id": "Arthur", "label": "Arthur", "shape": "dot", "size": 1}, {"font": {"color": "white"}, "group": 0, "id": "Dumbledore", "label": "Dumbledore", "shape": "dot", "size": 16}, {"font": {"color": "white"}, "group": 3, "id": "Malfoy", "label": "Malfoy", "shape": "dot", "size": 19}, {"font": {"color": "white"}, "group": 0, "id": "Fang", "label": "Fang", "shape": "dot", "size": 4}, {"font": {"color": "white"}, "group": 1, "id": "Goyle", "label": "Goyle", "shape": "dot", "size": 10}, {"font": {"color": "white"}, "group": 2, "id": "Lavender", "label": "Lavender", "shape": "dot", "size": 5}, {"font": {"color": "white"}, "group": 1, "id": "Parvati", "label": "Parvati", "shape": "dot", "size": 6}, {"font": {"color": "white"}, "group": 0, "id": "Buckbeak", "label": "Buckbeak", "shape": "dot", "size": 11}, {"font": {"color": "white"}, "group": 1, "id": "Pansy", "label": "Pansy", "shape": "dot", "size": 5}, {"font": {"color": "white"}, "group": 2, "id": "Seamus", "label": "Seamus", "shape": "dot", "size": 4}, {"font": {"color": "white"}, "group": 3, "id": "Angelina", "label": "Angelina", "shape": "dot", "size": 6}, {"font": {"color": "white"}, "group": 4, "id": "Colin", "label": "Colin", "shape": "dot", "size": 1}, {"font": {"color": "white"}, "group": 3, "id": "Oliver", "label": "Oliver", "shape": "dot", "size": 2}, {"font": {"color": "white"}, "group": 3, "id": "Alicia", "label": "Alicia", "shape": "dot", "size": 6}, {"font": {"color": "white"}, "group": 2, "id": "Madam", "label": "Madam", "shape": "dot", "size": 2}, {"font": {"color": "white"}, "group": 5, "id": "James", "label": "James", "shape": "dot", "size": 11}, {"font": {"color": "white"}, "group": 2, "id": "Crookshanks", "label": "Crookshanks", "shape": "dot", "size": 7}, {"font": {"color": "white"}, "group": 3, "id": "Katie", "label": "Katie", "shape": "dot", "size": 6}, {"font": {"color": "white"}, "group": 3, "id": "Cho", "label": "Cho", "shape": "dot", "size": 3}, {"font": {"color": "white"}, "group": 2, "id": "Dean", "label": "Dean", "shape": "dot", "size": 4}, {"font": {"color": "white"}, "group": 3, "id": "Lee", "label": "Lee", "shape": "dot", "size": 4}, {"font": {"color": "white"}, "group": 0, "id": "Sirius", "label": "Sirius", "shape": "dot", "size": 11}, {"font": {"color": "white"}, "group": 5, "id": "Peter", "label": "Peter", "shape": "dot", "size": 9}, {"font": {"color": "white"}, "group": 5, "id": "Remus", "label": "Remus", "shape": "dot", "size": 4}, {"font": {"color": "white"}, "group": 0, "id": "Poppy", "label": "Poppy", "shape": "dot", "size": 2}, {"font": {"color": "white"}, "group": 0, "id": "Peeves", "label": "Peeves", "shape": "dot", "size": 3}, {"font": {"color": "white"}, "group": 0, "id": "Penelope", "label": "Penelope", "shape": "dot", "size": 4}, {"font": {"color": "white"}, "group": 1, "id": "Trevor", "label": "Trevor", "shape": "dot", "size": 2}, {"font": {"color": "white"}, "group": 0, "id": "Norbert", "label": "Norbert", "shape": "dot", "size": 1}, {"font": {"color": "white"}, "group": 0, "id": "Minerva", "label": "Minerva", "shape": "dot", "size": 1}]); | |
| edges = new vis.DataSet([{"from": "Dudley", "to": "Harry", "value": 164, "width": 1}, {"from": "Dudley", "to": "Marge", "value": 4, "width": 1}, {"from": "Dudley", "to": "Petunia", "value": 7, "width": 1}, {"from": "Dudley", "to": "Vernon", "value": 4, "width": 1}, {"from": "Harry", "to": "Snape", "value": 658, "width": 1}, {"from": "Harry", "to": "Ron", "value": 2806, "width": 1}, {"from": "Harry", "to": "Hermione", "value": 703, "width": 1}, {"from": "Harry", "to": "Hedwig", "value": 121, "width": 1}, {"from": "Harry", "to": "Lily", "value": 9, "width": 1}, {"from": "Harry", "to": "Voldemort", "value": 148, "width": 1}, {"from": "Harry", "to": "Errol", "value": 54, "width": 1}, {"from": "Harry", "to": "Bill", "value": 20, "width": 1}, {"from": "Harry", "to": "Ginny", "value": 15, "width": 1}, {"from": "Harry", "to": "Hagrid", "value": 497, "width": 1}, {"from": "Harry", "to": "Petunia", "value": 56, "width": 1}, {"from": "Harry", "to": "Marge", "value": 64, "width": 1}, {"from": "Harry", "to": "Vernon", "value": 9, "width": 1}, {"from": "Harry", "to": "Stan", "value": 298, "width": 1}, {"from": "Harry", "to": "Ernie", "value": 24, "width": 1}, {"from": "Harry", "to": "Neville", "value": 167, "width": 1}, {"from": "Harry", "to": "Scabbers", "value": 119, "width": 1}, {"from": "Harry", "to": "Percy", "value": 152, "width": 1}, {"from": "Harry", "to": "Fred", "value": 263, "width": 1}, {"from": "Harry", "to": "Molly", "value": 14, "width": 1}, {"from": "Harry", "to": "Arthur", "value": 9, "width": 1}, {"from": "Harry", "to": "Dumbledore", "value": 278, "width": 1}, {"from": "Harry", "to": "Malfoy", "value": 438, "width": 1}, {"from": "Harry", "to": "Fang", "value": 9, "width": 1}, {"from": "Harry", "to": "Goyle", "value": 75, "width": 1}, {"from": "Harry", "to": "Lavender", "value": 5, "width": 1}, {"from": "Harry", "to": "Parvati", "value": 42, "width": 1}, {"from": "Harry", "to": "Buckbeak", "value": 255, "width": 1}, {"from": "Harry", "to": "Pansy", "value": 11, "width": 1}, {"from": "Harry", "to": "Seamus", "value": 15, "width": 1}, {"from": "Harry", "to": "Angelina", "value": 22, "width": 1}, {"from": "Harry", "to": "Colin", "value": 10, "width": 1}, {"from": "Harry", "to": "Oliver", "value": 10, "width": 1}, {"from": "Harry", "to": "Alicia", "value": 27, "width": 1}, {"from": "Harry", "to": "Madam", "value": 3, "width": 1}, {"from": "Harry", "to": "James", "value": 53, "width": 1}, {"from": "Harry", "to": "Crookshanks", "value": 12, "width": 1}, {"from": "Harry", "to": "Katie", "value": 31, "width": 1}, {"from": "Harry", "to": "Cho", "value": 69, "width": 1}, {"from": "Harry", "to": "Dean", "value": 4, "width": 1}, {"from": "Harry", "to": "Lee", "value": 20, "width": 1}, {"from": "Harry", "to": "Sirius", "value": 21, "width": 1}, {"from": "Harry", "to": "Peter", "value": 45, "width": 1}, {"from": "Harry", "to": "Remus", "value": 8, "width": 1}, {"from": "Harry", "to": "Poppy", "value": 3, "width": 1}, {"from": "Harry", "to": "Peeves", "value": 5, "width": 1}, {"from": "Harry", "to": "Penelope", "value": 5, "width": 1}, {"from": "Snape", "to": "Pansy", "value": 5, "width": 1}, {"from": "Snape", "to": "Ron", "value": 161, "width": 1}, {"from": "Snape", "to": "Malfoy", "value": 53, "width": 1}, {"from": "Snape", "to": "Neville", "value": 91, "width": 1}, {"from": "Snape", "to": "Goyle", "value": 6, "width": 1}, {"from": "Snape", "to": "Trevor", "value": 15, "width": 1}, {"from": "Snape", "to": "Parvati", "value": 13, "width": 1}, {"from": "Snape", "to": "Dumbledore", "value": 105, "width": 1}, {"from": "Snape", "to": "Percy", "value": 12, "width": 1}, {"from": "Snape", "to": "Hermione", "value": 50, "width": 1}, {"from": "Snape", "to": "Voldemort", "value": 5, "width": 1}, {"from": "Snape", "to": "Scabbers", "value": 24, "width": 1}, {"from": "Snape", "to": "James", "value": 5, "width": 1}, {"from": "Snape", "to": "Sirius", "value": 4, "width": 1}, {"from": "Snape", "to": "Buckbeak", "value": 1, "width": 1}, {"from": "Ron", "to": "Hermione", "value": 671, "width": 1}, {"from": "Ron", "to": "Scabbers", "value": 280, "width": 1}, {"from": "Ron", "to": "Percy", "value": 112, "width": 1}, {"from": "Ron", "to": "Hagrid", "value": 187, "width": 1}, {"from": "Ron", "to": "Hedwig", "value": 33, "width": 1}, {"from": "Ron", "to": "Errol", "value": 11, "width": 1}, {"from": "Ron", "to": "Fred", "value": 32, "width": 1}, {"from": "Ron", "to": "Ginny", "value": 15, "width": 1}, {"from": "Ron", "to": "Goyle", "value": 47, "width": 1}, {"from": "Ron", "to": "Malfoy", "value": 189, "width": 1}, {"from": "Ron", "to": "Neville", "value": 38, "width": 1}, {"from": "Ron", "to": "Dumbledore", "value": 43, "width": 1}, {"from": "Ron", "to": "Parvati", "value": 17, "width": 1}, {"from": "Ron", "to": "Dean", "value": 3, "width": 1}, {"from": "Ron", "to": "Lavender", "value": 14, "width": 1}, {"from": "Ron", "to": "Madam", "value": 6, "width": 1}, {"from": "Ron", "to": "Voldemort", "value": 22, "width": 1}, {"from": "Ron", "to": "Buckbeak", "value": 35, "width": 1}, {"from": "Ron", "to": "Crookshanks", "value": 68, "width": 1}, {"from": "Ron", "to": "Seamus", "value": 16, "width": 1}, {"from": "Ron", "to": "Bill", "value": 6, "width": 1}, {"from": "Ron", "to": "Remus", "value": 8, "width": 1}, {"from": "Ron", "to": "Sirius", "value": 10, "width": 1}, {"from": "Ron", "to": "Peter", "value": 10, "width": 1}, {"from": "Ron", "to": "James", "value": 1, "width": 1}, {"from": "Hermione", "to": "Scabbers", "value": 21, "width": 1}, {"from": "Hermione", "to": "Fred", "value": 11, "width": 1}, {"from": "Hermione", "to": "Errol", "value": 10, "width": 1}, {"from": "Hermione", "to": "Neville", "value": 34, "width": 1}, {"from": "Hermione", "to": "Hagrid", "value": 123, "width": 1}, {"from": "Hermione", "to": "Malfoy", "value": 17, "width": 1}, {"from": "Hermione", "to": "Parvati", "value": 27, "width": 1}, {"from": "Hermione", "to": "Lavender", "value": 11, "width": 1}, {"from": "Hermione", "to": "Dumbledore", "value": 16, "width": 1}, {"from": "Hermione", "to": "Percy", "value": 6, "width": 1}, {"from": "Hermione", "to": "Voldemort", "value": 6, "width": 1}, {"from": "Hermione", "to": "Crookshanks", "value": 9, "width": 1}, {"from": "Hermione", "to": "Buckbeak", "value": 33, "width": 1}, {"from": "Hermione", "to": "Peter", "value": 3, "width": 1}, {"from": "Hermione", "to": "James", "value": 4, "width": 1}, {"from": "Hermione", "to": "Fang", "value": 6, "width": 1}, {"from": "Hermione", "to": "Sirius", "value": 5, "width": 1}, {"from": "Hedwig", "to": "Errol", "value": 15, "width": 1}, {"from": "Hedwig", "to": "Fred", "value": 4, "width": 1}, {"from": "Hedwig", "to": "Stan", "value": 19, "width": 1}, {"from": "Hedwig", "to": "Neville", "value": 6, "width": 1}, {"from": "Lily", "to": "Voldemort", "value": 5, "width": 1}, {"from": "Lily", "to": "James", "value": 18, "width": 1}, {"from": "Voldemort", "to": "Dumbledore", "value": 20, "width": 1}, {"from": "Voldemort", "to": "Malfoy", "value": 4, "width": 1}, {"from": "Voldemort", "to": "Peter", "value": 13, "width": 1}, {"from": "Voldemort", "to": "James", "value": 3, "width": 1}, {"from": "Bill", "to": "Fred", "value": 5, "width": 1}, {"from": "Scabbers", "to": "Ginny", "value": 6, "width": 1}, {"from": "Scabbers", "to": "Percy", "value": 13, "width": 1}, {"from": "Scabbers", "to": "Crookshanks", "value": 18, "width": 1}, {"from": "Scabbers", "to": "Peter", "value": 8, "width": 1}, {"from": "Ginny", "to": "Percy", "value": 6, "width": 1}, {"from": "Ginny", "to": "Dumbledore", "value": 8, "width": 1}, {"from": "Fred", "to": "Percy", "value": 61, "width": 1}, {"from": "Fred", "to": "Malfoy", "value": 24, "width": 1}, {"from": "Fred", "to": "Oliver", "value": 16, "width": 1}, {"from": "Fred", "to": "Angelina", "value": 20, "width": 1}, {"from": "Fred", "to": "Katie", "value": 9, "width": 1}, {"from": "Fred", "to": "Alicia", "value": 11, "width": 1}, {"from": "Fred", "to": "Hagrid", "value": 5, "width": 1}, {"from": "Fred", "to": "Goyle", "value": 5, "width": 1}, {"from": "Fred", "to": "Crookshanks", "value": 4, "width": 1}, {"from": "Percy", "to": "Dumbledore", "value": 49, "width": 1}, {"from": "Percy", "to": "Penelope", "value": 4, "width": 1}, {"from": "Hagrid", "to": "Dumbledore", "value": 58, "width": 1}, {"from": "Hagrid", "to": "Malfoy", "value": 60, "width": 1}, {"from": "Hagrid", "to": "Goyle", "value": 16, "width": 1}, {"from": "Hagrid", "to": "Buckbeak", "value": 108, "width": 1}, {"from": "Hagrid", "to": "Pansy", "value": 5, "width": 1}, {"from": "Hagrid", "to": "Fang", "value": 18, "width": 1}, {"from": "Hagrid", "to": "Norbert", "value": 6, "width": 1}, {"from": "Hagrid", "to": "Penelope", "value": 5, "width": 1}, {"from": "Hagrid", "to": "James", "value": 7, "width": 1}, {"from": "Hagrid", "to": "Sirius", "value": 5, "width": 1}, {"from": "Petunia", "to": "Marge", "value": 10, "width": 1}, {"from": "Petunia", "to": "Vernon", "value": 6, "width": 1}, {"from": "Stan", "to": "Ernie", "value": 25, "width": 1}, {"from": "Stan", "to": "Neville", "value": 11, "width": 1}, {"from": "Neville", "to": "Parvati", "value": 1, "width": 1}, {"from": "Neville", "to": "Malfoy", "value": 4, "width": 1}, {"from": "Neville", "to": "Goyle", "value": 6, "width": 1}, {"from": "Neville", "to": "Trevor", "value": 5, "width": 1}, {"from": "Neville", "to": "Buckbeak", "value": 2, "width": 1}, {"from": "Dumbledore", "to": "Malfoy", "value": 9, "width": 1}, {"from": "Dumbledore", "to": "Peeves", "value": 11, "width": 1}, {"from": "Dumbledore", "to": "Sirius", "value": 12, "width": 1}, {"from": "Dumbledore", "to": "James", "value": 9, "width": 1}, {"from": "Dumbledore", "to": "Buckbeak", "value": 16, "width": 1}, {"from": "Dumbledore", "to": "Minerva", "value": 6, "width": 1}, {"from": "Dumbledore", "to": "Goyle", "value": 1, "width": 1}, {"from": "Dumbledore", "to": "Poppy", "value": 6, "width": 1}, {"from": "Goyle", "to": "Malfoy", "value": 67, "width": 1}, {"from": "Goyle", "to": "Buckbeak", "value": 6, "width": 1}, {"from": "Goyle", "to": "Pansy", "value": 4, "width": 1}, {"from": "Malfoy", "to": "Crookshanks", "value": 8, "width": 1}, {"from": "Malfoy", "to": "Buckbeak", "value": 33, "width": 1}, {"from": "Malfoy", "to": "Pansy", "value": 5, "width": 1}, {"from": "Malfoy", "to": "Seamus", "value": 5, "width": 1}, {"from": "Malfoy", "to": "Cho", "value": 3, "width": 1}, {"from": "Malfoy", "to": "Lee", "value": 10, "width": 1}, {"from": "Malfoy", "to": "Alicia", "value": 14, "width": 1}, {"from": "Malfoy", "to": "Katie", "value": 4, "width": 1}, {"from": "Malfoy", "to": "Angelina", "value": 7, "width": 1}, {"from": "Crookshanks", "to": "Peter", "value": 4, "width": 1}, {"from": "Parvati", "to": "Lavender", "value": 12, "width": 1}, {"from": "Fang", "to": "Buckbeak", "value": 5, "width": 1}, {"from": "Lavender", "to": "Dean", "value": 5, "width": 1}, {"from": "Buckbeak", "to": "Sirius", "value": 12, "width": 1}, {"from": "Seamus", "to": "Dean", "value": 5, "width": 1}, {"from": "Angelina", "to": "Alicia", "value": 31, "width": 1}, {"from": "Angelina", "to": "Katie", "value": 15, "width": 1}, {"from": "Angelina", "to": "Lee", "value": 3, "width": 1}, {"from": "Peeves", "to": "Sirius", "value": 8, "width": 1}, {"from": "Sirius", "to": "Peter", "value": 3, "width": 1}, {"from": "Sirius", "to": "James", "value": 6, "width": 1}, {"from": "Sirius", "to": "Penelope", "value": 5, "width": 1}, {"from": "Alicia", "to": "Katie", "value": 22, "width": 1}, {"from": "Alicia", "to": "Lee", "value": 5, "width": 1}, {"from": "Katie", "to": "Cho", "value": 5, "width": 1}, {"from": "James", "to": "Peter", "value": 23, "width": 1}, {"from": "James", "to": "Remus", "value": 5, "width": 1}, {"from": "Peter", "to": "Remus", "value": 7, "width": 1}]); | |
| nodeColors = {}; | |
| allNodes = nodes.get({ returnType: "Object" }); | |
| for (nodeId in allNodes) { | |
| nodeColors[nodeId] = allNodes[nodeId].color; | |
| } | |
| allEdges = edges.get({ returnType: "Object" }); | |
| // 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": true, | |
| "type": "dynamic" | |
| } | |
| }, | |
| "interaction": { | |
| "dragNodes": true, | |
| "hideEdgesOnDrag": false, | |
| "hideNodesOnDrag": false | |
| }, | |
| "physics": { | |
| "enabled": true, | |
| "forceAtlas2Based": { | |
| "avoidOverlap": 0, | |
| "centralGravity": 0.01, | |
| "damping": 0.4, | |
| "gravitationalConstant": -50, | |
| "springConstant": 0.08, | |
| "springLength": 50 | |
| }, | |
| "solver": "forceAtlas2Based", | |
| "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> |