Skip to content

Commit

Permalink
Merge pull request #9 from icfly2/move_to_class
Browse files Browse the repository at this point in the history
Move to class
  • Loading branch information
icfly2 committed Jun 1, 2022
2 parents 2fa90b4 + f958edf commit 6ea8b5e
Show file tree
Hide file tree
Showing 10 changed files with 357 additions and 186 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ jobs:
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
python -m pip install jinja2>=2.10.3 py2neo>=2020.0.0 IPython
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
Expand Down
2 changes: 0 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ services:
graphviz:
image: neographviz:latest
environment:
#- VIRTUAL_HOST= results.thebeast.sxp.saxopayments.com
#- PYTHONFILESHARE=/data/git/
- env=$env
ports:
- 5002:5000
Expand Down
6 changes: 2 additions & 4 deletions neographviz/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
from py2neo import Graph

__version__ = "0.4.6"
from .vis import plot, vis_network
__version__ = "0.5.0"
from .vis import plot, Plot
21 changes: 13 additions & 8 deletions neographviz/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,28 @@
@app.route("/")
def index():
"Main graph page"
query = request.args.get('query', 'match p= ()--() return p limit 25')
query = request.args.get("query", "match p= ()--() return p limit 25")
out = plot(graph, query=query, template_file="vis.html", app=True)
return out


if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Launch a graph visalisation app.')
parser.add_argument('--debug', type=bool, default='True',
help='Flag for debugging')
parser.add_argument('--host', default='', type=str,
help='Path to the graph DB, defaults to localhost')
parser.add_argument('--port', default=5000, type=int,
help='POrt on which to serve the app')
parser = argparse.ArgumentParser(description="Launch a graph visalisation app.")
parser.add_argument("--debug", type=bool, default="True", help="Flag for debugging")
parser.add_argument(
"--host",
default="",
type=str,
help="Path to the graph DB, defaults to localhost",
)
parser.add_argument(
"--port", default=5000, type=int, help="POrt on which to serve the app"
)
options = parser.parse_args()
graph = Graph(options.host)
if options.debug:
app.run(debug=True, port=5000)
else:
import waitress

waitress.serve(app, host="0.0.0.0", port=5000)
Loading

0 comments on commit 6ea8b5e

Please sign in to comment.