Fork me on GitHub
#re-frame
<
2017-03-01
>
sandbags15:03:05

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?

sandbags15:03:25

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

isak15:03:02

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

sandbags15:03:10

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

sandbags15:03:38

@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

sandbags15:03:15

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

isak15:03:17

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

sandbags15:03:38

oh, excellent, thank you

sandbags15:03:44

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

sandbags15:03:40

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

campeterson20:03:06

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

dragoncube22:03:33

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.

dragoncube22:03:04

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

dragoncube22:03:21

yeah, I guess that one, thanks

dragoncube22:03:22

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