https://kotlinlang.org logo
Title
h

holgerbrandl

01/10/2021, 9:55 PM
When defining a type renderer in kotlin-jupyter for library such as https://github.com/Kotlin/kotlin-jupyter/blob/master/libraries/krangl.json#L21 , is it possible to add another renderer for a package-internal class? I'd love to add support for
krangl.GroupedDataFrame
but this class is package-internal, and I'm somehow reluctant to make it part of the public library API just to get a more pretty rendering in jupyter. For corresponding sources see https://github.com/holgerbrandl/krangl/blob/master/src/main/kotlin/krangl/GroupedDataFrame.kt#L15
i

Ilya Muradyan

01/11/2021, 2:29 PM
Soon you'll be able to add jupyter integration for your library like that: https://github.com/nikitinas/dataframe/blob/master/src/main/kotlin/org/jetbrains/dataframe/jupyter/Integration.kt You may also use internal types there (apart from other benefits)
h

holgerbrandl

01/11/2021, 7:28 PM
Thanks @Ilya Muradyan for the pointer. That's super cool. Is this in jupyter-kernel master already? How would I tell the kernel where to find my libraries impl of
JupyterIntegration
Is the dataframe lib by jb a super-set or a sub-set of what I've started/tried in krangl? Or is the scope different?
i

Ilya Muradyan

01/11/2021, 7:44 PM
It's not yet in master, but in notebook-api branch. We're now working on clearing and prettying this API, I hope it will be released soon.
h

holgerbrandl

01/11/2021, 7:44 PM
Looking forward to it!
i

Ilya Muradyan

01/11/2021, 7:48 PM
About saying kernel of your integration impl: you need a small text file with your implementation FQN in JAR resources, kernel is looking for it and loads it. To simplify the process of bundling this file, we're providing a Gradle plugin, you may find how it's used in dataframe's build.gradle
h

holgerbrandl

01/11/2021, 7:49 PM
Sounds wonderful and easy to me.
i

Ilya Muradyan

01/11/2021, 7:53 PM
Regarding features of krangl and dataframe: I believe they do not include each other, but @Anatoly Nikitin should know better.