From 8ac3194f06084dfe5d0cfb141f178d83d937fcc3 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Fri, 17 Sep 2021 10:35:15 +0300 Subject: Return path to generated filename for now Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/clustering.gmi * To help with demonstrating that the code is producing the expected output, for now, we return the path to the generated html file that displays the interactive heatmap. At this point, it is mostly useful in the development environment. Moving forward, we might have to actually stream the raw html, or if we can get the Kaleido library packaged for GNU Guix, stream the images binary data instead. --- gn3/api/heatmaps.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/gn3/api/heatmaps.py b/gn3/api/heatmaps.py index cac9c71..f053241 100644 --- a/gn3/api/heatmaps.py +++ b/gn3/api/heatmaps.py @@ -20,9 +20,10 @@ def clustered_heatmaps(): # stream the heatmap data somehow here. # Can plotly actually stream the figure data in a way that can be used on # remote end to display the image without necessarily being html? - return jsonify( - { - "query": heatmap_request, - "output_png": heatmap_fig.to_image(format="png"), - "output_svg": heatmap_fig.to_image(format="svg") - }), 200 + # return jsonify( + # { + # "query": heatmap_request, + # "output_png": heatmap_fig.to_image(format="png"), + # "output_svg": heatmap_fig.to_image(format="svg") + # }), 200 + return jsonify({"output_filename": _heatmap_file}), 200 -- cgit v1.2.3