This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-11-28
Channels
- # adventofcode (4)
- # announcements (1)
- # babashka (4)
- # beginners (23)
- # calva (15)
- # cider (8)
- # clj-kondo (30)
- # cljsrn (1)
- # clojure (29)
- # clojure-europe (15)
- # clojure-uk (2)
- # clojurescript (10)
- # community-development (4)
- # cryogen (3)
- # cursive (4)
- # emacs (3)
- # figwheel-main (2)
- # fulcro (13)
- # jobs-discuss (1)
- # kaocha (1)
- # luminus (1)
- # meander (2)
- # off-topic (78)
- # pathom (2)
- # reagent (13)
- # rewrite-clj (56)
- # ring-swagger (2)
- # tools-deps (15)
- # vim (3)
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?
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 betterI’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.