I am following the tutorial here:
https://www.scala-js.org/doc/project/dependencies.html
- First things first, I have my project set up like this:
https://github.com/scala-js/scalajs-cross-compile-example
Without making any changes, this runs as expected when I pass in the following commands:
sbt> fooJS/run
sbt> fooJVM/run
Now I want to import this library:
I want to run the following function:
Plotly.newPlot('myDiv', data);
How can I do this?
My Main.scala file inside the js folder looks like this:
package example
object Main extends App {
println(s"Using Scala.js version ${System.getProperty("java.vm.version")}")
}
I know a facade for this library already exists, but I would like to be able to create my own facades for future projects, and am using this as an example. I read the tutorial here:
https://www.scala-js.org/doc/interoperability/facade-types.html
But in all honesty I do not follow those steps coming from a different language ecosystem.