MCPcopy Index your code
hub / github.com/python-visualization/folium / style_data

Method style_data

folium/features.py:1066–1081  ·  view source on GitHub ↗

Applies self.style_function to each feature of self.data.

(self)

Source from the content-addressed store, hash-verified

1064 self.add_child(Tooltip(tooltip))
1065
1066 def style_data(self) -> None:
1067 """Applies self.style_function to each feature of self.data."""
1068
1069 def recursive_get(data, keys):
1070 if len(keys):
1071 return recursive_get(data.get(keys[0]), keys[1:])
1072 else:
1073 return data
1074
1075 geometries = recursive_get(self.data, self.object_path.split("."))[
1076 "geometries"
1077 ] # noqa
1078 for feature in geometries:
1079 feature.setdefault("properties", {}).setdefault("style", {}).update(
1080 self.style_function(feature)
1081 ) # noqa
1082
1083 def render(self, **kwargs):
1084 """Renders the HTML representation of the element."""

Callers 1

renderMethod · 0.95

Calls 1

style_functionMethod · 0.80

Tested by

no test coverage detected