Spaces:
Runtime error
Runtime error
remove unused files
Browse files- .gitignore +1 -2
- app.py +10 -3
- pyvis/pyvis/lib/bindings/utils.js +0 -105
- pyvis/pyvis/lib/vis-9.0.4/vis-network.css +0 -0
- pyvis/pyvis/lib/vis-9.0.4/vis-network.min.js +0 -0
- pyvis/pyvis/network.py +1 -12
- pyvis/pyvis/source/conf.py +0 -308
- pyvis/pyvis/source/documentation.rst +0 -9
- pyvis/pyvis/source/gameofthrones.html +0 -97
- pyvis/pyvis/source/index.rst +0 -33
- pyvis/pyvis/source/install.rst +0 -20
- pyvis/pyvis/source/introduction.rst +0 -13
- pyvis/pyvis/source/license.rst +0 -33
- pyvis/pyvis/source/mulnodes.html +0 -80
- pyvis/pyvis/source/tutorial.rst +0 -227
- pyvis/pyvis/templates/animation_template.html +0 -144
- pyvis/pyvis/templates/template.html +106 -1
.gitignore
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
.DS_Store
|
2 |
.coverage
|
3 |
nx.html
|
4 |
-
.env
|
5 |
-
lib
|
|
|
1 |
.DS_Store
|
2 |
.coverage
|
3 |
nx.html
|
4 |
+
.env
|
|
app.py
CHANGED
@@ -39,8 +39,7 @@ def generate_graph_visualization_file(imports_graph):
|
|
39 |
|
40 |
@st.cache
|
41 |
def read_graph_visualization_file():
|
42 |
-
|
43 |
-
return imports_graph_html.read()
|
44 |
|
45 |
|
46 |
if owner and repo:
|
@@ -48,4 +47,12 @@ if owner and repo:
|
|
48 |
generate_graph_visualization_file(
|
49 |
generate_imports_graph(get_python_files(owner, repo, path))
|
50 |
)
|
51 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
|
40 |
@st.cache
|
41 |
def read_graph_visualization_file():
|
42 |
+
return open("nx.html", "r", encoding="utf-8").read()
|
|
|
43 |
|
44 |
|
45 |
if owner and repo:
|
|
|
47 |
generate_graph_visualization_file(
|
48 |
generate_imports_graph(get_python_files(owner, repo, path))
|
49 |
)
|
50 |
+
graph_visualization_file = read_graph_visualization_file()
|
51 |
+
|
52 |
+
st.download_button(
|
53 |
+
"Download the result file",
|
54 |
+
graph_visualization_file,
|
55 |
+
file_name="result.html",
|
56 |
+
mime="text/html",
|
57 |
+
)
|
58 |
+
components.html(graph_visualization_file, height=800, scrolling=True)
|
pyvis/pyvis/lib/bindings/utils.js
DELETED
@@ -1,105 +0,0 @@
|
|
1 |
-
function neighbourhoodHighlight(params) {
|
2 |
-
console.log("in nieghborhoodhighlight");
|
3 |
-
console.log(params);
|
4 |
-
allNodes = nodes.get({ returnType: "Object" });
|
5 |
-
// originalNodes = JSON.parse(JSON.stringify(allNodes));
|
6 |
-
// if something is selected:
|
7 |
-
if (params.nodes.length > 0) {
|
8 |
-
highlightActive = true;
|
9 |
-
var i, j;
|
10 |
-
var selectedNode = params.nodes[0];
|
11 |
-
var degrees = 2;
|
12 |
-
|
13 |
-
// mark all nodes as hard to read.
|
14 |
-
for (var nodeId in allNodes) {
|
15 |
-
// nodeColors[nodeId] = allNodes[nodeId].color;
|
16 |
-
allNodes[nodeId].color = "rgba(200,200,200,0.5)";
|
17 |
-
if (allNodes[nodeId].hiddenLabel === undefined) {
|
18 |
-
allNodes[nodeId].hiddenLabel = allNodes[nodeId].label;
|
19 |
-
allNodes[nodeId].label = undefined;
|
20 |
-
}
|
21 |
-
}
|
22 |
-
var connectedNodes = network.getConnectedNodes(selectedNode);
|
23 |
-
var allConnectedNodes = [];
|
24 |
-
|
25 |
-
// get the second degree nodes
|
26 |
-
for (i = 1; i < degrees; i++) {
|
27 |
-
for (j = 0; j < connectedNodes.length; j++) {
|
28 |
-
allConnectedNodes = allConnectedNodes.concat(
|
29 |
-
network.getConnectedNodes(connectedNodes[j])
|
30 |
-
);
|
31 |
-
}
|
32 |
-
}
|
33 |
-
|
34 |
-
// all second degree nodes get a different color and their label back
|
35 |
-
for (i = 0; i < allConnectedNodes.length; i++) {
|
36 |
-
// allNodes[allConnectedNodes[i]].color = "pink";
|
37 |
-
allNodes[allConnectedNodes[i]].color = "rgba(150,150,150,0.75)";
|
38 |
-
if (allNodes[allConnectedNodes[i]].hiddenLabel !== undefined) {
|
39 |
-
allNodes[allConnectedNodes[i]].label =
|
40 |
-
allNodes[allConnectedNodes[i]].hiddenLabel;
|
41 |
-
allNodes[allConnectedNodes[i]].hiddenLabel = undefined;
|
42 |
-
}
|
43 |
-
}
|
44 |
-
|
45 |
-
// all first degree nodes get their own color and their label back
|
46 |
-
for (i = 0; i < connectedNodes.length; i++) {
|
47 |
-
// allNodes[connectedNodes[i]].color = undefined;
|
48 |
-
allNodes[connectedNodes[i]].color = nodeColors[connectedNodes[i]];
|
49 |
-
if (allNodes[connectedNodes[i]].hiddenLabel !== undefined) {
|
50 |
-
allNodes[connectedNodes[i]].label =
|
51 |
-
allNodes[connectedNodes[i]].hiddenLabel;
|
52 |
-
allNodes[connectedNodes[i]].hiddenLabel = undefined;
|
53 |
-
}
|
54 |
-
}
|
55 |
-
|
56 |
-
// the main node gets its own color and its label back.
|
57 |
-
// allNodes[selectedNode].color = undefined;
|
58 |
-
allNodes[selectedNode].color = nodeColors[selectedNode];
|
59 |
-
if (allNodes[selectedNode].hiddenLabel !== undefined) {
|
60 |
-
allNodes[selectedNode].label = allNodes[selectedNode].hiddenLabel;
|
61 |
-
allNodes[selectedNode].hiddenLabel = undefined;
|
62 |
-
}
|
63 |
-
} else if (highlightActive === true) {
|
64 |
-
console.log("highlightActive was true");
|
65 |
-
// reset all nodes
|
66 |
-
for (var nodeId in allNodes) {
|
67 |
-
// allNodes[nodeId].color = "purple";
|
68 |
-
allNodes[nodeId].color = nodeColors[nodeId];
|
69 |
-
// delete allNodes[nodeId].color;
|
70 |
-
if (allNodes[nodeId].hiddenLabel !== undefined) {
|
71 |
-
allNodes[nodeId].label = allNodes[nodeId].hiddenLabel;
|
72 |
-
allNodes[nodeId].hiddenLabel = undefined;
|
73 |
-
}
|
74 |
-
}
|
75 |
-
highlightActive = false;
|
76 |
-
}
|
77 |
-
|
78 |
-
// transform the object into an array
|
79 |
-
var updateArray = [];
|
80 |
-
if (params.nodes.length > 0) {
|
81 |
-
for (nodeId in allNodes) {
|
82 |
-
if (allNodes.hasOwnProperty(nodeId)) {
|
83 |
-
// console.log(allNodes[nodeId]);
|
84 |
-
updateArray.push(allNodes[nodeId]);
|
85 |
-
}
|
86 |
-
}
|
87 |
-
nodes.update(updateArray);
|
88 |
-
} else {
|
89 |
-
console.log("Nothing was selected");
|
90 |
-
for (nodeId in allNodes) {
|
91 |
-
if (allNodes.hasOwnProperty(nodeId)) {
|
92 |
-
// console.log(allNodes[nodeId]);
|
93 |
-
// allNodes[nodeId].color = {};
|
94 |
-
updateArray.push(allNodes[nodeId]);
|
95 |
-
}
|
96 |
-
}
|
97 |
-
nodes.update(updateArray);
|
98 |
-
}
|
99 |
-
}
|
100 |
-
|
101 |
-
function selectNode(node) {
|
102 |
-
network.selectNodes([node]);
|
103 |
-
neighbourhoodHighlight({ nodes: [node] });
|
104 |
-
return node;
|
105 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pyvis/pyvis/lib/vis-9.0.4/vis-network.css
DELETED
The diff for this file is too large to render.
See raw diff
|
|
pyvis/pyvis/lib/vis-9.0.4/vis-network.min.js
DELETED
The diff for this file is too large to render.
See raw diff
|
|
pyvis/pyvis/network.py
CHANGED
@@ -1,15 +1,11 @@
|
|
1 |
import json
|
2 |
import os
|
3 |
-
import platform
|
4 |
-
import shutil
|
5 |
import tempfile
|
6 |
import webbrowser
|
7 |
from collections import defaultdict
|
8 |
-
from platform import uname
|
9 |
|
10 |
import jsonpickle
|
11 |
import networkx as nx
|
12 |
-
from IPython.core.display import HTML
|
13 |
from IPython.display import IFrame
|
14 |
from jinja2 import Template
|
15 |
|
@@ -277,7 +273,7 @@ class Network(object):
|
|
277 |
try:
|
278 |
node = int(node)
|
279 |
self.add_node(node, **nd[node])
|
280 |
-
except:
|
281 |
# or node could be string
|
282 |
assert isinstance(node, str)
|
283 |
self.add_node(node, **nd[node])
|
@@ -502,9 +498,6 @@ class Network(object):
|
|
502 |
self.html = self.generate_html(notebook=notebook)
|
503 |
|
504 |
if notebook:
|
505 |
-
if os.path.exists("lib"):
|
506 |
-
shutil.rmtree(f"lib")
|
507 |
-
shutil.copytree(f"{os.path.dirname(__file__)}/lib", "lib")
|
508 |
with open(name, "w+") as out:
|
509 |
out.write(self.html)
|
510 |
return IFrame(name, width=self.width, height="600px")
|
@@ -513,10 +506,6 @@ class Network(object):
|
|
513 |
tempdir = "."
|
514 |
else:
|
515 |
tempdir = tempfile.mkdtemp()
|
516 |
-
# with tempfile.mkdtemp() as tempdir:
|
517 |
-
if os.path.exists(f"{tempdir}/lib"):
|
518 |
-
shutil.rmtree(f"{tempdir}/lib")
|
519 |
-
shutil.copytree(f"{os.path.dirname(__file__)}/lib", f"{tempdir}/lib")
|
520 |
|
521 |
with open(f"{tempdir}/{name}", "w+") as out:
|
522 |
out.write(self.html)
|
|
|
1 |
import json
|
2 |
import os
|
|
|
|
|
3 |
import tempfile
|
4 |
import webbrowser
|
5 |
from collections import defaultdict
|
|
|
6 |
|
7 |
import jsonpickle
|
8 |
import networkx as nx
|
|
|
9 |
from IPython.display import IFrame
|
10 |
from jinja2 import Template
|
11 |
|
|
|
273 |
try:
|
274 |
node = int(node)
|
275 |
self.add_node(node, **nd[node])
|
276 |
+
except Exception:
|
277 |
# or node could be string
|
278 |
assert isinstance(node, str)
|
279 |
self.add_node(node, **nd[node])
|
|
|
498 |
self.html = self.generate_html(notebook=notebook)
|
499 |
|
500 |
if notebook:
|
|
|
|
|
|
|
501 |
with open(name, "w+") as out:
|
502 |
out.write(self.html)
|
503 |
return IFrame(name, width=self.width, height="600px")
|
|
|
506 |
tempdir = "."
|
507 |
else:
|
508 |
tempdir = tempfile.mkdtemp()
|
|
|
|
|
|
|
|
|
509 |
|
510 |
with open(f"{tempdir}/{name}", "w+") as out:
|
511 |
out.write(self.html)
|
pyvis/pyvis/source/conf.py
DELETED
@@ -1,308 +0,0 @@
|
|
1 |
-
# -*- coding: utf-8 -*-
|
2 |
-
#
|
3 |
-
# pyvis documentation build configuration file, created by
|
4 |
-
# sphinx-quickstart on Wed Nov 02 20:10:44 2016.
|
5 |
-
#
|
6 |
-
# This file is execfile()d with the current directory set to its
|
7 |
-
# containing dir.
|
8 |
-
#
|
9 |
-
# Note that not all possible configuration values are present in this
|
10 |
-
# autogenerated file.
|
11 |
-
#
|
12 |
-
# All configuration values have a default; values that are commented out
|
13 |
-
# serve to show the default.
|
14 |
-
|
15 |
-
import os
|
16 |
-
import sys
|
17 |
-
|
18 |
-
import sphinx_rtd_theme
|
19 |
-
|
20 |
-
# dynamically read the version
|
21 |
-
exec(open("../_version.py").read())
|
22 |
-
|
23 |
-
# If extensions (or modules to document with autodoc) are in another directory,
|
24 |
-
# add these directories to sys.path here. If the directory is relative to the
|
25 |
-
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
26 |
-
sys.path.insert(0, os.path.abspath("../.."))
|
27 |
-
|
28 |
-
# os.path.abspath('mydir/myfile.txt')
|
29 |
-
|
30 |
-
|
31 |
-
# -- General configuration ------------------------------------------------
|
32 |
-
|
33 |
-
# If your documentation needs a minimal Sphinx version, state it here.
|
34 |
-
# needs_sphinx = '1.0'
|
35 |
-
|
36 |
-
# Add any Sphinx extension module names here, as strings. They can be
|
37 |
-
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
38 |
-
# ones.
|
39 |
-
extensions = [
|
40 |
-
"sphinx.ext.autodoc",
|
41 |
-
"sphinx.ext.intersphinx",
|
42 |
-
"sphinx.ext.ifconfig",
|
43 |
-
"sphinx.ext.viewcode",
|
44 |
-
]
|
45 |
-
|
46 |
-
# Add any paths that contain templates here, relative to this directory.
|
47 |
-
templates_path = ["_templates"]
|
48 |
-
|
49 |
-
# The suffix(es) of source filenames.
|
50 |
-
# You can specify multiple suffix as a list of string:
|
51 |
-
# source_suffix = ['.rst', '.md']
|
52 |
-
source_suffix = ".rst"
|
53 |
-
|
54 |
-
# The encoding of source files.
|
55 |
-
# source_encoding = 'utf-8-sig'
|
56 |
-
|
57 |
-
# The master toctree document.
|
58 |
-
master_doc = "index"
|
59 |
-
|
60 |
-
# General information about the project.
|
61 |
-
project = "pyvis"
|
62 |
-
copyright = "2016-2018, West Health Institute"
|
63 |
-
author = "Giancarlo Perrone"
|
64 |
-
|
65 |
-
# The version info for the project you're documenting, acts as replacement for
|
66 |
-
# |version| and |release|, also used in various other places throughout the
|
67 |
-
# built documents.
|
68 |
-
#
|
69 |
-
# The short X.Y version.
|
70 |
-
version = __version__
|
71 |
-
# The full version, including alpha/beta/rc tags.
|
72 |
-
release = "0.1.3.1"
|
73 |
-
|
74 |
-
# The language for content autogenerated by Sphinx. Refer to documentation
|
75 |
-
# for a list of supported languages.
|
76 |
-
#
|
77 |
-
# This is also used if you do content translation via gettext catalogs.
|
78 |
-
# Usually you set "language" from the command line for these cases.
|
79 |
-
language = None
|
80 |
-
|
81 |
-
# There are two options for replacing |today|: either, you set today to some
|
82 |
-
# non-false value, then it is used:
|
83 |
-
# today = ''
|
84 |
-
# Else, today_fmt is used as the format for a strftime call.
|
85 |
-
# today_fmt = '%B %d, %Y'
|
86 |
-
|
87 |
-
# List of patterns, relative to source directory, that match files and
|
88 |
-
# directories to ignore when looking for source files.
|
89 |
-
# This patterns also effect to html_static_path and html_extra_path
|
90 |
-
exclude_patterns = []
|
91 |
-
|
92 |
-
# The reST default role (used for this markup: `text`) to use for all
|
93 |
-
# documents.
|
94 |
-
# default_role = None
|
95 |
-
|
96 |
-
# If true, '()' will be appended to :func: etc. cross-reference text.
|
97 |
-
# add_function_parentheses = True
|
98 |
-
|
99 |
-
# If true, the current module name will be prepended to all description
|
100 |
-
# unit titles (such as .. function::).
|
101 |
-
# add_module_names = True
|
102 |
-
|
103 |
-
# If true, sectionauthor and moduleauthor directives will be shown in the
|
104 |
-
# output. They are ignored by default.
|
105 |
-
# show_authors = False
|
106 |
-
|
107 |
-
# The name of the Pygments (syntax highlighting) style to use.
|
108 |
-
pygments_style = "sphinx"
|
109 |
-
|
110 |
-
# A list of ignored prefixes for module index sorting.
|
111 |
-
# modindex_common_prefix = []
|
112 |
-
|
113 |
-
# If true, keep warnings as "system message" paragraphs in the built documents.
|
114 |
-
# keep_warnings = False
|
115 |
-
|
116 |
-
# If true, `todo` and `todoList` produce output, else they produce nothing.
|
117 |
-
todo_include_todos = False
|
118 |
-
|
119 |
-
|
120 |
-
# -- Options for HTML output ----------------------------------------------
|
121 |
-
|
122 |
-
# The theme to use for HTML and HTML Help pages. See the documentation for
|
123 |
-
# a list of builtin themes.
|
124 |
-
html_theme = "sphinx_rtd_theme"
|
125 |
-
|
126 |
-
# Theme options are theme-specific and customize the look and feel of a theme
|
127 |
-
# further. For a list of options available for each theme, see the
|
128 |
-
# documentation.
|
129 |
-
# html_theme_options = {}
|
130 |
-
|
131 |
-
# Add any paths that contain custom themes here, relative to this directory.
|
132 |
-
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
|
133 |
-
|
134 |
-
# The name for this set of Sphinx documents.
|
135 |
-
# "<project> v<release> documentation" by default.
|
136 |
-
# html_title = u'pyvis v0.0.1'
|
137 |
-
|
138 |
-
# A shorter title for the navigation bar. Default is the same as html_title.
|
139 |
-
# html_short_title = None
|
140 |
-
|
141 |
-
# The name of an image file (relative to this directory) to place at the top
|
142 |
-
# of the sidebar.
|
143 |
-
# html_logo = None
|
144 |
-
|
145 |
-
# The name of an image file (relative to this directory) to use as a favicon of
|
146 |
-
# the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
|
147 |
-
# pixels large.
|
148 |
-
# html_favicon = None
|
149 |
-
|
150 |
-
# Add any paths that contain custom static files (such as style sheets) here,
|
151 |
-
# relative to this directory. They are copied after the builtin static files,
|
152 |
-
# so a file named "default.css" will overwrite the builtin "default.css".
|
153 |
-
html_static_path = ["_static"]
|
154 |
-
|
155 |
-
# Add any extra paths that contain custom files (such as robots.txt or
|
156 |
-
# .htaccess) here, relative to this directory. These files are copied
|
157 |
-
# directly to the root of the documentation.
|
158 |
-
# html_extra_path = []
|
159 |
-
|
160 |
-
# If not None, a 'Last updated on:' timestamp is inserted at every page
|
161 |
-
# bottom, using the given strftime format.
|
162 |
-
# The empty string is equivalent to '%b %d, %Y'.
|
163 |
-
# html_last_updated_fmt = None
|
164 |
-
|
165 |
-
# If true, SmartyPants will be used to convert quotes and dashes to
|
166 |
-
# typographically correct entities.
|
167 |
-
# html_use_smartypants = True
|
168 |
-
|
169 |
-
# Custom sidebar templates, maps document names to template names.
|
170 |
-
# html_sidebars = {}
|
171 |
-
|
172 |
-
# Additional templates that should be rendered to pages, maps page names to
|
173 |
-
# template names.
|
174 |
-
# html_additional_pages = {}
|
175 |
-
|
176 |
-
# If false, no module index is generated.
|
177 |
-
# html_domain_indices = True
|
178 |
-
|
179 |
-
# If false, no index is generated.
|
180 |
-
# html_use_index = True
|
181 |
-
|
182 |
-
# If true, the index is split into individual pages for each letter.
|
183 |
-
# html_split_index = False
|
184 |
-
|
185 |
-
# If true, links to the reST sources are added to the pages.
|
186 |
-
# html_show_sourcelink = True
|
187 |
-
|
188 |
-
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
|
189 |
-
# html_show_sphinx = True
|
190 |
-
|
191 |
-
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
|
192 |
-
# html_show_copyright = True
|
193 |
-
|
194 |
-
# If true, an OpenSearch description file will be output, and all pages will
|
195 |
-
# contain a <link> tag referring to it. The value of this option must be the
|
196 |
-
# base URL from which the finished HTML is served.
|
197 |
-
# html_use_opensearch = ''
|
198 |
-
|
199 |
-
# This is the file name suffix for HTML files (e.g. ".xhtml").
|
200 |
-
# html_file_suffix = None
|
201 |
-
|
202 |
-
# Language to be used for generating the HTML full-text search index.
|
203 |
-
# Sphinx supports the following languages:
|
204 |
-
# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja'
|
205 |
-
# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr', 'zh'
|
206 |
-
# html_search_language = 'en'
|
207 |
-
|
208 |
-
# A dictionary with options for the search language support, empty by default.
|
209 |
-
# 'ja' uses this config value.
|
210 |
-
# 'zh' user can custom change `jieba` dictionary path.
|
211 |
-
# html_search_options = {'type': 'default'}
|
212 |
-
|
213 |
-
# The name of a javascript file (relative to the configuration directory) that
|
214 |
-
# implements a search results scorer. If empty, the default will be used.
|
215 |
-
# html_search_scorer = 'scorer.js'
|
216 |
-
|
217 |
-
# Output file base name for HTML help builder.
|
218 |
-
htmlhelp_basename = "pyvisdoc"
|
219 |
-
|
220 |
-
# -- Options for LaTeX output ---------------------------------------------
|
221 |
-
|
222 |
-
latex_elements = {
|
223 |
-
# The paper size ('letterpaper' or 'a4paper').
|
224 |
-
#'papersize': 'letterpaper',
|
225 |
-
# The font size ('10pt', '11pt' or '12pt').
|
226 |
-
#'pointsize': '10pt',
|
227 |
-
# Additional stuff for the LaTeX preamble.
|
228 |
-
#'preamble': '',
|
229 |
-
# Latex figure (float) alignment
|
230 |
-
#'figure_align': 'htbp',
|
231 |
-
}
|
232 |
-
|
233 |
-
# Grouping the document tree into LaTeX files. List of tuples
|
234 |
-
# (source start file, target name, title,
|
235 |
-
# author, documentclass [howto, manual, or own class]).
|
236 |
-
latex_documents = [
|
237 |
-
(
|
238 |
-
master_doc,
|
239 |
-
"pyvis.tex",
|
240 |
-
"pyvis Documentation",
|
241 |
-
"Giancarlo Perrone, Shashank Soni",
|
242 |
-
"manual",
|
243 |
-
),
|
244 |
-
]
|
245 |
-
|
246 |
-
# The name of an image file (relative to this directory) to place at the top of
|
247 |
-
# the title page.
|
248 |
-
# latex_logo = None
|
249 |
-
|
250 |
-
# For "manual" documents, if this is true, then toplevel headings are parts,
|
251 |
-
# not chapters.
|
252 |
-
# latex_use_parts = False
|
253 |
-
|
254 |
-
# If true, show page references after internal links.
|
255 |
-
# latex_show_pagerefs = False
|
256 |
-
|
257 |
-
# If true, show URL addresses after external links.
|
258 |
-
# latex_show_urls = False
|
259 |
-
|
260 |
-
# Documents to append as an appendix to all manuals.
|
261 |
-
# latex_appendices = []
|
262 |
-
|
263 |
-
# If false, no module index is generated.
|
264 |
-
# latex_domain_indices = True
|
265 |
-
|
266 |
-
|
267 |
-
# -- Options for manual page output ---------------------------------------
|
268 |
-
|
269 |
-
# One entry per manual page. List of tuples
|
270 |
-
# (source start file, name, description, authors, manual section).
|
271 |
-
man_pages = [(master_doc, "pyvis", "pyvis Documentation", [author], 1)]
|
272 |
-
|
273 |
-
# If true, show URL addresses after external links.
|
274 |
-
# man_show_urls = False
|
275 |
-
|
276 |
-
|
277 |
-
# -- Options for Texinfo output -------------------------------------------
|
278 |
-
|
279 |
-
# Grouping the document tree into Texinfo files. List of tuples
|
280 |
-
# (source start file, target name, title, author,
|
281 |
-
# dir menu entry, description, category)
|
282 |
-
texinfo_documents = [
|
283 |
-
(
|
284 |
-
master_doc,
|
285 |
-
"pyvis",
|
286 |
-
"pyvis Documentation",
|
287 |
-
author,
|
288 |
-
"pyvis",
|
289 |
-
"One line description of project.",
|
290 |
-
"Miscellaneous",
|
291 |
-
),
|
292 |
-
]
|
293 |
-
|
294 |
-
# Documents to append as an appendix to all manuals.
|
295 |
-
# texinfo_appendices = []
|
296 |
-
|
297 |
-
# If false, no module index is generated.
|
298 |
-
# texinfo_domain_indices = True
|
299 |
-
|
300 |
-
# How to display URL addresses: 'footnote', 'no', or 'inline'.
|
301 |
-
# texinfo_show_urls = 'footnote'
|
302 |
-
|
303 |
-
# If true, do not generate a @detailmenu in the "Top" node's menu.
|
304 |
-
# texinfo_no_detailmenu = False
|
305 |
-
|
306 |
-
|
307 |
-
# Example configuration for intersphinx: refer to the Python standard library.
|
308 |
-
intersphinx_mapping = {"https://docs.python.org/": None}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pyvis/pyvis/source/documentation.rst
DELETED
@@ -1,9 +0,0 @@
|
|
1 |
-
=============
|
2 |
-
Documentation
|
3 |
-
=============
|
4 |
-
|
5 |
-
.. automodule:: pyvis.network
|
6 |
-
:members:
|
7 |
-
|
8 |
-
.. automodule:: pyvis.options
|
9 |
-
:members:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pyvis/pyvis/source/gameofthrones.html
DELETED
@@ -1,97 +0,0 @@
|
|
1 |
-
<html>
|
2 |
-
<head>
|
3 |
-
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/vis/4.16.1/vis.css" type="text/css" />
|
4 |
-
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/vis/4.16.1/vis-network.min.js"> </script>
|
5 |
-
|
6 |
-
<!-- <link rel="stylesheet" href="../node_modules/vis/dist/vis.min.css" type="text/css" />
|
7 |
-
<script type="text/javascript" src="../node_modules/vis/dist/vis.js"> </script>-->
|
8 |
-
|
9 |
-
<style type="text/css">
|
10 |
-
|
11 |
-
#mynetwork3 {
|
12 |
-
width: 100%;
|
13 |
-
height: 750px;
|
14 |
-
background-color: #222222;
|
15 |
-
border: 1px solid lightgray;
|
16 |
-
}
|
17 |
-
</style>
|
18 |
-
|
19 |
-
</head>
|
20 |
-
|
21 |
-
<body>
|
22 |
-
<div id = "mynetwork3"></div>
|
23 |
-
<script type="text/javascript">
|
24 |
-
|
25 |
-
// initialize global variables.
|
26 |
-
var edges;
|
27 |
-
var nodes;
|
28 |
-
var network;
|
29 |
-
var container;
|
30 |
-
var options, data;
|
31 |
-
|
32 |
-
|
33 |
-
// This method is responsible for drawing the graph, returns the drawn network
|
34 |
-
function drawGraph() {
|
35 |
-
var container = document.getElementById('mynetwork3');
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
// parsing and collecting nodes and edges from the python
|
40 |
-
nodes = [{'title': 'Aemon Neighbors:<br>Grenn<br>Samwell<br>Robert<br>Jon<br>Stannis', 'value': 5, 'label': 'Aemon', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Aemon'}, {'title': 'Grenn Neighbors:<br>Samwell<br>Aemon<br>Jon<br>Eddison', 'value': 4, 'label': 'Grenn', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Grenn'}, {'title': 'Samwell Neighbors:<br>Jojen<br>Craster<br>Mance<br>Stannis<br>Bowen<br>Melisandre<br>Eddison<br>Bran<br>Gilly<br>Grenn<br>Janos<br>Meera<br>Qhorin<br>Aemon<br>Jon', 'value': 15, 'label': 'Samwell', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Samwell'}, {'title': 'Aerys Neighbors:<br>Tywin<br>Robert<br>Jaime<br>Tyrion', 'value': 4, 'label': 'Aerys', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Aerys'}, {'title': 'Jaime Neighbors:<br>Stannis<br>Meryn<br>Balon<br>Robert<br>Robb<br>Brienne<br>Renly<br>Aerys<br>Walton<br>Joffrey<br>Tyrion<br>Gregor<br>Loras<br>Edmure<br>Barristan<br>Arya<br>Elia<br>Sansa<br>Tywin<br>Eddard<br>Cersei<br>Catelyn<br>Qyburn<br>Tommen', 'value': 24, 'label': 'Jaime', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Jaime'}, {'title': 'Robert Neighbors:<br>Barristan<br>Jon Arryn<br>Rhaegar<br>Renly<br>Tywin<br>Eddard<br>Sansa<br>Cersei<br>Aemon<br>Stannis<br>Jaime<br>Sandor<br>Daenerys<br>Tyrion<br>Arya<br>Aerys<br>Jon<br>Thoros', 'value': 18, 'label': 'Robert', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Robert'}, {'title': 'Tyrion Neighbors:<br>Stannis<br>Meryn<br>Balon<br>Gregor<br>Shae<br>Robb<br>Podrick<br>Ellaria<br>Renly<br>Chataya<br>Aerys<br>Mace<br>Joffrey<br>Janos<br>Margaery<br>Oberyn<br>Loras<br>Petyr<br>Pycelle<br>Kevan<br>Lysa<br>Bronn<br>Jaime<br>Varys<br>Arya<br>Viserys<br>Myrcella<br>Elia<br>Sansa<br>Tywin<br>Cersei<br>Sandor<br>Catelyn<br>Robert<br>Doran<br>Ilyn', 'value': 36, 'label': 'Tyrion', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Tyrion'}, {'title': 'Tywin Neighbors:<br>Stannis<br>Val<br>Balon<br>Gregor<br>Brynden<br>Robb<br>Podrick<br>Aerys<br>Mace<br>Joffrey<br>Tyrion<br>Oberyn<br>Petyr<br>Pycelle<br>Kevan<br>Lysa<br>Varys<br>Jaime<br>Tommen<br>Cersei<br>Walder<br>Robert', 'value': 22, 'label': 'Tywin', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Tywin'}, {'title': 'Alliser Neighbors:<br>Janos<br>Mance<br>Jon', 'value': 3, 'label': 'Alliser', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Alliser'}, {'title': 'Mance Neighbors:<br>Ygritte<br>Craster<br>Dalla<br>Val<br>Rattleshirt<br>Samwell<br>Styr<br>Gilly<br>Alliser<br>Janos<br>Qhorin<br>Jon', 'value': 12, 'label': 'Mance', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Mance'}, {'title': 'Amory Neighbors:<br>Oberyn', 'value': 1, 'label': 'Amory', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Amory'}, {'title': 'Oberyn Neighbors:<br>Ellaria<br>Tywin<br>Gregor<br>Amory<br>Mace<br>Joffrey<br>Tyrion', 'value': 7, 'label': 'Oberyn', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Oberyn'}, {'title': 'Arya Neighbors:<br>Sansa<br>Anguy<br>Eddard<br>Gendry<br>Gregor<br>Tyrion<br>Cersei<br>Beric<br>Roose<br>Robb<br>Jaime<br>Joffrey<br>Sandor<br>Brynden<br>Robert<br>Rickon<br>Bran<br>Jon<br>Thoros', 'value': 19, 'label': 'Arya', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Arya'}, {'title': 'Anguy Neighbors:<br>Arya<br>Beric', 'value': 2, 'label': 'Anguy', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Anguy'}, {'title': 'Beric Neighbors:<br>Anguy<br>Gendry<br>Eddard<br>Sandor<br>Arya<br>Thoros', 'value': 6, 'label': 'Beric', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Beric'}, {'title': 'Bran Neighbors:<br>Jojen<br>Luwin<br>Theon<br>Samwell<br>Sansa<br>Nan<br>Robb<br>Hodor<br>Meera<br>Arya<br>Rickon<br>Eddard<br>Jon<br>Catelyn', 'value': 14, 'label': 'Bran', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Bran'}, {'title': 'Brynden Neighbors:<br>Edmure<br>Walder<br>Tywin<br>Rickard<br>Catelyn<br>Lothar<br>Arya<br>Robb', 'value': 8, 'label': 'Brynden', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Brynden'}, {'title': 'Cersei Neighbors:<br>Eddard<br>Meryn<br>Elia<br>Sansa<br>Brienne<br>Lysa<br>Gregor<br>Shae<br>Bronn<br>Tywin<br>Jaime<br>Joffrey<br>Catelyn<br>Sandor<br>Tyrion<br>Arya<br>Varys<br>Robert<br>Ilyn<br>Pycelle', 'value': 20, 'label': 'Cersei', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Cersei'}, {'title': 'Gendry Neighbors:<br>Sandor<br>Arya<br>Beric<br>Thoros', 'value': 4, 'label': 'Gendry', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Gendry'}, {'title': 'Gregor Neighbors:<br>Jaime<br>Meryn<br>Elia<br>Tywin<br>Cersei<br>Bronn<br>Sandor<br>Joffrey<br>Tyrion<br>Arya<br>Oberyn<br>Ilyn', 'value': 12, 'label': 'Gregor', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Gregor'}, {'title': 'Joffrey Neighbors:<br>Stannis<br>Meryn<br>Kevan<br>Sansa<br>Tywin<br>Gregor<br>Tyrion<br>Cersei<br>Oberyn<br>Robb<br>Tommen<br>Jaime<br>Loras<br>Sandor<br>Margaery<br>Arya<br>Myrcella<br>Ilyn', 'value': 18, 'label': 'Joffrey', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Joffrey'}, {'title': 'Jon Neighbors:<br>Stannis<br>Ygritte<br>Val<br>Theon<br>Styr<br>Robert<br>Gilly<br>Robb<br>Dalla<br>Orell<br>Samwell<br>Janos<br>Meera<br>Qhorin<br>Craster<br>Rattleshirt<br>Eddison<br>Alliser<br>Arya<br>Bran<br>Mance<br>Sansa<br>Eddard<br>Melisandre<br>Grenn<br>Aemon', 'value': 26, 'label': 'Jon', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Jon'}, {'title': 'Rickon Neighbors:<br>Sansa<br>Eddard<br>Theon<br>Bran<br>Arya<br>Robb', 'value': 6, 'label': 'Rickon', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Rickon'}, {'title': 'Roose Neighbors:<br>Brienne<br>Arya<br>Catelyn<br>Robb', 'value': 4, 'label': 'Roose', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Roose'}, {'title': 'Sandor Neighbors:<br>Meryn<br>Gendry<br>Eddard<br>Sansa<br>Cersei<br>Beric<br>Joffrey<br>Tyrion<br>Robert<br>Arya<br>Gregor<br>Ilyn<br>Thoros', 'value': 13, 'label': 'Sandor', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Sandor'}, {'title': 'Thoros Neighbors:<br>Sandor<br>Robert<br>Arya<br>Beric<br>Gendry', 'value': 5, 'label': 'Thoros', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Thoros'}, {'title': 'Balon Neighbors:<br>Stannis<br>Tywin<br>Jaime<br>Tyrion<br>Robb<br>Loras', 'value': 6, 'label': 'Balon', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Balon'}, {'title': 'Loras Neighbors:<br>Balon<br>Brienne<br>Olenna<br>Renly<br>Jaime<br>Joffrey<br>Tyrion<br>Margaery<br>Sansa', 'value': 9, 'label': 'Loras', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Loras'}, {'title': 'Belwas Neighbors:<br>Daenerys<br>Barristan<br>Jorah<br>Illyrio', 'value': 4, 'label': 'Belwas', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Belwas'}, {'title': 'Barristan Neighbors:<br>Rhaegar<br>Robert<br>Jorah<br>Belwas<br>Jaime<br>Daenerys', 'value': 6, 'label': 'Barristan', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Barristan'}, {'title': 'Illyrio Neighbors:<br>Belwas', 'value': 1, 'label': 'Illyrio', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Illyrio'}, {'title': 'Hodor Neighbors:<br>Robb<br>Jojen<br>Bran<br>Meera', 'value': 4, 'label': 'Hodor', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Hodor'}, {'title': 'Jojen Neighbors:<br>Samwell<br>Hodor<br>Bran<br>Meera', 'value': 4, 'label': 'Jojen', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Jojen'}, {'title': 'Luwin Neighbors:<br>Nan<br>Bran', 'value': 2, 'label': 'Luwin', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Luwin'}, {'title': 'Meera Neighbors:<br>Jojen<br>Samwell<br>Hodor<br>Bran<br>Jon', 'value': 5, 'label': 'Meera', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Meera'}, {'title': 'Nan Neighbors:<br>Luwin<br>Bran', 'value': 2, 'label': 'Nan', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Nan'}, {'title': 'Theon Neighbors:<br>Rickon<br>Bran<br>Jon<br>Robb', 'value': 4, 'label': 'Theon', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Theon'}, {'title': 'Brienne Neighbors:<br>Sansa<br>Cersei<br>Roose<br>Jaime<br>Catelyn<br>Robb<br>Loras', 'value': 7, 'label': 'Brienne', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Brienne'}, {'title': 'Bronn Neighbors:<br>Gregor<br>Podrick<br>Cersei<br>Tyrion', 'value': 4, 'label': 'Bronn', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Bronn'}, {'title': 'Podrick Neighbors:<br>Tywin<br>Margaery<br>Tyrion<br>Bronn<br>Sansa', 'value': 5, 'label': 'Podrick', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Podrick'}, {'title': 'Lothar Neighbors:<br>Edmure<br>Brynden<br>Walder<br>Robb<br>Roslin', 'value': 5, 'label': 'Lothar', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Lothar'}, {'title': 'Walder Neighbors:<br>Edmure<br>Roslin<br>Tywin<br>Catelyn<br>Lothar<br>Brynden<br>Robb<br>Petyr', 'value': 8, 'label': 'Walder', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Walder'}, {'title': 'Catelyn Neighbors:<br>Edmure<br>Hoster<br>Jeyne<br>Roose<br>Roslin<br>Brienne<br>Lysa<br>Eddard<br>Sansa<br>Cersei<br>Robb<br>Stannis<br>Jaime<br>Tyrion<br>Brynden<br>Walder<br>Bran<br>Petyr', 'value': 18, 'label': 'Catelyn', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Catelyn'}, {'title': 'Edmure Neighbors:<br>Hoster<br>Roslin<br>Walder<br>Jaime<br>Catelyn<br>Lothar<br>Brynden<br>Robb', 'value': 8, 'label': 'Edmure', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Edmure'}, {'title': 'Hoster Neighbors:<br>Edmure<br>Lysa<br>Catelyn', 'value': 3, 'label': 'Hoster', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Hoster'}, {'title': 'Jeyne Neighbors:<br>Catelyn<br>Robb', 'value': 2, 'label': 'Jeyne', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Jeyne'}, {'title': 'Lysa Neighbors:<br>Hoster<br>Jon Arryn<br>Sansa<br>Tywin<br>Marillion<br>Cersei<br>Catelyn<br>Tyrion<br>Robert Arryn<br>Petyr', 'value': 10, 'label': 'Lysa', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Lysa'}, {'title': 'Petyr Neighbors:<br>Sansa<br>Tywin<br>Lysa<br>Walder<br>Catelyn<br>Tyrion<br>Robb', 'value': 7, 'label': 'Petyr', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Petyr'}, {'title': 'Robb Neighbors:<br>Stannis<br>Jeyne<br>Theon<br>Brynden<br>Brienne<br>Balon<br>Rickard<br>Joffrey<br>Tyrion<br>Rickon<br>Roose<br>Jon<br>Ramsay<br>Edmure<br>Jaime<br>Lothar<br>Arya<br>Bran<br>Sansa<br>Tywin<br>Eddard<br>Walder<br>Hodor<br>Catelyn<br>Petyr', 'value': 25, 'label': 'Robb', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Robb'}, {'title': 'Roslin Neighbors:<br>Edmure<br>Lothar<br>Catelyn<br>Walder', 'value': 4, 'label': 'Roslin', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Roslin'}, {'title': 'Sansa Neighbors:<br>Renly<br>Olenna<br>Robert<br>Shae<br>Robb<br>Loras<br>Podrick<br>Brienne<br>Bran<br>Joffrey<br>Tyrion<br>Margaery<br>Rickon<br>Jon<br>Petyr<br>Kevan<br>Lysa<br>Marillion<br>Jaime<br>Arya<br>Myrcella<br>Eddard<br>Cersei<br>Sandor<br>Catelyn<br>Robert Arryn', 'value': 26, 'label': 'Sansa', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Sansa'}, {'title': 'Stannis Neighbors:<br>Davos<br>Balon<br>Tywin<br>Robert<br>Renly<br>Melisandre<br>Aemon<br>Jaime<br>Joffrey<br>Catelyn<br>Tyrion<br>Robb<br>Jon<br>Samwell', 'value': 14, 'label': 'Stannis', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Stannis'}, {'title': 'Elia Neighbors:<br>Tyrion<br>Gregor<br>Jaime<br>Cersei<br>Rhaegar', 'value': 5, 'label': 'Elia', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Elia'}, {'title': 'Ilyn Neighbors:<br>Meryn<br>Gregor<br>Cersei<br>Sandor<br>Joffrey<br>Tyrion', 'value': 6, 'label': 'Ilyn', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Ilyn'}, {'title': 'Meryn Neighbors:<br>Gregor<br>Tyrion<br>Cersei<br>Jaime<br>Joffrey<br>Sandor<br>Ilyn', 'value': 7, 'label': 'Meryn', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Meryn'}, {'title': 'Pycelle Neighbors:<br>Tywin<br>Cersei<br>Varys<br>Tyrion', 'value': 4, 'label': 'Pycelle', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Pycelle'}, {'title': 'Shae Neighbors:<br>Chataya<br>Tyrion<br>Cersei<br>Varys<br>Sansa', 'value': 5, 'label': 'Shae', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Shae'}, {'title': 'Varys Neighbors:<br>Pycelle<br>Kevan<br>Renly<br>Tywin<br>Shae<br>Cersei<br>Tyrion', 'value': 7, 'label': 'Varys', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Varys'}, {'title': 'Craster Neighbors:<br>Gilly<br>Samwell<br>Jon<br>Karl<br>Mance', 'value': 5, 'label': 'Craster', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Craster'}, {'title': 'Karl Neighbors:<br>Craster', 'value': 1, 'label': 'Karl', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Karl'}, {'title': 'Daario Neighbors:<br>Daenerys<br>Drogo<br>Jorah<br>Irri', 'value': 4, 'label': 'Daario', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Daario'}, {'title': 'Drogo Neighbors:<br>Daenerys<br>Daario<br>Jorah<br>Irri', 'value': 4, 'label': 'Drogo', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Drogo'}, {'title': 'Irri Neighbors:<br>Daenerys<br>Daario<br>Missandei<br>Drogo', 'value': 4, 'label': 'Irri', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Irri'}, {'title': 'Daenerys Neighbors:<br>Barristan<br>Drogo<br>Rhaegar<br>Kraznys<br>Viserys<br>Robert<br>Jorah<br>Worm<br>Belwas<br>Daario<br>Irri<br>Aegon<br>Missandei<br>Rakharo', 'value': 14, 'label': 'Daenerys', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Daenerys'}, {'title': 'Aegon Neighbors:<br>Daenerys', 'value': 1, 'label': 'Aegon', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Aegon'}, {'title': 'Jorah Neighbors:<br>Barristan<br>Drogo<br>Rhaegar<br>Belwas<br>Daario<br>Daenerys', 'value': 6, 'label': 'Jorah', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Jorah'}, {'title': 'Kraznys Neighbors:<br>Daenerys', 'value': 1, 'label': 'Kraznys', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Kraznys'}, {'title': 'Missandei Neighbors:<br>Daenerys<br>Irri', 'value': 2, 'label': 'Missandei', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Missandei'}, {'title': 'Rakharo Neighbors:<br>Daenerys', 'value': 1, 'label': 'Rakharo', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Rakharo'}, {'title': 'Rhaegar Neighbors:<br>Barristan<br>Elia<br>Robert<br>Jorah<br>Daenerys<br>Viserys', 'value': 6, 'label': 'Rhaegar', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Rhaegar'}, {'title': 'Viserys Neighbors:<br>Daenerys<br>Rhaegar<br>Tyrion', 'value': 3, 'label': 'Viserys', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Viserys'}, {'title': 'Worm Neighbors:<br>Daenerys', 'value': 1, 'label': 'Worm', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Worm'}, {'title': 'Davos Neighbors:<br>Melisandre<br>Salladhor<br>Cressen<br>Shireen<br>Stannis', 'value': 5, 'label': 'Davos', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Davos'}, {'title': 'Cressen Neighbors:<br>Davos', 'value': 1, 'label': 'Cressen', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Cressen'}, {'title': 'Salladhor Neighbors:<br>Davos', 'value': 1, 'label': 'Salladhor', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Salladhor'}, {'title': 'Eddard Neighbors:<br>Sansa<br>Robert<br>Cersei<br>Beric<br>Robb<br>Jaime<br>Catelyn<br>Sandor<br>Arya<br>Rickon<br>Bran<br>Jon', 'value': 12, 'label': 'Eddard', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Eddard'}, {'title': 'Eddison Neighbors:<br>Grenn<br>Samwell<br>Jon', 'value': 3, 'label': 'Eddison', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Eddison'}, {'title': 'Gilly Neighbors:<br>Samwell<br>Craster<br>Mance<br>Jon', 'value': 4, 'label': 'Gilly', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Gilly'}, {'title': 'Qyburn Neighbors:<br>Jaime', 'value': 1, 'label': 'Qyburn', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Qyburn'}, {'title': 'Renly Neighbors:<br>Stannis<br>Sansa<br>Robert<br>Varys<br>Jaime<br>Tyrion<br>Margaery<br>Loras', 'value': 8, 'label': 'Renly', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Renly'}, {'title': 'Tommen Neighbors:<br>Tywin<br>Margaery<br>Jaime<br>Joffrey<br>Myrcella', 'value': 5, 'label': 'Tommen', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Tommen'}, {'title': 'Janos Neighbors:<br>Mance<br>Bowen<br>Samwell<br>Alliser<br>Tyrion<br>Jon', 'value': 6, 'label': 'Janos', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Janos'}, {'title': 'Bowen Neighbors:<br>Samwell<br>Janos', 'value': 2, 'label': 'Bowen', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Bowen'}, {'title': 'Kevan Neighbors:<br>Lancel<br>Sansa<br>Tywin<br>Varys<br>Joffrey<br>Tyrion', 'value': 6, 'label': 'Kevan', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Kevan'}, {'title': 'Margaery Neighbors:<br>Podrick<br>Sansa<br>Tommen<br>Renly<br>Joffrey<br>Tyrion<br>Loras', 'value': 7, 'label': 'Margaery', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Margaery'}, {'title': 'Myrcella Neighbors:<br>Tommen<br>Sansa<br>Joffrey<br>Tyrion', 'value': 4, 'label': 'Myrcella', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Myrcella'}, {'title': 'Dalla Neighbors:<br>Val<br>Mance<br>Jon', 'value': 3, 'label': 'Dalla', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Dalla'}, {'title': 'Melisandre Neighbors:<br>Stannis<br>Davos<br>Samwell<br>Jon', 'value': 4, 'label': 'Melisandre', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Melisandre'}, {'title': 'Orell Neighbors:<br>Jon', 'value': 1, 'label': 'Orell', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Orell'}, {'title': 'Qhorin Neighbors:<br>Rattleshirt<br>Samwell<br>Ygritte<br>Mance<br>Jon', 'value': 5, 'label': 'Qhorin', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Qhorin'}, {'title': 'Rattleshirt Neighbors:<br>Qhorin<br>Ygritte<br>Mance<br>Jon', 'value': 4, 'label': 'Rattleshirt', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Rattleshirt'}, {'title': 'Styr Neighbors:<br>Mance<br>Jon', 'value': 2, 'label': 'Styr', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Styr'}, {'title': 'Val Neighbors:<br>Tywin<br>Dalla<br>Mance<br>Jon', 'value': 4, 'label': 'Val', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Val'}, {'title': 'Ygritte Neighbors:<br>Rattleshirt<br>Qhorin<br>Mance<br>Jon', 'value': 4, 'label': 'Ygritte', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Ygritte'}, {'title': 'Jon Arryn Neighbors:<br>Lysa<br>Robert', 'value': 2, 'label': 'Jon Arryn', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Jon Arryn'}, {'title': 'Lancel Neighbors:<br>Kevan', 'value': 1, 'label': 'Lancel', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Lancel'}, {'title': 'Olenna Neighbors:<br>Loras<br>Sansa', 'value': 2, 'label': 'Olenna', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Olenna'}, {'title': 'Marillion Neighbors:<br>Robert Arryn<br>Lysa<br>Sansa', 'value': 3, 'label': 'Marillion', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Marillion'}, {'title': 'Robert Arryn Neighbors:<br>Lysa<br>Marillion<br>Sansa', 'value': 3, 'label': 'Robert Arryn', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Robert Arryn'}, {'title': 'Ellaria Neighbors:<br>Oberyn<br>Tyrion', 'value': 2, 'label': 'Ellaria', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Ellaria'}, {'title': 'Mace Neighbors:<br>Tywin<br>Oberyn<br>Tyrion', 'value': 3, 'label': 'Mace', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Mace'}, {'title': 'Rickard Neighbors:<br>Brynden<br>Robb', 'value': 2, 'label': 'Rickard', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Rickard'}, {'title': 'Ramsay Neighbors:<br>Robb', 'value': 1, 'label': 'Ramsay', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Ramsay'}, {'title': 'Chataya Neighbors:<br>Tyrion<br>Shae', 'value': 2, 'label': 'Chataya', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Chataya'}, {'title': 'Shireen Neighbors:<br>Davos', 'value': 1, 'label': 'Shireen', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Shireen'}, {'title': 'Doran Neighbors:<br>Tyrion', 'value': 1, 'label': 'Doran', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Doran'}, {'title': 'Walton Neighbors:<br>Jaime', 'value': 1, 'label': 'Walton', 'shape': 'dot', 'font': {'color': 'white'}, 'id': 'Walton'}];
|
41 |
-
edges = [{'to': 'Grenn', 'from': 'Aemon', 'value': 5}, {'to': 'Samwell', 'from': 'Aemon', 'value': 31}, {'to': 'Jaime', 'from': 'Aerys', 'value': 18}, {'to': 'Robert', 'from': 'Aerys', 'value': 6}, {'to': 'Tyrion', 'from': 'Aerys', 'value': 5}, {'to': 'Tywin', 'from': 'Aerys', 'value': 8}, {'to': 'Mance', 'from': 'Alliser', 'value': 5}, {'to': 'Oberyn', 'from': 'Amory', 'value': 5}, {'to': 'Anguy', 'from': 'Arya', 'value': 11}, {'to': 'Beric', 'from': 'Arya', 'value': 23}, {'to': 'Bran', 'from': 'Arya', 'value': 9}, {'to': 'Brynden', 'from': 'Arya', 'value': 6}, {'to': 'Cersei', 'from': 'Arya', 'value': 5}, {'to': 'Gendry', 'from': 'Arya', 'value': 43}, {'to': 'Gregor', 'from': 'Arya', 'value': 7}, {'to': 'Jaime', 'from': 'Arya', 'value': 11}, {'to': 'Joffrey', 'from': 'Arya', 'value': 6}, {'to': 'Jon', 'from': 'Arya', 'value': 7}, {'to': 'Rickon', 'from': 'Arya', 'value': 8}, {'to': 'Robert', 'from': 'Arya', 'value': 4}, {'to': 'Roose', 'from': 'Arya', 'value': 5}, {'to': 'Sandor', 'from': 'Arya', 'value': 46}, {'to': 'Thoros', 'from': 'Arya', 'value': 18}, {'to': 'Tyrion', 'from': 'Arya', 'value': 5}, {'to': 'Loras', 'from': 'Balon', 'value': 4}, {'to': 'Barristan', 'from': 'Belwas', 'value': 18}, {'to': 'Illyrio', 'from': 'Belwas', 'value': 10}, {'to': 'Anguy', 'from': 'Beric', 'value': 4}, {'to': 'Gendry', 'from': 'Beric', 'value': 4}, {'to': 'Thoros', 'from': 'Beric', 'value': 21}, {'to': 'Hodor', 'from': 'Bran', 'value': 96}, {'to': 'Jojen', 'from': 'Bran', 'value': 46}, {'to': 'Jon', 'from': 'Bran', 'value': 12}, {'to': 'Luwin', 'from': 'Bran', 'value': 4}, {'to': 'Meera', 'from': 'Bran', 'value': 54}, {'to': 'Nan', 'from': 'Bran', 'value': 14}, {'to': 'Rickon', 'from': 'Bran', 'value': 35}, {'to': 'Samwell', 'from': 'Bran', 'value': 11}, {'to': 'Theon', 'from': 'Bran', 'value': 11}, {'to': 'Loras', 'from': 'Brienne', 'value': 7}, {'to': 'Gregor', 'from': 'Bronn', 'value': 5}, {'to': 'Podrick', 'from': 'Bronn', 'value': 19}, {'to': 'Lothar', 'from': 'Brynden', 'value': 4}, {'to': 'Walder', 'from': 'Brynden', 'value': 5}, {'to': 'Bran', 'from': 'Catelyn', 'value': 4}, {'to': 'Brienne', 'from': 'Catelyn', 'value': 7}, {'to': 'Brynden', 'from': 'Catelyn', 'value': 8}, {'to': 'Cersei', 'from': 'Catelyn', 'value': 4}, {'to': 'Edmure', 'from': 'Catelyn', 'value': 16}, {'to': 'Hoster', 'from': 'Catelyn', 'value': 9}, {'to': 'Jaime', 'from': 'Catelyn', 'value': 19}, {'to': 'Jeyne', 'from': 'Catelyn', 'value': 10}, {'to': 'Lysa', 'from': 'Catelyn', 'value': 8}, {'to': 'Petyr', 'from': 'Catelyn', 'value': 5}, {'to': 'Robb', 'from': 'Catelyn', 'value': 43}, {'to': 'Roose', 'from': 'Catelyn', 'value': 4}, {'to': 'Roslin', 'from': 'Catelyn', 'value': 6}, {'to': 'Sansa', 'from': 'Catelyn', 'value': 8}, {'to': 'Stannis', 'from': 'Catelyn', 'value': 4}, {'to': 'Tyrion', 'from': 'Catelyn', 'value': 5}, {'to': 'Walder', 'from': 'Catelyn', 'value': 19}, {'to': 'Brienne', 'from': 'Cersei', 'value': 5}, {'to': 'Bronn', 'from': 'Cersei', 'value': 4}, {'to': 'Elia', 'from': 'Cersei', 'value': 4}, {'to': 'Gregor', 'from': 'Cersei', 'value': 6}, {'to': 'Ilyn', 'from': 'Cersei', 'value': 7}, {'to': 'Jaime', 'from': 'Cersei', 'value': 36}, {'to': 'Joffrey', 'from': 'Cersei', 'value': 23}, {'to': 'Meryn', 'from': 'Cersei', 'value': 10}, {'to': 'Pycelle', 'from': 'Cersei', 'value': 4}, {'to': 'Robert', 'from': 'Cersei', 'value': 16}, {'to': 'Sandor', 'from': 'Cersei', 'value': 6}, {'to': 'Shae', 'from': 'Cersei', 'value': 4}, {'to': 'Tyrion', 'from': 'Cersei', 'value': 46}, {'to': 'Varys', 'from': 'Cersei', 'value': 4}, {'to': 'Karl', 'from': 'Craster', 'value': 6}, {'to': 'Drogo', 'from': 'Daario', 'value': 4}, {'to': 'Irri', 'from': 'Daario', 'value': 5}, {'to': 'Aegon', 'from': 'Daenerys', 'value': 8}, {'to': 'Barristan', 'from': 'Daenerys', 'value': 20}, {'to': 'Belwas', 'from': 'Daenerys', 'value': 26}, {'to': 'Daario', 'from': 'Daenerys', 'value': 14}, {'to': 'Drogo', 'from': 'Daenerys', 'value': 18}, {'to': 'Irri', 'from': 'Daenerys', 'value': 17}, {'to': 'Jorah', 'from': 'Daenerys', 'value': 47}, {'to': 'Kraznys', 'from': 'Daenerys', 'value': 10}, {'to': 'Missandei', 'from': 'Daenerys', 'value': 26}, {'to': 'Rakharo', 'from': 'Daenerys', 'value': 7}, {'to': 'Rhaegar', 'from': 'Daenerys', 'value': 12}, {'to': 'Robert', 'from': 'Daenerys', 'value': 5}, {'to': 'Viserys', 'from': 'Daenerys', 'value': 8}, {'to': 'Worm', 'from': 'Daenerys', 'value': 14}, {'to': 'Cressen', 'from': 'Davos', 'value': 4}, {'to': 'Salladhor', 'from': 'Davos', 'value': 16}, {'to': 'Arya', 'from': 'Eddard', 'value': 18}, {'to': 'Beric', 'from': 'Eddard', 'value': 8}, {'to': 'Bran', 'from': 'Eddard', 'value': 15}, {'to': 'Catelyn', 'from': 'Eddard', 'value': 5}, {'to': 'Cersei', 'from': 'Eddard', 'value': 6}, {'to': 'Jaime', 'from': 'Eddard', 'value': 6}, {'to': 'Jon', 'from': 'Eddard', 'value': 8}, {'to': 'Rickon', 'from': 'Eddard', 'value': 8}, {'to': 'Robb', 'from': 'Eddard', 'value': 13}, {'to': 'Robert', 'from': 'Eddard', 'value': 10}, {'to': 'Sandor', 'from': 'Eddard', 'value': 5}, {'to': 'Sansa', 'from': 'Eddard', 'value': 6}, {'to': 'Grenn', 'from': 'Eddison', 'value': 8}, {'to': 'Brynden', 'from': 'Edmure', 'value': 7}, {'to': 'Lothar', 'from': 'Edmure', 'value': 4}, {'to': 'Roslin', 'from': 'Edmure', 'value': 16}, {'to': 'Walder', 'from': 'Edmure', 'value': 9}, {'to': 'Thoros', 'from': 'Gendry', 'value': 7}, {'to': 'Craster', 'from': 'Gilly', 'value': 17}, {'to': 'Elia', 'from': 'Gregor', 'value': 9}, {'to': 'Ilyn', 'from': 'Gregor', 'value': 7}, {'to': 'Meryn', 'from': 'Gregor', 'value': 7}, {'to': 'Oberyn', 'from': 'Gregor', 'value': 24}, {'to': 'Sandor', 'from': 'Gregor', 'value': 12}, {'to': 'Jojen', 'from': 'Hodor', 'value': 35}, {'to': 'Meera', 'from': 'Hodor', 'value': 41}, {'to': 'Edmure', 'from': 'Hoster', 'value': 9}, {'to': 'Drogo', 'from': 'Irri', 'value': 7}, {'to': 'Balon', 'from': 'Jaime', 'value': 6}, {'to': 'Barristan', 'from': 'Jaime', 'value': 4}, {'to': 'Brienne', 'from': 'Jaime', 'value': 88}, {'to': 'Edmure', 'from': 'Jaime', 'value': 5}, {'to': 'Elia', 'from': 'Jaime', 'value': 4}, {'to': 'Gregor', 'from': 'Jaime', 'value': 6}, {'to': 'Joffrey', 'from': 'Jaime', 'value': 15}, {'to': 'Loras', 'from': 'Jaime', 'value': 16}, {'to': 'Meryn', 'from': 'Jaime', 'value': 11}, {'to': 'Qyburn', 'from': 'Jaime', 'value': 11}, {'to': 'Renly', 'from': 'Jaime', 'value': 7}, {'to': 'Robert', 'from': 'Jaime', 'value': 17}, {'to': 'Stannis', 'from': 'Jaime', 'value': 5}, {'to': 'Tommen', 'from': 'Jaime', 'value': 8}, {'to': 'Tyrion', 'from': 'Jaime', 'value': 31}, {'to': 'Alliser', 'from': 'Janos', 'value': 9}, {'to': 'Bowen', 'from': 'Janos', 'value': 5}, {'to': 'Mance', 'from': 'Janos', 'value': 4}, {'to': 'Gregor', 'from': 'Joffrey', 'value': 5}, {'to': 'Ilyn', 'from': 'Joffrey', 'value': 4}, {'to': 'Kevan', 'from': 'Joffrey', 'value': 8}, {'to': 'Loras', 'from': 'Joffrey', 'value': 7}, {'to': 'Margaery', 'from': 'Joffrey', 'value': 28}, {'to': 'Meryn', 'from': 'Joffrey', 'value': 5}, {'to': 'Myrcella', 'from': 'Joffrey', 'value': 5}, {'to': 'Oberyn', 'from': 'Joffrey', 'value': 4}, {'to': 'Sandor', 'from': 'Joffrey', 'value': 14}, {'to': 'Stannis', 'from': 'Joffrey', 'value': 10}, {'to': 'Tommen', 'from': 'Joffrey', 'value': 9}, {'to': 'Tyrion', 'from': 'Joffrey', 'value': 54}, {'to': 'Meera', 'from': 'Jojen', 'value': 33}, {'to': 'Samwell', 'from': 'Jojen', 'value': 11}, {'to': 'Aemon', 'from': 'Jon', 'value': 30}, {'to': 'Alliser', 'from': 'Jon', 'value': 15}, {'to': 'Craster', 'from': 'Jon', 'value': 7}, {'to': 'Dalla', 'from': 'Jon', 'value': 6}, {'to': 'Eddison', 'from': 'Jon', 'value': 4}, {'to': 'Gilly', 'from': 'Jon', 'value': 9}, {'to': 'Grenn', 'from': 'Jon', 'value': 25}, {'to': 'Janos', 'from': 'Jon', 'value': 8}, {'to': 'Mance', 'from': 'Jon', 'value': 69}, {'to': 'Meera', 'from': 'Jon', 'value': 4}, {'to': 'Melisandre', 'from': 'Jon', 'value': 7}, {'to': 'Orell', 'from': 'Jon', 'value': 6}, {'to': 'Qhorin', 'from': 'Jon', 'value': 31}, {'to': 'Rattleshirt', 'from': 'Jon', 'value': 20}, {'to': 'Robert', 'from': 'Jon', 'value': 5}, {'to': 'Samwell', 'from': 'Jon', 'value': 52}, {'to': 'Stannis', 'from': 'Jon', 'value': 9}, {'to': 'Styr', 'from': 'Jon', 'value': 16}, {'to': 'Theon', 'from': 'Jon', 'value': 8}, {'to': 'Val', 'from': 'Jon', 'value': 12}, {'to': 'Ygritte', 'from': 'Jon', 'value': 54}, {'to': 'Lysa', 'from': 'Jon Arryn', 'value': 5}, {'to': 'Robert', 'from': 'Jon Arryn', 'value': 6}, {'to': 'Barristan', 'from': 'Jorah', 'value': 11}, {'to': 'Belwas', 'from': 'Jorah', 'value': 13}, {'to': 'Daario', 'from': 'Jorah', 'value': 7}, {'to': 'Drogo', 'from': 'Jorah', 'value': 6}, {'to': 'Lancel', 'from': 'Kevan', 'value': 7}, {'to': 'Varys', 'from': 'Kevan', 'value': 5}, {'to': 'Margaery', 'from': 'Loras', 'value': 9}, {'to': 'Olenna', 'from': 'Loras', 'value': 5}, {'to': 'Roslin', 'from': 'Lothar', 'value': 4}, {'to': 'Nan', 'from': 'Luwin', 'value': 4}, {'to': 'Cersei', 'from': 'Lysa', 'value': 4}, {'to': 'Hoster', 'from': 'Lysa', 'value': 6}, {'to': 'Marillion', 'from': 'Lysa', 'value': 10}, {'to': 'Petyr', 'from': 'Lysa', 'value': 29}, {'to': 'Robert Arryn', 'from': 'Lysa', 'value': 9}, {'to': 'Tyrion', 'from': 'Lysa', 'value': 5}, {'to': 'Tywin', 'from': 'Lysa', 'value': 4}, {'to': 'Craster', 'from': 'Mance', 'value': 11}, {'to': 'Dalla', 'from': 'Mance', 'value': 8}, {'to': 'Gilly', 'from': 'Mance', 'value': 7}, {'to': 'Qhorin', 'from': 'Mance', 'value': 10}, {'to': 'Rattleshirt', 'from': 'Mance', 'value': 9}, {'to': 'Styr', 'from': 'Mance', 'value': 7}, {'to': 'Val', 'from': 'Mance', 'value': 8}, {'to': 'Ygritte', 'from': 'Mance', 'value': 12}, {'to': 'Samwell', 'from': 'Meera', 'value': 7}, {'to': 'Davos', 'from': 'Melisandre', 'value': 30}, {'to': 'Samwell', 'from': 'Melisandre', 'value': 5}, {'to': 'Ilyn', 'from': 'Meryn', 'value': 5}, {'to': 'Irri', 'from': 'Missandei', 'value': 4}, {'to': 'Tommen', 'from': 'Myrcella', 'value': 5}, {'to': 'Tyrion', 'from': 'Myrcella', 'value': 4}, {'to': 'Ellaria', 'from': 'Oberyn', 'value': 6}, {'to': 'Mace', 'from': 'Oberyn', 'value': 6}, {'to': 'Margaery', 'from': 'Podrick', 'value': 4}, {'to': 'Qhorin', 'from': 'Rattleshirt', 'value': 6}, {'to': 'Loras', 'from': 'Renly', 'value': 8}, {'to': 'Margaery', 'from': 'Renly', 'value': 7}, {'to': 'Varys', 'from': 'Renly', 'value': 4}, {'to': 'Barristan', 'from': 'Rhaegar', 'value': 5}, {'to': 'Elia', 'from': 'Rhaegar', 'value': 7}, {'to': 'Jorah', 'from': 'Rhaegar', 'value': 5}, {'to': 'Robert', 'from': 'Rhaegar', 'value': 6}, {'to': 'Brynden', 'from': 'Rickard', 'value': 4}, {'to': 'Theon', 'from': 'Rickon', 'value': 8}, {'to': 'Arya', 'from': 'Robb', 'value': 15}, {'to': 'Balon', 'from': 'Robb', 'value': 6}, {'to': 'Bran', 'from': 'Robb', 'value': 23}, {'to': 'Brienne', 'from': 'Robb', 'value': 6}, {'to': 'Brynden', 'from': 'Robb', 'value': 17}, {'to': 'Edmure', 'from': 'Robb', 'value': 32}, {'to': 'Hodor', 'from': 'Robb', 'value': 5}, {'to': 'Jaime', 'from': 'Robb', 'value': 15}, {'to': 'Jeyne', 'from': 'Robb', 'value': 18}, {'to': 'Joffrey', 'from': 'Robb', 'value': 10}, {'to': 'Jon', 'from': 'Robb', 'value': 14}, {'to': 'Lothar', 'from': 'Robb', 'value': 10}, {'to': 'Petyr', 'from': 'Robb', 'value': 5}, {'to': 'Ramsay', 'from': 'Robb', 'value': 4}, {'to': 'Rickard', 'from': 'Robb', 'value': 7}, {'to': 'Rickon', 'from': 'Robb', 'value': 15}, {'to': 'Roose', 'from': 'Robb', 'value': 4}, {'to': 'Sansa', 'from': 'Robb', 'value': 15}, {'to': 'Stannis', 'from': 'Robb', 'value': 4}, {'to': 'Theon', 'from': 'Robb', 'value': 11}, {'to': 'Tyrion', 'from': 'Robb', 'value': 12}, {'to': 'Tywin', 'from': 'Robb', 'value': 12}, {'to': 'Walder', 'from': 'Robb', 'value': 26}, {'to': 'Aemon', 'from': 'Robert', 'value': 4}, {'to': 'Barristan', 'from': 'Robert', 'value': 5}, {'to': 'Renly', 'from': 'Robert', 'value': 4}, {'to': 'Stannis', 'from': 'Robert', 'value': 5}, {'to': 'Thoros', 'from': 'Robert', 'value': 4}, {'to': 'Marillion', 'from': 'Robert Arryn', 'value': 4}, {'to': 'Brienne', 'from': 'Roose', 'value': 4}, {'to': 'Bowen', 'from': 'Samwell', 'value': 6}, {'to': 'Craster', 'from': 'Samwell', 'value': 34}, {'to': 'Eddison', 'from': 'Samwell', 'value': 12}, {'to': 'Gilly', 'from': 'Samwell', 'value': 36}, {'to': 'Grenn', 'from': 'Samwell', 'value': 43}, {'to': 'Janos', 'from': 'Samwell', 'value': 6}, {'to': 'Mance', 'from': 'Samwell', 'value': 10}, {'to': 'Qhorin', 'from': 'Samwell', 'value': 5}, {'to': 'Beric', 'from': 'Sandor', 'value': 15}, {'to': 'Gendry', 'from': 'Sandor', 'value': 5}, {'to': 'Ilyn', 'from': 'Sandor', 'value': 4}, {'to': 'Meryn', 'from': 'Sandor', 'value': 4}, {'to': 'Robert', 'from': 'Sandor', 'value': 6}, {'to': 'Thoros', 'from': 'Sandor', 'value': 10}, {'to': 'Arya', 'from': 'Sansa', 'value': 22}, {'to': 'Bran', 'from': 'Sansa', 'value': 10}, {'to': 'Brienne', 'from': 'Sansa', 'value': 5}, {'to': 'Cersei', 'from': 'Sansa', 'value': 16}, {'to': 'Jaime', 'from': 'Sansa', 'value': 10}, {'to': 'Joffrey', 'from': 'Sansa', 'value': 35}, {'to': 'Jon', 'from': 'Sansa', 'value': 4}, {'to': 'Kevan', 'from': 'Sansa', 'value': 5}, {'to': 'Loras', 'from': 'Sansa', 'value': 14}, {'to': 'Lysa', 'from': 'Sansa', 'value': 28}, {'to': 'Margaery', 'from': 'Sansa', 'value': 36}, {'to': 'Marillion', 'from': 'Sansa', 'value': 9}, {'to': 'Myrcella', 'from': 'Sansa', 'value': 4}, {'to': 'Olenna', 'from': 'Sansa', 'value': 7}, {'to': 'Petyr', 'from': 'Sansa', 'value': 28}, {'to': 'Podrick', 'from': 'Sansa', 'value': 8}, {'to': 'Renly', 'from': 'Sansa', 'value': 4}, {'to': 'Rickon', 'from': 'Sansa', 'value': 7}, {'to': 'Robert', 'from': 'Sansa', 'value': 5}, {'to': 'Robert Arryn', 'from': 'Sansa', 'value': 6}, {'to': 'Sandor', 'from': 'Sansa', 'value': 6}, {'to': 'Shae', 'from': 'Sansa', 'value': 8}, {'to': 'Tyrion', 'from': 'Sansa', 'value': 77}, {'to': 'Chataya', 'from': 'Shae', 'value': 4}, {'to': 'Varys', 'from': 'Shae', 'value': 8}, {'to': 'Davos', 'from': 'Shireen', 'value': 5}, {'to': 'Aemon', 'from': 'Stannis', 'value': 4}, {'to': 'Balon', 'from': 'Stannis', 'value': 4}, {'to': 'Davos', 'from': 'Stannis', 'value': 32}, {'to': 'Melisandre', 'from': 'Stannis', 'value': 20}, {'to': 'Renly', 'from': 'Stannis', 'value': 15}, {'to': 'Samwell', 'from': 'Stannis', 'value': 13}, {'to': 'Margaery', 'from': 'Tommen', 'value': 5}, {'to': 'Balon', 'from': 'Tyrion', 'value': 4}, {'to': 'Bronn', 'from': 'Tyrion', 'value': 31}, {'to': 'Chataya', 'from': 'Tyrion', 'value': 5}, {'to': 'Doran', 'from': 'Tyrion', 'value': 5}, {'to': 'Elia', 'from': 'Tyrion', 'value': 5}, {'to': 'Ellaria', 'from': 'Tyrion', 'value': 4}, {'to': 'Gregor', 'from': 'Tyrion', 'value': 22}, {'to': 'Ilyn', 'from': 'Tyrion', 'value': 5}, {'to': 'Janos', 'from': 'Tyrion', 'value': 5}, {'to': 'Kevan', 'from': 'Tyrion', 'value': 11}, {'to': 'Loras', 'from': 'Tyrion', 'value': 6}, {'to': 'Mace', 'from': 'Tyrion', 'value': 9}, {'to': 'Margaery', 'from': 'Tyrion', 'value': 7}, {'to': 'Meryn', 'from': 'Tyrion', 'value': 5}, {'to': 'Oberyn', 'from': 'Tyrion', 'value': 25}, {'to': 'Petyr', 'from': 'Tyrion', 'value': 12}, {'to': 'Podrick', 'from': 'Tyrion', 'value': 28}, {'to': 'Pycelle', 'from': 'Tyrion', 'value': 11}, {'to': 'Renly', 'from': 'Tyrion', 'value': 6}, {'to': 'Robert', 'from': 'Tyrion', 'value': 9}, {'to': 'Sandor', 'from': 'Tyrion', 'value': 4}, {'to': 'Shae', 'from': 'Tyrion', 'value': 21}, {'to': 'Stannis', 'from': 'Tyrion', 'value': 6}, {'to': 'Varys', 'from': 'Tyrion', 'value': 18}, {'to': 'Balon', 'from': 'Tywin', 'value': 5}, {'to': 'Brynden', 'from': 'Tywin', 'value': 4}, {'to': 'Cersei', 'from': 'Tywin', 'value': 16}, {'to': 'Gregor', 'from': 'Tywin', 'value': 7}, {'to': 'Jaime', 'from': 'Tywin', 'value': 13}, {'to': 'Joffrey', 'from': 'Tywin', 'value': 13}, {'to': 'Kevan', 'from': 'Tywin', 'value': 14}, {'to': 'Mace', 'from': 'Tywin', 'value': 5}, {'to': 'Oberyn', 'from': 'Tywin', 'value': 6}, {'to': 'Petyr', 'from': 'Tywin', 'value': 4}, {'to': 'Podrick', 'from': 'Tywin', 'value': 5}, {'to': 'Pycelle', 'from': 'Tywin', 'value': 5}, {'to': 'Robert', 'from': 'Tywin', 'value': 11}, {'to': 'Stannis', 'from': 'Tywin', 'value': 15}, {'to': 'Tommen', 'from': 'Tywin', 'value': 4}, {'to': 'Tyrion', 'from': 'Tywin', 'value': 39}, {'to': 'Val', 'from': 'Tywin', 'value': 4}, {'to': 'Varys', 'from': 'Tywin', 'value': 6}, {'to': 'Walder', 'from': 'Tywin', 'value': 4}, {'to': 'Dalla', 'from': 'Val', 'value': 7}, {'to': 'Pycelle', 'from': 'Varys', 'value': 4}, {'to': 'Rhaegar', 'from': 'Viserys', 'value': 7}, {'to': 'Tyrion', 'from': 'Viserys', 'value': 4}, {'to': 'Lothar', 'from': 'Walder', 'value': 12}, {'to': 'Petyr', 'from': 'Walder', 'value': 6}, {'to': 'Roslin', 'from': 'Walder', 'value': 6}, {'to': 'Jaime', 'from': 'Walton', 'value': 10}, {'to': 'Qhorin', 'from': 'Ygritte', 'value': 7}, {'to': 'Rattleshirt', 'from': 'Ygritte', 'value': 9}];
|
42 |
-
|
43 |
-
// adding nodes and edges to the graph
|
44 |
-
data = {nodes: nodes, edges: edges};
|
45 |
-
|
46 |
-
var options = {
|
47 |
-
"configure": {
|
48 |
-
"enabled": false
|
49 |
-
},
|
50 |
-
"edges": {
|
51 |
-
"color": {
|
52 |
-
"inherit": true
|
53 |
-
},
|
54 |
-
"smooth": {
|
55 |
-
"enabled": false,
|
56 |
-
"type": "continuous"
|
57 |
-
}
|
58 |
-
},
|
59 |
-
"interaction": {
|
60 |
-
"dragNodes": true,
|
61 |
-
"hideEdgesOnDrag": false,
|
62 |
-
"hideNodesOnDrag": false
|
63 |
-
},
|
64 |
-
"physics": {
|
65 |
-
"barnesHut": {
|
66 |
-
"gravitationalConstant": -80000,
|
67 |
-
"springConstant": 0.001,
|
68 |
-
"springLength": 250
|
69 |
-
},
|
70 |
-
"enabled": true,
|
71 |
-
"stabilization": {
|
72 |
-
"enabled": true,
|
73 |
-
"fit": true,
|
74 |
-
"iterations": 1000,
|
75 |
-
"onlyDynamicEdges": false,
|
76 |
-
"updateInterval": 50
|
77 |
-
}
|
78 |
-
}
|
79 |
-
};
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
// default to using dot shape for nodes
|
84 |
-
options.nodes = {
|
85 |
-
shape: "dot"
|
86 |
-
}
|
87 |
-
|
88 |
-
network = new vis.Network(container, data, options);
|
89 |
-
return network;
|
90 |
-
|
91 |
-
}
|
92 |
-
|
93 |
-
drawGraph();
|
94 |
-
|
95 |
-
</script>
|
96 |
-
</body>
|
97 |
-
</html>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pyvis/pyvis/source/index.rst
DELETED
@@ -1,33 +0,0 @@
|
|
1 |
-
|
2 |
-
.. image:: net.png
|
3 |
-
:width: 30%
|
4 |
-
.. image:: net2.png
|
5 |
-
:width: 30%
|
6 |
-
.. image:: net3.png
|
7 |
-
:width: 30%
|
8 |
-
|
9 |
-
Interactive network visualizations
|
10 |
-
==================================
|
11 |
-
.. image:: tut.gif
|
12 |
-
|
13 |
-
Contents:
|
14 |
-
=========
|
15 |
-
.. toctree::
|
16 |
-
:maxdepth: 2
|
17 |
-
|
18 |
-
install
|
19 |
-
introduction
|
20 |
-
tutorial
|
21 |
-
license
|
22 |
-
documentation
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
Indices and tables
|
28 |
-
------------------
|
29 |
-
|
30 |
-
* :ref:`genindex`
|
31 |
-
* :ref:`modindex`
|
32 |
-
* :ref:`search`
|
33 |
-
* :ref:`glossary`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pyvis/pyvis/source/install.rst
DELETED
@@ -1,20 +0,0 @@
|
|
1 |
-
============
|
2 |
-
Installation
|
3 |
-
============
|
4 |
-
|
5 |
-
----------------
|
6 |
-
Install with pip
|
7 |
-
----------------
|
8 |
-
|
9 |
-
.. code-block:: bash
|
10 |
-
|
11 |
-
$ pip install pyvis
|
12 |
-
|
13 |
-
Or you can download an archive of the project here_. To install, unpack it
|
14 |
-
and run the following in the top-level directory:
|
15 |
-
|
16 |
-
.. code-block:: bash
|
17 |
-
|
18 |
-
$ python setup.py install
|
19 |
-
|
20 |
-
.. _here: https://github.com/WestHealth/pyvis/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pyvis/pyvis/source/introduction.rst
DELETED
@@ -1,13 +0,0 @@
|
|
1 |
-
============
|
2 |
-
Introduction
|
3 |
-
============
|
4 |
-
|
5 |
-
The goal of this project is to build a python based approach to constructing and visualizing
|
6 |
-
network graphs in the same space. A pyvis network can be customized on a per node or per edge
|
7 |
-
basis. Nodes can be given colors, sizes, labels, and other metadata. Each graph can be interacted
|
8 |
-
with, allowing the dragging, hovering, and selection of nodes and edges. Each graph's layout
|
9 |
-
algorithm can be tweaked as well to allow experimentation with rendering of larger graphs.
|
10 |
-
|
11 |
-
Pyvis is built around the amazing VisJS_ library.
|
12 |
-
|
13 |
-
.. _VisJS: https://visjs.github.io/vis-network/examples/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pyvis/pyvis/source/license.rst
DELETED
@@ -1,33 +0,0 @@
|
|
1 |
-
============
|
2 |
-
License
|
3 |
-
============
|
4 |
-
|
5 |
-
Pyvis is distributed with the BSD 3 Clause license.
|
6 |
-
|
7 |
-
Copyright (c) 2018, West Health Institute
|
8 |
-
All rights reserved.
|
9 |
-
|
10 |
-
Redistribution and use in source and binary forms, with or without modification,
|
11 |
-
are permitted provided that the following conditions are met:
|
12 |
-
|
13 |
-
- Redistributions of source code must retain the above copyright notice,
|
14 |
-
this list of conditions and the following disclaimer.
|
15 |
-
|
16 |
-
- Redistributions in binary form must reproduce the above copyright notice,
|
17 |
-
this list of conditions and the following disclaimer in the documentation
|
18 |
-
and/or other materials provided with the distribution.
|
19 |
-
|
20 |
-
- Neither the name of West Health Institute nor the names of its contributors may
|
21 |
-
be used to endorse or promote products derived from this software without
|
22 |
-
specific prior written permission.
|
23 |
-
|
24 |
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
25 |
-
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
26 |
-
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
27 |
-
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
28 |
-
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
29 |
-
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
30 |
-
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
31 |
-
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
32 |
-
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
33 |
-
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pyvis/pyvis/source/mulnodes.html
DELETED
@@ -1,80 +0,0 @@
|
|
1 |
-
<html>
|
2 |
-
<head>
|
3 |
-
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/vis/4.16.1/vis.css" type="text/css" />
|
4 |
-
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/vis/4.16.1/vis-network.min.js"> </script>
|
5 |
-
|
6 |
-
<!-- <link rel="stylesheet" href="../node_modules/vis/dist/vis.min.css" type="text/css" />
|
7 |
-
<script type="text/javascript" src="../node_modules/vis/dist/vis.js"> </script>-->
|
8 |
-
|
9 |
-
<style type="text/css">
|
10 |
-
|
11 |
-
#mynetwork1 {
|
12 |
-
width: 100%;
|
13 |
-
height: 300px;
|
14 |
-
border: 1px solid lightgray;
|
15 |
-
}
|
16 |
-
</style>
|
17 |
-
|
18 |
-
</head>
|
19 |
-
|
20 |
-
<body>
|
21 |
-
<div id = "mynetwork1"></div>
|
22 |
-
<script type="text/javascript">
|
23 |
-
|
24 |
-
// initialize global variables.
|
25 |
-
var edges;
|
26 |
-
var nodes;
|
27 |
-
var network;
|
28 |
-
var container;
|
29 |
-
var options, data;
|
30 |
-
|
31 |
-
|
32 |
-
// This method is responsible for drawing the graph, returns the drawn network
|
33 |
-
function drawGraph() {
|
34 |
-
var container = document.getElementById('mynetwork1');
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
// parsing and collecting nodes and edges from the python
|
39 |
-
nodes = [{'title': 'I am node 1', 'color': '#00ff1e', 'value': 10, 'label': 'NODE 1', 'shape': 'dot', 'y': 100.2, 'x': 21.4, 'id': 1}, {'title': 'node 2 here', 'color': '#162347', 'value': 100, 'label': 'NODE 2', 'shape': 'dot', 'y': 23.54, 'x': 54.2, 'id': 2}, {'title': 'and im node 3', 'color': '#dd4b39', 'value': 400, 'label': 'NODE 3', 'shape': 'dot', 'y': 32.1, 'x': 11.2, 'id': 3}];
|
40 |
-
edges = [];
|
41 |
-
|
42 |
-
// adding nodes and edges to the graph
|
43 |
-
data = {nodes: nodes, edges: edges};
|
44 |
-
|
45 |
-
var options = {
|
46 |
-
"configure": {
|
47 |
-
"enabled": false
|
48 |
-
},
|
49 |
-
"edges": {
|
50 |
-
"color": {
|
51 |
-
"inherit": true
|
52 |
-
},
|
53 |
-
"smooth": {
|
54 |
-
"enabled": false,
|
55 |
-
"type": "continuous"
|
56 |
-
}
|
57 |
-
},
|
58 |
-
"interaction": {},
|
59 |
-
"physics": {
|
60 |
-
"enabled": true
|
61 |
-
}
|
62 |
-
};
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
// default to using dot shape for nodes
|
67 |
-
options.nodes = {
|
68 |
-
shape: "dot"
|
69 |
-
}
|
70 |
-
|
71 |
-
network = new vis.Network(container, data, options);
|
72 |
-
return network;
|
73 |
-
|
74 |
-
}
|
75 |
-
|
76 |
-
drawGraph();
|
77 |
-
|
78 |
-
</script>
|
79 |
-
</body>
|
80 |
-
</html>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pyvis/pyvis/source/tutorial.rst
DELETED
@@ -1,227 +0,0 @@
|
|
1 |
-
|
2 |
-
============
|
3 |
-
Tutorial
|
4 |
-
============
|
5 |
-
The pyvis library is meant for quick generation of visual network graphs
|
6 |
-
with minimal python code. It is designed as a wrapper around the popular
|
7 |
-
Javascript visJS library found at this link_.
|
8 |
-
|
9 |
-
.. _link: https://visjs.github.io/vis-network/examples/
|
10 |
-
|
11 |
-
|
12 |
-
Getting started
|
13 |
-
---------------
|
14 |
-
All networks must be instantiated as a ``Network`` class instance
|
15 |
-
|
16 |
-
>>> from pyvis.network import Network
|
17 |
-
>>> net = Network()
|
18 |
-
|
19 |
-
Add nodes to the network
|
20 |
-
------------------------
|
21 |
-
>>> net.add_node(1, label="Node 1") # node id = 1 and label = Node 1
|
22 |
-
>>> net.add_node(2) # node id and label = 2
|
23 |
-
|
24 |
-
Here, the first parameter to the add_node method is the desired ID to give the
|
25 |
-
Node. This can be a string or a numeric. The label argument is the string that
|
26 |
-
will be visibly attached to the node in the final visualization. If no label
|
27 |
-
argument is specified then the node id will be used as a label.
|
28 |
-
|
29 |
-
.. note:: The ``ID`` parameter must be unique
|
30 |
-
|
31 |
-
You can also add a list of nodes
|
32 |
-
|
33 |
-
>>> nodes = ["a", "b", "c", "d"]
|
34 |
-
>>> net.add_nodes(nodes) # node ids and labels = ["a", "b", "c", "d"]
|
35 |
-
>>> net.add_nodes("hello") # node ids and labels = ["h", "e", "l", "o"]
|
36 |
-
|
37 |
-
.. note:: :meth:`network.Network.add_nodes` accepts any iterable as long as the contents are strings or numerics
|
38 |
-
|
39 |
-
Node properties
|
40 |
-
---------------
|
41 |
-
A call to :meth:`add_node` supports various node properties that can be set
|
42 |
-
individually. All of these properties can be found here_, courtesy of VisJS_.
|
43 |
-
For the direct Python translation of these attributes, reference the
|
44 |
-
:meth:`network.Network.add_node` docs.
|
45 |
-
|
46 |
-
.. _here: https://visjs.github.io/vis-network/docs/network/nodes.html
|
47 |
-
.. _VisJS: https://visjs.github.io/vis-network/docs/network/
|
48 |
-
|
49 |
-
.. note:: Through no fault of pyvis, some of the attributes in the VisJS_ documentation do not
|
50 |
-
work as expected, or at all. Pyvis can translate into the JavaScript
|
51 |
-
elements for VisJS_ but after that it's up to VisJS_!
|
52 |
-
|
53 |
-
Indexing a Node
|
54 |
-
---------------
|
55 |
-
Use the :meth:`get_node` method to index a node by its ID:
|
56 |
-
|
57 |
-
>>> net.add_nodes(["a", "b", "c"])
|
58 |
-
>>> net.get_node("c")
|
59 |
-
>>> {'id': 'c', 'label': 'c', 'shape': 'dot'}
|
60 |
-
|
61 |
-
|
62 |
-
Adding list of nodes with properties
|
63 |
-
------------------------------------
|
64 |
-
When using the :meth:`network.Network.add_nodes` method optional keyword arguments can be
|
65 |
-
passed in to add properties to these nodes as well. The valid properties in this case are
|
66 |
-
|
67 |
-
>>> ['size', 'value', 'title', 'x', 'y', 'label', 'color']
|
68 |
-
|
69 |
-
Each of these keyword args must be the same length as the nodes parameter to the method.
|
70 |
-
|
71 |
-
Example:
|
72 |
-
|
73 |
-
>>> g = Network()
|
74 |
-
>>> g.add_nodes([1,2,3], value=[10, 100, 400],
|
75 |
-
title=['I am node 1', 'node 2 here', 'and im node 3'],
|
76 |
-
x=[21.4, 54.2, 11.2],
|
77 |
-
y=[100.2, 23.54, 32.1],
|
78 |
-
label=['NODE 1', 'NODE 2', 'NODE 3'],
|
79 |
-
color=['#00ff1e', '#162347', '#dd4b39'])
|
80 |
-
|
81 |
-
.. raw:: html
|
82 |
-
:file: mulnodes.html
|
83 |
-
|
84 |
-
.. note:: If you mouse over each node you will see that the ``title`` of a node
|
85 |
-
attribute is responsible for rendering data on mouse hover. You can add ``HTML``
|
86 |
-
in your ``title`` string and it will be rendered as such.
|
87 |
-
|
88 |
-
.. note:: The ``color`` attribute can also be a plain HTML ``color`` like red or blue. You can also
|
89 |
-
specify the full ``rgba`` specification if needed. The VisJS_ documentation has more
|
90 |
-
details.
|
91 |
-
|
92 |
-
Detailed optional argument documentation for nodes are in the
|
93 |
-
:meth:`network.Network.add_node` method documentation.
|
94 |
-
|
95 |
-
Edges
|
96 |
-
-----
|
97 |
-
|
98 |
-
Assuming the network's nodes exist, the edges can then be added according to node id's
|
99 |
-
|
100 |
-
>>> net.add_node(0, label='a')
|
101 |
-
>>> net.add_node(1, label='b')
|
102 |
-
>>> net.add_edge(0, 1)
|
103 |
-
|
104 |
-
Edges can contain a ``weight`` attribute as well
|
105 |
-
|
106 |
-
>>> net.add_edge(0, 1, weight=.87)
|
107 |
-
|
108 |
-
Edges can be customized and documentation on options can be found at
|
109 |
-
:meth:`network.Network.add_edge` method documentation, or by referencing the
|
110 |
-
original VisJS edge_ module docs.
|
111 |
-
|
112 |
-
.. _edge: https://visjs.github.io/vis-network/docs/network/edges.html
|
113 |
-
|
114 |
-
`Networkx <https://networkx.github.io/>`_ integration
|
115 |
-
------------------------------------------------------
|
116 |
-
|
117 |
-
An easy way to visualize and construct pyvis networks is to use `Networkx <https://networkx.github.io>`_
|
118 |
-
and use pyvis's built-in networkx helper method to translate the graph. Note that the
|
119 |
-
Networkx node properties with the same names as those consumed by pyvis (e.g., ``title``) are
|
120 |
-
translated directly to the correspondingly-named pyvis node attributes.
|
121 |
-
|
122 |
-
>>> from pyvis.network import Network
|
123 |
-
>>> import networkx as nx
|
124 |
-
>>> nx_graph = nx.cycle_graph(10)
|
125 |
-
>>> nx_graph.nodes[1]['title'] = 'Number 1'
|
126 |
-
>>> nx_graph.nodes[1]['group'] = 1
|
127 |
-
>>> nx_graph.nodes[3]['title'] = 'I belong to a different group!'
|
128 |
-
>>> nx_graph.nodes[3]['group'] = 10
|
129 |
-
>>> nx_graph.add_node(20, size=20, title='couple', group=2)
|
130 |
-
>>> nx_graph.add_node(21, size=15, title='couple', group=2)
|
131 |
-
>>> nx_graph.add_edge(20, 21, weight=5)
|
132 |
-
>>> nx_graph.add_node(25, size=25, label='lonely', title='lonely node', group=3)
|
133 |
-
>>> nt = Network('500px', '500px')
|
134 |
-
# populates the nodes and edges data structures
|
135 |
-
>>> nt.from_nx(nx_graph)
|
136 |
-
>>> nt.show('nx.html')
|
137 |
-
|
138 |
-
.. raw:: html
|
139 |
-
:file: nx.html
|
140 |
-
|
141 |
-
|
142 |
-
Visualization
|
143 |
-
-------------
|
144 |
-
|
145 |
-
The displaying of a graph is achieved by a single method call on
|
146 |
-
:meth:`network.Network.show()` after the underlying network is constructed.
|
147 |
-
The interactive visualization is presented as a static HTML file.
|
148 |
-
|
149 |
-
>>> net.toggle_physics(True)
|
150 |
-
>>> net.show('mygraph.html')
|
151 |
-
|
152 |
-
.. note:: Triggering the :meth:`toggle_physics` method allows for more fluid graph interactions
|
153 |
-
|
154 |
-
Example: Visualizing a Game of Thrones character network
|
155 |
-
--------------------------------------------------------
|
156 |
-
|
157 |
-
The following code block is a minimal example of the capabilities of pyvis.
|
158 |
-
|
159 |
-
.. code-block:: python
|
160 |
-
|
161 |
-
from pyvis.network import Network
|
162 |
-
import pandas as pd
|
163 |
-
|
164 |
-
got_net = Network(height='750px', width='100%', bgcolor='#222222', font_color='white')
|
165 |
-
|
166 |
-
# set the physics layout of the network
|
167 |
-
got_net.barnes_hut()
|
168 |
-
got_data = pd.read_csv('https://www.macalester.edu/~abeverid/data/stormofswords.csv')
|
169 |
-
|
170 |
-
sources = got_data['Source']
|
171 |
-
targets = got_data['Target']
|
172 |
-
weights = got_data['Weight']
|
173 |
-
|
174 |
-
edge_data = zip(sources, targets, weights)
|
175 |
-
|
176 |
-
for e in edge_data:
|
177 |
-
src = e[0]
|
178 |
-
dst = e[1]
|
179 |
-
w = e[2]
|
180 |
-
|
181 |
-
got_net.add_node(src, src, title=src)
|
182 |
-
got_net.add_node(dst, dst, title=dst)
|
183 |
-
got_net.add_edge(src, dst, value=w)
|
184 |
-
|
185 |
-
neighbor_map = got_net.get_adj_list()
|
186 |
-
|
187 |
-
# add neighbor data to node hover data
|
188 |
-
for node in got_net.nodes:
|
189 |
-
node['title'] += ' Neighbors:<br>' + '<br>'.join(neighbor_map[node['id']])
|
190 |
-
node['value'] = len(neighbor_map[node['id']])
|
191 |
-
|
192 |
-
got_net.show('gameofthrones.html')
|
193 |
-
|
194 |
-
|
195 |
-
If you want to try out the above code, the csv data source can be `downloaded <https://www.macalester.edu/~abeverid/data/stormofswords.csv>`_
|
196 |
-
|
197 |
-
.. note:: The ``title`` attribute of each node is responsible for rendering data on node hover.
|
198 |
-
|
199 |
-
.. raw:: html
|
200 |
-
:file: gameofthrones.html
|
201 |
-
|
202 |
-
Using the configuration UI to dynamically tweak ``Network`` settings
|
203 |
-
----------------------------------------------------------------
|
204 |
-
You also have the option of supplying your visualization with a UI used to
|
205 |
-
dynamically alter some of the settings pertaining to your network. This could
|
206 |
-
be useful for finding the most optimal parameters to your graph's physics and
|
207 |
-
layout function.
|
208 |
-
|
209 |
-
>>> net.show_buttons(filter_=['physics'])
|
210 |
-
|
211 |
-
.. image:: buttons.gif
|
212 |
-
|
213 |
-
.. note:: You can copy/paste the output from the `generate options` button in the above UI
|
214 |
-
into :meth:`network.Network.set_options` to finalize your results from experimentation
|
215 |
-
with the settings.
|
216 |
-
|
217 |
-
.. image:: set_options_ex.gif
|
218 |
-
|
219 |
-
Using pyvis within `Jupyter <https://jupyter.org>`_ notebook
|
220 |
-
------------------------------------------------------------
|
221 |
-
|
222 |
-
Pyvis supports `Jupyter <https://jupyter.org>`_ notebook embedding through the
|
223 |
-
use of the :meth:`network.Network` constructor. The network instance must be
|
224 |
-
"prepped" during instantiation by supplying the `notebook=True` kwarg.
|
225 |
-
Example:
|
226 |
-
|
227 |
-
.. image:: jup.png
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pyvis/pyvis/templates/animation_template.html
DELETED
@@ -1,144 +0,0 @@
|
|
1 |
-
<html>
|
2 |
-
|
3 |
-
<head>
|
4 |
-
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/vis/4.16.1/vis.css" type="text/css" />
|
5 |
-
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/vis/4.16.1/vis-network.min.js"> </script>
|
6 |
-
<style type="text/css">
|
7 |
-
#mynetwork {
|
8 |
-
width: {{width}};
|
9 |
-
height: {{height}};
|
10 |
-
border: 1px solid lightgray;
|
11 |
-
}
|
12 |
-
</style>
|
13 |
-
</head>
|
14 |
-
|
15 |
-
<body>
|
16 |
-
<div id="mynetwork"></div>
|
17 |
-
|
18 |
-
|
19 |
-
<button onclick="getNextData()">Next Data!</button>
|
20 |
-
|
21 |
-
|
22 |
-
<input type="button" onclick="addNextData()" value="add node dynamically"> <br />
|
23 |
-
|
24 |
-
|
25 |
-
<script type="text/javascript">
|
26 |
-
var row_index = 0;
|
27 |
-
function addNextData() {
|
28 |
-
console.log(row_index);
|
29 |
-
row_index++;
|
30 |
-
document.button_form.row.value = row_index;
|
31 |
-
}
|
32 |
-
|
33 |
-
</script>
|
34 |
-
|
35 |
-
<script type="text/javascript">
|
36 |
-
|
37 |
-
var edges;
|
38 |
-
var network;
|
39 |
-
var container;
|
40 |
-
var options, data;
|
41 |
-
var edge_ids;
|
42 |
-
|
43 |
-
function drawGraph() {
|
44 |
-
|
45 |
-
var container = document.getElementById('mynetwork');
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
{% if use_DOT %}
|
50 |
-
alert("using DOT");
|
51 |
-
var DOTstring = "{{dot_lang|safe}}";
|
52 |
-
var parsedData = vis.network.convertDot(DOTstring);
|
53 |
-
|
54 |
-
data = {
|
55 |
-
nodes: parsedData.nodes,
|
56 |
-
edges: parsedData.edges
|
57 |
-
}
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
var options = parsedData.options;
|
62 |
-
|
63 |
-
options.nodes = {
|
64 |
-
shape: "dot"
|
65 |
-
}
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
{% else %}
|
70 |
-
|
71 |
-
|
72 |
-
var nodes = {{nodes|safe}};
|
73 |
-
|
74 |
-
edges = {{edges|safe}};
|
75 |
-
|
76 |
-
var e_values = [];
|
77 |
-
|
78 |
-
|
79 |
-
console.log("edges: " + e_values);
|
80 |
-
|
81 |
-
data = {nodes: nodes, edges: edges};
|
82 |
-
var options = {{options|safe}};
|
83 |
-
|
84 |
-
{% endif %}
|
85 |
-
|
86 |
-
{% if widget %}
|
87 |
-
var widgetFn = function(option, path) {
|
88 |
-
if(path.indexOf('nodes') !== -1 && option == 'size') {
|
89 |
-
return true;
|
90 |
-
}
|
91 |
-
return false;
|
92 |
-
};
|
93 |
-
|
94 |
-
options.configure.filter = widgetFn;
|
95 |
-
{% endif %}
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
network = new vis.Network(container, data, options);
|
100 |
-
return network;
|
101 |
-
|
102 |
-
}
|
103 |
-
|
104 |
-
|
105 |
-
function getEdges() {
|
106 |
-
old_edges = {};
|
107 |
-
for (var i = 0; i < edges.length; i++) {
|
108 |
-
old_edges[i] = edges[i]["width"];
|
109 |
-
}
|
110 |
-
return old_edges;
|
111 |
-
}
|
112 |
-
|
113 |
-
function outputUpdate(vol) {
|
114 |
-
document.querySelector('#volume').value = vol;
|
115 |
-
updateEdges(vol);
|
116 |
-
}
|
117 |
-
|
118 |
-
function updateEdges(vol) {
|
119 |
-
//console.log("Updating edges based off original widths of " + JSON.stringify(edge_ids));
|
120 |
-
for (var i = 0; i < edges.length; i++) {
|
121 |
-
|
122 |
-
var originalVal = old_edges[i];
|
123 |
-
//console.log("original value: " + originalVal);
|
124 |
-
edges[i]["width"] = originalVal + ((vol/10) * originalVal);
|
125 |
-
//console.log("new edge width: " + edges[i]["width"]);
|
126 |
-
|
127 |
-
}
|
128 |
-
|
129 |
-
data.edges = edges;
|
130 |
-
//console.log(data);
|
131 |
-
network.setData(data);
|
132 |
-
}
|
133 |
-
|
134 |
-
new_network = drawGraph();
|
135 |
-
old_edges = getEdges();
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
</script>
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
</body>
|
144 |
-
</html>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pyvis/pyvis/templates/template.html
CHANGED
@@ -3,7 +3,6 @@
|
|
3 |
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/vis-network@latest/styles/vis-network.css" type="text/css" />
|
4 |
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/vis-network@latest/dist/vis-network.min.js"> </script>
|
5 |
|
6 |
-
<script type="text/javascript" src="lib/bindings/utils.js"></script>
|
7 |
<link
|
8 |
href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta3/dist/css/bootstrap.min.css"
|
9 |
rel="stylesheet"
|
@@ -206,6 +205,112 @@
|
|
206 |
var container;
|
207 |
var options, data;
|
208 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
209 |
|
210 |
// This method is responsible for drawing the graph, returns the drawn network
|
211 |
function drawGraph() {
|
|
|
3 |
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/vis-network@latest/styles/vis-network.css" type="text/css" />
|
4 |
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/vis-network@latest/dist/vis-network.min.js"> </script>
|
5 |
|
|
|
6 |
<link
|
7 |
href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta3/dist/css/bootstrap.min.css"
|
8 |
rel="stylesheet"
|
|
|
205 |
var container;
|
206 |
var options, data;
|
207 |
|
208 |
+
function neighbourhoodHighlight(params) {
|
209 |
+
console.log("in nieghborhoodhighlight");
|
210 |
+
console.log(params);
|
211 |
+
allNodes = nodes.get({ returnType: "Object" });
|
212 |
+
// originalNodes = JSON.parse(JSON.stringify(allNodes));
|
213 |
+
// if something is selected:
|
214 |
+
if (params.nodes.length > 0) {
|
215 |
+
highlightActive = true;
|
216 |
+
var i, j;
|
217 |
+
var selectedNode = params.nodes[0];
|
218 |
+
var degrees = 2;
|
219 |
+
|
220 |
+
// mark all nodes as hard to read.
|
221 |
+
for (var nodeId in allNodes) {
|
222 |
+
// nodeColors[nodeId] = allNodes[nodeId].color;
|
223 |
+
allNodes[nodeId].color = "rgba(200,200,200,0.5)";
|
224 |
+
if (allNodes[nodeId].hiddenLabel === undefined) {
|
225 |
+
allNodes[nodeId].hiddenLabel = allNodes[nodeId].label;
|
226 |
+
allNodes[nodeId].label = undefined;
|
227 |
+
}
|
228 |
+
}
|
229 |
+
var connectedNodes = network.getConnectedNodes(selectedNode);
|
230 |
+
var allConnectedNodes = [];
|
231 |
+
|
232 |
+
// get the second degree nodes
|
233 |
+
for (i = 1; i < degrees; i++) {
|
234 |
+
for (j = 0; j < connectedNodes.length; j++) {
|
235 |
+
allConnectedNodes = allConnectedNodes.concat(
|
236 |
+
network.getConnectedNodes(connectedNodes[j])
|
237 |
+
);
|
238 |
+
}
|
239 |
+
}
|
240 |
+
|
241 |
+
// all second degree nodes get a different color and their label back
|
242 |
+
for (i = 0; i < allConnectedNodes.length; i++) {
|
243 |
+
// allNodes[allConnectedNodes[i]].color = "pink";
|
244 |
+
allNodes[allConnectedNodes[i]].color = "rgba(150,150,150,0.75)";
|
245 |
+
if (allNodes[allConnectedNodes[i]].hiddenLabel !== undefined) {
|
246 |
+
allNodes[allConnectedNodes[i]].label =
|
247 |
+
allNodes[allConnectedNodes[i]].hiddenLabel;
|
248 |
+
allNodes[allConnectedNodes[i]].hiddenLabel = undefined;
|
249 |
+
}
|
250 |
+
}
|
251 |
+
|
252 |
+
// all first degree nodes get their own color and their label back
|
253 |
+
for (i = 0; i < connectedNodes.length; i++) {
|
254 |
+
// allNodes[connectedNodes[i]].color = undefined;
|
255 |
+
allNodes[connectedNodes[i]].color = nodeColors[connectedNodes[i]];
|
256 |
+
if (allNodes[connectedNodes[i]].hiddenLabel !== undefined) {
|
257 |
+
allNodes[connectedNodes[i]].label =
|
258 |
+
allNodes[connectedNodes[i]].hiddenLabel;
|
259 |
+
allNodes[connectedNodes[i]].hiddenLabel = undefined;
|
260 |
+
}
|
261 |
+
}
|
262 |
+
|
263 |
+
// the main node gets its own color and its label back.
|
264 |
+
// allNodes[selectedNode].color = undefined;
|
265 |
+
allNodes[selectedNode].color = nodeColors[selectedNode];
|
266 |
+
if (allNodes[selectedNode].hiddenLabel !== undefined) {
|
267 |
+
allNodes[selectedNode].label = allNodes[selectedNode].hiddenLabel;
|
268 |
+
allNodes[selectedNode].hiddenLabel = undefined;
|
269 |
+
}
|
270 |
+
} else if (highlightActive === true) {
|
271 |
+
console.log("highlightActive was true");
|
272 |
+
// reset all nodes
|
273 |
+
for (var nodeId in allNodes) {
|
274 |
+
// allNodes[nodeId].color = "purple";
|
275 |
+
allNodes[nodeId].color = nodeColors[nodeId];
|
276 |
+
// delete allNodes[nodeId].color;
|
277 |
+
if (allNodes[nodeId].hiddenLabel !== undefined) {
|
278 |
+
allNodes[nodeId].label = allNodes[nodeId].hiddenLabel;
|
279 |
+
allNodes[nodeId].hiddenLabel = undefined;
|
280 |
+
}
|
281 |
+
}
|
282 |
+
highlightActive = false;
|
283 |
+
}
|
284 |
+
|
285 |
+
// transform the object into an array
|
286 |
+
var updateArray = [];
|
287 |
+
if (params.nodes.length > 0) {
|
288 |
+
for (nodeId in allNodes) {
|
289 |
+
if (allNodes.hasOwnProperty(nodeId)) {
|
290 |
+
// console.log(allNodes[nodeId]);
|
291 |
+
updateArray.push(allNodes[nodeId]);
|
292 |
+
}
|
293 |
+
}
|
294 |
+
nodes.update(updateArray);
|
295 |
+
} else {
|
296 |
+
console.log("Nothing was selected");
|
297 |
+
for (nodeId in allNodes) {
|
298 |
+
if (allNodes.hasOwnProperty(nodeId)) {
|
299 |
+
// console.log(allNodes[nodeId]);
|
300 |
+
// allNodes[nodeId].color = {};
|
301 |
+
updateArray.push(allNodes[nodeId]);
|
302 |
+
}
|
303 |
+
}
|
304 |
+
nodes.update(updateArray);
|
305 |
+
}
|
306 |
+
}
|
307 |
+
|
308 |
+
function selectNode(node) {
|
309 |
+
network.selectNodes([node]);
|
310 |
+
neighbourhoodHighlight({ nodes: [node] });
|
311 |
+
return node;
|
312 |
+
}
|
313 |
+
|
314 |
|
315 |
// This method is responsible for drawing the graph, returns the drawn network
|
316 |
function drawGraph() {
|