提交 e94a20c1 编写于 作者: Q Qiao Longfei 提交者: GitHub

add graph mock data (#62)

* add graph mock data

* rm run parameter

* add simple MLP graph

* use json format for graph
上级 52b00f9a
......@@ -99,3 +99,130 @@ def sequence_data():
], [1465980671.173917, 108, 0.7400000095367432], [
1465980671.205898, 109, 0.8799999952316284
], [1465980671.833723, 111, 0.9100000262260437]]
def graph_data():
return """{
"title": {
"text": "MLP"
},
"tooltip": {},
"animationDurationUpdate": 1500,
"animationEasingUpdate": "quinticInOut",
"series": [
{
"type": "graph",
"layout": "none",
"symbolSize": 50,
"roam": true,
"label": {
"normal": {
"show": true
}
},
"edgeSymbol": [
"circle",
"arrow"
],
"edgeSymbolSize": [
4,
10
],
"edgeLabel": {
"normal": {
"textStyle": {
"fontSize": 20
}
}
},
"data": [
{
"name": "X",
"x": 450,
"y": 600
},
{
"name": "W1",
"x": 750,
"y": 600
},
{
"name": "B1",
"x": 650,
"y": 600
},
{
"name": "W2",
"x": 650,
"y": 800
},
{
"name": "B2",
"x": 750,
"y": 800
},
{
"name": "FC1",
"x": 550,
"y": 700
},
{
"name": "RELU",
"x": 550,
"y": 800
},
{
"name": "FC2",
"x": 550,
"y": 900
},
{
"name": "Y",
"x": 550,
"y": 1000
}
],
"links": [
{
"source": "X",
"target": "FC1"
},
{
"source": "W1",
"target": "FC1"
},
{
"source": "B1",
"target": "FC1"
},
{
"source": "FC1",
"target": "RELU"
},
{
"source": "RELU",
"target": "FC2"
},
{
"source": "W2",
"target": "FC2"
},
{
"source": "B2",
"target": "FC2"
},
{
"source": "FC2",
"target": "Y"
}
],
"lineStyle": {
"normal": {
"opacity": 0.9,
"width": 2,
"curveness": 0
}
}
}
]
}"""
\ No newline at end of file
......@@ -168,8 +168,12 @@ def histogram():
@app.route('/data/plugin/graphs/graph')
def graph():
model_json = graph.load_model("")
return Response(model_json, mimetype='application/json')
# run = request.args.get('run')
# model_json = graph.load_model("")
model_json_str = mock_data.graph_data()
model_json = json.loads(model_json_str)
result = gen_result(0, "", model_json)
return Response(json.dumps(result), mimetype='application/json')
if __name__ == '__main__':
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册