Plotly wrapper
Plotly wrapper.
This module contains functions for quick plotting of analysed gdfs using Plotly library.
plot_regions(
regions_gdf,
return_plot=False,
mapbox_style="open-street-map",
mapbox_accesstoken=None,
renderer=None,
zoom=None,
height=None,
width=None,
)
¶
plot_regions(
regions_gdf,
return_plot=False,
mapbox_style="open-street-map",
mapbox_accesstoken=None,
renderer=None,
zoom=None,
height=None,
width=None,
)
Plot regions shapes using Plotly library.
For more info about parameters, check https://plotly.com/python/mapbox-layers/.
PARAMETER | DESCRIPTION |
---|---|
regions_gdf |
Region indexes and geometries to plot.
TYPE:
|
return_plot |
Flag whether to return the Figure object or not.
If
TYPE:
|
mapbox_style |
Map style background. Defaults to "open-street-map".
TYPE:
|
mapbox_accesstoken |
Access token required for mapbox based map backgrounds. Defaults to None.
TYPE:
|
renderer |
Name of renderer used for displaying the figure. For all descriptions, look here: https://plotly.com/python/renderers/. Defaults to None.
TYPE:
|
zoom |
Map zoom. If not filled, will be approximated based on the bounding box of regions. Defaults to None.
TYPE:
|
height |
Height of the plot. Defaults to None.
TYPE:
|
width |
Width of the plot. Defaults to None.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Optional[Figure]
|
Optional[go.Figure]: Figure of the plot. Will be returned if |
Source code in srai/plotting/plotly_wrapper.py
plot_neighbours(
regions_gdf,
region_id,
neighbours_ids,
return_plot=False,
mapbox_style="open-street-map",
mapbox_accesstoken=None,
renderer=None,
zoom=None,
height=None,
width=None,
)
¶
plot_neighbours(
regions_gdf,
region_id,
neighbours_ids,
return_plot=False,
mapbox_style="open-street-map",
mapbox_accesstoken=None,
renderer=None,
zoom=None,
height=None,
width=None,
)
Plot neighbours on a map using Plotly library.
For more info about parameters, check https://plotly.com/python/mapbox-layers/.
PARAMETER | DESCRIPTION |
---|---|
regions_gdf |
Region indexes and geometries to plot.
TYPE:
|
region_id |
Center
TYPE:
|
neighbours_ids |
List of neighbours to highlight.
TYPE:
|
return_plot |
Flag whether to return the Figure object or not.
If
TYPE:
|
mapbox_style |
Map style background. Defaults to "open-street-map".
TYPE:
|
mapbox_accesstoken |
Access token required for mapbox based map backgrounds. Defaults to None.
TYPE:
|
renderer |
Name of renderer used for displaying the figure. For all descriptions, look here: https://plotly.com/python/renderers/. Defaults to None.
TYPE:
|
zoom |
Map zoom. If not filled, will be approximated based on the bounding box of regions. Defaults to None.
TYPE:
|
height |
Height of the plot. Defaults to None.
TYPE:
|
width |
Width of the plot. Defaults to None.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Optional[Figure]
|
Optional[go.Figure]: Figure of the plot. Will be returned if |
Source code in srai/plotting/plotly_wrapper.py
plot_all_neighbourhood(
regions_gdf,
region_id,
neighbourhood,
neighbourhood_max_distance=100,
return_plot=False,
mapbox_style="open-street-map",
mapbox_accesstoken=None,
renderer=None,
zoom=None,
height=None,
width=None,
)
¶
plot_all_neighbourhood(
regions_gdf,
region_id,
neighbourhood,
neighbourhood_max_distance=100,
return_plot=False,
mapbox_style="open-street-map",
mapbox_accesstoken=None,
renderer=None,
zoom=None,
height=None,
width=None,
)
Plot full neighbourhood on a map using Plotly library.
For more info about parameters, check https://plotly.com/python/mapbox-layers/.
PARAMETER | DESCRIPTION |
---|---|
regions_gdf |
Region indexes and geometries to plot.
TYPE:
|
region_id |
Center
TYPE:
|
neighbourhood |
TYPE:
|
neighbourhood_max_distance |
Max distance for rendering neighbourhoods. Neighbours farther away won't be coloured, and will be left as "other" regions. Defaults to 100.
TYPE:
|
return_plot |
Flag whether to return the Figure object or not.
If
TYPE:
|
mapbox_style |
Map style background. Defaults to "open-street-map".
TYPE:
|
mapbox_accesstoken |
Access token required for mapbox based map backgrounds. Defaults to None.
TYPE:
|
renderer |
Name of renderer used for displaying the figure. For all descriptions, look here: https://plotly.com/python/renderers/. Defaults to None.
TYPE:
|
zoom |
Map zoom. If not filled, will be approximated based on the bounding box of regions. Defaults to None.
TYPE:
|
height |
Height of the plot. Defaults to None.
TYPE:
|
width |
Width of the plot. Defaults to None.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Optional[Figure]
|
Optional[go.Figure]: Figure of the plot. Will be returned if |
Source code in srai/plotting/plotly_wrapper.py
144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 |
|