({{, (RefLink[MouseAnnotation, paclet:ref/MouseAnnotation])[]
gives any mouse annotation associated with the expression at the current mouse position. }})

OpenersNotesSection(Spacer1)Details

(RefLink[MouseAnnotation, paclet:ref/MouseAnnotation])[] returns (RefLink[Null, paclet:ref/Null]) if there is no mouse annotation associated with the expression at the current mouse position.

(RefLink[MouseAnnotation, paclet:ref/MouseAnnotation])[def] returns def if there is no current annotation.

(RefLink[MouseAnnotation, paclet:ref/MouseAnnotation])[] yields the mouse annotation associated with the expression that would be selected if the mouse were clicked.

The annotation is the expression note in (RefLink[Annotation, paclet:ref/Annotation])[expr,note,"Mouse"].

(RefLink[Dynamic, paclet:ref/Dynamic])[MouseAnnotation[]] gives the continually updated current mouse annotation.

OpenersPrimaryExamplesSection(Spacer1)Examples  (6)

OpenersExampleSection0(Spacer1)Basic Examples  (2)

If the mouse is over the graphics, (RefLink[MouseAnnotation, paclet:ref/MouseAnnotation]) will return the associated annotation:

Annotation[Graphics[Disk[]],"An annotation","Mouse"]

When the mouse is over the graphics, the annotation is displayed:

Dynamic[MouseAnnotation[]]

Use in plots:

Plot[{Annotation[Sin[x],"Sine","Mouse"],Annotation[Cos[x],"Cosine","Mouse"]},{x,0,2π},PlotStyle->Thick]

Dynamic[MouseAnnotation[]]

OpenersExampleSection1(Spacer1)Applications  (1)

Use (RefLink[MouseAnnotation, paclet:ref/MouseAnnotation]) to update the state associated with each graphic:

DynamicModule[{x={0,0,0}},EventHandler[{Annotation[Graphics[{Red,Disk[]},PlotLabel->Dynamic[x[[1]]]],1,"Mouse"],Annotation[Graphics[{Green,Disk[]},PlotLabel->Dynamic[x[[2]]]],2,"Mouse"],Annotation[Graphics[{Blue,Disk[]},PlotLabel->Dynamic[x[[3]]]],3,"Mouse"]},{"MouseClicked":>(x[[MouseAnnotation[]]]=x[[MouseAnnotation[]]]+1)}]]

OpenersExampleSection2(Spacer1)Properties & Relations  (3)

(RefLink[MouseAnnotation, paclet:ref/MouseAnnotation]) reveals annotations stored in other expressions:

Annotation["xxx","Label","Mouse"]

Dynamic[MouseAnnotation[]]

(RefLink[Tooltip, paclet:ref/Tooltip]) presents the annotated information in a popup box:

Tooltip[x+y,label]

(RefLink[Mouseover, paclet:ref/Mouseover]) presents the annotated information by changing the displayed form:

Mouseover[x+y,label]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[Tooltip, paclet:ref/Tooltip])  ▪  (RefLink[MousePosition, paclet:ref/MousePosition])  ▪  (RefLink[CurrentValue, paclet:ref/CurrentValue])  ▪  (RefLink[Mouseover, paclet:ref/Mouseover])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Formatted Output, paclet:tutorial/FormattedOutput])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Viewers and Annotation, paclet:guide/ViewersAndAnnotation])}, {▪(RefLinkPlain[Annotating & Combining Graphics, paclet:guide/AnnotatingAndCombiningGraphics])}})}})