esionecneics
01/09/2025, 11:50 PMimport org.jetbrains.kotlinx.dataframe.DataFrame
import org.jetbrains.kotlinx.kandy.dsl.plot
import org.jetbrains.kotlinx.kandy.letsplot.layers.line
import org.jetbrains.kotlinx.kandy.util.color.Color
fun visualizeCustomerNumber(df: DataFrame<*>) {
df.plot {
line {
x("createdAt") {
axis {
name = "Date"
}
}
y("customerNumber") {
axis {
name = "Customer Number"
}
}
color = Color.RED
}
layout {
title = "Tomorrow Customer Number"
}
}
}
The keywords: |axis, name, layout, title| are recognized by IntelliJ
The import in the notebook on the other hand works perfectly with: %use kandy
This is the version I use in my build.gradle.kts:
dependencies {
implementation("org.jetbrains.kotlinxkandy lets plot0.8.0-RC1")
}Andrei Kislitsyn
01/10/2025, 7:47 AMlayout {}
is an extension function and should be imported:
import org.jetbrains.kotlinx.kandy.letsplot.feature.layout
esionecneics
01/12/2025, 11:21 PMfun visualizeCustomerNumber(df: DataFrame<*>) {
df.plot {
line {
x("createdAt") {
axis.name = "Date"
}
y("customerNumber") {
axis.name = "Customer Number"
}
color = Color.RED
}
layout {
title = "Tomorrow Customer Number"
}
}
}
Then it works.
This means I have to use a different syntax depending on whether I am working in a notebook or a kt file. Why is that?Andrei Kislitsyn
01/13/2025, 4:52 PMimport org.jetbrains.kotlinx.kandy.util.context.invoke
.
For some reason, IDEA doesnât recognise it đ.esionecneics
01/13/2025, 9:56 PMAndrei Kislitsyn
01/13/2025, 10:04 PM