Fork me on GitHub
#clojurescript
<
2023-05-12
>
dorab17:05:40

Clojurescript newbie. I'm trying to figure out how to click-drag a SVG line (or other SVG element) within the context of Reagent and Re-frame (though I'm more-or-less using direct Clojurescript and Reagent but not Re-frame for the click-drag). I'm looking for some examples I can learn from. I was wondering whether there were useful or recent examples I could look at. Responses in a thread please. Thanks.

dorab17:05:50

The best I've found so far is https://www.petercollingridge.co.uk/tutorials/svg/interactive/dragging/ but is pure Javascript and I'd prefer if there was a Clojurescript example. Thanks.

dorab17:05:21

General Clojurescript articles relating to click-drag would be helpful too. I've read the general Clojurescript docs.

p-himik17:05:05

95% of all that code is not JS itself but the browser API. You'll have to write the exact same code in CLJS, only with slightly different syntax. And you can convert every single block of code there to CLJS with this converter: https://roman01la.github.io/javascript-to-clojurescript/