Function Repository Resource:

MouseoverHighlightGraph

Source Notebook

Display a graph so that connected edges are highlighted when you mouse over a vertex

Contributed by: Jon McLoone

ResourceFunction["MouseoverHighlightGraph"][gr]

displays Graph gr so that connected edges are highlighted when you mouse over a vertex.

Details and Options

Clicking anywhere in the displayed Graph cancels the current vertex selection.
ResourceFunction["MouseoverHighlightGraph"] accepts the following options:
BaseStyleGraythe style applied to the graph before mouseover
"HighlightStyle"{Black,Thickness[0.01]}the style applied to highlighted edges

Examples

Basic Examples (2) 

Display a graph with interactive mouseover effect:

In[1]:=
ResourceFunction["MouseoverHighlightGraph"][RandomGraph[{10, 20}]]
Out[1]=

When the mouse is moved over a vertex, all connected edges are highlighted:

Options (1) 

The style of the graph before and after highlighting is controlled with BaseStyle and "HighlightStyle":

In[2]:=
ResourceFunction["MouseoverHighlightGraph"][RandomGraph[{10, 20}],
 BaseStyle -> Darker[Yellow],
 "HighlightStyle" -> Darker[Blue]]
Out[2]=

Publisher

Jon McLoone

Version History

  • 1.0.0 – 13 November 2019

License Information