I tried to reproduce the simple Kotlin Kandy histogram example at https://kotlin.github.io/kandy/histogram-simple.html.
val random = java.util.Random(42)
val dataframe = dataFrameOf(
"sample" to List(1000) { random.nextGaussian() }
)
dataframe.plot {
histogram("sample")
}
However, I get the error:
Unresolved reference: histogram
It seems like the unit tests depend on import org.jetbrains.kotlinx.statistics.kandy.layers.histogram
, but I can't find that class anywhere and IntelliJ won't resolve the import.
I'm using these dependencies in a desktop Kotlin project:
dependencies {
implementation("org.jetbrains.kotlinx:kandy-lets-plot:0.7.1")
implementation("org.jetbrains.kotlinx:kandy-echarts:0.7.1")
implementation("org.jetbrains.kotlinx:kandy-util:0.7.1")
implementation("org.jetbrains.kotlinx:kandy-api:0.7.1")
}
Steps to reproduce the behavior:
Histogram should be generated:
Application doesn't build - it can't find histogram
I opened a bug for this on the Kandy GitHub repo at https://github.com/Kotlin/kandy/issues/443
According to this page, you need an extra dependency for the things in the org.jetbrains.kotlinx.statistics
package.
repositories {
mavenCentral()
maven("https://packages.jetbrains.team/maven/p/kds/kotlin-ds-maven")
}
dependencies {
implementation("org.jetbrains.kotlinx:kandy-lets-plot:0.7.0")
// this below!
implementation("org.jetbrains.kotlinx:kotlin-statistics-jvm:0.3.1")
}