- Notifications
You must be signed in to change notification settings - Fork 630
Fix graph bugs #391
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
Fix graph bugs #391
Changes from all commits
a2aaebb d9aec25 c8ff8a4 9996d42 f609af0 7a897fc df70d96 da74c18 3922cd2 f274b78 1eb7a81 fdf7ab1 e719dfd dba5bad 3cbf005 9526d1b c16eaa2 08c624f 732547c d957f3c 3055be6 fa6cfc4 File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| | @@ -298,11 +298,18 @@ def individual_audio(): | |
| | ||
| @app.route('/data/plugin/graphs/graph') | ||
| def graph(): | ||
| # TODO(ChunweiYan) need to add a config for whether have graph. | ||
| if graph_image_path is None or not os.path.isfile(graph_image_path): | ||
| data = {'url': ''} | ||
| # TODO(daming-lu): rename variables because we switched from static graph generated by graphviz | ||
| # to d3/dagre drawn svg | ||
| if graph_image_path is not None: | ||
| There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will we generate static image? We might be able to remove block There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Like the TODO mentioned, we need to rename and remove some stuff because we were using GraphViz previously. I will do it after the release | ||
| data = { | ||
| 'data': graph_image_path, | ||
| } | ||
| else: | ||
| data = {'url': '/graphs/image'} | ||
| image_dir = os.path.join(args.logdir, "graphs") | ||
| There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. image_dir seems un-necessary now. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. It will be removed in the code cleanup. | ||
| if not os.path.isdir(image_dir): | ||
| os.mkdir(image_dir) | ||
| json_str = vdl_graph.draw_graph(args.model_pb, image_dir) | ||
| data = {'data': json_str} | ||
| result = gen_result(0, "", data) | ||
| return Response(json.dumps(result), mimetype='application/json') | ||
| | ||
| | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function name doesn't apply anymore. Also the we no longer need image_dir.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. This will also be renamed in the cleanup PR.