Skip to content

Commit 4b1709b

Browse files
Add a Compose demo with hyperlinks
1 parent b2be303 commit 4b1709b

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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.various
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.HyperlinkSpec
16+
17+
@OptIn(ExperimentalLayoutApi::class)
18+
fun main() = application {
19+
Window(onCloseRequest = ::exitApplication, title = "Hyperlink (Compose Desktop)") {
20+
MaterialTheme {
21+
FlowRow(
22+
modifier = Modifier.fillMaxSize().padding(start = 10.dp, top = 10.dp, end = 10.dp, bottom = 10.dp),
23+
) {
24+
HyperlinkSpec().createFigureList().forEach { figure ->
25+
Column {
26+
PlotPanel(
27+
figure = figure,
28+
modifier = Modifier.size(610.dp)
29+
) { computationMessages ->
30+
computationMessages.forEach { println("[DEMO APP MESSAGE] $it") }
31+
}
32+
}
33+
}
34+
}
35+
}
36+
}
37+
}
38+

0 commit comments

Comments
 (0)