Skip to content

Commit

Permalink
Adjust for DF 0.2.0-dev-8
Browse files Browse the repository at this point in the history
  • Loading branch information
altavir committed Nov 20, 2020
1 parent 9e676f0 commit f6da7d6
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion examples/src/main/kotlin/contour/BasicContour.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion examples/src/main/kotlin/contour/ConnectNullGaps.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ fun main() {
listOf<Number?>(null, null, null, 27, null, null, null, 21),
listOf<Number?>(null, null, null, 26, 25, 24, 23, 22))

val contour1 = Contour {
val contour1 = Contour{
x.set(x1)
y.set(y2)
z.set(z1)
Expand Down
2 changes: 1 addition & 1 deletion examples/src/main/kotlin/downloadChartAsSVG.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import kscience.plotly.models.ScatterMode
*/
fun main() {
val fragment = Plotly.fragment {
val plotConfig = PlotlyConfig {
val plotConfig = PlotlyConfig{
saveAsSvg()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
4 changes: 2 additions & 2 deletions plotlykt-core/src/commonMain/kotlin/kscience/plotly/dfExt.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import kotlin.time.toDuration
* A delegate for list of objects with specification
* TODO move to DataForge core
*/
internal fun <T : Configurable> Configurable.list(
internal fun <T : Scheme> Configurable.list(
spec: Specification<T>, key: Name? = null
): ReadWriteProperty<Any?, List<T>> = object : ReadWriteProperty<Any?, List<T>> {
override fun getValue(thisRef: Any?, property: KProperty<*>): List<T> {
Expand Down Expand Up @@ -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 <T : Configurable> Configurable.lazySpec(
internal fun <T : Scheme> Configurable.lazySpec(
spec: Specification<T>, key: Name? = null
): ReadWriteProperty<Any?, T> = object : ReadWriteProperty<Any?, T> {
override fun getValue(thisRef: Any?, property: KProperty<*>): T {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion plotlykt-server/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f6da7d6

Please sign in to comment.