Skip to content

Commit 22d4bc3

Browse files
Added multiple plot demos
1 parent 2979634 commit 22d4bc3

File tree

2 files changed

+84
-0
lines changed

2 files changed

+84
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
* Copyright (c) 2023 JetBrains s.r.o.
3+
* Use of this source code is governed by the MIT license that can be found in the LICENSE file.
4+
*/
5+
6+
package demo.plot.minimal
7+
8+
import androidx.compose.foundation.layout.*
9+
import androidx.compose.material.MaterialTheme
10+
import androidx.compose.ui.Modifier
11+
import androidx.compose.ui.unit.dp
12+
import androidx.compose.ui.window.Window
13+
import androidx.compose.ui.window.application
14+
import org.jetbrains.letsPlot.skia.compose.PlotPanel
15+
import plotSpec.DensitySpec
16+
17+
fun main() = application {
18+
Window(onCloseRequest = ::exitApplication, title = "Multiple Plot Size Layout (Compose Desktop)") {
19+
MaterialTheme {
20+
Column(
21+
modifier = Modifier.fillMaxSize().padding(start = 10.dp, top = 10.dp, end = 10.dp, bottom = 10.dp),
22+
) {
23+
24+
PlotPanel(
25+
figure = DensitySpec().createFigure(),
26+
modifier = Modifier.height(100.dp).width(100.dp)
27+
) { computationMessages ->
28+
computationMessages.forEach { println("[DEMO APP MESSAGE] $it") }
29+
}
30+
31+
PlotPanel(
32+
figure = DensitySpec().createFigure(),
33+
modifier = Modifier.height(100.dp).width(100.dp)
34+
) { computationMessages ->
35+
computationMessages.forEach { println("[DEMO APP MESSAGE] $it") }
36+
}
37+
}
38+
}
39+
}
40+
}
41+
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*
2+
* Copyright (c) 2023 JetBrains s.r.o.
3+
* Use of this source code is governed by the MIT license that can be found in the LICENSE file.
4+
*/
5+
6+
package demo.plot.minimal
7+
8+
import androidx.compose.foundation.layout.Column
9+
import androidx.compose.foundation.layout.fillMaxSize
10+
import androidx.compose.foundation.layout.padding
11+
import androidx.compose.material.MaterialTheme
12+
import androidx.compose.ui.Modifier
13+
import androidx.compose.ui.unit.dp
14+
import androidx.compose.ui.window.Window
15+
import androidx.compose.ui.window.application
16+
import org.jetbrains.letsPlot.skia.compose.PlotPanel
17+
import plotSpec.DensitySpec
18+
19+
fun main() = application {
20+
Window(onCloseRequest = ::exitApplication, title = "Multiple Plot Weight Layout (Compose Desktop)") {
21+
MaterialTheme {
22+
Column(
23+
modifier = Modifier.fillMaxSize().padding(start = 10.dp, top = 10.dp, end = 10.dp, bottom = 10.dp),
24+
) {
25+
26+
PlotPanel(
27+
figure = DensitySpec().createFigure(),
28+
modifier = Modifier.weight(1f)
29+
) { computationMessages ->
30+
computationMessages.forEach { println("[DEMO APP MESSAGE] $it") }
31+
}
32+
33+
PlotPanel(
34+
figure = DensitySpec().createFigure(),
35+
modifier = Modifier.weight(1f)
36+
) { computationMessages ->
37+
computationMessages.forEach { println("[DEMO APP MESSAGE] $it") }
38+
}
39+
}
40+
}
41+
}
42+
}
43+

0 commit comments

Comments
 (0)