Skip to content

Commit 7e18838

Browse files
authored
Remove Web WorldWind support (#275)
It was always kind of flaky and is now broken on the docs and in Jupyter Lab. We can try better version of this later on. Right now, it's not easy to test and maintain and shouldn't be in the code base.
1 parent 4dab34b commit 7e18838

File tree

7 files changed

+9
-192
lines changed

7 files changed

+9
-192
lines changed

Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ lint:
4242

4343
clean:
4444
find . -name "*.pyc" -exec rm -v {} \;
45+
find . -name "*~" -exec rm -v {} \;
4546
rm -rvf build dist MANIFEST *.egg-info __pycache__ .coverage .cache
4647
rm -rvf $(TESTDIR)
4748
rm -rvf baseline

doc/sphinxext.rst

-13
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,6 @@ code. For example:
3939
fig.show()
4040

4141

42-
The HTML rich display features that work in Jupyter notebooks also work for the
43-
extension:
44-
45-
.. gmt-plot::
46-
47-
quakes = pygmt.datasets.load_usgs_quakes()
48-
49-
fig2 = pygmt.Figure()
50-
fig2.plot(x=quakes.longitude, y=quakes.latitude, region=[-180, 180, -90, 90],
51-
projection="X10id", color="yellow", style="c0.2c", pen="black")
52-
fig2.show(method="globe")
53-
54-
5542
Installing
5643
----------
5744

doc/tutorials/first-steps.ipynb

+2-4
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,7 @@
9797
"This is useful when using the Python shell or IPython terminal app. \n",
9898
"However, **this command will not interrupt your Python process**. \n",
9999
"So using it in a Python script will not work because the script will finish and delete the generated previews.\n",
100-
"Use `fig.savefig` to save the figure to a file instead (see below).\n",
101-
"\n",
102-
"There is also the option of inserting the figure in an **interactive globe** using [NASA's WorldWind Web](https://worldwind.arc.nasa.gov/web/). See option `external='globe'` in the examples below."
100+
"Use `fig.savefig` to save the figure to a file instead (see below)."
103101
]
104102
},
105103
{
@@ -186,7 +184,7 @@
186184
"name": "python",
187185
"nbconvert_exporter": "python",
188186
"pygments_lexer": "ipython3",
189-
"version": "3.6.5"
187+
"version": "3.6.7"
190188
}
191189
},
192190
"nbformat": 4,

doc/tutorials/plot-data-points.ipynb

+1-30
Original file line numberDiff line numberDiff line change
@@ -235,35 +235,6 @@
235235
" cmap='viridis', style='cc', pen='black')\n",
236236
"fig.show()"
237237
]
238-
},
239-
{
240-
"cell_type": "markdown",
241-
"metadata": {},
242-
"source": [
243-
"## Interactive map previews"
244-
]
245-
},
246-
{
247-
"cell_type": "markdown",
248-
"metadata": {},
249-
"source": [
250-
"Let's preview this map using the **interactive globe**. In this case, we don't need the frame or color in the oceans. We must also use a **Cartesian projection** (X) and degrees (d) for plot units so that the figure can be aligned with the globe."
251-
]
252-
},
253-
{
254-
"cell_type": "code",
255-
"execution_count": null,
256-
"metadata": {},
257-
"outputs": [],
258-
"source": [
259-
"fig = pygmt.Figure()\n",
260-
"fig.coast(region=quakes_region, projection='X6id/6id', land='gray')\n",
261-
"fig.plot(x=quakes.longitude, y=quakes.latitude, \n",
262-
" sizes=0.02*2**quakes.magnitude,\n",
263-
" color=quakes.depth_km/quakes.depth_km.max(),\n",
264-
" cmap='viridis', style='cc', pen='black')\n",
265-
"fig.show(method='globe')"
266-
]
267238
}
268239
],
269240
"metadata": {
@@ -282,7 +253,7 @@
282253
"name": "python",
283254
"nbconvert_exporter": "python",
284255
"pygments_lexer": "ipython3",
285-
"version": "3.6.5"
256+
"version": "3.6.7"
286257
}
287258
},
288259
"nbformat": 4,

pygmt/figure.py

+5-27
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
kwargs_to_strings,
2121
launch_external_viewer,
2222
unique_name,
23-
worldwind_show,
2423
)
2524

2625

@@ -222,7 +221,7 @@ def savefig(
222221
if show:
223222
launch_external_viewer(fname)
224223

225-
def show(self, dpi=300, width=500, method="static", globe_center=None):
224+
def show(self, dpi=300, width=500, method="static"):
226225
"""
227226
Display a preview of the figure.
228227
@@ -235,10 +234,6 @@ def show(self, dpi=300, width=500, method="static", globe_center=None):
235234
browser). Note that the external viewer does not block the current
236235
process, so this won't work in a script.
237236
238-
If using the ``'globe'`` preview, use a Cartesian projection (``'X'``)
239-
and specify degrees as size units (e.g. ``projection='X3id/3id'``).
240-
Otherwise, the figure may not align with the globe.
241-
242237
Parameters
243238
----------
244239
dpi : int
@@ -249,34 +244,17 @@ def show(self, dpi=300, width=500, method="static", globe_center=None):
249244
method : str
250245
How the figure will be displayed. Options are (1) ``'static'``: PNG
251246
preview (default); (2) ``'external'``: PDF preview in an external
252-
program; (3) ``'globe'``: interactive 3D globe in the notebook
253-
using `NASA WorldWind Web <https://worldwind.arc.nasa.gov>`__ (only
254-
use if plotting lon/lat data).
255-
globe_center : None or tuple = (lon, lat, height[m])
256-
The coordinates used to set the view point for the globe preview.
257-
If None, will automatically determine a view based on the plot
258-
region. Only used if ``method='globe'``.
247+
program.
259248
260249
Returns
261250
-------
262-
img : IPython.display.Image or IPython.display.Javascript
251+
img : IPython.display.Image
263252
Only if ``method != 'external'``.
264253
265254
"""
266-
if method not in ["static", "external", "globe"]:
255+
if method not in ["static", "external"]:
267256
raise GMTInvalidInput("Invalid show method '{}'.".format(method))
268-
if method == "globe":
269-
png = self._preview(
270-
fmt="png", dpi=dpi, anti_alias=True, as_bytes=True, transparent=True
271-
)
272-
img = worldwind_show(
273-
image=png,
274-
width=width,
275-
region=self.region,
276-
canvas_id=self._name,
277-
globe_center=globe_center,
278-
)
279-
elif method == "external":
257+
if method == "external":
280258
pdf = self._preview(fmt="pdf", dpi=dpi, anti_alias=False, as_bytes=False)
281259
launch_external_viewer(pdf)
282260
img = None

pygmt/helpers/__init__.py

-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,3 @@
1010
is_nonstr_iter,
1111
launch_external_viewer,
1212
)
13-
from .worldwind import worldwind_show

pygmt/helpers/worldwind.py

-117
This file was deleted.

0 commit comments

Comments
 (0)