Fork me on GitHub
#clojurescript
<
2021-08-08
>
victorb11:08:08

anyone sitting on some nice solutions for doing animations/transitions in ClojureScript? I'm using Reagent but wouldn't be afraid of using something that manipulates the DOM/CSS directly if needed (if the animation API is nice enough)

alpox14:08:30

(not infinitely free, check pricing) These are from the react universe @victorbjelkholm429 Id actually love to see if there is something similar or a wrapper to react spring in cljs.

victorb14:08:11

thanks @alpox! What I was looking for actually is something more "zoomed out" in terms of managing the animation state, more focused on the architecture with good support for animations, rather than specific libraries/methods like that. Most React wrappers (like these ones) seems to rely on wrapping the components that are being animated in some parent component, something that never felt like a good solution to me, looking to see if there is any alternatives for a overall architecture for animations spread throughout

alpox15:08:36

That is only what framer motion does though - which is also why I prefer react spring. It uses react hooks for the animation. The animation itself circumvents react entirely and does direct DOM manipulation. You might be able to write something that goes a similar way for Reagent

javi16:08:27

you can use gsap, i create a map of different timelines with different animations and the use them on some user event or component-did-mount/useEffect… https://greensock.com/

borkdude22:08:39

Given that I have:

(let [all (.-all js/Promise)] ...)
how do I invoke all on an array, like in (js/Promise.all (into-array [])). Is this possible?

borkdude22:08:36

I probably need .bind or something here right?

emccue22:08:18

(.all js/Promise (apply array promises))

emccue22:08:37

but if you already have all in that let

emccue22:08:55

((.bind all js/Promise) (apply array ...))

zach23:08:51

Do y'all have recommendations for clojurescript data visualization libraries? For context, I am building a reframe application that I want to have pretty simple charts within (e.g. a stacked bar chart with tooltip on hover). I would like the charts to look pretty on a phone or desktop. I tried https://github.com/metasoarous/oz and loved the ease in creating a chart, but it doesn't seem very customizable, or pleasant on a phone. I also tried porting a couple react chart libraries into clojurescript, but may not be smart enough for that yet. I had the best luck with https://formidable.com/open-source/victory/ but these charts often require specifying react components from within its props, which was causing compiling errors with clojurescript. I also tried https://recharts.org/en-US/, but was getting error messages i couldn't parse at all.

zach23:08:44

I am still newish to clojure(script), and using this personal project to build up my understanding, but to be honest I've hit a frustration wall. It feels like a pretzel logic of interops (reagent converted to react component library converted to react converted to d3), which makes error handling extremely hard. It also feels like I am now just writing javascript in a clojure flavour, but not getting the benefit of either language. I am wondering if it would be better to scrap the project and write it in straight JS.

zach23:08:21

Would anyone have recs for data visualization, or could point to a repo where they used re-frame and graphs? I can definitely learn from source code, but having terrible luck finding any cljs graphing examples. Thank you!!

valtteri07:08:51

Maybe the components near the end of the file are the best to look at.

zach08:08:59

Ah, awesome, thank you Valtteri. I'll take a look!

valtteri10:08:02

No problem. 🙂 Let me know if you have any further questions