This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-08-20
Channels
- # alda (2)
- # beginners (6)
- # boot (25)
- # cider (10)
- # clojars (5)
- # clojure (81)
- # clojure-brasil (1)
- # clojure-dev (2)
- # clojure-russia (19)
- # clojure-spec (21)
- # clojure-uk (69)
- # clojurescript (23)
- # code-reviews (15)
- # cursive (3)
- # datavis (1)
- # datomic (8)
- # euroclojure (3)
- # events (5)
- # flambo (15)
- # hoplon (17)
- # jobs-rus (13)
- # lambdaisland (50)
- # mount (5)
- # off-topic (3)
- # om (1)
- # parinfer (72)
- # proton (1)
- # protorepl (1)
- # re-frame (17)
- # reagent (59)
- # videos (1)
@flyboarder i was trying to make bidi
work,
but it's a bit too much (~600lines), especially for SPA routing.
that's why i went with what hoplon ui.
1. it has one route
cell
2. which has a structure like [[:path :segments ...] {:param1 "val1"}]
3. representing #/path/segments/...?param1="val1"
4. and its bidirectionally bound to js/window.location.hash
we agreed to have a convention in our app, so the 1st path element always represents a view
or screen
as micha calls it
and the 2nd path elem represents alternate versions of that screen, which are usually implemented as tabs
visually.
that's why i defined the following path-cell
s:
(def current-path (path-cell route [0]))
(def current-qmap (path-cell route [1]))
(def current-view (path-cell route [0 0]))
(def current-tab (path-cell route [0 1]))
so i can independently change these various bits, besides concisely writing code which depend on them@thedavidmeister: dang, my reply seems to have disappeared. I like plottable very much, but I needed to zoom-pan an ordinal axis (because I had a lot of categories) and plottable didn't support it, so I had to go back to vanilla d3.
@adamw http://tailrecursion.com/~alan/ttt/basic.html is the prototype i made many moons ago
unfortunately you can't easily tell which nodes in the graph correspond to which cells in the source code, but since i've made this, cljs has begun to support retaining Var metadata. so source code and def names could be available at runtime, and we could potentially then show in visualizations like this
I have this timer element and i'm trying to get the timer element todisplay "0:00" before the js/alert fires off, is there an easy way to do this that i'm missing? (countdown cell is seconds remaining)
(defelem countdown [{:keys [countdown-cell] :as attrs} kids]
(let [interval (.setInterval js/window #(swap! countdown-cell dec) 1000)]
(cell=
(when (zero? countdown-cell)
(js/alert "DONE")
(.clearInterval js/window interval)))
(div attrs
(cell= (pprint/cl-format nil
"~2,'0d:~2,'0d"
(int (/ countdown-cell 60))
(mod countdown-cell 60))))))
currently the alert fires while the timer displays 0:01 and only after closing the alert does it show 0:00
@jjttjj love the cl-format
action btw!