scaladget
scaladget copied to clipboard
selection.node() always returns null
Using:
"fr.iscpif" %%% "scaladget" % "0.7.0"
I want to obtain a DOM element as a result of D3 selection. For example,
d3.select("body").node()
but the result is always null. However, I'd like to get HTMLBodyElement
for that example.
Hi, you can use d3.select and compose on it. An example here: https://github.com/mathieuleclaire/scalaWUI/blob/master/client/src/main/scala/fr/iscpif/client/FlowChart.scala#L56-L60
Ok, I can. But try to get a node svg.node()
and you will get a null
I don't know D3 a lot, but it does not seem to be a proper way to use it. If you just want to get the body node, why not use scalajs-dom instead and invoke dom.document.body ?
I don't want to get document body exactly. It was just an example of incorrect behavior. I am trying to tell you, that a method node()
doesn't work properly.
I have to use scaldget in my project, but I compared scaladget with an another D3 facade and that facade works fine.