Skip to content

Commit

Permalink
default style selected
Browse files Browse the repository at this point in the history
  • Loading branch information
chrieke committed Nov 30, 2024
1 parent 03cbae7 commit c3a8431
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions prettymapp/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from typing import Tuple, List
from dataclasses import dataclass

from dataclasses import field
from geopandas.plotting import _plot_polygon_collection, _plot_linestring_collection
from geopandas import GeoDataFrame
import numpy as np
Expand All @@ -12,7 +13,7 @@
from matplotlib.patches import Ellipse
import matplotlib.patheffects as PathEffects

from prettymapp.settings import STREETS_WIDTH
from prettymapp.settings import STREETS_WIDTH, STYLES


def adjust_lightness(color: str, amount: float = 0.5) -> Tuple[float, float, float]:
Expand All @@ -34,21 +35,27 @@ def adjust_lightness(color: str, amount: float = 0.5) -> Tuple[float, float, flo

@dataclass
class Plot:
"""
Main plotting class for prettymapp.
"""
df: GeoDataFrame
aoi_bounds: List[
float
] # Not df bounds as could lead to weird plot shapes with unequal geometry distribution.
draw_settings: dict
draw_settings: dict = field(default_factory=lambda: STYLES["Peach"])
# Map layout settings
shape: str = "circle"
contour_width: int = 0
contour_color: str = "#2F3537"
# Optional map text settings e.g. to display location name
name_on: bool = False
name: str = "some name"
font_size: int = 25
font_color: str = "#2F3737"
text_x: int = 0
text_y: int = 0
text_rotation: int = 0
# Map background settings
bg_shape: str = "rectangle"
bg_buffer: int = 2
bg_color: str = "#F2F4CB"
Expand Down

0 comments on commit c3a8431

Please sign in to comment.