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": 0, "id": "Dudley", "label": "Dudley", "shape": "dot", "size": 11}, {"font": {"color": "white"}, "group": 0, "id": "Vernon", "label": "Vernon", "shape": "dot", "size": 3}, {"font": {"color": "white"}, "group": 0, "id": "Harry", "label": "Harry", "shape": "dot", "size": 74}, {"font": {"color": "white"}, "group": 2, "id": "Voldemort", "label": "Voldemort", "shape": "dot", "size": 19}, {"font": {"color": "white"}, "group": 1, "id": "Ron", "label": "Ron", "shape": "dot", "size": 54}, {"font": {"color": "white"}, "group": 0, "id": "Petunia", "label": "Petunia", "shape": "dot", "size": 4}, {"font": {"color": "white"}, "group": 0, "id": "Dumbledore", "label": "Dumbledore", "shape": "dot", "size": 41}, {"font": {"color": "white"}, "group": 2, "id": "Sirius", "label": "Sirius", "shape": "dot", "size": 23}, {"font": {"color": "white"}, "group": 0, "id": "Marge", "label": "Marge", "shape": "dot", "size": 2}, {"font": {"color": "white"}, "group": 0, "id": "Bill", "label": "Bill", "shape": "dot", "size": 9}, {"font": {"color": "white"}, "group": 3, "id": "Ginny", "label": "Ginny", "shape": "dot", "size": 23}, {"font": {"color": "white"}, "group": 4, "id": "Snape", "label": "Snape", "shape": "dot", "size": 21}, {"font": {"color": "white"}, "group": 1, "id": "Dobby", "label": "Dobby", "shape": "dot", "size": 10}, {"font": {"color": "white"}, "group": 0, "id": "Mafalda", "label": "Mafalda", "shape": "dot", "size": 1}, {"font": {"color": "white"}, "group": 2, "id": "Hedwig", "label": "Hedwig", "shape": "dot", "size": 9}, {"font": {"color": "white"}, "group": 0, "id": "Nymphadora", "label": "Nymphadora", "shape": "dot", "size": 2}, {"font": {"color": "white"}, "group": 0, "id": "Kingsley", "label": "Kingsley", "shape": "dot", "size": 10}, {"font": {"color": "white"}, "group": 4, "id": "Hermione", "label": "Hermione", "shape": "dot", "size": 37}, {"font": {"color": "white"}, "group": 3, "id": "Fred", "label": "Fred", "shape": "dot", "size": 24}, {"font": {"color": "white"}, "group": 0, "id": "Charlie", "label": "Charlie", "shape": "dot", "size": 3}, {"font": {"color": "white"}, "group": 0, "id": "Percy", "label": "Percy", "shape": "dot", "size": 8}, {"font": {"color": "white"}, "group": 1, "id": "Kreacher", "label": "Kreacher", "shape": "dot", "size": 12}, {"font": {"color": "white"}, "group": 2, "id": "Molly", "label": "Molly", "shape": "dot", "size": 9}, {"font": {"color": "white"}, "group": 1, "id": "Buckbeak", "label": "Buckbeak", "shape": "dot", "size": 4}, {"font": {"color": "white"}, "group": 2, "id": "Andromeda", "label": "Andromeda", "shape": "dot", "size": 3}, {"font": {"color": "white"}, "group": 2, "id": "Arthur", "label": "Arthur", "shape": "dot", "size": 12}, {"font": {"color": "white"}, "group": 2, "id": "Bob", "label": "Bob", "shape": "dot", "size": 2}, {"font": {"color": "white"}, "group": 3, "id": "Malfoy", "label": "Malfoy", "shape": "dot", "size": 25}, {"font": {"color": "white"}, "group": 4, "id": "Hagrid", "label": "Hagrid", "shape": "dot", "size": 27}, {"font": {"color": "white"}, "group": 2, "id": "James", "label": "James", "shape": "dot", "size": 8}, {"font": {"color": "white"}, "group": 3, "id": "Lee", "label": "Lee", "shape": "dot", "size": 11}, {"font": {"color": "white"}, "group": 2, "id": "Mundungus", "label": "Mundungus", "shape": "dot", "size": 2}, {"font": {"color": "white"}, "group": 4, "id": "Trevor", "label": "Trevor", "shape": "dot", "size": 2}, {"font": {"color": "white"}, "group": 4, "id": "Neville", "label": "Neville", "shape": "dot", "size": 24}, {"font": {"color": "white"}, "group": 2, "id": "Luna", "label": "Luna", "shape": "dot", "size": 21}, {"font": {"color": "white"}, "group": 3, "id": "Cho", "label": "Cho", "shape": "dot", "size": 18}, {"font": {"color": "white"}, "group": 4, "id": "Goyle", "label": "Goyle", "shape": "dot", "size": 9}, {"font": {"color": "white"}, "group": 4, "id": "Parvati", "label": "Parvati", "shape": "dot", "size": 12}, {"font": {"color": "white"}, "group": 4, "id": "Alice", "label": "Alice", "shape": "dot", "size": 3}, {"font": {"color": "white"}, "group": 4, "id": "Dean", "label": "Dean", "shape": "dot", "size": 8}, {"font": {"color": "white"}, "group": 4, "id": "Seamus", "label": "Seamus", "shape": "dot", "size": 9}, {"font": {"color": "white"}, "group": 3, "id": "Angelina", "label": "Angelina", "shape": "dot", "size": 15}, {"font": {"color": "white"}, "group": 3, "id": "Peeves", "label": "Peeves", "shape": "dot", "size": 10}, {"font": {"color": "white"}, "group": 0, "id": "Cedric", "label": "Cedric", "shape": "dot", "size": 2}, {"font": {"color": "white"}, "group": 4, "id": "Lavender", "label": "Lavender", "shape": "dot", "size": 3}, {"font": {"color": "white"}, "group": 3, "id": "Ernie", "label": "Ernie", "shape": "dot", "size": 9}, {"font": {"color": "white"}, "group": 1, "id": "Bloody", "label": "Bloody", "shape": "dot", "size": 3}, {"font": {"color": "white"}, "group": 2, "id": "Sturgis", "label": "Sturgis", "shape": "dot", "size": 8}, {"font": {"color": "white"}, "group": 3, "id": "Alicia", "label": "Alicia", "shape": "dot", "size": 8}, {"font": {"color": "white"}, "group": 3, "id": "Katie", "label": "Katie", "shape": "dot", "size": 7}, {"font": {"color": "white"}, "group": 2, "id": "Crookshanks", "label": "Crookshanks", "shape": "dot", "size": 3}, {"font": {"color": "white"}, "group": 0, "id": "Viktor", "label": "Viktor", "shape": "dot", "size": 1}, {"font": {"color": "white"}, "group": 1, "id": "Colin", "label": "Colin", "shape": "dot", "size": 4}, {"font": {"color": "white"}, "group": 3, "id": "Zacharias", "label": "Zacharias", "shape": "dot", "size": 7}, {"font": {"color": "white"}, "group": 0, "id": "Wilhelmina", "label": "Wilhelmina", "shape": "dot", "size": 1}, {"font": {"color": "white"}, "group": 4, "id": "Pansy", "label": "Pansy", "shape": "dot", "size": 8}, {"font": {"color": "white"}, "group": 1, "id": "Anthony", "label": "Anthony", "shape": "dot", "size": 2}, {"font": {"color": "white"}, "group": 0, "id": "Marietta", "label": "Marietta", "shape": "dot", "size": 6}, {"font": {"color": "white"}, "group": 1, "id": "Fang", "label": "Fang", "shape": "dot", "size": 3}, {"font": {"color": "white"}, "group": 4, "id": "Olympe", "label": "Olympe", "shape": "dot", "size": 3}, {"font": {"color": "white"}, "group": 0, "id": "Phineas", "label": "Phineas", "shape": "dot", "size": 2}, {"font": {"color": "white"}, "group": 1, "id": "Gilderoy", "label": "Gilderoy", "shape": "dot", "size": 3}, {"font": {"color": "white"}, "group": 1, "id": "Stan", "label": "Stan", "shape": "dot", "size": 2}, {"font": {"color": "white"}, "group": 4, "id": "Frank", "label": "Frank", "shape": "dot", "size": 2}, {"font": {"color": "white"}, "group": 2, "id": "Bellatrix", "label": "Bellatrix", "shape": "dot", "size": 12}, {"font": {"color": "white"}, "group": 2, "id": "Rita", "label": "Rita", "shape": "dot", "size": 5}, {"font": {"color": "white"}, "group": 4, "id": "Firenze", "label": "Firenze", "shape": "dot", "size": 9}, {"font": {"color": "white"}, "group": 4, "id": "Bane", "label": "Bane", "shape": "dot", "size": 5}, {"font": {"color": "white"}, "group": 0, "id": "Minerva", "label": "Minerva", "shape": "dot", "size": 5}, {"font": {"color": "white"}, "group": 4, "id": "Grawp", "label": "Grawp", "shape": "dot", "size": 7}, {"font": {"color": "white"}, "group": 4, "id": "Magorian", "label": "Magorian", "shape": "dot", "size": 6}, {"font": {"color": "white"}, "group": 0, "id": "Ronan", "label": "Ronan", "shape": "dot", "size": 2}, {"font": {"color": "white"}, "group": 4, "id": "Crabbe", "label": "Crabbe", "shape": "dot", "size": 3}, {"font": {"color": "white"}, "group": 0, "id": "Fawkes", "label": "Fawkes", "shape": "dot", "size": 2}, {"font": {"color": "white"}, "group": 2, "id": "Sybill", "label": "Sybill", "shape": "dot", "size": 3}, {"font": {"color": "white"}, "group": 1, "id": "Winky", "label": "Winky", "shape": "dot", "size": 1}, {"font": {"color": "white"}, "group": 2, "id": "Aberforth", "label": "Aberforth", "shape": "dot", "size": 2}, {"font": {"color": "white"}, "group": 2, "id": "Pigwidgeon", "label": "Pigwidgeon", "shape": "dot", "size": 2}, {"font": {"color": "white"}, "group": 1, "id": "Dennis", "label": "Dennis", "shape": "dot", "size": 2}, {"font": {"color": "white"}, "group": 1, "id": "Oliver", "label": "Oliver", "shape": "dot", "size": 2}, {"font": {"color": "white"}, "group": 3, "id": "Hannah", "label": "Hannah", "shape": "dot", "size": 3}, {"font": {"color": "white"}, "group": 4, "id": "Norbert", "label": "Norbert", "shape": "dot", "size": 4}, {"font": {"color": "white"}, "group": 2, "id": "Alastor", "label": "Alastor", "shape": "dot", "size": 3}, {"font": {"color": "white"}, "group": 0, "id": "Cornelius", "label": "Cornelius", "shape": "dot", "size": 2}, {"font": {"color": "white"}, "group": 0, "id": "Lucius", "label": "Lucius", "shape": "dot", "size": 2}, {"font": {"color": "white"}, "group": 0, "id": "Remus", "label": "Remus", "shape": "dot", "size": 1}, {"font": {"color": "white"}, "group": 2, "id": "Lily", "label": "Lily", "shape": "dot", "size": 1}, {"font": {"color": "white"}, "group": 3, "id": "Justin", "label": "Justin", "shape": "dot", "size": 2}, {"font": {"color": "white"}, "group": 4, "id": "Aragog", "label": "Aragog", "shape": "dot", "size": 2}, {"font": {"color": "white"}, "group": 0, "id": "Dolores", "label": "Dolores", "shape": "dot", "size": 1}]); | |
| edges = new vis.DataSet([{"from": "Dudley", "to": "Vernon", "value": 10, "width": 1}, {"from": "Dudley", "to": "Harry", "value": 451, "width": 1}, {"from": "Dudley", "to": "Voldemort", "value": 2, "width": 1}, {"from": "Dudley", "to": "Ron", "value": 13, "width": 1}, {"from": "Dudley", "to": "Petunia", "value": 25, "width": 1}, {"from": "Dudley", "to": "Dumbledore", "value": 17, "width": 1}, {"from": "Dudley", "to": "Sirius", "value": 2, "width": 1}, {"from": "Dudley", "to": "Marge", "value": 6, "width": 1}, {"from": "Dudley", "to": "Bill", "value": 5, "width": 1}, {"from": "Dudley", "to": "Ginny", "value": 5, "width": 1}, {"from": "Dudley", "to": "Snape", "value": 10, "width": 1}, {"from": "Vernon", "to": "Harry", "value": 16, "width": 1}, {"from": "Vernon", "to": "Petunia", "value": 3, "width": 1}, {"from": "Harry", "to": "Petunia", "value": 52, "width": 1}, {"from": "Harry", "to": "Dobby", "value": 186, "width": 1}, {"from": "Harry", "to": "Voldemort", "value": 536, "width": 1}, {"from": "Harry", "to": "Ron", "value": 4169, "width": 1}, {"from": "Harry", "to": "Sirius", "value": 479, "width": 1}, {"from": "Harry", "to": "Dumbledore", "value": 1437, "width": 1}, {"from": "Harry", "to": "Mafalda", "value": 2, "width": 1}, {"from": "Harry", "to": "Marge", "value": 5, "width": 1}, {"from": "Harry", "to": "Hedwig", "value": 252, "width": 1}, {"from": "Harry", "to": "Nymphadora", "value": 3, "width": 1}, {"from": "Harry", "to": "Kingsley", "value": 96, "width": 1}, {"from": "Harry", "to": "Hermione", "value": 1211, "width": 1}, {"from": "Harry", "to": "Fred", "value": 565, "width": 1}, {"from": "Harry", "to": "Snape", "value": 1174, "width": 1}, {"from": "Harry", "to": "Ginny", "value": 278, "width": 1}, {"from": "Harry", "to": "Bill", "value": 51, "width": 1}, {"from": "Harry", "to": "Charlie", "value": 4, "width": 1}, {"from": "Harry", "to": "Percy", "value": 132, "width": 1}, {"from": "Harry", "to": "Kreacher", "value": 167, "width": 1}, {"from": "Harry", "to": "Molly", "value": 41, "width": 1}, {"from": "Harry", "to": "Buckbeak", "value": 42, "width": 1}, {"from": "Harry", "to": "Andromeda", "value": 25, "width": 1}, {"from": "Harry", "to": "Arthur", "value": 120, "width": 1}, {"from": "Harry", "to": "Bob", "value": 1, "width": 1}, {"from": "Harry", "to": "Malfoy", "value": 420, "width": 1}, {"from": "Harry", "to": "Hagrid", "value": 770, "width": 1}, {"from": "Harry", "to": "James", "value": 119, "width": 1}, {"from": "Harry", "to": "Lee", "value": 55, "width": 1}, {"from": "Harry", "to": "Mundungus", "value": 3, "width": 1}, {"from": "Harry", "to": "Trevor", "value": 33, "width": 1}, {"from": "Harry", "to": "Neville", "value": 782, "width": 1}, {"from": "Harry", "to": "Luna", "value": 335, "width": 1}, {"from": "Harry", "to": "Cho", "value": 478, "width": 1}, {"from": "Harry", "to": "Goyle", "value": 72, "width": 1}, {"from": "Harry", "to": "Parvati", "value": 64, "width": 1}, {"from": "Harry", "to": "Alice", "value": 11, "width": 1}, {"from": "Harry", "to": "Dean", "value": 108, "width": 1}, {"from": "Harry", "to": "Seamus", "value": 114, "width": 1}, {"from": "Harry", "to": "Angelina", "value": 206, "width": 1}, {"from": "Harry", "to": "Peeves", "value": 45, "width": 1}, {"from": "Harry", "to": "Cedric", "value": 4, "width": 1}, {"from": "Harry", "to": "Lavender", "value": 15, "width": 1}, {"from": "Harry", "to": "Ernie", "value": 52, "width": 1}, {"from": "Harry", "to": "Bloody", "value": 4, "width": 1}, {"from": "Harry", "to": "Sturgis", "value": 15, "width": 1}, {"from": "Harry", "to": "Alicia", "value": 33, "width": 1}, {"from": "Harry", "to": "Katie", "value": 31, "width": 1}, {"from": "Harry", "to": "Crookshanks", "value": 4, "width": 1}, {"from": "Harry", "to": "Viktor", "value": 8, "width": 1}, {"from": "Harry", "to": "Colin", "value": 6, "width": 1}, {"from": "Harry", "to": "Zacharias", "value": 7, "width": 1}, {"from": "Harry", "to": "Wilhelmina", "value": 7, "width": 1}, {"from": "Harry", "to": "Pansy", "value": 25, "width": 1}, {"from": "Harry", "to": "Anthony", "value": 5, "width": 1}, {"from": "Harry", "to": "Marietta", "value": 92, "width": 1}, {"from": "Harry", "to": "Fang", "value": 44, "width": 1}, {"from": "Harry", "to": "Olympe", "value": 4, "width": 1}, {"from": "Harry", "to": "Phineas", "value": 12, "width": 1}, {"from": "Harry", "to": "Gilderoy", "value": 16, "width": 1}, {"from": "Harry", "to": "Stan", "value": 24, "width": 1}, {"from": "Harry", "to": "Frank", "value": 6, "width": 1}, {"from": "Harry", "to": "Bellatrix", "value": 109, "width": 1}, {"from": "Harry", "to": "Rita", "value": 67, "width": 1}, {"from": "Harry", "to": "Firenze", "value": 67, "width": 1}, {"from": "Harry", "to": "Bane", "value": 50, "width": 1}, {"from": "Harry", "to": "Minerva", "value": 14, "width": 1}, {"from": "Harry", "to": "Grawp", "value": 91, "width": 1}, {"from": "Harry", "to": "Magorian", "value": 22, "width": 1}, {"from": "Harry", "to": "Ronan", "value": 8, "width": 1}, {"from": "Harry", "to": "Crabbe", "value": 9, "width": 1}, {"from": "Harry", "to": "Fawkes", "value": 11, "width": 1}, {"from": "Harry", "to": "Sybill", "value": 4, "width": 1}, {"from": "Petunia", "to": "Voldemort", "value": 5, "width": 1}, {"from": "Dobby", "to": "Hermione", "value": 8, "width": 1}, {"from": "Dobby", "to": "Hedwig", "value": 10, "width": 1}, {"from": "Dobby", "to": "Winky", "value": 17, "width": 1}, {"from": "Dobby", "to": "Dumbledore", "value": 10, "width": 1}, {"from": "Dobby", "to": "Snape", "value": 5, "width": 1}, {"from": "Dobby", "to": "Ron", "value": 15, "width": 1}, {"from": "Dobby", "to": "Kreacher", "value": 9, "width": 1}, {"from": "Dobby", "to": "Luna", "value": 5, "width": 1}, {"from": "Dobby", "to": "Malfoy", "value": 6, "width": 1}, {"from": "Voldemort", "to": "Ron", "value": 69, "width": 1}, {"from": "Voldemort", "to": "Dumbledore", "value": 299, "width": 1}, {"from": "Voldemort", "to": "Percy", "value": 20, "width": 1}, {"from": "Voldemort", "to": "Hermione", "value": 35, "width": 1}, {"from": "Voldemort", "to": "Sirius", "value": 24, "width": 1}, {"from": "Voldemort", "to": "Arthur", "value": 6, "width": 1}, {"from": "Voldemort", "to": "Aberforth", "value": 4, "width": 1}, {"from": "Voldemort", "to": "Neville", "value": 11, "width": 1}, {"from": "Voldemort", "to": "Snape", "value": 67, "width": 1}, {"from": "Voldemort", "to": "Rita", "value": 6, "width": 1}, {"from": "Voldemort", "to": "Luna", "value": 5, "width": 1}, {"from": "Voldemort", "to": "Sturgis", "value": 3, "width": 1}, {"from": "Voldemort", "to": "Bellatrix", "value": 33, "width": 1}, {"from": "Voldemort", "to": "Malfoy", "value": 11, "width": 1}, {"from": "Voldemort", "to": "Sybill", "value": 18, "width": 1}, {"from": "Voldemort", "to": "Hagrid", "value": 2, "width": 1}, {"from": "Ron", "to": "Dumbledore", "value": 242, "width": 1}, {"from": "Ron", "to": "Sirius", "value": 59, "width": 1}, {"from": "Ron", "to": "Hermione", "value": 653, "width": 1}, {"from": "Ron", "to": "Hedwig", "value": 44, "width": 1}, {"from": "Ron", "to": "Pigwidgeon", "value": 11, "width": 1}, {"from": "Ron", "to": "Fred", "value": 374, "width": 1}, {"from": "Ron", "to": "Ginny", "value": 257, "width": 1}, {"from": "Ron", "to": "Percy", "value": 89, "width": 1}, {"from": "Ron", "to": "Kreacher", "value": 25, "width": 1}, {"from": "Ron", "to": "Bill", "value": 33, "width": 1}, {"from": "Ron", "to": "Charlie", "value": 8, "width": 1}, {"from": "Ron", "to": "Arthur", "value": 14, "width": 1}, {"from": "Ron", "to": "Neville", "value": 210, "width": 1}, {"from": "Ron", "to": "Luna", "value": 103, "width": 1}, {"from": "Ron", "to": "Goyle", "value": 41, "width": 1}, {"from": "Ron", "to": "Malfoy", "value": 66, "width": 1}, {"from": "Ron", "to": "Kingsley", "value": 4, "width": 1}, {"from": "Ron", "to": "Hagrid", "value": 255, "width": 1}, {"from": "Ron", "to": "Alice", "value": 1, "width": 1}, {"from": "Ron", "to": "Bloody", "value": 2, "width": 1}, {"from": "Ron", "to": "Colin", "value": 5, "width": 1}, {"from": "Ron", "to": "Dennis", "value": 5, "width": 1}, {"from": "Ron", "to": "Seamus", "value": 62, "width": 1}, {"from": "Ron", "to": "Angelina", "value": 145, "width": 1}, {"from": "Ron", "to": "Snape", "value": 144, "width": 1}, {"from": "Ron", "to": "Cho", "value": 98, "width": 1}, {"from": "Ron", "to": "Dean", "value": 48, "width": 1}, {"from": "Ron", "to": "Peeves", "value": 27, "width": 1}, {"from": "Ron", "to": "Ernie", "value": 36, "width": 1}, {"from": "Ron", "to": "Oliver", "value": 11, "width": 1}, {"from": "Ron", "to": "Katie", "value": 19, "width": 1}, {"from": "Ron", "to": "Crookshanks", "value": 8, "width": 1}, {"from": "Ron", "to": "Lee", "value": 20, "width": 1}, {"from": "Ron", "to": "Zacharias", "value": 15, "width": 1}, {"from": "Ron", "to": "Hannah", "value": 3, "width": 1}, {"from": "Ron", "to": "Sturgis", "value": 13, "width": 1}, {"from": "Ron", "to": "Alicia", "value": 28, "width": 1}, {"from": "Ron", "to": "Anthony", "value": 4, "width": 1}, {"from": "Ron", "to": "Fang", "value": 19, "width": 1}, {"from": "Ron", "to": "Buckbeak", "value": 1, "width": 1}, {"from": "Ron", "to": "Gilderoy", "value": 6, "width": 1}, {"from": "Ron", "to": "Stan", "value": 16, "width": 1}, {"from": "Ron", "to": "Bellatrix", "value": 9, "width": 1}, {"from": "Ron", "to": "Pansy", "value": 6, "width": 1}, {"from": "Ron", "to": "Marietta", "value": 8, "width": 1}, {"from": "Ron", "to": "Parvati", "value": 21, "width": 1}, {"from": "Ron", "to": "Firenze", "value": 31, "width": 1}, {"from": "Ron", "to": "James", "value": 1, "width": 1}, {"from": "Ron", "to": "Grawp", "value": 11, "width": 1}, {"from": "Ron", "to": "Norbert", "value": 1, "width": 1}, {"from": "Sirius", "to": "Dumbledore", "value": 67, "width": 1}, {"from": "Sirius", "to": "Hedwig", "value": 6, "width": 1}, {"from": "Sirius", "to": "Fred", "value": 27, "width": 1}, {"from": "Sirius", "to": "Molly", "value": 10, "width": 1}, {"from": "Sirius", "to": "Alastor", "value": 7, "width": 1}, {"from": "Sirius", "to": "Kingsley", "value": 19, "width": 1}, {"from": "Sirius", "to": "Kreacher", "value": 45, "width": 1}, {"from": "Sirius", "to": "Ginny", "value": 8, "width": 1}, {"from": "Sirius", "to": "Hermione", "value": 17, "width": 1}, {"from": "Sirius", "to": "Luna", "value": 13, "width": 1}, {"from": "Sirius", "to": "Percy", "value": 10, "width": 1}, {"from": "Sirius", "to": "Hagrid", "value": 21, "width": 1}, {"from": "Sirius", "to": "Crookshanks", "value": 6, "width": 1}, {"from": "Sirius", "to": "Arthur", "value": 1, "width": 1}, {"from": "Sirius", "to": "Snape", "value": 85, "width": 1}, {"from": "Sirius", "to": "James", "value": 21, "width": 1}, {"from": "Sirius", "to": "Lee", "value": 6, "width": 1}, {"from": "Sirius", "to": "Bellatrix", "value": 6, "width": 1}, {"from": "Sirius", "to": "Cho", "value": 6, "width": 1}, {"from": "Dumbledore", "to": "Fred", "value": 20, "width": 1}, {"from": "Dumbledore", "to": "Percy", "value": 28, "width": 1}, {"from": "Dumbledore", "to": "Kreacher", "value": 52, "width": 1}, {"from": "Dumbledore", "to": "Arthur", "value": 18, "width": 1}, {"from": "Dumbledore", "to": "Bill", "value": 14, "width": 1}, {"from": "Dumbledore", "to": "Cornelius", "value": 27, "width": 1}, {"from": "Dumbledore", "to": "Malfoy", "value": 13, "width": 1}, {"from": "Dumbledore", "to": "James", "value": 3, "width": 1}, {"from": "Dumbledore", "to": "Kingsley", "value": 36, "width": 1}, {"from": "Dumbledore", "to": "Aberforth", "value": 6, "width": 1}, {"from": "Dumbledore", "to": "Alastor", "value": 5, "width": 1}, {"from": "Dumbledore", "to": "Parvati", "value": 17, "width": 1}, {"from": "Dumbledore", "to": "Hagrid", "value": 71, "width": 1}, {"from": "Dumbledore", "to": "Cho", "value": 4, "width": 1}, {"from": "Dumbledore", "to": "Neville", "value": 29, "width": 1}, {"from": "Dumbledore", "to": "Seamus", "value": 4, "width": 1}, {"from": "Dumbledore", "to": "Hermione", "value": 56, "width": 1}, {"from": "Dumbledore", "to": "Snape", "value": 114, "width": 1}, {"from": "Dumbledore", "to": "Cedric", "value": 4, "width": 1}, {"from": "Dumbledore", "to": "Ernie", "value": 6, "width": 1}, {"from": "Dumbledore", "to": "Zacharias", "value": 4, "width": 1}, {"from": "Dumbledore", "to": "Angelina", "value": 5, "width": 1}, {"from": "Dumbledore", "to": "Peeves", "value": 2, "width": 1}, {"from": "Dumbledore", "to": "Minerva", "value": 23, "width": 1}, {"from": "Dumbledore", "to": "Fawkes", "value": 15, "width": 1}, {"from": "Dumbledore", "to": "Phineas", "value": 40, "width": 1}, {"from": "Dumbledore", "to": "Ginny", "value": 15, "width": 1}, {"from": "Dumbledore", "to": "Molly", "value": 6, "width": 1}, {"from": "Dumbledore", "to": "Sybill", "value": 7, "width": 1}, {"from": "Dumbledore", "to": "Firenze", "value": 22, "width": 1}, {"from": "Dumbledore", "to": "Lucius", "value": 4, "width": 1}, {"from": "Dumbledore", "to": "Marietta", "value": 37, "width": 1}, {"from": "Dumbledore", "to": "Dean", "value": 5, "width": 1}, {"from": "Dumbledore", "to": "Luna", "value": 3, "width": 1}, {"from": "Dumbledore", "to": "Bellatrix", "value": 6, "width": 1}, {"from": "Hermione", "to": "Hedwig", "value": 16, "width": 1}, {"from": "Hermione", "to": "Percy", "value": 3, "width": 1}, {"from": "Hermione", "to": "Rita", "value": 5, "width": 1}, {"from": "Hermione", "to": "Snape", "value": 47, "width": 1}, {"from": "Hermione", "to": "Ginny", "value": 85, "width": 1}, {"from": "Hermione", "to": "Fred", "value": 110, "width": 1}, {"from": "Hermione", "to": "Kreacher", "value": 31, "width": 1}, {"from": "Hermione", "to": "Buckbeak", "value": 8, "width": 1}, {"from": "Hermione", "to": "Luna", "value": 56, "width": 1}, {"from": "Hermione", "to": "Malfoy", "value": 36, "width": 1}, {"from": "Hermione", "to": "Hagrid", "value": 205, "width": 1}, {"from": "Hermione", "to": "Neville", "value": 142, "width": 1}, {"from": "Hermione", "to": "Lee", "value": 9, "width": 1}, {"from": "Hermione", "to": "Goyle", "value": 4, "width": 1}, {"from": "Hermione", "to": "Cho", "value": 40, "width": 1}, {"from": "Hermione", "to": "Angelina", "value": 5, "width": 1}, {"from": "Hermione", "to": "Ernie", "value": 12, "width": 1}, {"from": "Hermione", "to": "Olympe", "value": 4, "width": 1}, {"from": "Hermione", "to": "Peeves", "value": 7, "width": 1}, {"from": "Hermione", "to": "Firenze", "value": 32, "width": 1}, {"from": "Hermione", "to": "Minerva", "value": 3, "width": 1}, {"from": "Hermione", "to": "Seamus", "value": 6, "width": 1}, {"from": "Hermione", "to": "James", "value": 1, "width": 1}, {"from": "Hermione", "to": "Norbert", "value": 5, "width": 1}, {"from": "Hermione", "to": "Grawp", "value": 24, "width": 1}, {"from": "Hermione", "to": "Parvati", "value": 11, "width": 1}, {"from": "Hermione", "to": "Bane", "value": 4, "width": 1}, {"from": "Hermione", "to": "Magorian", "value": 6, "width": 1}, {"from": "Hermione", "to": "Ronan", "value": 5, "width": 1}, {"from": "Hermione", "to": "Bellatrix", "value": 5, "width": 1}, {"from": "Hermione", "to": "Arthur", "value": 4, "width": 1}, {"from": "Hedwig", "to": "Alastor", "value": 1, "width": 1}, {"from": "Hedwig", "to": "Neville", "value": 6, "width": 1}, {"from": "Hedwig", "to": "Luna", "value": 5, "width": 1}, {"from": "Hedwig", "to": "Hagrid", "value": 21, "width": 1}, {"from": "Nymphadora", "to": "Remus", "value": 9, "width": 1}, {"from": "Kingsley", "to": "Fred", "value": 1, "width": 1}, {"from": "Kingsley", "to": "Bill", "value": 4, "width": 1}, {"from": "Kingsley", "to": "Marietta", "value": 6, "width": 1}, {"from": "Kingsley", "to": "Cornelius", "value": 1, "width": 1}, {"from": "Kingsley", "to": "Minerva", "value": 3, "width": 1}, {"from": "Kingsley", "to": "Bellatrix", "value": 6, "width": 1}, {"from": "Pigwidgeon", "to": "Luna", "value": 6, "width": 1}, {"from": "Fred", "to": "Ginny", "value": 49, "width": 1}, {"from": "Fred", "to": "Bill", "value": 19, "width": 1}, {"from": "Fred", "to": "Percy", "value": 29, "width": 1}, {"from": "Fred", "to": "Molly", "value": 9, "width": 1}, {"from": "Fred", "to": "Kreacher", "value": 8, "width": 1}, {"from": "Fred", "to": "Sturgis", "value": 1, "width": 1}, {"from": "Fred", "to": "Lee", "value": 30, "width": 1}, {"from": "Fred", "to": "Neville", "value": 4, "width": 1}, {"from": "Fred", "to": "Snape", "value": 10, "width": 1}, {"from": "Fred", "to": "Alicia", "value": 18, "width": 1}, {"from": "Fred", "to": "Angelina", "value": 45, "width": 1}, {"from": "Fred", "to": "Katie", "value": 32, "width": 1}, {"from": "Fred", "to": "Zacharias", "value": 9, "width": 1}, {"from": "Fred", "to": "Cho", "value": 4, "width": 1}, {"from": "Fred", "to": "Malfoy", "value": 15, "width": 1}, {"from": "Fred", "to": "Arthur", "value": 16, "width": 1}, {"from": "Fred", "to": "Luna", "value": 12, "width": 1}, {"from": "Fred", "to": "Peeves", "value": 13, "width": 1}, {"from": "Ginny", "to": "Snape", "value": 1, "width": 1}, {"from": "Ginny", "to": "Molly", "value": 7, "width": 1}, {"from": "Ginny", "to": "Arthur", "value": 12, "width": 1}, {"from": "Ginny", "to": "Luna", "value": 105, "width": 1}, {"from": "Ginny", "to": "Neville", "value": 104, "width": 1}, {"from": "Ginny", "to": "Hagrid", "value": 3, "width": 1}, {"from": "Ginny", "to": "Angelina", "value": 13, "width": 1}, {"from": "Ginny", "to": "Hannah", "value": 3, "width": 1}, {"from": "Ginny", "to": "Cho", "value": 4, "width": 1}, {"from": "Ginny", "to": "Alicia", "value": 3, "width": 1}, {"from": "Ginny", "to": "Kreacher", "value": 5, "width": 1}, {"from": "Ginny", "to": "Gilderoy", "value": 5, "width": 1}, {"from": "Ginny", "to": "Peeves", "value": 1, "width": 1}, {"from": "Ginny", "to": "Grawp", "value": 5, "width": 1}, {"from": "Ginny", "to": "Malfoy", "value": 6, "width": 1}, {"from": "Ginny", "to": "Bellatrix", "value": 5, "width": 1}, {"from": "Snape", "to": "Cho", "value": 36, "width": 1}, {"from": "Snape", "to": "Neville", "value": 26, "width": 1}, {"from": "Snape", "to": "Seamus", "value": 9, "width": 1}, {"from": "Snape", "to": "Pansy", "value": 3, "width": 1}, {"from": "Snape", "to": "Malfoy", "value": 42, "width": 1}, {"from": "Snape", "to": "Marietta", "value": 4, "width": 1}, {"from": "Snape", "to": "James", "value": 121, "width": 1}, {"from": "Snape", "to": "Hagrid", "value": 5, "width": 1}, {"from": "Snape", "to": "Luna", "value": 4, "width": 1}, {"from": "Snape", "to": "Kreacher", "value": 6, "width": 1}, {"from": "Snape", "to": "Crabbe", "value": 2, "width": 1}, {"from": "Bill", "to": "Charlie", "value": 14, "width": 1}, {"from": "Bill", "to": "Molly", "value": 15, "width": 1}, {"from": "Bill", "to": "Percy", "value": 6, "width": 1}, {"from": "Rita", "to": "Cho", "value": 6, "width": 1}, {"from": "Rita", "to": "Luna", "value": 9, "width": 1}, {"from": "Kreacher", "to": "Hagrid", "value": 6, "width": 1}, {"from": "Kreacher", "to": "Buckbeak", "value": 4, "width": 1}, {"from": "Kreacher", "to": "Malfoy", "value": 5, "width": 1}, {"from": "Molly", "to": "James", "value": 6, "width": 1}, {"from": "Molly", "to": "Arthur", "value": 10, "width": 1}, {"from": "Molly", "to": "Sturgis", "value": 3, "width": 1}, {"from": "James", "to": "Lily", "value": 5, "width": 1}, {"from": "Arthur", "to": "Andromeda", "value": 1, "width": 1}, {"from": "Arthur", "to": "Bob", "value": 4, "width": 1}, {"from": "Arthur", "to": "Sturgis", "value": 11, "width": 1}, {"from": "Andromeda", "to": "Bellatrix", "value": 11, "width": 1}, {"from": "Bellatrix", "to": "Neville", "value": 45, "width": 1}, {"from": "Bellatrix", "to": "Malfoy", "value": 17, "width": 1}, {"from": "Bellatrix", "to": "Luna", "value": 5, "width": 1}, {"from": "Malfoy", "to": "Goyle", "value": 36, "width": 1}, {"from": "Malfoy", "to": "Neville", "value": 46, "width": 1}, {"from": "Malfoy", "to": "Luna", "value": 9, "width": 1}, {"from": "Malfoy", "to": "Parvati", "value": 4, "width": 1}, {"from": "Malfoy", "to": "Hagrid", "value": 65, "width": 1}, {"from": "Malfoy", "to": "Angelina", "value": 16, "width": 1}, {"from": "Malfoy", "to": "Katie", "value": 16, "width": 1}, {"from": "Malfoy", "to": "Lee", "value": 5, "width": 1}, {"from": "Malfoy", "to": "Pansy", "value": 6, "width": 1}, {"from": "Malfoy", "to": "Sturgis", "value": 15, "width": 1}, {"from": "Malfoy", "to": "Lucius", "value": 4, "width": 1}, {"from": "Malfoy", "to": "Ernie", "value": 29, "width": 1}, {"from": "Malfoy", "to": "Cho", "value": 6, "width": 1}, {"from": "Malfoy", "to": "Justin", "value": 5, "width": 1}, {"from": "Hagrid", "to": "Goyle", "value": 11, "width": 1}, {"from": "Hagrid", "to": "Fang", "value": 59, "width": 1}, {"from": "Hagrid", "to": "Olympe", "value": 10, "width": 1}, {"from": "Hagrid", "to": "Lee", "value": 6, "width": 1}, {"from": "Hagrid", "to": "Parvati", "value": 31, "width": 1}, {"from": "Hagrid", "to": "Neville", "value": 12, "width": 1}, {"from": "Hagrid", "to": "Pansy", "value": 12, "width": 1}, {"from": "Hagrid", "to": "Firenze", "value": 46, "width": 1}, {"from": "Hagrid", "to": "Dean", "value": 6, "width": 1}, {"from": "Hagrid", "to": "Grawp", "value": 48, "width": 1}, {"from": "Hagrid", "to": "Norbert", "value": 3, "width": 1}, {"from": "Hagrid", "to": "Magorian", "value": 32, "width": 1}, {"from": "Hagrid", "to": "Bane", "value": 17, "width": 1}, {"from": "Hagrid", "to": "Aragog", "value": 5, "width": 1}, {"from": "Hagrid", "to": "Seamus", "value": 3, "width": 1}, {"from": "Hagrid", "to": "Luna", "value": 6, "width": 1}, {"from": "Frank", "to": "Neville", "value": 6, "width": 1}, {"from": "Neville", "to": "Luna", "value": 93, "width": 1}, {"from": "Neville", "to": "Trevor", "value": 7, "width": 1}, {"from": "Neville", "to": "Cho", "value": 15, "width": 1}, {"from": "Neville", "to": "Goyle", "value": 16, "width": 1}, {"from": "Neville", "to": "Parvati", "value": 18, "width": 1}, {"from": "Neville", "to": "Seamus", "value": 35, "width": 1}, {"from": "Neville", "to": "Dean", "value": 56, "width": 1}, {"from": "Neville", "to": "Lavender", "value": 6, "width": 1}, {"from": "Neville", "to": "Pansy", "value": 5, "width": 1}, {"from": "Neville", "to": "Alicia", "value": 4, "width": 1}, {"from": "Neville", "to": "Alice", "value": 9, "width": 1}, {"from": "Sturgis", "to": "Mundungus", "value": 5, "width": 1}, {"from": "Lee", "to": "Zacharias", "value": 1, "width": 1}, {"from": "Lee", "to": "Cho", "value": 4, "width": 1}, {"from": "Lee", "to": "Alicia", "value": 10, "width": 1}, {"from": "Lee", "to": "Angelina", "value": 20, "width": 1}, {"from": "Luna", "to": "Parvati", "value": 17, "width": 1}, {"from": "Luna", "to": "Angelina", "value": 14, "width": 1}, {"from": "Luna", "to": "Cho", "value": 5, "width": 1}, {"from": "Luna", "to": "Grawp", "value": 4, "width": 1}, {"from": "Cho", "to": "Colin", "value": 5, "width": 1}, {"from": "Cho", "to": "Angelina", "value": 8, "width": 1}, {"from": "Cho", "to": "Zacharias", "value": 5, "width": 1}, {"from": "Cho", "to": "Marietta", "value": 37, "width": 1}, {"from": "Cho", "to": "Seamus", "value": 1, "width": 1}, {"from": "Goyle", "to": "Pansy", "value": 6, "width": 1}, {"from": "Goyle", "to": "Ernie", "value": 4, "width": 1}, {"from": "Goyle", "to": "Crabbe", "value": 6, "width": 1}, {"from": "Parvati", "to": "Lavender", "value": 46, "width": 1}, {"from": "Parvati", "to": "Dean", "value": 19, "width": 1}, {"from": "Parvati", "to": "Peeves", "value": 4, "width": 1}, {"from": "Parvati", "to": "Firenze", "value": 53, "width": 1}, {"from": "Bloody", "to": "Peeves", "value": 5, "width": 1}, {"from": "Colin", "to": "Dennis", "value": 6, "width": 1}, {"from": "Dean", "to": "Seamus", "value": 65, "width": 1}, {"from": "Dean", "to": "Firenze", "value": 4, "width": 1}, {"from": "Angelina", "to": "Oliver", "value": 6, "width": 1}, {"from": "Angelina", "to": "Alicia", "value": 48, "width": 1}, {"from": "Angelina", "to": "Pansy", "value": 9, "width": 1}, {"from": "Angelina", "to": "Katie", "value": 48, "width": 1}, {"from": "Angelina", "to": "Peeves", "value": 5, "width": 1}, {"from": "Peeves", "to": "Katie", "value": 6, "width": 1}, {"from": "Ernie", "to": "Zacharias", "value": 5, "width": 1}, {"from": "Ernie", "to": "Hannah", "value": 12, "width": 1}, {"from": "Ernie", "to": "Justin", "value": 6, "width": 1}, {"from": "Alicia", "to": "Katie", "value": 41, "width": 1}, {"from": "Dolores", "to": "Minerva", "value": 4, "width": 1}, {"from": "Firenze", "to": "Bane", "value": 21, "width": 1}, {"from": "Firenze", "to": "Magorian", "value": 14, "width": 1}, {"from": "Bane", "to": "Magorian", "value": 23, "width": 1}, {"from": "Grawp", "to": "Magorian", "value": 5, "width": 1}, {"from": "Norbert", "to": "Aragog", "value": 5, "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> |