visionforge/demo/playground/notebooks/common-demo.ipynb

2.4 KiB

In [ ]:
@file:Repository("*mavenLocal")
@file:Repository("https://repo.kotlin.link")
@file:Repository("https://maven.pkg.jetbrains.space/spc/p/sci/dev")
@file:DependsOn("space.kscience:visionforge-jupyter-common-jvm:0.3.0-dev-11")
@file:DependsOn("io.ktor:ktor-server-cio-jvm:2.3.0")
@file:DependsOn("io.ktor:ktor-server-websockets-jvm:2.3.0")
@file:DependsOn("io.ktor:ktor-server-cors-jvm:2.3.0")
In [ ]:
import io.ktor.server.cio.CIO

println(CIO)

vf.startServer()
In [ ]:
import space.kscience.visionforge.plotly.plotly
import space.kscience.plotly.*
import space.kscience.plotly.models.*

vf.page {
    h1 { +"AAA" }
    vision {
        solid {
            ambientLight()
            box(100, 100, 200)

            sphere(100) {
                x = 300
            }
        }
    }

    vision {
        plotly {
            scatter {
                x(1, 2, 3, 1)
                y(1, 2, 3, 4)
            }
        }
    }
}
In [ ]: