AnnotationValue

AnnotationValue[obj,key]

gives the annotation value associated with key for the object obj.

AnnotationValue[{obj,itemspec},key]

gives the annotation value associated with key for items specified by itemspec in obj.

Details

  • Typically used to extract and manipulate values in annotations associated to an object or an item in an object.
  • AnnotationValue gives the value value in key->value annotations for an object and its items.
  • Possible objects with items that can be annotated:
  • Audiotime points and time intervals
    BoundaryMeshRegionmesh cells
    Graphvertices and edges
    MeshRegionmesh cells
  • Item specification itemspec for each type of object is given in its reference page.
  • Missing is returned when a name requested in AnnotationValue is not found.
  • AnnotationValue[{obj,itemspec},key] returns unevaluated for the tag key without value.
  • AnnotationValue[,key]=val can be used to modify the annotation value.

Examples

open allclose all

Basic Examples  (3)

Generate a complete graph with annotations:

Retrieve the annotation value associated with an annotation name:

Change the annotation value:

Unset the annotation value:

Get intrinsic MeshCellMeasure annotations for cells in a mesh:

Automatically compute annotations for an Audio object:

Retrieve annotations for louder intervals:

Scope  (15)

Graphs & Networks  (13)

Graph annotations  (7)

Retrieve several properties from a vertex:

And from an edge:

Unset annotations for vertices:

And edges:

AnnotationValue works with undirected graphs:

Directed graphs:

Multigraphs graphs:

Mixed graphs:

Weighted graphs:

Vertex annotations  (3)

Standard vertex annotations include VertexStyle:

VertexLabels:

VertexSize:

VertexShape:

VertexShapeFunction:

Non-visual annotations include VertexWeight:

Set a custom annotation:

Set an annotation value for vertex 1:

Retrieve the annotation value for vertex 1:

Edge annotations  (3)

Standard edge annotations include EdgeStyle:

EdgeLabels:

EdgeShapeFunction:

Non-visual annotations include EdgeWeight:

Set a custom annotation:

Set an annotation value for the edge 12:

Retrieve the annotation value for the edge 12:

Audio  (2)

Annotate an Audio object:

Retrieve the annotation using AnnotationValue:

Annotate an Audio object using AudioAnnotate:

Retrieve multiple annotations using AnnotationValue:

Applications  (5)

Use Do to set several annotation values:

Or different annotation values for different items:

Use Table to build a list of annotation values:

Create a weighted graph:

Set edge weights:

Compute weight scale:

Set the edge thickness to reflect the edge weight:

Highlight a path and mark the start point and endpoint:

Select vertices along a path:

Highlight by setting edge style along the path and vertex labels for start point and endpoint:

Dynamically highlight the edges in the order given by EdgeList:

Do five updates a second:

Dynamically visualize breadth-first search:

Properties & Relations  (5)

Use Annotation as a wrapper to specify annotations in functions such as Graph:

AnnotationValue returns $Failed for undefined annotations:

Use AnnotationKeys to test for the presence of an annotation:

Generate a list of vertex label rules:

Use Annotate to set an annotation without changing the original:

The original graph is unchanged:

Use AnnotationDelete to remove an annotation without changing the original:

The original graph is unchanged:

Possible Issues  (2)

AnnotationValue returns $Failed for undefined annotations:

Use AnnotationKeys to test for the presence of an annotation:

AnnotationValue may return $Failed even when an annotation value exists:

Use AnnotationKeys to check for actual annotation values:

Wolfram Research (2020), AnnotationValue, Wolfram Language function, https://reference.wolfram.com/language/ref/AnnotationValue.html.

Text

Wolfram Research (2020), AnnotationValue, Wolfram Language function, https://reference.wolfram.com/language/ref/AnnotationValue.html.

CMS

Wolfram Language. 2020. "AnnotationValue." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/AnnotationValue.html.

APA

Wolfram Language. (2020). AnnotationValue. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/AnnotationValue.html

BibTeX

@misc{reference.wolfram_2024_annotationvalue, author="Wolfram Research", title="{AnnotationValue}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/AnnotationValue.html}", note=[Accessed: 22-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_annotationvalue, organization={Wolfram Research}, title={AnnotationValue}, year={2020}, url={https://reference.wolfram.com/language/ref/AnnotationValue.html}, note=[Accessed: 22-November-2024 ]}