Clojurians
#hoplon
<
2016-07-20
>

This page is not created by, affiliated with, or supported by Slack Technologies, Inc.

levitanong03:07:24

@adamw Give http://plottablejs.org/ a try πŸ™‚ It’s also reactive to boot!

adamw05:07:26

@levitanong: will do thanks!

adamw09:07:39

Ok so annoying javelin question. I am probably doing this the wrong way, any suggestions greatly welcomed. I have a cell that responds when window size changes (couples a resize listener to a cell) and if so, triggers a pdf/js re-render. This actually returns a promise, and it's not a good idea to call .render() again while it's rendering (does weird stuff). So I would like to gate my cell on both size changed & not currently rendering. This is what I tried:

(defn page-size [page canvas pg-width pg-height]
  (let [
        rendering (cell false)
        ]
    ; set canvas size and re-render page
    (cell= (let [...other stuff...]
             (when (not rendering)
               (reset! rendering true)
               (.then (.render page render-context) #(reset! rendering false))
               )))))

adamw09:07:50

problem of course is that I can't (reset! rendering true) inside the (cell= because rendering is passed as the value, -not- the cell. Is there a way to get a hold of the actual cell so I can set it to false. And if I do will it cause weird stuff to happen on propagation (since the current cell depends on rendering as well)? Any suggestions? πŸ™‚

peterromfeld13:07:19

hi d3 is quite complicated, i really liked the convenience layer of http://c3js.org/

peterromfeld13:07:46

there is cljsjs package for it, but like most cljsjs packages it doesn't play very well with hoplon out of the box

peterromfeld13:07:50

plotte layer is ok if you need country maps for visualisation

alandipert13:07:40

@adamw: instead of using cell= i would add-watch... it seems like you're trying to handle an event, which is achieved most easily with callbacks

alandipert13:07:44

i should add that it's possible to do what you want using cells but without cell=... with javelin.core/formula. but i think it would be more hassle than callbacks

adamw15:07:52

@alandipert: Ahh, ok thanks! Will give it a go

alandipert15:07:14

kudos for thinking in cells all the way tho πŸ’―

happy.lisper18:07:24

Hi, What would be the best way to embed in my hoplon app a REPL?

happy.lisper18:07:52

(I mean ClojureScript in browser)

alandipert18:07:54

@happy.lisper: i haven't used it but https://github.com/Lambda-X/replumb looks interesting

alandipert18:07:12

example usage at the bottom of the file, i have driven this stuff successfully from cells in the past

happy.lisper19:07:09

ty, I will check it out.