Add basic data structure views and styles

This commit is contained in:
chris (daiyi) 2017-09-01 16:04:20 +02:00 committed by Daniel Compton
parent 4ea8041bbc
commit 251b3436ae
4 changed files with 94 additions and 5 deletions

View File

@ -22,6 +22,9 @@
========================================================================== */ ========================================================================== */
background: white; background: white;
font-family: 'courier new', monospace; font-family: 'courier new', monospace;
color: #222222;
/* app-state data viewer
========================================================================== */
} }
#--re-frame-trace-- * { #--re-frame-trace-- * {
all: unset; all: unset;
@ -415,3 +418,41 @@
#--re-frame-trace-- .active { #--re-frame-trace-- .active {
opacity: 1; opacity: 1;
} }
#--re-frame-trace-- .re-frame-trace--collection {
border-left: 1px solid #efeef1;
margin-left: 10px;
padding-left: 10px;
}
#--re-frame-trace-- .re-frame-trace--primative:not(:first-child) {
margin-left: 10px;
}
#--re-frame-trace-- .re-frame-trace--boolean {
font-style: italic;
}
#--re-frame-trace-- .re-frame-trace--string:before {
color: #8f8f8f;
content: "\"";
}
#--re-frame-trace-- .re-frame-trace--string:after {
color: #8f8f8f;
content: "\"";
}
#--re-frame-trace-- .re-frame-trace--nil {
text-decoration: line-through;
font-style: italic;
}
#--re-frame-trace-- .re-frame-trace--keyword {
color: #616cdb;
}
#--re-frame-trace-- .re-frame-trace--cljs-core-PersistentArrayMap:before,
#--re-frame-trace-- .re-frame-trace--cljs-core-PersistentTreeMap:before,
#--re-frame-trace-- .re-frame-trace--cljs-core-PersistentVector:before {
color: #8f8f8f;
content: "{";
}
#--re-frame-trace-- .re-frame-trace--cljs-core-PersistentArrayMap:after,
#--re-frame-trace-- .re-frame-trace--cljs-core-PersistentTreeMap:after,
#--re-frame-trace-- .re-frame-trace--cljs-core-PersistentVector:after {
color: #8f8f8f;
content: "}";
}

View File

@ -241,6 +241,7 @@
background: white; background: white;
font-family: 'courier new', monospace; font-family: 'courier new', monospace;
color: @text-color;
table { table {
width: 100%; width: 100%;
@ -523,4 +524,54 @@
.active { .active {
opacity: 1; opacity: 1;
} }
/* app-state data viewer
========================================================================== */
.re-frame-trace--collection {
border-left: 1px solid @light-gray;
margin-left: 10px;
padding-left: 10px;
// background: rgba(0, 0, 0, 0.07);
}
.re-frame-trace--primative:not(:first-child) {
margin-left: 10px;
// color: @text-color-muted;
}
.re-frame-trace--number {
}
.re-frame-trace--boolean {
font-style: italic;
}
.re-frame-trace--string {
&:before {
color: @text-color-muted;
content: "\"";
}
&:after {
color: @text-color-muted;
content: "\"";
}
}
.re-frame-trace--nil {
text-decoration: line-through;
font-style: italic;
}
.re-frame-trace--keyword {
color: @light-purple;
}
.re-frame-trace--symbol {
}
.re-frame-trace--cljs-core-PersistentArrayMap,
.re-frame-trace--cljs-core-PersistentTreeMap,
.re-frame-trace--cljs-core-PersistentVector {
&:before {
color: @text-color-muted;
content: "{";
}
&:after {
color: @text-color-muted;
content: "}";
}
}
} }

View File

@ -399,7 +399,6 @@
:subvis [subvis/render-subvis traces :subvis [subvis/render-subvis traces
[:div.panel-content-scrollable]] [:div.panel-content-scrollable]]
:app-state [app-state/tab @db/app-db])]]]))}))) :app-state [app-state/tab @db/app-db])]]]))})))
(defn panel-div [] (defn panel-div []
(let [id "--re-frame-trace--" (let [id "--re-frame-trace--"
panel (.getElementById js/document id)] panel (.getElementById js/document id)]

View File

@ -27,8 +27,8 @@
(defn view (defn view
[data] [data]
(if (coll? data) (if (coll? data)
[:div {:class (str (namespace-css "collection") " " (namespace-css (css-munge (type-string data))))}] [:div {:class (str (namespace-css "collection") " " (namespace-css (css-munge (type-string data))))}]
[:span {:class (namespace-css (css-munge (type-string data)))} (str data)])) [:span {:class (str (namespace-css "primative") " " (namespace-css (css-munge (type-string data))))} (str data)]))
(defn crawl (defn crawl
[data] [data]
@ -37,8 +37,6 @@
(view data))) (view data)))
(defn tab [data] (defn tab [data]
(pprint data)
(pprint (crawl data))
[:div {:style {:flex "1 0 auto" :width "100%" :height "100%" :display "flex" :flex-direction "column"}} [:div {:style {:flex "1 0 auto" :width "100%" :height "100%" :display "flex" :flex-direction "column"}}
[:div.panel-content-scrollable [:div.panel-content-scrollable
(crawl data)]]) (crawl data)]])