|
8 | 8 | import shapely |
9 | 9 | import geoarrow.pyarrow as ga |
10 | 10 | from geoarrow.pyarrow import io as gaio |
11 | | -from lonboard import viz, PathLayer, PolygonLayer, ScatterplotLayer |
12 | | -from lonboard.colormap import apply_continuous_cmap, apply_categorical_cmap |
| 11 | + |
13 | 12 | from polars import col as c |
14 | 13 |
|
15 | 14 | from ._utils import validate_cmap_input, validate_width_and_radius_input |
16 | 15 |
|
17 | 16 | if TYPE_CHECKING: |
| 17 | + from lonboard import Map, PathLayer, PolygonLayer, ScatterplotLayer |
18 | 18 | from lonboard.types.layer import ( |
19 | 19 | PathLayerKwargs, |
20 | 20 | PolygonLayerKwargs, |
21 | 21 | ScatterplotLayerKwargs, |
22 | 22 | ) |
23 | | - from lonboard.types.map import Map, MapKwargs |
| 23 | + from lonboard.types.map import MapKwargs |
24 | 24 | from io import BytesIO |
25 | 25 | from numpy.typing import NDArray |
26 | 26 | from palettable.palette import Palette |
@@ -650,6 +650,7 @@ def viz( |
650 | 650 | >>> df.spatial.viz() |
651 | 651 |
|
652 | 652 | """ |
| 653 | + from lonboard import viz |
653 | 654 | geoarrow_table = self.to_geoarrow(geometry_name) |
654 | 655 |
|
655 | 656 | return viz( |
@@ -808,6 +809,9 @@ def to_scatterplotlayer( |
808 | 809 |
|
809 | 810 |
|
810 | 811 | """ |
| 812 | + from lonboard import ScatterplotLayer |
| 813 | + from lonboard.colormap import apply_continuous_cmap, apply_categorical_cmap |
| 814 | + |
811 | 815 | validate_cmap_input( |
812 | 816 | self._df, |
813 | 817 | fill_cmap_col, |
@@ -1022,6 +1026,10 @@ def to_pathlayer( |
1022 | 1026 |
|
1023 | 1027 |
|
1024 | 1028 | """ |
| 1029 | + from lonboard import PathLayer |
| 1030 | + from lonboard.colormap import apply_continuous_cmap, apply_categorical_cmap |
| 1031 | + |
| 1032 | + |
1025 | 1033 | validate_cmap_input( |
1026 | 1034 | self._df, cmap_col, cmap_type, cmap, alpha, normalize_cmap_col |
1027 | 1035 | ) |
@@ -1217,6 +1225,9 @@ def to_polygonlayer( |
1217 | 1225 | Implementation varies slightly from Lonboard for the setting of color and width to make it easy to use from the SpatialFrame. |
1218 | 1226 |
|
1219 | 1227 | """ |
| 1228 | + from lonboard import PolygonLayer |
| 1229 | + from lonboard.colormap import apply_continuous_cmap, apply_categorical_cmap |
| 1230 | + |
1220 | 1231 | validate_cmap_input( |
1221 | 1232 | self._df, |
1222 | 1233 | fill_cmap_col, |
|
0 commit comments