Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#6903 add doc for ipyvolume #7395

Merged
merged 7 commits into from
May 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
}