Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any plan to release it for Scala 3? #391

Open
pmeheut opened this issue Apr 13, 2023 · 2 comments
Open

Any plan to release it for Scala 3? #391

pmeheut opened this issue Apr 13, 2023 · 2 comments

Comments

@pmeheut
Copy link

pmeheut commented Apr 13, 2023

Or is there a way to use it? When I tried to cross-use it, I got:
Conflicting cross-version suffixes in: org.scala-js:scalajs-dom_sjs1

I also tried to recompile v0.84 as is before even trying to port it to Scala 3 but got:

[error] java.lang.StackOverflowError
[error] scala.collection.immutable.Set$Set2$$anon$1.apply(Set.scala:196)
[error] scala.collection.immutable.Set$SetNIterator.next(Set.scala:139)
[error] scala.reflect.macros.Attachments.get(Attachments.scala:62)
[error] scala.tools.nsc.typechecker.Macros.standardMacroArgs(Macros.scala:390)
[error] scala.tools.nsc.typechecker.Macros.standardMacroArgs$(Macros.scala:385)
[error] scala.tools.nsc.Global$$anon$5.standardMacroArgs(Global.scala:497)
@axb21
Copy link

axb21 commented Jan 19, 2024

Also wondering this. I'd use a scala 3 version.

@sven42
Copy link

sven42 commented Apr 25, 2024

I was able to use plotly-scala with Scala 3 and Laminar by excluding the conflicting dependency in build.sbt:

libraryDependencies += ("org.plotly-scala" %%% "plotly-render" % "0.8.4")
                         .cross(CrossVersion.for3Use2_13)
                         .exclude("org.scala-js", "scalajs-dom_sjs1_2.13")

So far I just reused the snippet from the Readme but it compiles and looks nice:

    def plotElement(id: String): HtmlElement =
      div(idAttr := id).amend(onMountCallback { ctx =>
        val x  = (0 to 100).map(_ * 0.1)
        val y1 = x.map(d => 2.0 * d + util.Random.nextGaussian())
        val y2 = x.map(math.exp)

        val plot: Seq[Scatter] = Seq(
          Scatter(x, y1).withName("Approx twice"),
          Scatter(x, y2).withName("Exp")
        )

        val layout = Layout().withTitle("Curves")
        plot.plot(id, layout) // attaches to div element with id
      })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants