Closed pmeheut closed 1 year ago
Are you using laminar? The nodeCtx us a ref to the laminar Div. Your example is an extract from the laminar section and won't work outside of the context, of that laminar div.
Can you post up a longer example and a little context of what you're aiming for? At a high level, the idea is to simply cast any div
type to html.Div
, and then feed it to the plot.
sketch
val aDiv = ??? // from some UI framework
val domDiv = aDiv.asInstanceOf[html.Div] // this should be safe - a div is always a div to the browser
BarChart(List(viz.Utils.fillDiv))(using domDiv)
Does this help?
As an aside, I'm actually not at all happy with this API, and have the heavy lifting for much better scalaJS integration done.
It's just... not ready... one day I'll have time to finish it properly. This will get easier / better in future.
Yes, it helps and the problem was on my side: bad dependency in sbt. Everything works as expected. Sorry for the mistake.
Great - I hope you have success with it - please let me know either way around - I'm very open to feedback of any sort... and quite proud that there is someone out there actually giving it a go!
Hi,
I've tried to compile the code from https://quafadas.github.io/dedav4s/ScalaVersions/scalaJS.html#examples but got this error message: