From c8510f8f3f878daf1b2a0846a36d9ce3e363419a Mon Sep 17 00:00:00 2001 From: Sebastien Jourdain Date: Thu, 19 Dec 2024 17:21:23 -0700 Subject: [PATCH] feat(globe): enable globe as accessor --- examples/jupyter/xarray-globe.ipynb | 105 ++++++++++++++++ pan3d/explorers/globe.py | 77 ++++++++++-- pan3d/filters/globe.py | 13 +- pan3d/ui/globe.py | 189 +++++++++++++++++++--------- pan3d/ui/vtk_view.py | 154 +++++++++++++---------- pan3d/xarray/accessor.py | 10 ++ 6 files changed, 410 insertions(+), 138 deletions(-) create mode 100644 examples/jupyter/xarray-globe.ipynb diff --git a/examples/jupyter/xarray-globe.ipynb b/examples/jupyter/xarray-globe.ipynb new file mode 100644 index 0000000..ed8fdc6 --- /dev/null +++ b/examples/jupyter/xarray-globe.ipynb @@ -0,0 +1,105 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "d3e629af-a060-4f1e-b821-34114a7694b2", + "metadata": {}, + "source": [ + "## Load XArray data" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "id": "0a67097d-b562-444a-8c2c-ea383d46fa48", + "metadata": {}, + "outputs": [], + "source": [ + "import xarray as xr\n", + "\n", + "ds = xr.tutorial.load_dataset(\"air_temperature\")" + ] + }, + { + "cell_type": "markdown", + "id": "2bb6f93d-0005-4734-9af1-3db0ace2533b", + "metadata": {}, + "source": [ + "## Show data using Pan3d slicer" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "9a0c47e0-a635-4c95-8bac-382c4e9ab264", + "metadata": {}, + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "13609393ee3f4604984a3bb6b11ae634", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "HTML(value='