#!/usr/bin/env python # coding: utf-8 # # Behavior when hovering over a LineString-type GeoDataFrame in holoviews/geoviews # # This examples uses `hvplot` on a GeoDataFrame. But the same behavior is observed after converting from the GeoPandas GeoDataFrame to a geoviews `Path` or a `Spatialpandas` GeoDataFrame. # In[1]: import geopandas as gpd import hvplot.pandas # In[2]: geojson_features = [ {"type": "Feature", "properties": {"id": 19}, "geometry": {"type": "LineString", "coordinates": [[140.51, 4.40], [140.59, 4.33], [140.62, 4.29]]}}, {"type": "Feature", "properties": {"id": 20}, "geometry": {"type": "LineString", "coordinates": [[140.61, 4.39], [140.65, 4.37], [140.69, 4.33]]}} ] # In[3]: line_gdf = gpd.GeoDataFrame.from_features(geojson_features) line_gdf # The desired behavior is for the whole line feature (all segments) to be highlighted on hover. Instead, only an individual line segment are highlighted. # In[4]: line_gdf.hvplot( geo=True, color='black', hover_line_color='red', tools=['hover'], hover_cols=['id'], ) # In[ ]: