|
287 | 287 | " max_plot_points = 10000\n", |
288 | 288 | " if points_dropdown.value == \"100K\":\n", |
289 | 289 | " max_plot_points = 100000\n", |
290 | | - " elif points_dropdown.value == \"unlimited\":\n", |
| 290 | + " elif points_dropdown.value == \"all\":\n", |
291 | 291 | " max_plot_points = 1000000000\n", |
| 292 | + " if max_plot_points > atl06_rsps.shape[0]:\n", |
| 293 | + " max_plot_points = atl06_rsps.shape[0]\n", |
| 294 | + " print(f'Plotting {max_plot_points} of {atl06_rsps.shape[0]} elevations. This may take 10-60+ seconds for larger point datasets.')\n", |
292 | 295 | " m.GeoData(atl06_rsps, column_name=SRwidgets.variable.value, cmap=SRwidgets.colormap, max_plot_points=max_plot_points)\n", |
293 | 296 | "\n", |
294 | 297 | "# refresh action\n", |
295 | 298 | "def on_refresh_clicked(b):\n", |
296 | 299 | " global atl06_rsps\n", |
297 | 300 | " with refresh_output:\n", |
298 | | - " if atl06_rsps and atl06_rsps.shape[0] > 0:\n", |
| 301 | + " if atl06_rsps is not None and atl06_rsps.shape[0] > 0:\n", |
299 | 302 | " max_plot_points = 10000\n", |
300 | 303 | " if points_dropdown.value == \"100K\":\n", |
301 | 304 | " max_plot_points = 100000\n", |
302 | | - " elif points_dropdown.value == \"unlimited\":\n", |
| 305 | + " elif points_dropdown.value == \"all\":\n", |
303 | 306 | " max_plot_points = 1000000000\n", |
| 307 | + " if max_plot_points > atl06_rsps.shape[0]:\n", |
| 308 | + " max_plot_points = atl06_rsps.shape[0]\n", |
| 309 | + " print(f'Plotting {max_plot_points} of {atl06_rsps.shape[0]} elevations. This may take 10-60+ seconds for larger point datasets.')\n", |
304 | 310 | " m.GeoData(atl06_rsps, column_name=SRwidgets.variable.value, cmap=SRwidgets.colormap, max_plot_points=max_plot_points)\n", |
305 | 311 | "\n", |
306 | 312 | "# link buttons\n", |
|
339 | 345 | "\n", |
340 | 346 | "# points to plot drop down\n", |
341 | 347 | "points_dropdown = widgets.Dropdown(\n", |
342 | | - " options = [\"10K\", \"100K\", \"unlimited\"],\n", |
| 348 | + " options = [\"10K\", \"100K\", \"all\"],\n", |
343 | 349 | " value = \"10K\",\n", |
344 | 350 | " description = \"Pts to Draw\",\n", |
345 | 351 | " disabled = False,\n", |
|
562 | 568 | "display(pc_button)\n", |
563 | 569 | "display(pc_output)" |
564 | 570 | ] |
565 | | - }, |
566 | | - { |
567 | | - "cell_type": "code", |
568 | | - "execution_count": null, |
569 | | - "metadata": {}, |
570 | | - "outputs": [], |
571 | | - "source": [] |
572 | 571 | } |
573 | 572 | ], |
574 | 573 | "metadata": { |
|
605 | 604 | "name": "python", |
606 | 605 | "nbconvert_exporter": "python", |
607 | 606 | "pygments_lexer": "ipython3", |
608 | | - "version": "3.8.13" |
| 607 | + "version": "3.10.6" |
609 | 608 | }, |
610 | 609 | "toc-showtags": false |
611 | 610 | }, |
|
0 commit comments