Skip to content

Commit

Permalink
#6903 add doc for ipyvolume (#7395)
Browse files Browse the repository at this point in the history
* #6903 add doc for ipyvolume

* #6903 link to new doc

* #6903 add conda dependency

* #6903 use master branch, expand explanation

* move 3D from widget section to plotting section

* clear widget state

* remove extra space
  • Loading branch information
scottdraves committed May 22, 2018
1 parent d0ffc21 commit 0acbe67
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 1 deletion.
2 changes: 1 addition & 1 deletion StartHere.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"[Python](doc/python/AutoTranslation.ipynb), [Groovy](doc/groovy/AutoTranslation.ipynb).\n",
"\n",
"### Groovy Plotting and Charting\n",
"[Example and Interaction](doc/groovy/Charting.ipynb), [Time Series and General APIs and Features](doc/groovy/PlotFeatures.ipynb), [Category Plots and Bar Charts](doc/groovy/CategoryPlot.ipynb), [Levels of Detail](doc/groovy/LevelsOfDetails.ipynb), [Histograms](doc/groovy/Histogram.ipynb), [Heatmaps](doc/groovy/Heatmap.ipynb), [Treemaps](doc/groovy/Treemap.ipynb), [Plot Actions](doc/groovy/PlotActions.ipynb), [Plot Seamless Updates](doc/groovy/PlotsPythonStyle.ipynb), [Second Y Axis](doc/groovy/2ndYaxis.ipynb).\n",
"[Example and Interaction](doc/groovy/Charting.ipynb), [Time Series and General APIs and Features](doc/groovy/PlotFeatures.ipynb), [Category Plots and Bar Charts](doc/groovy/CategoryPlot.ipynb), [Levels of Detail](doc/groovy/LevelsOfDetails.ipynb), [Histograms](doc/groovy/Histogram.ipynb), [Heatmaps](doc/groovy/Heatmap.ipynb), [Treemaps](doc/groovy/Treemap.ipynb), [Plot Actions](doc/groovy/PlotActions.ipynb), [Plot Seamless Updates](doc/groovy/PlotsPythonStyle.ipynb), [Second Y Axis](doc/groovy/2ndYaxis.ipynb), [3D Visualization and Maps](doc/groovy/3D.ipynb).\n",
"\n",
"### Table Display\n",
"[Groovy API including Actions](doc/groovy/TableAPI.ipynb), [64-Bit Integers and BigNums](doc/groovy/BigInts.ipynb), [Automatic Display of Simple Data Structures](doc/groovy/MapLikeTable.ipynb), [Handling of Large Tables](doc/groovy/BigTable.ipynb).\n",
Expand Down
63 changes: 63 additions & 0 deletions doc/groovy/3D.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# 3D Visualization and Maps\n",
"\n",
"There is an alpha Groovy API for [ipyvolume](https://github.com/maartenbreddels/ipyvolume). For this to work, the widget JS needs to be installed:\n",
"```\n",
"conda install -c conda-forge ipyvolume\n",
"```\n",
"\n",
"[Pythreejs](https://github.com/jupyter-widgets/pythreejs) and [ipyleaflet](https://github.com/jupyter-widgets/ipyleaflet) will be forthcoming, see [#6903](https://github.com/twosigma/beakerx/issues/6903), and we hope these APIs will be included upstream in the original widget repositories."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"%classpath config resolver jitpack.io https://jitpack.io\n",
"%classpath add mvn com.github.twosigma:ipyvolume:master-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"
}
},
"nbformat": 4,
"nbformat_minor": 1
}

0 comments on commit 0acbe67

Please sign in to comment.