<jupyter_start><jupyter_text>StylesThis shows the ``StyleTool`` and ``StyleTextTool`` to interactively change the style of GeoJSON and GeoData and similar layers.<jupyter_code>import requests
from ipyleaflet import basemaps, GeoJSON, LayersControl, Map
from ipywidgets import Layout

from leafmaptools.utils import bounds
from leafmaptools.styles import StyleTool, StyleTextTool
cc = "BRA"
url = f"https://raw.githubusercontent.com/johan/world.geo.json/master/countries/{cc}.geo.json"
data = requests.get(url).json()
gj = GeoJSON(data=data, name=cc)
bm = basemaps.OpenStreetMap.Mapnik
layout = Layout(width="800px", height="400px")
m = Map(center=[0, 0], zoom=3, basemap=bm, layout=layout)
m += LayersControl()
m += gj
m.fit_bounds(bounds(data))
st_stroke = StyleTool(a_map=m, layer=gj, transparent=True, position="bottomright")
st_fill = StyleTool(a_map=m, layer=gj, kind="fill", transparent=True, position="bottomright")
m
bm = basemaps.OpenStreetMap.Mapnik
layout = Layout(width="800px", height="400px")
m = Map(center=[0, 0], zoom=3, basemap=bm, layout=layout)
m += LayersControl()
style={
    "color": "blue", "fillColor": "red", "weight": 2,
    "opacity": 1, "fillOpacity": 0.5, "dashArray": "10,20,5"
}
gj = GeoJSON(data=data, name=cc, style=style)
m += gj
m.fit_bounds(bounds(data))
st_stroke = StyleTextTool(a_map=m, layer=gj, kind="stroke", position="topright")
m<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15598290598290598, 'fraction_numerical': 0.019230769230769232, 'mean_word_length': 7.363095238095238, 'pattern_counts': {'":': 6, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '510020', 'license': 'MIT', 'n_tokens_mistral': 527, 'n_tokens_neox': 501, 'n_words': 115, 'path': 'examples/notebooks/styles.ipynb', 'repo_name': 'giswqs/leafmaptools', 'size': '1404'}