Skip to content

Commit 1cacaef

Browse files
committed
update interactive notebook
1 parent 295d6f2 commit 1cacaef

File tree

1 file changed

+4
-170
lines changed

1 file changed

+4
-170
lines changed

notebooks/03-uxarray-vis/07-animations.ipynb

Lines changed: 4 additions & 170 deletions
Original file line numberDiff line numberDiff line change
@@ -11,183 +11,17 @@
1111
},
1212
"id": "766ae3323db40ec2"
1313
},
14-
{
15-
"cell_type": "code",
16-
"execution_count": null,
17-
"outputs": [],
18-
"source": [
19-
"import warnings\n",
20-
"\n",
21-
"import holoviews as hv\n",
22-
"import uxarray as ux\n",
23-
"\n",
24-
"warnings.filterwarnings(\"ignore\")\n",
25-
"\n",
26-
"hv.extension(\"bokeh\")\n",
27-
"\n",
28-
"file_dir = \"../../meshfiles/\""
29-
],
30-
"metadata": {
31-
"collapsed": false
32-
},
33-
"id": "e6d8966f381f6a14"
34-
},
35-
{
36-
"cell_type": "code",
37-
"execution_count": null,
38-
"outputs": [],
39-
"source": [
40-
"grid_filename_geoflow = file_dir + \"geoflow.grid.nc\"\n",
41-
"data_filename_geoflow = file_dir + \"geoflow.data.nc\"\n",
42-
"uxds = ux.open_dataset(grid_filename_geoflow, data_filename_geoflow)\n",
43-
"\n",
44-
"v1 = uxds[\"v1\"].nodal_average()"
45-
],
46-
"metadata": {
47-
"collapsed": false
48-
},
49-
"id": "fabacde78c2027ca"
50-
},
5114
{
5215
"cell_type": "markdown",
5316
"source": [
54-
"## Interactivity \n",
55-
"\n",
56-
"### Dynamic Rendering\n",
57-
"\n",
58-
"By setting the \"dynamic\" parameter to True, the resulting plot will dynamically re-rasterize whenever you zoom."
59-
],
60-
"metadata": {
61-
"collapsed": false
62-
},
63-
"id": "11d050fd83cfc049"
64-
},
65-
{
66-
"cell_type": "code",
67-
"execution_count": null,
68-
"outputs": [],
69-
"source": [
70-
"v1[0][0].plot.rasterize(method=\"polygon\", dynamic=True)"
71-
],
72-
"metadata": {
73-
"collapsed": false
74-
},
75-
"id": "4c1e60b1f35ee6a3"
76-
},
77-
{
78-
"cell_type": "markdown",
79-
"source": [
80-
"### Tools"
81-
],
82-
"metadata": {
83-
"collapsed": false
84-
},
85-
"id": "36dd246ddcfc2220"
86-
},
87-
{
88-
"cell_type": "code",
89-
"execution_count": null,
90-
"outputs": [],
91-
"source": [
92-
"v1[0][0].plot.polygons().opts(tools=[\"hover\"], width=900, height=400)"
93-
],
94-
"metadata": {
95-
"collapsed": false
96-
},
97-
"id": "572417f981cbebcf"
98-
},
99-
{
100-
"cell_type": "code",
101-
"execution_count": null,
102-
"outputs": [],
103-
"source": [
104-
"v1[0][0].plot.polygons().opts(tools=[\"hover\"], width=900, height=400)"
17+
":::{note}\n",
18+
"This notebook is currently under development! Please refer to the [Interactive HoloViz Visualization](https://projectpythia.org/advanced-viz-cookbook/notebooks/interactive-holoviz-mpas.html#interactive-holoviz-plots) notebook in the Advanced Visualization Cookbook.\n",
19+
":::"
10520
],
10621
"metadata": {
10722
"collapsed": false
10823
},
109-
"id": "dfe8e8cc3966db84"
110-
},
111-
{
112-
"cell_type": "markdown",
113-
"source": [
114-
"An additional tool that can be selected is the 'lasso_select` tool, which similar to the `box_select` tool can be used to interactively select points."
115-
],
116-
"metadata": {
117-
"collapsed": false
118-
},
119-
"id": "3d53a4b99cc1ec9a"
120-
},
121-
{
122-
"cell_type": "code",
123-
"execution_count": null,
124-
"outputs": [],
125-
"source": [
126-
"v1[0][0].plot.points().opts(tools=[\"hover\", \"lasso_select\"], width=900, height=400)"
127-
],
128-
"metadata": {
129-
"collapsed": false
130-
},
131-
"id": "200640779a5ebfdd"
132-
},
133-
{
134-
"cell_type": "markdown",
135-
"source": [
136-
"### HoloMaps"
137-
],
138-
"metadata": {
139-
"collapsed": false
140-
},
141-
"id": "bac833698a730d2a"
142-
},
143-
{
144-
"cell_type": "code",
145-
"execution_count": null,
146-
"outputs": [],
147-
"source": [
148-
"%%capture\n",
149-
"hmap = hv.HoloMap(\n",
150-
" {\n",
151-
" i: v1[0][i].plot.rasterize(\n",
152-
" method=\"polygon\",\n",
153-
" exclude_antimeridian=False,\n",
154-
" cmap=\"coolwarm\",\n",
155-
" title=f\"v1: Mesh Layer {i}\",\n",
156-
" width=700,\n",
157-
" height=350,\n",
158-
" clim=(-10, 10),\n",
159-
" )\n",
160-
" for i in range(5)\n",
161-
" },\n",
162-
" kdims=\"Mesh Layer\",\n",
163-
")"
164-
],
165-
"metadata": {
166-
"collapsed": false
167-
},
168-
"id": "5a00d5599c34648b"
169-
},
170-
{
171-
"cell_type": "code",
172-
"execution_count": null,
173-
"outputs": [],
174-
"source": [
175-
"hmap"
176-
],
177-
"metadata": {
178-
"collapsed": false
179-
},
180-
"id": "b66ceaad4c6f552e"
181-
},
182-
{
183-
"cell_type": "code",
184-
"execution_count": null,
185-
"outputs": [],
186-
"source": [],
187-
"metadata": {
188-
"collapsed": false
189-
},
190-
"id": "433a5e65413f567a"
24+
"id": "135881e235d90c09"
19125
}
19226
],
19327
"metadata": {

0 commit comments

Comments
 (0)