Add demo notebook

This commit is contained in:
Alexander Nozik 2022-11-20 20:35:36 +03:00
parent b2624cb10b
commit 279b848039
No known key found for this signature in database
GPG Key ID: F7FCF2DD25C71357
3 changed files with 92 additions and 339 deletions

1
.gitignore vendored
View File

@ -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

View 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
}