Fork me on GitHub

I'm learning reagent, and I have a doubt: I want to slowly construct a graph during the lifetime of the application, and the graph will be displayed with cytoscape.js. What should go in a r/atom? How can I get the external javascript to change the page?


I have two questions on reagent; the context is that my page displays a graph managed with cytoscape.js 1. I have the entire graph in my r/atom. However, when the graph is updated, I don't want to redraw all the graph (because to keep positions of the already displayed nodes I want to pass only those to cytoscape). Instead, I want to calculate the diff between what was previously in the atom and my new version, and use that diff to issue the proper command to cytoscape. I cannot figure where to put this logic in the reagent framework, though


2. I want to intercept when a node in my graph is clicked, and put that information in my global atom. But that part of the dom is built by cytoscape. How can I intercept the click events on the nodes?


All these questions should probably be asked in #reagent instead.


Thanks, will ask there!


Why can I use this in a template:

[:p #{{:id 1 :data "foo"}}]
but not this:
[:p {:foo #{{:id 1 :data "foo"}}}]
It has something to do with the way data is represented in the js side, but I'd like to understand better


sometimes an object is printed as #object[Core [object Object]] even if I use str


Nevermind my bad, I had a bad type assignment (I need instrumentation 😂)


I’m using .-rep to view a LocalDate in transit, but I need to format the result differently. What’s a good way to do that?


First time working with transit, BTW.