Skip to content

Commit

Permalink
gui details (#25)
Browse files Browse the repository at this point in the history
* slightly modifying side bar layout

* display model name in title

* not in use

* making plot autosize

* models not components

* formatting
  • Loading branch information
ljamt authored Jan 4, 2019
1 parent 48f034c commit 13752a8
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
4 changes: 0 additions & 4 deletions resources/public/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,4 @@ body {

.pull-right {
float: right !important;
}

#charty {
width: 1000px;
}
4 changes: 3 additions & 1 deletion src/cse_client/trend.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@
{:component-did-mount (fn [comp]
(js/Plotly.plot (r/dom-node comp) (clj->js [{:x []
:y []}])
(clj->js {:xaxis {:title "Time [s]"}}))
(clj->js {:xaxis {:title "Time [s]"}
:autosize true
:use-resize-handler true}))
(.on (r/dom-node comp) "plotly_relayout" relayout-callback))
:component-did-update update
:reagent-render (fn []
Expand Down
20 changes: 12 additions & 8 deletions src/cse_client/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,14 @@
"Trend"
[:div.ui.teal.left.pointing.label trend-count]])
[:div.ui.divider]
(map (fn [module]
[:a.item {:class (when (= route-module module) :active)
:key module
:href (k/path-for [:module {:module module}])} module])
modules)]))
[:div.item
[:div.header "Models"]
[:div.menu
(map (fn [module]
[:a.item {:class (when (= route-module module) :active)
:key module
:href (k/path-for [:module {:module module}])} module])
modules)]]]))

(defn realtime-button []
(if @(rf/subscribe [:realtime?])
Expand Down Expand Up @@ -128,7 +131,7 @@
[:tr
[:td k]
[:td v]])]]
[:div.header "Controls"]
[:h3 "Controls"]
[:table.ui.basic.table.definition
[:tbody
[:tr [:td "Real time target"] [:td [realtime-button]]]
Expand Down Expand Up @@ -168,7 +171,8 @@
(defn root-comp []
(let [socket-state (rf/subscribe [:kee-frame.websocket/state socket-url])
loaded? (rf/subscribe [:loaded?])
status (rf/subscribe [:status])]
status (rf/subscribe [:status])
module (rf/subscribe [:module])]
[:div
[:div.ui.inverted.huge.borderless.fixed.menu
[:a.header.item {:href "/"} "Core Simulation Environment - demo application"]
Expand Down Expand Up @@ -197,7 +201,7 @@
[:div.ui.grid
[:div.row
[:h1.ui.huge.header [k/switch-route (comp :name :data)
:module "Model"
:module (if @module (@module :name) "")
:trend "Trend"
:index (if @loaded? "Simulation status" "Simulation setup")
nil [:div "Loading..."]]]]
Expand Down

0 comments on commit 13752a8

Please sign in to comment.