Add demo notebook
This commit is contained in:
parent
b2624cb10b
commit
279b848039
1
.gitignore
vendored
1
.gitignore
vendored
@ -9,3 +9,4 @@ data/
|
|||||||
!gradle-wrapper.jar
|
!gradle-wrapper.jar
|
||||||
|
|
||||||
/kotlin-js-store/yarn.lock
|
/kotlin-js-store/yarn.lock
|
||||||
|
.
|
||||||
|
File diff suppressed because one or more lines are too long
91
demo/playground/notebooks/dynamic-demo.ipynb
Normal file
91
demo/playground/notebooks/dynamic-demo.ipynb
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
{
|
||||||
|
"cells": [
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"metadata": {
|
||||||
|
"pycharm": {
|
||||||
|
"is_executing": true
|
||||||
|
},
|
||||||
|
"tags": []
|
||||||
|
},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"@file:DependsOn(\"../build/libs/playground-0.3.0-dev-4-all.jar\")"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"vf.startServer()"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"metadata": {
|
||||||
|
"collapsed": false,
|
||||||
|
"jupyter": {
|
||||||
|
"outputs_hidden": false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"import kotlinx.coroutines.*\n",
|
||||||
|
"import kotlin.random.Random\n",
|
||||||
|
"\n",
|
||||||
|
"Plotly.plot{\n",
|
||||||
|
" scatter{\n",
|
||||||
|
" x(1,2,3)\n",
|
||||||
|
" y(1,2,3)\n",
|
||||||
|
" if(vf.isServerRunning()){\n",
|
||||||
|
" vf.launch{\n",
|
||||||
|
" while(isActive){\n",
|
||||||
|
" delay(500)\n",
|
||||||
|
" y(Random.nextDouble(), Random.nextDouble(), Random.nextDouble())\n",
|
||||||
|
" }\n",
|
||||||
|
" }\n",
|
||||||
|
" }\n",
|
||||||
|
" }\n",
|
||||||
|
"}"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"vf.stopServer()"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"metadata": {
|
||||||
|
"kernelspec": {
|
||||||
|
"display_name": "Kotlin",
|
||||||
|
"language": "kotlin",
|
||||||
|
"name": "kotlin"
|
||||||
|
},
|
||||||
|
"language_info": {
|
||||||
|
"codemirror_mode": "text/x-kotlin",
|
||||||
|
"file_extension": ".kt",
|
||||||
|
"mimetype": "text/x-kotlin",
|
||||||
|
"name": "kotlin",
|
||||||
|
"nbconvert_exporter": "",
|
||||||
|
"pygments_lexer": "kotlin",
|
||||||
|
"version": "1.8.0-dev-3517"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nbformat": 4,
|
||||||
|
"nbformat_minor": 4
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user