This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-08-03
Channels
- # aleph (8)
- # announcements (3)
- # architecture (47)
- # babashka (22)
- # beginners (22)
- # chlorine-clover (2)
- # cider (15)
- # clj-yaml (6)
- # cljs-dev (3)
- # clojure (76)
- # clojure-austin (2)
- # clojure-europe (16)
- # clojure-france (10)
- # clojure-gamedev (11)
- # clojure-norway (28)
- # clojure-sweden (4)
- # clojurescript (32)
- # conjure (1)
- # datahike (2)
- # datomic (6)
- # events (9)
- # graalvm (8)
- # gratitude (5)
- # honeysql (8)
- # humbleui (2)
- # hyperfiddle (37)
- # jobs (1)
- # polylith (4)
- # re-frame (14)
- # releases (2)
- # rum (9)
- # sci (9)
- # scittle (8)
- # shadow-cljs (9)
- # spacemacs (4)
- # sql (10)
- # xtdb (24)
I can’t figure out why this adapt-class
isn’t working (trying to adapt this small example: https://codesandbox.io/s/reagraph-example-mwh96q).
The canvas div itself shows up, but with no content in it. It seems like the data input isn’t properly interpreted…? Just following the guide in the Rum docs.
The code is just what I posted a screenshot of. It doesn’t throw an error and the canvas itself comes out fine on the page, but what I’m wondering about is why the content isn’t showing up. It seems likely that just using plain Clojure data isn’t working, but since I’m getting no errors and this is just a straight translation of the example code, I’m not really sure how to proceed.
(rum/adapt-class
GraphCanvas
{:nodes [{:id "n-1"
:label "1"}
{:id "n-2"
:label "2"}
{:id "n-3"
:label "3"}
{:id "n-4"
:label "4"}]
:edges [{:id "1->2"
:source "n-1"
:target "n-2"
:label "Edge 1-2"}
{:id "1->3"
:source "n-1"
:target "n-3"
:label "Edge 1-3"}
{:id "1->4"
:source "n-1"
:target "n-4"
:label "Edge 1-4"}]})
which is an adaption of
<GraphCanvas
nodes={[
{
id: "n-1",
label: "1"
},
{
id: "n-2",
label: "2"
},
{
id: "n-3",
label: "3"
},
{
id: "n-4",
label: "4"
}
]}
edges={[
{
id: "1->2",
source: "n-1",
target: "n-2",
label: "Edge 1-2"
},
{
id: "1->3",
source: "n-1",
target: "n-3",
label: "Edge 1-3"
},
{
id: "1->4",
source: "n-1",
target: "n-4",
label: "Edge 1-4"
}
]}