Visualization Reference
Map visualizations
plot_track_line_on_map(data, *, zoom=13, height=None, width=None, line_width=2.5, map_style='open-street-map', **kwargs)
Plot the track line on a map.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data
|
DataFrame
|
DataFrame containing latitude and longitude data. |
required |
zoom
|
int
|
Zoom level for the map, defaults to 13 |
13
|
height
|
None | int
|
Height of the plot, defaults to None |
None
|
width
|
None | int
|
Width of the plot, defaults to None |
None
|
line_width
|
float
|
Width of the line on the map, defaults to 2.5 |
2.5
|
map_style
|
str
|
Valid map_style for plotly mapbox_style, defaults to open-street-map |
'open-street-map'
|
kwargs
|
Additional keyword arguments. |
{}
|
Returns:
Type | Description |
---|---|
Figure
|
Plotly Figure object. |
Source code in geo_track_analyzer/visualize/map.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 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 |
|
plot_track_enriched_on_map(data, *, enrich_with_column='elevation', color_by_zone=False, zoom=13, height=None, width=None, overwrite_color_gradient=None, overwrite_unit_text=None, cbar_ticks=5, map_style='open-street-map', **kwargs)
Plot the track line enriched with additional information (as z-axis) on a map.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data
|
DataFrame
|
DataFrame containing track data. |
required |
enrich_with_column
|
Literal['elevation', 'speed', 'heartrate', 'cadence', 'power']
|
Column to enrich the track with, defaults to "elevation" |
'elevation'
|
color_by_zone
|
bool
|
If True, track will be covered by Zones. Only available for enrich_with_column heartrate, cadence and power. |
False
|
zoom
|
int
|
Zoom level for the map, defaults to 13 |
13
|
height
|
None | int
|
Height of the plot, defaults to None |
None
|
width
|
None | int
|
Width of the plot, defaults to None |
None
|
overwrite_color_gradient
|
None | tuple[str, str]
|
Custom color gradient for the plot. Check track_analyzer.visualize.constants for defaults, defaults to None |
None
|
overwrite_unit_text
|
None | str
|
Custom unit text for the enrichment. Check track_analyzer.visualize.constants for defaults, defaults to None |
None
|
cbar_ticks
|
int
|
Number of color bar ticks, defaults to 5 |
5
|
map_style
|
str
|
Valid map_style for plotly mapbox_style, defaults to open-street-map |
'open-street-map'
|
kwargs
|
Additional keyword arguments. |
{}
|
Returns:
Type | Description |
---|---|
Figure
|
Plotly Figure object. |
Raises:
Type | Description |
---|---|
VisualizationSetupError
|
If no data is in passed enrich_with_column column |
VisualizationSetupError
|
If color_by_zone is passed and enricht_with_column is unsupported or Zones are not set for the supported values |
Source code in geo_track_analyzer/visualize/map.py
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 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 130 131 132 133 134 135 136 137 138 139 140 141 142 143 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 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 |
|
plot_track_2d(data, *, include_velocity=False, include_heartrate=False, include_cadence=False, include_power=False, show_segment_borders=False, strict_data_selection=False, height=600, width=1800, pois=None, color_elevation=None, color_additional_trace=None, color_poi=None, color_segment_border=None, slider=False, split_by_zone=False, min_zone_size=0.0025, **kwargs)
Elevation profile of the track. May be enhanced with additional information like Velocity, Heartrate, Cadence, and Power.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data
|
DataFrame
|
DataFrame containing track data |
required |
include_velocity
|
bool
|
Plot velocity as second y-axis, defaults to False |
False
|
include_heartrate
|
bool
|
Plot heart rate as second y-axis, defaults to False |
False
|
include_cadence
|
bool
|
Plot cadence as second y-axis, defaults to False |
False
|
include_power
|
bool
|
Plot power as second y-axis, defaults to False |
False
|
show_segment_borders
|
bool
|
If True show vertical lines between segments in track, defaults to False. If no segments are present in data, no error is raised. |
False
|
strict_data_selection
|
bool
|
If True only included that passing the minimum speed requirements of the Track, defaults to False |
False
|
height
|
None | int
|
Height of the plot, defaults to 600 |
600
|
width
|
None | int
|
Width of the plot, defaults to 1800 |
1800
|
pois
|
None | list[tuple[float, float]]
|
Optional lat/long coordingates to add to the plot as points of interest, defaults to None |
None
|
color_elevation
|
None | str
|
Color of the elevation as str interpretable by plotly, defaults to None |
None
|
color_additional_trace
|
None | str
|
Color of velocity/heartrate/cadence/power as str interpretable by plotly, defaults to None |
None
|
color_poi
|
None | str
|
Color of the pois as str interpretable by plotly, defaults to None |
None
|
color_segment_border
|
None | str
|
Color of the segment border lines as str interpretable by plotly, defaults to None |
None
|
slider
|
bool
|
Should a slide be included in the plot to zoom into the x-axis, defaults to False |
False
|
split_by_zone
|
bool
|
If True, and one for included_* flags is passed and Zones are set for the corresponding extension are set, the Zones will be colored according to the zone colors. |
False
|
min_zone_size
|
float
|
Minimum fraction of points required for a distinct zone, if split_by_Zone is passed. |
0.0025
|
Returns:
Type | Description |
---|---|
Figure
|
Plotly Figure object. |
Raises:
Type | Description |
---|---|
VisualizationSetupError
|
If more than one of include_velocity, include_heartrate, include_cadence, or include_power was set the True |
VisualizationSetupError
|
If elevation data is missing in the data |
VisualizationSetupError
|
If the data requried for the additional data is missing |
VisualizationSetupError
|
If split_by_zone is passed but Zones are not set |
Source code in geo_track_analyzer/visualize/profiles.py
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 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 |
|
Track profile
plot_track_with_slope(data, *, slope_gradient_color=('#0000FF', '#00FF00', '#FF0000'), min_slope=-18, max_slope=18, show_segment_borders=False, height=600, width=1800, slider=False, color_segment_border=None, **kwargs)
Elevation profile with slopes between points.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data
|
DataFrame
|
DataFrame containing track data |
required |
slope_gradient_color
|
tuple[str, str, str]
|
Colors for the min, neutral, max slope values, defaults to ("#0000FF", "#00FF00", "#FF0000") |
('#0000FF', '#00FF00', '#FF0000')
|
min_slope
|
int
|
Minimum slope for the gradient also acts as floor for the displayed slope, defaults to -18 |
-18
|
max_slope
|
int
|
Maximum slope for the gradient also acts as ceiling for the displayed slope, defaults to 18 |
18
|
show_segment_borders
|
bool
|
If True show vertical lines between segments in track, defaults to False. If no segments are present in data, no error is raised. |
False
|
height
|
None | int
|
Height of the plot, defaults to 600 |
600
|
width
|
None | int
|
Width of the plot, defaults to 1800 |
1800
|
slider
|
bool
|
Should a slide be included in the plot to zoom into the x-axis, defaults to False |
False
|
color_segment_border
|
None | str
|
Color of the segment border lines as str interpretable by plotly, defaults to None |
None
|
Returns:
Type | Description |
---|---|
Figure
|
Plotly Figure object |
Raises:
Type | Description |
---|---|
VisualizationSetupError
|
If elevation data is missing in the data |
Source code in geo_track_analyzer/visualize/profiles.py
390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 |
|
plot_segments_on_map(data, *, zoom=13, height=None, width=None, line_width=2.5, average_only=True, map_style='open-street-map', **kwargs)
Plot track line on map. Segments are displayed individually.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data
|
DataFrame
|
DataFrame containing track segment data. |
required |
zoom
|
int
|
Zoom level for the map, defaults to 13 |
13
|
height
|
None | int
|
Height of the plot, defaults to None |
None
|
width
|
None | int
|
Width of the plot, defaults to None |
None
|
line_width
|
float
|
Width of the line on the map, defaults to 2.5 |
2.5
|
average_only
|
bool
|
Flag to display averages only, defaults to True |
True
|
map_style
|
str
|
Valid map_style for plotly mapbox_style, defaults to open-street-map |
'open-street-map'
|
kwargs
|
Additional keyword arguments. |
{}
|
Returns:
Type | Description |
---|---|
Figure
|
Plotly Figure object. |
Raises:
Type | Description |
---|---|
VisualizationSetupError
|
If no segment information is contained in the data |
VisualizationSetupError
|
If there are not two or more segments in the data |
Source code in geo_track_analyzer/visualize/map.py
261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 |
|
Other track visualizations
plot_track_3d(data, strict_data_selection=False)
Source code in geo_track_analyzer/visualize/interactive.py
10 11 12 13 14 15 16 17 |
|
Summary visualizations
plot_track_zones(data, metric, aggregate, *, use_zone_colors=False, height=600, width=1200, strict_data_selection=False, as_pie_chart=False)
Aggregate a value per zone defined for heartrate, power, or cadence.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data
|
DataFrame
|
DataFrame containing track and zone data |
required |
metric
|
Literal['heartrate', 'power', 'cadence']
|
One of "heartrate", "cadence", or "power" |
required |
aggregate
|
Literal['time', 'distance', 'speed']
|
Value to aggregate. Supported values are (total) "time", "distance", and (average) speed in a certain zone |
required |
use_zone_colors
|
bool
|
If True, use distinct colors per zone (either set by the zone object or a default defined by the package). Otherwise alternating colors will be used, defaults to False. |
False
|
height
|
None | int
|
Height of the plot, defaults to 600 |
600
|
width
|
None | int
|
Width of the plot, defaults to 1200 |
1200
|
strict_data_selection
|
bool
|
If True only included that passing the minimum speed requirements of the Track, defaults to False |
False
|
Returns:
Type | Description |
---|---|
Figure
|
Plotly Figure object |
Raises:
Type | Description |
---|---|
VisualizationSetupError
|
Is raised if metric is not avaialable in the data |
Source code in geo_track_analyzer/visualize/summary.py
89 90 91 92 93 94 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 130 131 132 133 134 135 136 137 138 139 140 141 142 143 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 |
|
plot_segment_zones(data, metric, aggregate, *, bar_colors=None, height=600, width=1200, strict_data_selection=False)
Aggregate a value per zone defined for heartrate, power, or cadence, split into segments available in data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data
|
DataFrame
|
DataFrame containing track and zone data |
required |
metric
|
Literal['heartrate', 'power', 'cadence']
|
One of heartrate, cadence, or power |
required |
aggregate
|
Literal['time', 'distance', 'speed']
|
Value to aggregate. Supported values are (total) "time", "distance", and (average) speed in a certain zone |
required |
bar_colors
|
None | tuple[str, str] | list[str]
|
Overwrite the default colors for the bar. If a tuple of two colors is passed, a colorscale will be generated based on these values and colors for segments will be picked from this scale. Furthermore, a list of colors can be passed that must at least be as long as the number of segments in the data |
None
|
height
|
None | int
|
Height of the plot, defaults to 600 |
600
|
width
|
None | int
|
Width of the plot, defaults to 1200 |
1200
|
strict_data_selection
|
bool
|
If True only included that passing the minimum speed requirements of the Track, defaults to False |
False
|
Returns:
Type | Description |
---|---|
Figure
|
Plotly Figure object |
Raises:
Type | Description |
---|---|
VisualizationSetupError
|
Is raised if metric is not avaialable in the data |
VisualizationSetupError
|
Is raised if no segment information is available in the data |
Source code in geo_track_analyzer/visualize/summary.py
220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 |
|
plot_segment_summary(data, aggregate, *, colors=None, height=600, width=1200, strict_data_selection=False)
summary
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data
|
DataFrame
|
DataFrame containing track and zone data |
required |
aggregate
|
Literal['total_time', 'total_distance', 'avg_speed', 'max_speed']
|
Value to aggregate. Supported values are "total_time", "total_distance", "avg_speed", and "max_speed" |
required |
colors
|
None | tuple[str, str]
|
Overwrite the default alternating colors, defaults to None |
None
|
height
|
None | int
|
Height of the plot, defaults to 600 |
600
|
width
|
None | int
|
Width of the plot, defaults to 1200 |
1200
|
strict_data_selection
|
bool
|
If True only included that passing the minimum speed requirements of the Track, defaults to False |
False
|
Returns:
Type | Description |
---|---|
Figure
|
Plotly Figure object |
Raises:
Type | Description |
---|---|
VisualizationSetupError
|
Is raised if no segment information is available in the data |
Source code in geo_track_analyzer/visualize/summary.py
319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 |
|
plot_segment_box_summary(data, metric, *, colors=None, height=600, width=1200, strict_data_selection=False)
Show the metric as boxplot for each segment in the data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data
|
DataFrame
|
DataFrame containing track and zone data |
required |
metric
|
Literal['heartrate', 'power', 'cadence', 'speed', 'elevation']
|
One of "heartrate", "cadence", "power", or "speed" |
required |
colors
|
None | tuple[str, str]
|
Overwrite the default alternating colors, defaults to None |
None
|
height
|
None | int
|
Height of the plot, defaults to 600 |
600
|
width
|
None | int
|
Width of the plot, defaults to 1200 |
1200
|
strict_data_selection
|
bool
|
If True only included that passing the minimum speed requirements of the Track, defaults to False |
False
|
Returns:
Type | Description |
---|---|
Figure
|
Plotly Figure object |
Raises:
Type | Description |
---|---|
VisualizationSetupError
|
Is raised if metric is not avaialable in the data |
VisualizationSetupError
|
Is raised if no segment information is available in the data |
Source code in geo_track_analyzer/visualize/summary.py
408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 |
|