Skip to content

Commit

Permalink
chore: improvement _get_dimension (#844)
Browse files Browse the repository at this point in the history
Signed-off-by: slowy07 <[email protected]>
  • Loading branch information
slowy07 authored Jul 23, 2024
1 parent e79c305 commit 9b29a89
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions leafmap/map_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,15 @@ def __init__(

def _get_dimensions(self, orientation, kwargs):
default_dims = {"horizontal": (3.0, 0.3), "vertical": (0.3, 3.0)}
if orientation in default_dims:
default = default_dims[orientation]
return (
kwargs.get("width", default[0]),
kwargs.get("height", default[1]),
if orientation not in default_dims:
valid_orientations = ", ".join(default_dims.keys())
raise ValueError(
f"orientation must be one of [{', '.join(valid_orientations)}]"
)
raise ValueError(
f"orientation must be one of [{', '.join(default_dims.keys())}]."
)
default_width, default_height = default_dims[orientation]
width = kwargs.get("width", default_width)
height = kwargs.get("height", default_height)
return width, height


class Legend(ipywidgets.VBox):
Expand Down

0 comments on commit 9b29a89

Please sign in to comment.