matplotlib-map-utils 3.1.2__py3-none-any.whl → 4.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,12 +10,24 @@ __all__ = ["NorthArrow", "north_arrow",
10
10
  "InsetMap","inset_map", "ExtentIndicator","indicate_extent", "DetailIndicator","indicate_detail", "inset_usa",
11
11
  "set_size"]
12
12
 
13
+ from . import config
14
+
13
15
  def set_size(size: Literal["xs","xsmall","x-small",
14
16
  "sm","small",
15
17
  "md","medium",
16
18
  "lg","large",
17
19
  "xl","xlarge","x-large"]):
18
-
19
- NorthArrow.set_size(size)
20
- ScaleBar.set_size(size)
21
- InsetMap.set_size(size)
20
+
21
+ # standardize the size string
22
+ size_map = {
23
+ "xs": "xs", "xsmall": "xs", "x-small": "xs",
24
+ "sm": "sm", "small": "sm",
25
+ "md": "md", "medium": "md",
26
+ "lg": "lg", "large": "lg",
27
+ "xl": "xl", "xlarge": "xl", "x-large": "xl"
28
+ }
29
+
30
+ if size.lower() not in size_map:
31
+ raise ValueError("Invalid value supplied, try one of ['xsmall', 'small', 'medium', 'large', 'xlarge']")
32
+
33
+ config.DEFAULT_SIZE = size_map[size.lower()]
@@ -0,0 +1,4 @@
1
+ # Global configuration variables for matplotlib-map-utils
2
+
3
+ # Default size used across all artists if no size is specified during initialization
4
+ DEFAULT_SIZE = "md"