diff --git a/CHANGELOG.md b/CHANGELOG.md index c72ae37b..52289cf9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Grid view ### Fixed +- Fixed rendering for Jupyter lab ### Security diff --git a/build.gradle.kts b/build.gradle.kts index 6b08110b..9349600f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -10,7 +10,7 @@ val plotlyVersion by extra("2.29.0") allprojects { group = "space.kscience" - version = "0.7.0" + version = "0.7.1" } apiValidation { diff --git a/examples/notebooks/plotlykt-demo.ipynb b/examples/notebooks/plotlykt-demo.ipynb index 0ce976d2..c2c502bf 100644 --- a/examples/notebooks/plotlykt-demo.ipynb +++ b/examples/notebooks/plotlykt-demo.ipynb @@ -14,6 +14,17 @@ "//%use plotly" ] }, + { + "cell_type": "code", + "outputs": [], + "source": [ + "Plotly.jupyter.notebook()" + ], + "metadata": { + "collapsed": false + }, + "execution_count": null + }, { "cell_type": "code", "execution_count": null, diff --git a/examples/notebooks/plotlykt-server-demo.ipynb b/examples/notebooks/plotlykt-server-demo.ipynb index 73ecae7e..2798393f 100644 --- a/examples/notebooks/plotlykt-server-demo.ipynb +++ b/examples/notebooks/plotlykt-server-demo.ipynb @@ -208,7 +208,7 @@ "toc_window_display": false }, "ktnbPluginMetadata": { - "isBuildProject": true + "projectDependencies": true } }, "nbformat": 4, diff --git a/plotlykt-core/src/jsMain/kotlin/space/kscience/plotly/PlotlyConnect.kt b/plotlykt-core/src/jsMain/kotlin/space/kscience/plotly/PlotlyConnect.kt index 5e526e54..cf2d6832 100644 --- a/plotlykt-core/src/jsMain/kotlin/space/kscience/plotly/PlotlyConnect.kt +++ b/plotlykt-core/src/jsMain/kotlin/space/kscience/plotly/PlotlyConnect.kt @@ -25,7 +25,7 @@ public object PlotlyConnect { console.warn("Plotly not defined. Loading the script from CDN") window.asDynamic().promiseOfPlotly = Promise { resolve, reject -> val plotlyLoaderScript = document.createElement("script") as HTMLScriptElement - plotlyLoaderScript.src = "https://cdn.plot.ly/plotly-2.24.1.min.js" + plotlyLoaderScript.src = "https://cdn.plot.ly/plotly-2.29.0.min.js" plotlyLoaderScript.type = "text/javascript" plotlyLoaderScript.onload = { resolve(PlotlyJs) @@ -163,4 +163,5 @@ public object PlotlyConnect { public fun main() { window.asDynamic().plotlyConnect = PlotlyConnect + window.asDynamic().Plotly = PlotlyJs } \ No newline at end of file diff --git a/plotlykt-geo/build.gradle.kts b/plotlykt-geo/build.gradle.kts index 788c4c15..341adac0 100644 --- a/plotlykt-geo/build.gradle.kts +++ b/plotlykt-geo/build.gradle.kts @@ -9,7 +9,7 @@ kscience{ native() wasm() dependencies { - api(project(":plotlykt-core")) + api(projects.plotlyktCore) } } diff --git a/plotlykt-jupyter/src/jvmMain/kotlin/space/kscience/plotly/PlotlyIntegration.kt b/plotlykt-jupyter/src/jvmMain/kotlin/space/kscience/plotly/PlotlyIntegration.kt index 7c93bc9f..b6737978 100644 --- a/plotlykt-jupyter/src/jvmMain/kotlin/space/kscience/plotly/PlotlyIntegration.kt +++ b/plotlykt-jupyter/src/jvmMain/kotlin/space/kscience/plotly/PlotlyIntegration.kt @@ -17,7 +17,7 @@ public object PlotlyJupyterConfiguration { return PlotlyHtmlFragment { div { style = "color: blue;" - +"Plotly notebook integration switched into the legacy mode." + +"Plotly notebook integration switched into the notebook mode." } } } diff --git a/plotlykt-script/src/jvmTest/kotlin/space/kscience/plotly/script/BuilderTest.kt b/plotlykt-script/src/jvmTest/kotlin/space/kscience/plotly/script/BuilderTest.kt index 5eccfc8b..3271253d 100644 --- a/plotlykt-script/src/jvmTest/kotlin/space/kscience/plotly/script/BuilderTest.kt +++ b/plotlykt-script/src/jvmTest/kotlin/space/kscience/plotly/script/BuilderTest.kt @@ -8,6 +8,6 @@ internal class BuilderTest { fun testBuilderFromString() { val string = javaClass.getResource("/customPage.plotly.kts").readText() val page = Plotly.page(string) - page.render() + println(page.render()) } } \ No newline at end of file diff --git a/plotlykt-server/build.gradle.kts b/plotlykt-server/build.gradle.kts index 57063afd..ec7d9cc9 100644 --- a/plotlykt-server/build.gradle.kts +++ b/plotlykt-server/build.gradle.kts @@ -11,6 +11,7 @@ val ktorVersion = KScienceVersions.ktorVersion kscience{ jvm() + useCoroutines() commonMain{ api(projects.plotlyktCore) api("io.ktor:ktor-server-cio:$ktorVersion") diff --git a/plotlykt-server/src/jvmMain/kotlin/space/kscience/plotly/server/PlotlyServerIntegration.kt b/plotlykt-server/src/jvmMain/kotlin/space/kscience/plotly/server/PlotlyServerIntegration.kt index 9be4229c..2ea82a3a 100644 --- a/plotlykt-server/src/jvmMain/kotlin/space/kscience/plotly/server/PlotlyServerIntegration.kt +++ b/plotlykt-server/src/jvmMain/kotlin/space/kscience/plotly/server/PlotlyServerIntegration.kt @@ -115,8 +115,6 @@ public class PlotlyServerIntegration : JupyterIntegration() { } } - private fun renderPage(page: PlotlyPage): String = page.copy(renderer = renderer).render() - override fun Builder.onLoaded() { resources { @@ -131,7 +129,8 @@ public class PlotlyServerIntegration : JupyterIntegration() { "space.kscience.plotly.*", "space.kscience.plotly.models.*", "space.kscience.dataforge.meta.*", - "kotlinx.html.*" + "kotlinx.html.*", + "kotlinx.coroutines.*" ) import("space.kscience.plotly.server.jupyter")