Folium CircleMarker Visualization System¶
viz_circle_marker
¶
ResolvedCircleMarkerFeature
dataclass
¶
Bases: ResolvedFeature
Specialized style container for circle marker visualizations.
Source code in src/mesqual/visualizations/folium_viz_system/viz_circle_marker.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | |
CircleMarkerFeatureResolver
¶
Bases: FeatureResolver[ResolvedCircleMarkerFeature]
Resolves the visual properties of circle markers at point locations.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fill_color
|
PropertyMapper | str
|
Fill color. |
'#D9D9D9'
|
border_color
|
PropertyMapper | str
|
Border color. |
'white'
|
radius
|
PropertyMapper | float
|
Radius in pixels. |
8.0
|
border_width
|
PropertyMapper | float
|
Border width in pixels. |
1.0
|
fill_opacity
|
PropertyMapper | float
|
Fill opacity from 0 to 1. |
1.0
|
tooltip
|
PropertyMapper | str | bool
|
Tooltip content, see |
True
|
popup
|
PropertyMapper | Popup | bool
|
Popup content, see |
False
|
location
|
PropertyMapper | Point
|
Point of the marker. Default: the first |
None
|
**property_mappers
|
PropertyMapper | Any
|
Additional custom property mappings. |
{}
|
Each argument takes a static value or a PropertyMapper.
Source code in src/mesqual/visualizations/folium_viz_system/viz_circle_marker.py
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | |
CircleMarkerGenerator
¶
Bases: FoliumObjectGenerator[CircleMarkerFeatureResolver]
Generates folium CircleMarker objects for point geometries.
Examples:
One marker per node, with the radius from the voltage:
>>> import folium
>>> generator = CircleMarkerGenerator(
... CircleMarkerFeatureResolver(radius=PropertyMapper.from_item_attr('voltage', lambda v: v / 40))
... )
>>> folium_map = folium.Map(location=[48, 9], zoom_start=6)
>>> fg = generator.generate_objects_for_model_df(dataset.fetch('Node.Model'), folium.FeatureGroup('Nodes'))
>>> fg = fg.add_to(folium_map)
>>> folium_map.get_root().render().count('L.circleMarker(')
4
Source code in src/mesqual/visualizations/folium_viz_system/viz_circle_marker.py
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 | |