Skip to content

Commit

Permalink
#6903 add doc for ipyvolume
Browse files Browse the repository at this point in the history
  • Loading branch information
scottdraves committed May 22, 2018
1 parent 4c23a58 commit 8b6b7ed
Showing 1 changed file with 96 additions and 0 deletions.
96 changes: 96 additions & 0 deletions doc/groovy/3D.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# 3D Visualization and Maps\n",
"\n",
"There are Groovy APIs for [ipyvolume](https://github.com/maartenbreddels/ipyvolume),\n",
"[pythreejs](https://github.com/jupyter-widgets/pythreejs), and [ipyleaflet](https://github.com/jupyter-widgets/ipyleaflet)."
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "",
"version_major": 2,
"version_minor": 0
},
"method": "display_data"
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "3b12ce46-89c9-4b76-97da-16f8f0998d02",
"version_major": 2,
"version_minor": 0
},
"method": "display_data"
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"%classpath config resolver jitpack.io https://jitpack.io\n",
"%classpath add mvn com.github.twosigma:ipyvolume:lmitusinski~beakerx-widget-SNAPSHOT\n",
"import ipyvolume.PyLab;\n",
"\n",
"int size = 32;\n",
"int radius = 12;\n",
"float[][][] data = new float[size][size][size];\n",
"for (int x = 0; x<size; x++){\n",
" for (int y = 0; y<size; y++){\n",
" for (int z = 0; z<size; z++){\n",
" if (Math.pow(x - size/2, 2) + Math.pow(y - size/2, 2) + Math.pow(z - size/2, 2) <= Math.pow(radius, 2)){\n",
" data[x][y][z] = 1.0f;\n",
" }\n",
" }\n",
" }\n",
"}\n",
"\n",
"figure = PyLab.volShow(data)"
]
}
],
"metadata": {
"anaconda-cloud": {},
"beakerx_kernel_parameters": {},
"kernelspec": {
"display_name": "Groovy",
"language": "groovy",
"name": "groovy"
},
"language_info": {
"codemirror_mode": "groovy",
"file_extension": ".groovy",
"mimetype": "",
"name": "Groovy",
"nbconverter_exporter": "",
"version": "2.4.3"
},
"widgets": {
"state": {
"f6132997-5d22-4fbe-b4f9-16d41cb4e58b": {
"views": [
{
"cell_index": 0
}
]
}
},
"version": "1.2.0"
}
},
"nbformat": 4,
"nbformat_minor": 1
}

0 comments on commit 8b6b7ed

Please sign in to comment.