add plotly imports

This commit is contained in:
Alexander Nozik 2023-07-20 09:13:24 +03:00
parent 5783cf1430
commit a49a4f1a7f
2 changed files with 44 additions and 24 deletions

View File

@ -2,59 +2,76 @@
"cells": [
{
"cell_type": "code",
"execution_count": null,
"outputs": [],
"source": [
"//SessionOptions.resolveMpp = true"
],
"execution_count": 2,
"metadata": {
"collapsed": false
"ExecuteTime": {
"end_time": "2023-07-20T06:12:13.305060400Z",
"start_time": "2023-07-20T06:12:13.011273800Z"
}
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"@file:Repository(\"*mavenLocal\")\n",
"@file:Repository(\"https://repo.kotlin.link\")\n",
"@file:Repository(\"https://maven.pkg.jetbrains.space/spc/p/sci/dev\")\n",
"@file:DependsOn(\"space.kscience:visionforge-jupyter-common-jvm:0.3.0-dev-11\")\n",
"//@file:DependsOn(\"io.ktor:ktor-server-cio-jvm:2.3.0\")\n",
"//@file:DependsOn(\"io.ktor:ktor-server-websockets-jvm:2.3.0\")\n",
"//@file:DependsOn(\"io.ktor:ktor-server-cors-jvm:2.3.0\")"
"@file:DependsOn(\"space.kscience:visionforge-jupyter-common-jvm:0.3.0-dev-11\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
},
"ExecuteTime": {
"end_time": "2023-07-20T06:12:19.603077Z",
"start_time": "2023-07-20T06:12:19.419504300Z"
}
},
"outputs": [],
"outputs": [
{
"data": {
"text/html": "<p style=\"color: blue;\">Starting VisionForge server on http://localhost:7777</p>\n"
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"vf.startServer()"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 4,
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
},
"ExecuteTime": {
"end_time": "2023-07-20T06:12:21.490069100Z",
"start_time": "2023-07-20T06:12:20.694188600Z"
}
},
"outputs": [],
"outputs": [
{
"data": {
"text/html": "<div id=\"fragment[1645474043/2315898832]\">\n <h1>AAA</h1>\n <div id=\"output[vision[302766000]]\" class=\"visionforge-output\" data-output-name=\"vision[302766000]\" data-output-connect=\"ws://localhost:7777/content-0/ws\">\n <script type=\"text/json\" class=\"visionforge-output-data\">\n{\n \"type\": \"group.solid\",\n \"children\": {\n \"@ambientLight\": {\n \"type\": \"solid.light.ambient\"\n },\n \"@static[1326263213]\": {\n \"type\": \"solid.box\",\n \"xSize\": 100.0,\n \"ySize\": 100.0,\n \"zSize\": 200.0\n },\n \"@static[1813044036]\": {\n \"type\": \"solid.sphere\",\n \"properties\": {\n \"position\": {\n \"x\": 300\n }\n },\n \"radius\": 100.0\n }\n }\n}\n</script>\n </div>\n <div id=\"output[vision[1326029936]]\" class=\"visionforge-output\" data-output-name=\"vision[1326029936]\" data-output-connect=\"ws://localhost:7777/content-0/ws\">\n <script type=\"text/json\" class=\"visionforge-output-data\">\n{\n \"type\": \"vision.plotly\",\n \"meta\": {\n \"data\": {\n \"type\": \"scatter\",\n \"x\": [\n 1,\n 2,\n 3,\n 1\n ],\n \"y\": [\n 1,\n 2,\n 3,\n 4\n ],\n \"@index\": \"0\"\n }\n }\n}\n</script>\n </div>\n</div>\n<script type=\"text/javascript\">VisionForge.renderAllVisionsById(\"fragment[1645474043/2315898832]\");</script>\n"
},
"execution_count": 4,
"metadata": {
"text/html": {
"isolated": true
}
},
"output_type": "execute_result"
}
],
"source": [
"import space.kscience.visionforge.plotly.plotly\n",
"import space.kscience.plotly.*\n",
"import space.kscience.plotly.models.*\n",
"\n",
"vf.page {\n",
" h1 { +\"AAA\" }\n",
" vision {\n",

View File

@ -33,6 +33,9 @@ public class JupyterCommonIntegration : VisionForgeIntegration(CONTEXT.visionMan
"space.kscience.visionforge.solid.*",
"space.kscience.tables.*",
"space.kscience.dataforge.meta.*",
"space.kscience.plotly.*",
"space.kscience.plotly.models.*",
"space.kscience.visionforge.plotly.plotly"
)
render<Gdml> { gdmlModel ->