-
Notifications
You must be signed in to change notification settings - Fork 382
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* #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
1 parent
d0ffc21
commit 0acbe67
Showing
2 changed files
with
64 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |