Skip to content

Commit 5fa9d9f

Browse files
committed
refactor imports
1 parent 7dcad87 commit 5fa9d9f

File tree

6 files changed

+5371
-6
lines changed

6 files changed

+5371
-6
lines changed

maplibre/__init__.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import importlib.metadata
22
import logging
33

4-
__version__ = importlib.metadata.version(__package__)
5-
64
logging.basicConfig()
75
logger = logging.getLogger(__name__)
86

@@ -25,3 +23,13 @@
2523
except ImportError as e:
2624
logger.warning(e)
2725
logger.warning(WARNING_MESSAGE)
26+
27+
# New imports
28+
try:
29+
from .anywidget import MapWidget
30+
except ImportError as e:
31+
print(e)
32+
33+
__version__ = importlib.metadata.version(__package__)
34+
35+
__all__ = ["Map", "MapOptions", "Layer", "LayerType", "ControlPosition"]

maplibre/anywidget.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ class MapWidget(AnyWidget, Map):
3131
>>> m # doctest: +SKIP
3232
"""
3333

34-
# _esm = join(Path(__file__).parent, "srcjs", "ipywidget.js")
35-
# _css = join(Path(__file__).parent, "srcjs", "ipywidget.css")
34+
# _esm = Path(__file__).parent / "srcjs" / "ipywidget.js"
35+
# _css = Path(__file__).parent / "srcjs" / "ipywidget.css"
3636

37-
_esm = Path(__file__).parent / "srcjs" / "ipywidget.js"
38-
_css = Path(__file__).parent / "srcjs" / "ipywidget.css"
37+
_esm = Path(__file__).parent / "srcjs" / "maplibre.anywidget.js"
38+
_css = Path(__file__).parent / "srcjs" / "maplibre.anywidget.css"
3939

4040
_use_message_queue = True
4141
_rendered = traitlets.Bool(False).tag(config=True).tag(sync=True)

maplibre/export.py

Whitespace-only changes.

maplibre/srcjs/maplibre.anywidget.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

maplibre/srcjs/maplibre.anywidget.js

Lines changed: 5319 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

marimo/playground.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import marimo
2+
3+
__generated_with = "0.10.17"
4+
app = marimo.App(width="medium")
5+
6+
7+
@app.cell
8+
def _():
9+
import maplibre as mlb
10+
return (mlb,)
11+
12+
13+
@app.cell
14+
def _(mlb):
15+
m = mlb.MapWidget()
16+
return (m,)
17+
18+
19+
@app.cell
20+
def _(m):
21+
m
22+
return
23+
24+
25+
@app.cell
26+
def _(m, mlb):
27+
m.add_control(mlb.controls.ScaleControl())
28+
return
29+
30+
31+
@app.cell
32+
def _():
33+
return
34+
35+
36+
if __name__ == "__main__":
37+
app.run()

0 commit comments

Comments
 (0)