-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Export graph data #61
Comments
FWIW, I was able to grab the raw graph data this tool generates by using the wget command found in issue #49: #49 (comment) and then editing the index.html, and then post-processing it to a format gephi could use. It was more manual work than I had planned, which is why I thought it might make a nice feature. |
It should be possible to create a view that returns the data in a format you like by taking inspiration from the existing view: django-schema-graph/schema_graph/views.py Lines 29 to 33 in f0b982c
In your case, I think you'll want something like: from cattrs.preconf.json import make_converter as make_json_converter
from django.http import HttpResponse
from schema_graph.schema import get_schema
def schema_json(request):
schema = get_schema()
json_converter = make_json_converter()
schema_json = json_converter.dumps(schema)
return HttpResponse(schema_json, content_type="application/json") This example returns the graph data as JSON, but if you want another format you should be able to do that in the view. |
Gephi [ https://gephi.org ] is a handy graph visualization tool, as is Graphviz [ https://graphviz.org ]. It would be cool if it were easy to just export the raw graph data here, and then import it a popular graph visualization tool of choice to run graph algorithms on it and study it further.
The text was updated successfully, but these errors were encountered: