Returns a figure aggregating scattered points into connected hexagons
(
data_frame=None,
lat=None,
lon=None,
color=None,
nx_hexagon=5,
agg_func=None,
animation_frame=None,
color_discrete_sequence=None,
color_discrete_map={},
labels={},
color_continuous_scale=None,
range_color=None,
color_continuous_midpoint=None,
opacity=None,
zoom=None,
center=None,
map_style=None,
title=None,
template=None,
width=None,
height=None,
min_count=None,
show_original_data=False,
original_data_marker=None,
)
| 324 | |
| 325 | |
| 326 | def create_hexbin_map( |
| 327 | data_frame=None, |
| 328 | lat=None, |
| 329 | lon=None, |
| 330 | color=None, |
| 331 | nx_hexagon=5, |
| 332 | agg_func=None, |
| 333 | animation_frame=None, |
| 334 | color_discrete_sequence=None, |
| 335 | color_discrete_map={}, |
| 336 | labels={}, |
| 337 | color_continuous_scale=None, |
| 338 | range_color=None, |
| 339 | color_continuous_midpoint=None, |
| 340 | opacity=None, |
| 341 | zoom=None, |
| 342 | center=None, |
| 343 | map_style=None, |
| 344 | title=None, |
| 345 | template=None, |
| 346 | width=None, |
| 347 | height=None, |
| 348 | min_count=None, |
| 349 | show_original_data=False, |
| 350 | original_data_marker=None, |
| 351 | ): |
| 352 | """ |
| 353 | Returns a figure aggregating scattered points into connected hexagons |
| 354 | """ |
| 355 | args = build_dataframe(args=locals(), constructor=None) |
| 356 | native_namespace = nw.get_native_namespace(args["data_frame"]) |
| 357 | if agg_func is None: |
| 358 | agg_func = np.mean |
| 359 | |
| 360 | lat_range = ( |
| 361 | args["data_frame"] |
| 362 | .select( |
| 363 | nw.min(args["lat"]).name.suffix("_min"), |
| 364 | nw.max(args["lat"]).name.suffix("_max"), |
| 365 | ) |
| 366 | .to_numpy() |
| 367 | .squeeze() |
| 368 | ) |
| 369 | |
| 370 | lon_range = ( |
| 371 | args["data_frame"] |
| 372 | .select( |
| 373 | nw.min(args["lon"]).name.suffix("_min"), |
| 374 | nw.max(args["lon"]).name.suffix("_max"), |
| 375 | ) |
| 376 | .to_numpy() |
| 377 | .squeeze() |
| 378 | ) |
| 379 | |
| 380 | hexagons_lats, hexagons_lons, hexagons_ids, count = _compute_wgs84_hexbin( |
| 381 | lat=args["data_frame"].get_column(args["lat"]).to_numpy(), |
| 382 | lon=args["data_frame"].get_column(args["lon"]).to_numpy(), |
| 383 | lat_range=lat_range, |
no test coverage detected