You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
wanijo/src/wanijo/visualisation/view.clj

24 lines
950 B

(ns wanijo.visualisation.view
(:require [hiccup.page :refer [include-js include-css]]
[hiccup.form :as hform]
[hiccup.core :refer [h]]
[wanijo.infra.routing :refer [path]]
[wanijo.infra.view :as view]))
(defn index [instance req]
(view/layout
:request req
:head (list (include-css "/css/vis-network.min.css")
(include-js "/js/vis-network.min.js"
"/js/vis.js"))
:content
[[:h1 "Explore instance " [:small (h (:name instance))]]
[:form.search {:action (path :vis-search-instance {:term ""})}
(hform/label "term" "Search Instance")
(hform/text-field {:autofocus true} "term")
[:input {:style "display: none" :type "submit"}]]
[:div.vis-canvas {:data-instance-url (path :vis-get-instance instance)}]
[:p.flash--warn
"Changes to the visualisation will not
(yet) mirror to the actual database"]]))