summaryrefslogtreecommitdiff
path: root/examples/javascript
diff options
context:
space:
mode:
authorJarrod Millman <jarrod.millman@gmail.com>2017-07-21 08:50:40 -0700
committerDan Schult <dschult@colgate.edu>2017-07-21 11:50:40 -0400
commit1e6df4c105fa7a1e442da72ddb009bb253dc7d4e (patch)
treed728526ccca673a762f90f174223cb558c86e02d /examples/javascript
parent7be0d8f33b46d37264ae181cb2a9fadb310fe687 (diff)
downloadnetworkx-1e6df4c105fa7a1e442da72ddb009bb253dc7d4e.tar.gz
Refactor examples (#2527)
* Fix unix_email and plot more examples * Fix doctest * Fix more examples * Fix AntiGraph.degree generator error in examples * Style/consistency changes and plot more examples
Diffstat (limited to 'examples/javascript')
-rw-r--r--examples/javascript/force.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/examples/javascript/force.py b/examples/javascript/force.py
index fb6275fe..21b81040 100644
--- a/examples/javascript/force.py
+++ b/examples/javascript/force.py
@@ -7,16 +7,17 @@ Example of writing JSON format graph data and using the D3 Javascript library to
"""
# Author: Aric Hagberg <aric.hagberg@gmail.com>
-# Copyright (C) 2011-2016 by
+# Copyright (C) 2011-2017 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
import json
+
+import flask
import networkx as nx
from networkx.readwrite import json_graph
-import flask
G = nx.barbell_graph(6, 3)
# this d3 example uses the name attribute for the mouse-hover value,
@@ -32,11 +33,9 @@ print('Wrote node-link JSON data to force/force.json')
# Serve the file over http to allow for cross origin requests
app = flask.Flask(__name__, static_folder="force")
-
@app.route('/<path:path>')
def static_proxy(path):
return app.send_static_file(path)
-
print('\nGo to http://localhost:8000/force.html to see the example\n')
app.run(port=8000)