<jupyter_start><jupyter_text>Preleminary demo of the pattern plugin for Folium<jupyter_code>import folium
from folium import plugins


m = folium.Map([40.0, -105.0], zoom_start=6)

url = "https://raw.githubusercontent.com/python-visualization/folium/main/examples/data/us-states.json"
stripes = plugins.pattern.StripePattern(angle=-45)
stripes.add_to(m)

circles = plugins.pattern.CirclePattern(
    width=20, height=20, radius=5, fill_opacity=0.5, opacity=1
)
circles.add_to(m)


def style_function(feature):
    default_style = {
        "opacity": 1.0,
        "fillColor": "#ffff00",
        "color": "black",
        "weight": 2,
    }

    if feature["properties"]["name"] == "Colorado":
        default_style["fillPattern"] = stripes
        default_style["fillOpacity"] = 1.0

    if feature["properties"]["name"] == "Utah":
        default_style["fillPattern"] = circles
        default_style["fillOpacity"] = 1.0

    return default_style


# Adding remote GeoJSON as additional layer.
folium.GeoJson(url, smooth_factor=0.5, style_function=style_function).add_to(m)

m<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1407942238267148, 'fraction_numerical': 0.026173285198555957, 'mean_word_length': 4.182242990654205, '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': '30997', 'license': 'MIT', 'n_tokens_mistral': 398, 'n_tokens_neox': 379, 'n_words': 67, 'path': 'examples/plugin-patterns.ipynb', 'repo_name': 'uni-3/folium', 'size': '1108'}