diff --git a/build.gradle.kts b/build.gradle.kts index 213fcfd8..b7406672 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -4,7 +4,7 @@ plugins { } val ktorVersion by extra("1.4.0") -val dataforgeVersion by extra("0.2.0-dev-3") +val dataforgeVersion by extra("0.2.0-dev-8") val htmlVersion by extra("0.7.2") val bintrayRepo by extra("kscience") diff --git a/examples/src/main/kotlin/contour/BasicContour.kt b/examples/src/main/kotlin/contour/BasicContour.kt index 699ab575..ed3114ad 100644 --- a/examples/src/main/kotlin/contour/BasicContour.kt +++ b/examples/src/main/kotlin/contour/BasicContour.kt @@ -24,7 +24,7 @@ fun main() { val x1 = listOf(-9, -6, -5, -3, -1) val y1 = listOf(0, 1, 4, 5, 7) - val contour = Contour { + val contour = Contour{ x.numbers = x1 y.numbers = y1 z(values) diff --git a/examples/src/main/kotlin/contour/ConnectNullGaps.kt b/examples/src/main/kotlin/contour/ConnectNullGaps.kt index 73f5673d..eeba38a3 100644 --- a/examples/src/main/kotlin/contour/ConnectNullGaps.kt +++ b/examples/src/main/kotlin/contour/ConnectNullGaps.kt @@ -22,7 +22,7 @@ fun main() { listOf(null, null, null, 27, null, null, null, 21), listOf(null, null, null, 26, 25, 24, 23, 22)) - val contour1 = Contour { + val contour1 = Contour{ x.set(x1) y.set(y2) z.set(z1) diff --git a/examples/src/main/kotlin/downloadChartAsSVG.kt b/examples/src/main/kotlin/downloadChartAsSVG.kt index 3851bdba..55119f3d 100644 --- a/examples/src/main/kotlin/downloadChartAsSVG.kt +++ b/examples/src/main/kotlin/downloadChartAsSVG.kt @@ -8,7 +8,7 @@ import kscience.plotly.models.ScatterMode */ fun main() { val fragment = Plotly.fragment { - val plotConfig = PlotlyConfig { + val plotConfig = PlotlyConfig{ saveAsSvg() } diff --git a/plotlykt-core/src/commonMain/kotlin/kscience/plotly/Plot.kt b/plotlykt-core/src/commonMain/kotlin/kscience/plotly/Plot.kt index b507cc98..e958f83c 100644 --- a/plotlykt-core/src/commonMain/kotlin/kscience/plotly/Plot.kt +++ b/plotlykt-core/src/commonMain/kotlin/kscience/plotly/Plot.kt @@ -81,7 +81,7 @@ public inline fun Plot.layout(block: Layout.() -> Unit) { * Add a generic trace */ public inline fun Plot.trace(block: Trace.() -> Unit): Trace { - val trace = Trace.invoke(block) + val trace = Trace(block) traces(trace) return trace } \ No newline at end of file diff --git a/plotlykt-core/src/commonMain/kotlin/kscience/plotly/dfExt.kt b/plotlykt-core/src/commonMain/kotlin/kscience/plotly/dfExt.kt index 4ed52876..67ad5585 100644 --- a/plotlykt-core/src/commonMain/kotlin/kscience/plotly/dfExt.kt +++ b/plotlykt-core/src/commonMain/kotlin/kscience/plotly/dfExt.kt @@ -19,7 +19,7 @@ import kotlin.time.toDuration * A delegate for list of objects with specification * TODO move to DataForge core */ -internal fun Configurable.list( +internal fun Configurable.list( spec: Specification, key: Name? = null ): ReadWriteProperty> = object : ReadWriteProperty> { override fun getValue(thisRef: Any?, property: KProperty<*>): List { @@ -53,7 +53,7 @@ internal fun Configurable.list( /** * A variation of [spec] extension with lazy initialization of empty specified nod in case it is missing */ -internal fun Configurable.lazySpec( +internal fun Configurable.lazySpec( spec: Specification, key: Name? = null ): ReadWriteProperty = object : ReadWriteProperty { override fun getValue(thisRef: Any?, property: KProperty<*>): T { diff --git a/plotlykt-core/src/jvmMain/kotlin/kscience/plotly/JupyterPlotly.kt b/plotlykt-core/src/jvmMain/kotlin/kscience/plotly/JupyterPlotly.kt index a83d0ed0..7bb05c23 100644 --- a/plotlykt-core/src/jvmMain/kotlin/kscience/plotly/JupyterPlotly.kt +++ b/plotlykt-core/src/jvmMain/kotlin/kscience/plotly/JupyterPlotly.kt @@ -84,7 +84,7 @@ object JupyterPlotly: PlotlyRenderer { } fun renderPlot(plot: Plot): String = createHTML().div { - plot(plot, config = PlotlyConfig { + plot(plot, config = PlotlyConfig{ responsive = true }, renderer = this@JupyterPlotly) } diff --git a/plotlykt-server/build.gradle.kts b/plotlykt-server/build.gradle.kts index 2322df79..18f64f8f 100644 --- a/plotlykt-server/build.gradle.kts +++ b/plotlykt-server/build.gradle.kts @@ -20,7 +20,7 @@ dependencies { //api("io.ktor:ktor-server-netty:$ktorVersion") api("io.ktor:ktor-html-builder:$ktorVersion") api("io.ktor:ktor-websockets:$ktorVersion") - api("hep.dataforge:dataforge-output:$dataforgeVersion"){ + api("hep.dataforge:dataforge-context:$dataforgeVersion"){ exclude(module = "kotlinx-io") } } \ No newline at end of file diff --git a/plotlykt-server/src/main/kotlin/kscience/plotly/server/JupyterPlotlyServer.kt b/plotlykt-server/src/main/kotlin/kscience/plotly/server/JupyterPlotlyServer.kt index 3c7526ff..f03f7d60 100644 --- a/plotlykt-server/src/main/kotlin/kscience/plotly/server/JupyterPlotlyServer.kt +++ b/plotlykt-server/src/main/kotlin/kscience/plotly/server/JupyterPlotlyServer.kt @@ -222,7 +222,7 @@ public class JupyterPlotlyServer( } public fun renderPlot(plot: Plot): String = createHTML().div { - plot(plot, config = PlotlyConfig { + plot(plot, config = PlotlyConfig{ responsive = true }, renderer = jupyterPlotlyServer ?: StaticPlotlyRenderer) } diff --git a/plotlykt-server/src/main/kotlin/kscience/plotly/server/PlotlyServer.kt b/plotlykt-server/src/main/kotlin/kscience/plotly/server/PlotlyServer.kt index 44722227..96c2041b 100644 --- a/plotlykt-server/src/main/kotlin/kscience/plotly/server/PlotlyServer.kt +++ b/plotlykt-server/src/main/kotlin/kscience/plotly/server/PlotlyServer.kt @@ -105,9 +105,9 @@ private class ServerPlotlyRenderer( public class PlotlyServer internal constructor(private val routing: Routing, private val rootRoute: String) : Configurable { override val config: Config = Config() - public var updateMode: PlotlyUpdateMode by enum(PlotlyUpdateMode.NONE, key = UPDATE_MODE_KEY) - public var updateInterval: Long by long(300, key = UPDATE_INTERVAL_KEY) - public var embedData: Boolean by boolean(false) + public var updateMode: PlotlyUpdateMode by config.enum(PlotlyUpdateMode.NONE, key = UPDATE_MODE_KEY) + public var updateInterval: Long by config.long(300, key = UPDATE_INTERVAL_KEY) + public var embedData: Boolean by config.boolean(false) /** * a list of headers that should be applied to all pages