Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add webGL option for rendering GPS traces #995

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/docs-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
run: uv python install ${{ matrix.python-version }}

- name: Install dependencies
run: uv sync --python ${{ matrix.python-version }}
run: uv sync --python ${{ matrix.python-version }} --prerelease=allow

- name: Install optional dependencies
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
run: uv python install ${{ matrix.python-version }}

- name: Install dependencies
run: uv sync --python ${{ matrix.python-version }}
run: uv sync --python ${{ matrix.python-version }} --prerelease=allow

- name: Install optional dependencies
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/installation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
run: uv python install ${{ matrix.python-version }}

- name: Install dependencies
run: uv sync --python ${{ matrix.python-version }}
run: uv sync --python ${{ matrix.python-version }} --prerelease=allow

- name: Test import
run: uv run python -c "import leafmap; print('leafmap import successful')"
2 changes: 1 addition & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
run: uv python install ${{ matrix.config.py }}

- name: Install dependencies
run: uv sync --python ${{ matrix.config.py }}
run: uv sync --python ${{ matrix.config.py }} --prerelease=allow

- name: Test import
run: |
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/py313.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ jobs:
run: uv python install ${{ matrix.python-version }}

- name: Install dependencies
run: uv sync --python ${{ matrix.python-version }}
run: |
uv venv --python ${{ matrix.python-version }}
uv pip install -r pyproject.toml --prerelease=allow

- name: Test import
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
run: uv python install ${{ matrix.python-version }}

- name: Install dependencies
run: uv sync --python ${{ matrix.python-version }}
run: uv sync --python ${{ matrix.python-version }} --prerelease=allow

- name: Install optional dependencies
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
run: uv python install ${{ matrix.python-version }}

- name: Install dependencies
run: uv sync --python ${{ matrix.python-version }}
run: uv sync --python ${{ matrix.python-version }} --prerelease=allow

- name: Test import
run: |
Expand Down
9 changes: 8 additions & 1 deletion leafmap/maplibregl.py
Original file line number Diff line number Diff line change
Expand Up @@ -3953,6 +3953,7 @@ def edit_gps_trace(
fig_width: str = "1550px",
fig_height: str = "300px",
time_format: str = "%Y-%m-%d %H:%M:%S",
webGL: bool = False,
**kwargs,
) -> Any:
"""
Expand All @@ -3969,18 +3970,24 @@ def edit_gps_trace(
fig_width (str, optional): The width of the figure. Defaults to "1550px".
fig_height (str, optional): The height of the figure. Defaults to "300px".
time_format (str, optional): The time format for the timestamp. Defaults to "%Y-%m-%d %H:%M:%S".
webGL (bool, optional): Whether to use WebGL (bqplot-gl) for rendering. Defaults to False.
**kwargs: Additional keyword arguments.

Returns:
Any: The main widget containing the map and the editing interface.
"""

from datetime import datetime
from bqplot import LinearScale, Scatter, Figure, PanZoom
from bqplot import LinearScale, Figure, PanZoom
import bqplot as bq
from ipywidgets import VBox, Button
import ipywidgets as widgets

if webGL:
from bqplot_gl import ScatterGL as Scatter
else:
from bqplot import Scatter

output = widgets.Output()
download_widget = widgets.Output()

Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ classifiers = [
authors = [{name = "Qiusheng Wu", email = "[email protected]"}]

[project.optional-dependencies]
backends = ["bokeh", "keplergl", "maplibre", "pydeck", "plotly"]
backends = ["bokeh", "maplibre", "pydeck", "plotly"]
lidar = ["geopandas","ipygany", "ipyvtklink", "laspy", "panel", "pyntcloud[LAS]", "pyvista[all]"]
raster = ["localtileserver>=0.10.4", "jupyter-server-proxy", "rio-cogeo", "rioxarray", "netcdf4", "pynhd", "py3dep", "d2spy"]
sql = ["psycopg2", "sqlalchemy"]
apps = ["streamlit-folium", "voila", "solara"]
vector = ["geopandas", "osmnx", "pmtiles", "flask", "flask-cors", "lonboard", "mapclassify"]
pmtiles = ["pmtiles", "flask", "flask-cors"]
ai = ["geopandas", "osmnx", "localtileserver>=0.10.4", "rastervision", "pytorch-lightning", "torchgeo"]
maplibre = ["geopandas", "h3", "ipyvuetify", "localtileserver", "mapclassify", "maplibre", "pmtiles", "rioxarray", "xarray"]
maplibre = ["geopandas", "h3", "ipyvuetify", "localtileserver", "mapclassify", "maplibre", "pmtiles", "rioxarray", "xarray", "bqplot-gl>=0.1.0a0"]
gdal = ["gdal", "pyproj"]

[tool]
Expand Down
2 changes: 1 addition & 1 deletion requirements_dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ h5py
# ipyvtklink
# jupyter_bokeh
jupyterlab>=3.0.0
keplergl
# keplergl
laspy
localtileserver>=0.10.1
lonboard
Expand Down
Loading