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

131 lines
3.0 KiB
Plaintext
Raw Permalink Normal View History

2022-11-20 20:35:36 +03:00
{
"cells": [
{
"cell_type": "code",
2023-05-29 21:38:30 +03:00
"execution_count": 1,
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
2023-05-29 21:38:30 +03:00
},
"ExecuteTime": {
"end_time": "2023-05-29T15:22:37.933397300Z",
"start_time": "2023-05-29T15:22:37.913872100Z"
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-05-29 21:38:30 +03:00
"execution_count": 3,
"metadata": {
"ExecuteTime": {
"end_time": "2023-05-29T15:22:50.486483300Z",
"start_time": "2023-05-29T15:22:50.457485500Z"
}
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"Line_2.jupyter.kts (1:1 - 3) Unresolved reference: vf"
]
}
],
2022-11-20 20:35:36 +03:00
"source": [
"vf.startServer()"
]
},
{
"cell_type": "code",
2023-05-29 21:38:30 +03:00
"execution_count": 4,
2022-11-20 20:35:36 +03:00
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
2023-05-29 21:38:30 +03:00
},
"ExecuteTime": {
"end_time": "2023-05-29T15:22:51.410680600Z",
"start_time": "2023-05-29T15:22:51.250779400Z"
2022-11-20 20:35:36 +03:00
}
},
2023-05-29 21:38:30 +03:00
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"Line_3.jupyter.kts (1:16 - 26) Unresolved reference: coroutines\n",
"Line_3.jupyter.kts (4:1 - 7) Unresolved reference: Plotly\n",
"Line_3.jupyter.kts (5:5 - 12) Unresolved reference: scatter\n",
"Line_3.jupyter.kts (6:9 - 10) Unresolved reference: x\n",
"Line_3.jupyter.kts (7:9 - 10) Unresolved reference: y\n",
"Line_3.jupyter.kts (8:12 - 14) Unresolved reference: vf\n",
"Line_3.jupyter.kts (9:13 - 15) Unresolved reference: vf\n",
"Line_3.jupyter.kts (10:23 - 31) Unresolved reference: isActive\n",
"Line_3.jupyter.kts (11:21 - 26) Unresolved reference: delay\n",
"Line_3.jupyter.kts (12:21 - 22) Unresolved reference: y"
]
}
],
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": {
"isAddProjectLibrariesToClasspath": false
2022-11-20 20:35:36 +03:00
}
},
"nbformat": 4,
"nbformat_minor": 4
}