JetBrains / lets-plot-kotlin

Grammar of Graphics for Kotlin
https://lets-plot.org/kotlin/
MIT License
419 stars 36 forks source link

Some dependency issues migrating to 3.0.0 #77

Closed breandan closed 3 years ago

breandan commented 3 years ago

After updating to 3.0.0, I encountered the following error:

Cannot access class 'jetbrains.datalore.vis.svgToString.SvgToString'. Check your module classpath for missing or conflicting dependencies

After reading the dev docs, I added this dependency:

implementation("org.jetbrains.lets-plot:lets-plot-jfx:2.0.3")

This did not work due the following error:

Could not find org.jetbrains.kotlinx:kotlinx-html-jvm:0.7.2.

Then I added this dependency:

implementation("org.jetbrains.kotlinx:kotlinx-html-jvm:0.7.3")

And everything worked again.

alshan commented 3 years ago

Oh, good, kotlinx-html v0.7.3 is at the Maven central finally.

v0.7.2 is at "https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven" - I totally forgot to mention it - will be fixed, thanx!

alshan commented 3 years ago

https://github.com/JetBrains/lets-plot-kotlin/commit/a53831f2684937c019f5a27bb193acc0a70007a9

@breandan did you have to add JavaFx dependencies. If yes then which ones? I would document this as well.

breandan commented 3 years ago

It was not necessary to manually add any other dependencies, but it's possible they were imported transitively.

https://github.com/breandan/kotlingrad/commit/3df05b325e39717d29478c925f72615ddb569f04

alshan commented 3 years ago

Now I see. As you don't need any Swing rendering, you can replace the 'lets-plot-jfx' dependency with just 'lets-plot-common':

implementation "org.jetbrains.lets-plot:lets-plot-common:2.0.3"

The "lets-plot-kotlin-jvm" (i.e. Kotlin API) should be importing it transitively but at the moment it's not.

Also, you could continue using jetbrains.datalore.plot.PlotSvgExport instead of its "Portable" variation.

I've added "plot export" to the samples: https://github.com/alshan/lets-plot-mini-apps/tree/main/jvm-plot-export/src/main/kotlin

alshan commented 3 years ago

Hi @breandan , it turned out there was another nasty issue in 3.0.0, so we've made a bugfix release 3.0.1 where the dependency issues you reported were addressed as well.

When migrating to 3.0.1 you can remove all dependencies which you had to add while migrating to 3.0.0.

The only dependency you need is:

    implementation "org.jetbrains.lets-plot:lets-plot-kotlin-jvm:3.0.1"

I hope it will be smooth this time )

breandan commented 3 years ago

Okay, thank you for the heads up. After migrating to 3.0.1, I can confirm that no other dependencies were needed.