Skip to content

Commit 46f2f20

Browse files
committed
Removed use of arrows in project, cleaned up code
- Figuring out how to lay out arrows was unnecessarily difficult, and ended up being too distracting, so utilizing the column space each node and its children are in was a much cleaner way to represent a subtree relationship - Figure will closely resemble a treemap
1 parent d192bab commit 46f2f20

File tree

7 files changed

+48
-299
lines changed

7 files changed

+48
-299
lines changed

gradle/libs.versions.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
agpVersion = "8.8.0"
44

55
compileSdk = "34"
6+
filekitDialogsComposeVersion = "0.10.0-beta04"
67
minSdk = "24"
78
moshiKotlinVersion = "1.15.2"
89
targetSdk = "33"
@@ -186,6 +187,7 @@ dokka-gradle-plugin = { module = "org.jetbrains.dokka:dokka-gradle-plugin", vers
186187

187188
dropbox-dependencyGuard = { module = "com.dropbox.dependency-guard:dependency-guard", version.ref = "dependencyGuard" }
188189

190+
filekit-dialogs-compose = { module = "io.github.vinceglb:filekit-dialogs-compose", version.ref = "filekitDialogsComposeVersion" }
189191
google-android-material = { module = "com.google.android.material:material", version.ref = "material" }
190192
google-ksp = { module = "com.google.devtools.ksp:symbol-processing-gradle-plugin", version.ref = "google-ksp" }
191193

workflow-trace-viewer/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ kotlin {
2424
implementation(libs.kotlinx.coroutines.swing)
2525
implementation(compose.materialIconsExtended)
2626
implementation(libs.moshi.kotlin)
27+
implementation("io.github.vinceglb:filekit-dialogs-compose:0.10.0-beta03")
2728
}
2829
}
2930
}

workflow-trace-viewer/src/jvmMain/kotlin/com/squareup/workflow1/traceviewer/App.kt

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,41 @@ package com.squareup.workflow1.traceviewer
22

33
import androidx.compose.material.Text
44
import androidx.compose.runtime.Composable
5+
import androidx.compose.runtime.mutableStateOf
6+
import androidx.compose.runtime.remember
7+
import com.squareup.workflow1.traceviewer.FileReader.fetchFile
8+
import io.github.vinceglb.filekit.PlatformFile
59

610
@Composable
711
fun App() {
8-
val jsonString = object {}.javaClass.getResource("/workflow-simple.json")?.readText()
12+
val jsonString = fetchFile()
913
val root = jsonString?.let { FetchRoot(it) }
10-
println(root)
14+
15+
var selectedFile = remember { mutableStateOf<PlatformFile?>(null)}
16+
17+
// UploadFile { selectedFile.value = it }
18+
1119
if (root != null) {
1220
DrawWorkflowTree(root)
1321
} else {
1422
Text("Empty data or failed to parse data") // TODO: proper handling of error
1523
}
1624
}
25+
26+
27+
object FileReader {
28+
fun fetchFile() : String?{
29+
return javaClass.getResource("/workflow-simple.json")?.readText()
30+
}
31+
}
32+
33+
//
34+
// @Composable
35+
// private fun UploadFile(onFileSelected: (PlatformFile?) -> Unit) {
36+
// val launcher = rememberFilePickerLauncher(
37+
// type = FileKitType.Custom(listOf("json","txt")),
38+
// title = "Select Workflow Trace File"
39+
// ) {
40+
// onFileSelected(it)
41+
// }
42+
// }

workflow-trace-viewer/src/jvmMain/kotlin/com/squareup/workflow1/traceviewer/Arrow.kt

Lines changed: 0 additions & 85 deletions
This file was deleted.

workflow-trace-viewer/src/jvmMain/kotlin/com/squareup/workflow1/traceviewer/Main.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package com.squareup.workflow1.traceviewer
33
import androidx.compose.ui.window.singleWindowApplication
44

55
fun main() {
6+
// FileKit.init(appId = "com.squareup.workflow1.traceviewer")
67
singleWindowApplication(title = "Workflow Trace Viewer") {
78
SandboxBackground { App() }
89
}

workflow-trace-viewer/src/jvmMain/kotlin/com/squareup/workflow1/traceviewer/SandboxBackground.kt

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,7 @@ import androidx.compose.ui.input.pointer.pointerInput
2424
*/
2525
@Composable
2626
public fun SandboxBackground(
27-
content: @Composable (
28-
translationX: Float,
29-
translationY: Float,
30-
scale: Float,
31-
) -> Unit
27+
content: @Composable () -> Unit
3228
) {
3329
var scale by remember { mutableStateOf(1f) }
3430
var offset by remember { mutableStateOf(Offset.Zero) }
@@ -75,9 +71,6 @@ public fun SandboxBackground(
7571
scaleY = scale
7672
}
7773
) {
78-
content(
79-
offset.x, offset.y,
80-
scale
81-
) // this is main content
74+
content()
8275
}
8376
}

0 commit comments

Comments
 (0)