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

128 lines
2.7 KiB
Plaintext
Raw Normal View History

2023-07-19 22:25:32 +03:00
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"outputs": [],
"source": [
"//SessionOptions.resolveMpp = true"
],
"metadata": {
"collapsed": false
}
},
2023-07-19 22:25:32 +03:00
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
2023-07-19 22:25:32 +03:00
"outputs": [],
"source": [
"@file:Repository(\"*mavenLocal\")\n",
"@file:Repository(\"https://repo.kotlin.link\")\n",
"@file:Repository(\"https://maven.pkg.jetbrains.space/spc/p/sci/dev\")\n",
"@file:DependsOn(\"space.kscience:visionforge-jupyter-common-jvm:0.3.0-dev-11\")\n",
"//@file:DependsOn(\"io.ktor:ktor-server-cio-jvm:2.3.0\")\n",
"//@file:DependsOn(\"io.ktor:ktor-server-websockets-jvm:2.3.0\")\n",
"//@file:DependsOn(\"io.ktor:ktor-server-cors-jvm:2.3.0\")"
2023-07-19 22:25:32 +03:00
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
2023-07-19 22:25:32 +03:00
"outputs": [],
"source": [
"vf.startServer()"
]
2023-07-19 22:25:32 +03:00
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
2023-07-19 22:25:32 +03:00
"outputs": [],
"source": [
"import space.kscience.visionforge.plotly.plotly\n",
"import space.kscience.plotly.*\n",
"import space.kscience.plotly.models.*\n",
2023-07-19 22:25:32 +03:00
"\n",
"vf.page {\n",
" h1 { +\"AAA\" }\n",
" vision {\n",
" solid {\n",
" ambientLight()\n",
" box(100, 100, 200)\n",
"\n",
" sphere(100) {\n",
" x = 300\n",
" }\n",
" }\n",
" }\n",
"\n",
" vision {\n",
" plotly {\n",
" scatter {\n",
" x(1, 2, 3, 1)\n",
" y(1, 2, 3, 4)\n",
" }\n",
" }\n",
" }\n",
"}"
]
2023-07-19 22:25:32 +03:00
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"outputs": [],
"source": [
"vf.stopServer()"
]
},
{
"cell_type": "code",
"execution_count": null,
"outputs": [],
"source": [],
"metadata": {
"collapsed": false
}
2023-07-19 22:25:32 +03:00
}
],
"metadata": {
"kernelspec": {
"display_name": "Kotlin",
"language": "kotlin",
"name": "kotlin"
},
"ktnbPluginMetadata": {
"isAddProjectLibrariesToClasspath": false
},
2023-07-19 22:25:32 +03:00
"language_info": {
"codemirror_mode": "text/x-kotlin",
2023-07-19 22:25:32 +03:00
"file_extension": ".kt",
"mimetype": "text/x-kotlin",
"name": "kotlin",
"nbconvert_exporter": "",
2023-07-19 22:25:32 +03:00
"pygments_lexer": "kotlin",
"version": "1.8.20"
2023-07-19 22:25:32 +03:00
}
},
"nbformat": 4,
"nbformat_minor": 4
2023-07-19 22:25:32 +03:00
}