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"
}
]}Yeah, looks fine
you can try use js/React.createElement
but you’ll have to prefix all your data structures with #js
also you can look at generated code, maybe you’ll spot something weird there
Thanks. I'll try to investigate further then.
which guide? And what’s your code?