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

90 lines
1.7 KiB
Plaintext
Raw Normal View History

2022-11-20 20:35:36 +03:00
{
"cells": [
{
"cell_type": "code",
2023-07-19 22:25:32 +03:00
"execution_count": null,
2022-11-20 20:35:36 +03:00
"metadata": {
2022-11-21 13:28:39 +03:00
"tags": [],
2022-11-20 20:35:36 +03:00
"pycharm": {
"is_executing": true
2022-11-21 13:28:39 +03:00
}
2022-11-20 20:35:36 +03:00
},
"outputs": [],
2023-05-29 21:38:30 +03:00
"source": []
2022-11-20 20:35:36 +03:00
},
{
"cell_type": "code",
2023-07-19 22:25:32 +03:00
"execution_count": null,
"metadata": {},
"outputs": [],
2022-11-20 20:35:36 +03:00
"source": [
"vf.startServer()"
]
},
{
"cell_type": "code",
2023-07-19 22:25:32 +03:00
"execution_count": null,
2022-11-20 20:35:36 +03:00
"metadata": {
2023-11-29 09:41:22 +03:00
"collapsed": false
2022-11-20 20:35:36 +03:00
},
2023-07-19 22:25:32 +03:00
"outputs": [],
2022-11-20 20:35:36 +03:00
"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"
2023-05-29 21:38:30 +03:00
},
"ktnbPluginMetadata": {
2023-11-29 09:41:22 +03:00
"projectLibraries": []
2022-11-20 20:35:36 +03:00
}
},
"nbformat": 4,
"nbformat_minor": 4
}