Fork me on GitHub
#reagent
<
2017-02-21
>
fernandohur06:02:41

Hi everyone, I’m evaluating clojurescript + reagent for a new project I’m working on and I’ve been struggling for the past couple of days trying to integrate a javascript library (http://js.cytoscape.org/) I have a pretty much “default” project created with lein new reagent my-app +devcards. Is there any good documentation out there on how to import a javascript library into your project? (Btw i’m just concerned about making it work on dev, no need for externs or any prod setup) By the way: I don’t mind importing through a <script>

gklijs07:02:56

Maybe this is usefull, I mjust looked at it and maybe try to get it working in the near future

fernandohur07:02:05

Ok so I just got it working: it was relatively simple. In the handlers.clj I added the following line under loading page:

(include-js “/js/cytoscape-2.7.15.js”)
And I copied the library to my public/js folder

kauko11:02:05

@dsapoetra does it work from your browser's devtools?

kauko11:02:41

Ah, apparently you got your answer from the #re-frame channel

dsapoetra11:02:02

@kauko yup, I got the answer from there, and it works