Fork me on GitHub
#clojurescript
<
2016-01-16
>
richiardiandrea03:01:16

Hello guys, can I ask suggestions for a reagent-friendly image gallery/carousel component? I have had a look at Semantic UI but it seems like they dont have it (yet).

simax9913:01:24

I’m trying to use the https://github.com/r0man/cljs-http library to make a POST request (which I can do) but how do I access the response :status and :body from a POST request. There are examples of how to do it for a GET, and that I can do, but how do I do it for a post? Anybody know?

nberger13:01:45

@simax99: it's the same as for GET requests. It returns a channel, you get the entire response with <! in a go block, and then you can get :body and :status from the response

simax9913:01:01

@nberger: Hmmm, thats what I was doing. Keep getting a #object[cljs.core.async.impl.channels.ManyToManyChannel back though. I’ll dig my code out to show you, give me a second.

simax9914:01:51

@nberger: Using this in the REPL. The POST is successful, it reaches my Clojure backend and writes record to DB.

(go (let [response (<! (http/post "" {:form-params emp}))
          status (:status response)]
      (println status)))

simax9914:01:25

@nberger: Forget that. I’m being a complete idiot. That is what I see in the REPL. But of course the println is sending the message to the browser console and there I’m seeing the correct status being printed. embarrassed :face_with_rolling_eyes:

octahedrion14:01:21

@simax99: nobody's judging you 😃

simax9914:01:23

haha, yeh I know. Just feel dumb. One of those days…. simple_smile

nberger15:01:59

Cool @simax99! Yeah don't worry, we all have many of those days :)

richiardiandrea20:01:37

Have folks tried some adaptive image framework on cljs? I see http://adaptive-images.com but it has php in it 😞

mathpunk21:01:52

I would like to make svg graphics in ClojureScript but I don't know where to begin. I thought maybe with Snap.svg but I don't understand externing at all. I am not a web developer.

mathpunk21:01:08

I'm after generative vector art so I can cut vinyl and do sandblasting tricks at my makerspace. Am I barking up the wrong tree?

eggsyntax22:01:34

@mathpunk: try asking in #C066TDGGL or #C0F0V8DT5 — should be easy to get good advice there (although not as much on a weekend).

mathpunk22:01:51

@eggsyntax: oh cool, thank you!

eggsyntax22:01:55

Haven’t done it myself, btw, but AFAIK, D3 should probably handle that nicely, & it has a cljs wrapper (strokes). Or Processing will do some SVG stuff, is well-suited to generative work, & also has a cljs wrapper (quil). But you’ll probably want advice from someone who’s actually done it in cljs, which isn’t me.

yenda22:01:19

i've been thinking on using something like quil to render some graphs in clojurescript

mathpunk22:01:17

@eggsyntax Oh, huh. There was a really nice Quil tutorial going around, maybe I'll go with that. I sort of thought that if it was Processing it was Canvas

mathpunk22:01:27

(I am under the impression that Canvas is a way to draw stuff in browsers and SVG is a different way to draw stuff that may or may not be in browsers.)

cjmurphy22:01:24

You can just use SVG directly as well, like in this example: https://gist.github.com/cstorey/9198985

eggsyntax22:01:40

@mathpunk I only know that Processing has at least some SVG capabilities. I used to do a ton of Processing stuff, but never used that side of it. But again, you’ll find folks who have much more knowledge about it in those other two channels.

mathpunk22:01:21

Thanks y'all, I have some much better starting points than I had this morning