Fork me on GitHub
#reagent
<
2016-11-09
>
lsenta10:11:47

Hi reagenters, have you any good experience with drawing & animation to share?

lsenta10:11:29

I want to draw and animate various html & svg components, before react & cljs I’d have used d3 but now I’m not so sure

kauko11:11:13

I've never used svg with Reagent, but I have some friends who have, and they said there was nothing special to it. D3 also works pretty well with Reagent.

kauko11:11:37

The challenges related to this have to do with React, not with Reagent specifically

lsenta12:11:09

@kauko Got it, I’ll stick to d3 then, thanks for the precision

kauko12:11:04

There's actually a bunch of blog posts about this topic too

mattly16:11:10

using svg with react/reagent/etc is just like using html

mattly16:11:28

you tell it what elements you want where and it makes it happen

mattly16:11:52

the benefit to D3 is primarily in transformations: scales, shapes & layouts, animation

lsenta17:11:37

@gadfly361 thanks, tbh I’ve been through http://zachcp.org/blog/2015/reagent-d3/ which is more straightforward (I know reagent, d3 & inc already)

lsenta17:11:36

@gadfly361 shouldn’t you use something like (select (reagent/dom-node this)) to avoid leaking your component with a global selector btw?

gadfly36117:11:51

@lsenta when adding the bars, you wont be selecting this, so for convenience i used a global selector. I do agree using dom-node is really nice in many situations tho. As an aside, this is something to track: https://github.com/reagent-project/reagent/issues/251