{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": { "pycharm": { "is_executing": true }, "tags": [] }, "outputs": [ { "data": { "text/html": [ "
\n", " " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "@file:DependsOn(\"../build/libs/playground-0.3.0-dev-4-all.jar\")" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/html": [ "

Starting VisionForge server on http://localhost:7777

\n" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "vf.startServer()" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": false, "jupyter": { "outputs_hidden": false } }, "outputs": [ { "data": { "text/html": [ "
\n", "
\n", " \n", "
\n", "
\n", "\n" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "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": 4, "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 }