Commit 1f67a66c authored by Alexander Lercher's avatar Alexander Lercher

added multilayer result for querying

parent d94883d1
......@@ -28,19 +28,33 @@ paths:
responses:
200:
description: "Successful echo of request data"
/graphinfo:
/agi/multilayer/multilayer.png:
get:
operationId: "rest.graphinfo.get"
operationId: "rest.multilayer.get_image"
tags:
- "GraphInfo"
summary: "Get info about clustered nodes"
description: "Returns multiple metrics for all nodes created by analyzing and clustering the blockchain traces"
- "Multilayer"
summary: "Returning the multilayer created from AGI data"
parameters: []
produces:
- "image/png"
responses:
200:
description: "Successful operation"
schema:
$ref: "#/definitions/NodeInfo"
description: "Successful echo of request data"
# /graphinfo:
# get:
# operationId: "rest.graphinfo.get"
# tags:
# - "GraphInfo"
# summary: "Get info about clustered nodes"
# description: "Returns multiple metrics for all nodes created by analyzing and clustering the blockchain traces"
# parameters: []
# responses:
# 200:
# description: "Successful operation"
# schema:
# $ref: "#/definitions/NodeInfo"
definitions:
NodeInfo:
......
from flask import request, Response
from initialdemo.NodeInfo import NodeInfo
from flask import request, Response, send_file
import pickle as json
import io
from flask import request, Response
from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
from visualization.multilayer import *
from core import multinet
def get():
## multilayer
multilayer_network = multinet.multi_layer_network().load_network("/home/zarah/Downloads/multigraph2.gpickle", directed=False, input_type="gpickle_biomine")
multilayer_network.basic_stats() ## check core imports
multilayer_network.visualize_network(style="diagonal")
import visualization.multilayer as m
fig = m.main_figure
output = io.BytesIO()
FigureCanvas(fig).print_png(output)
return Response(output.getvalue(), mimetype="image/png")
\ No newline at end of file
def get_image():
return send_file("multilayer.png", mimetype="image/png")
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment