From 038c3ea0a89cec3794b20db51bee6154a2b1cd23 Mon Sep 17 00:00:00 2001 From: Josha von Gizycki Date: Fri, 18 Jan 2019 08:15:06 +0100 Subject: [PATCH] embed svg of all-instances directly into html --- resources/app/stylesheets/app.less | 2 +- src/wanijo/visualisation/routes.clj | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/resources/app/stylesheets/app.less b/resources/app/stylesheets/app.less index 8e75d8d..4dc392b 100644 --- a/resources/app/stylesheets/app.less +++ b/resources/app/stylesheets/app.less @@ -44,7 +44,7 @@ em { font-weight: bold; } -img { +img, svg { max-width: 100%; } diff --git a/src/wanijo/visualisation/routes.clj b/src/wanijo/visualisation/routes.clj index 93233e5..d5fdf3a 100644 --- a/src/wanijo/visualisation/routes.clj +++ b/src/wanijo/visualisation/routes.clj @@ -13,8 +13,7 @@ :request req :content [[:h1 "All Instances"] - [:img {:src (path :vis-all-instances-img) - :alt "All Instances"}]])) + (viz/all-instances (vis-domain/all-instance-connections!))])) (defroutes routes (GET (register! :vis-single-instance "/visualisation/instance/:uuid") @@ -24,8 +23,4 @@ :headers {"Content-Type" "image/svg+xml"}}) (GET (register! :vis-all-instances "/visualisation/all-instances") [:as req] - (all-instances req)) - (GET (register! :vis-all-instances-img "/visualisation/all-instances.svg") - [] - {:body (viz/all-instances (vis-domain/all-instance-connections!)) - :headers {"Content-Type" "image/svg+xml"}})) + (all-instances req)))