Highlight nodes when hovering

hello everyone,

I am working on nycflights 2013 in r. I created a map to show the flights between airports. I would like to highlight two circles to show the flight route when hovering over them. How to achieve this?

image

here is my code so far:

geo <- list(
scope = ‘usa’,
projection = list(type = ‘usa’),
showland = TRUE,
landcolor = toRGB(“gray95”),
countrycolor = toRGB(“gray80”)
)

#adding marker for the three origin airports
plot_geo(locationmode = ‘usa-states’) %>%
add_markers(
data=airports, x = ~lon, y = ~lat,hoverinfo=“text”, text=~airport,size = 0.1,
alpha = 0.5,name=“Airport Name”) %>%
#adding flights routes
add_segments(
data = AirportsMap,
x = ~lon_origin_airport, xend = ~lon_Dest_airport,
y = ~lat_origin_airport, yend = ~lat_Dest_airport,
alpha = 0.3,hoverinfo = “text”,text=~paste(AirportsMap$n,“Flight”),
name=‘Number of Flights’) %>%
#adding a title
layout(
title = ‘NYC Flights 2013
(Hover for airport names
and number of flights)’,
geo = geo, showlegend = TRUE,legend = list(x = -0.1, y = -0.1))