From 0f610a5e198e9f3f263f38915236454aec6709c8 Mon Sep 17 00:00:00 2001 From: darksnake Date: Thu, 24 Aug 2023 16:25:17 +0300 Subject: [PATCH] Fix mass demo plot --- .../space/kscience/controls/demo/MassDevice.kt | 12 +++++------- magix/magix-zmq/build.gradle.kts | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/demo/many-devices/src/main/kotlin/space/kscience/controls/demo/MassDevice.kt b/demo/many-devices/src/main/kotlin/space/kscience/controls/demo/MassDevice.kt index 5c89c26..040d288 100644 --- a/demo/many-devices/src/main/kotlin/space/kscience/controls/demo/MassDevice.kt +++ b/demo/many-devices/src/main/kotlin/space/kscience/controls/demo/MassDevice.kt @@ -23,10 +23,7 @@ import space.kscience.magix.rsocket.rSocketWithTcp import space.kscience.magix.rsocket.rSocketWithWebSockets import space.kscience.magix.server.RSocketMagixFlowPlugin import space.kscience.magix.server.startMagixServer -import space.kscience.plotly.Plotly -import space.kscience.plotly.bar -import space.kscience.plotly.layout -import space.kscience.plotly.plot +import space.kscience.plotly.* import space.kscience.plotly.server.PlotlyUpdateMode import space.kscience.plotly.server.serve import space.kscience.plotly.server.show @@ -88,9 +85,10 @@ suspend fun main() { updateMode = PlotlyUpdateMode.PUSH updateInterval = 1000 page { container -> - plot(renderer = container) { + plot(renderer = container, config = PlotlyConfig { saveAsSvg() }) { layout { - title = "Latest event" +// title = "Latest event" + xaxis.title = "Device number" yaxis.title = "Maximum latency in ms" } @@ -119,7 +117,7 @@ suspend fun main() { latest.clear() max.clear() x.numbers = sorted.keys - y.numbers = sorted.values.map { it.inWholeMilliseconds / 1000.0 + 0.0001 } + y.numbers = sorted.values.map { it.inWholeMicroseconds / 1000.0 + 0.0001 } } } } diff --git a/magix/magix-zmq/build.gradle.kts b/magix/magix-zmq/build.gradle.kts index cf4ee9b..20cc246 100644 --- a/magix/magix-zmq/build.gradle.kts +++ b/magix/magix-zmq/build.gradle.kts @@ -12,7 +12,7 @@ description = """ dependencies { api(projects.magix.magixApi) api("org.slf4j:slf4j-api:2.0.6") - api("org.zeromq:jeromq:0.5.2") + api("org.zeromq:jeromq:0.5.3") } readme {