Skip to content

Commit 7521240

Browse files
committed
Use new rendering API in dataframe
1 parent 63ca282 commit 7521240

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/jupyter/Integration.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ import org.jetbrains.kotlinx.jupyter.api.declare
4343
import org.jetbrains.kotlinx.jupyter.api.libraries.ColorScheme
4444
import org.jetbrains.kotlinx.jupyter.api.libraries.JupyterIntegration
4545
import org.jetbrains.kotlinx.jupyter.api.libraries.resources
46+
import org.jetbrains.kotlinx.jupyter.api.renderHtmlAsIFrameIfNeeded
4647
import kotlin.reflect.KClass
4748
import kotlin.reflect.KProperty
4849
import kotlin.reflect.full.isSubtypeOf
@@ -76,7 +77,7 @@ internal class Integration : JupyterIntegration() {
7677
}
7778

7879
with(JupyterHtmlRenderer(config.display, this)) {
79-
render<HtmlData> { notebook.renderHtmlAsIFrame(it) }
80+
render<HtmlData> { notebook.renderHtmlAsIFrameIfNeeded(it) }
8081
render<AnyRow>({ it.toDataFrame() }, { "DataRow: index = ${it.index()}, columnsCount = ${it.columnsCount()}" })
8182
render<ColumnGroup<*>>({ it.asDataFrame() }, { """ColumnGroup: name = "${it.name}", rowsCount = ${it.rowsCount()}, columnsCount = ${it.columnsCount()}""" })
8283
render<AnyCol>({ dataFrameOf(it) }, { """DataColumn: name = "${it.name}", type = ${renderType(it.type())}, size = ${it.size()}""" })

core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/jupyter/JupyterHtmlRenderer.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import org.jetbrains.kotlinx.dataframe.io.DisplayConfiguration
55
import org.jetbrains.kotlinx.dataframe.io.initHtml
66
import org.jetbrains.kotlinx.dataframe.io.toHTML
77
import org.jetbrains.kotlinx.jupyter.api.libraries.JupyterIntegration
8+
import org.jetbrains.kotlinx.jupyter.api.renderHtmlAsIFrameIfNeeded
89

910
internal class JupyterHtmlRenderer(
1011
val display: DisplayConfiguration,
@@ -29,5 +30,5 @@ internal inline fun <reified T : Any> JupyterHtmlRenderer.render(
2930
contextRenderer
3031
) { footer }
3132

32-
notebook.renderHtmlAsIFrame(html)
33+
notebook.renderHtmlAsIFrameIfNeeded(html)
3334
}

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[versions]
22
ksp = "1.7.20-1.0.8"
3-
kotlinJupyter = "0.11.0-180-1"
3+
kotlinJupyter = "0.11.0-183-1"
44
ktlint = "3.4.5"
55
kotlin = "1.7.20"
66
dokka = "1.6.20"

0 commit comments

Comments
 (0)