I am currently following a tutorial on setting up dependencies in my Scala.js project. Here is the link to the tutorial:
- First and foremost, I have organized my project setup as shown below:
https://github.com/scala-js/scalajs-cross-compile-example
Without any modifications, everything runs smoothly when I input the following commands:
sbt> fooJS/run
sbt> fooJVM/run
Now I want to import a specific library into my project:
My goal is to execute this function:
Plotly.newPlot('myDiv', data);
How can I accomplish this task?
The contents of my Main.scala file located within the js folder are as follows:
package example
object Main extends App {
println(s"Using Scala.js version ${System.getProperty("java.vm.version")}")
}
I am aware that there is already a facade available for this library, however, I prefer to create my own facades for future projects and using this as a learning experience. I have gone through the tutorial mentioned here:
However, I must admit that I am having difficulty grasping the steps due to transitioning from a different language ecosystem.