Fork me on GitHub

I want to draw some graphs (as in edges & nodes) in one of my apps. I've found the Vis.js library which seems to be pretty good and is packaged by cljsjs. I'm not quite sure what my next step is though. From what I can see of the example source you hand a container DOM node to vis.Network and it does its thing inside. I'm not really sure how to ask my "What do I do next" question intelligently enough to Google. Can anyone point me in the direction of the on-ramp?


(alternative suggestions for how to solve the draw-a-graph problem for a re-frame app also welcome)


@sandbags is the question how to use Vis.js, or how to mount it in reframe?


Given my needs are relatively simple I could also fall back to drawing this myself using SVG


@isak the question is how to mount a vis.Network in re-frame since it appears to be a JS component that gets passed a DOM node to do its thing in


maybe its not even possible since DOM nodes are transient in react...?


ah, there is a nice example for that, let me find it


oh, excellent, thank you


Ah "stateful JS component" appears to be the words I didn't know I needed, thank you!


oh yes, this is great thank you. It looks so much simpler than I was beginning to fear!


Hi. Has anyone familiar with re-frame + secretary had to deal with URL redirection? For example: If current-user is nil, redirect to /#/login


How could I use subscription value in event handlers? I guess this was already discussed multiple time, but I’m struggling to find any concrete answer in clojurians slack logs.


I recall recently Mike had a discussion with someone, and agreed that particular use case should be handled better


yeah, I guess that one, thanks


ok, the proposed solution is to model it as co-effect