visionforge/demo/playground/src/jvmMain/kotlin/tables.kt

23 lines
665 B
Kotlin
Raw Normal View History

2022-01-07 12:29:43 +03:00
package space.kscience.visionforge.examples
2022-08-09 14:53:46 +03:00
import space.kscience.dataforge.meta.ValueType
2022-01-07 12:29:43 +03:00
import space.kscience.tables.ColumnHeader
import space.kscience.tables.valueRow
import space.kscience.visionforge.html.ResourceLocation
import space.kscience.visionforge.tables.table
import kotlin.math.pow
fun main() {
val x by ColumnHeader.value(ValueType.NUMBER)
val y by ColumnHeader.value(ValueType.NUMBER)
makeVisionFile(resourceLocation = ResourceLocation.SYSTEM) {
2022-01-07 12:29:43 +03:00
vision {
table(x, y) {
repeat(100) {
valueRow(x to it, y to it.toDouble().pow(2))
}
}
}
}
}