Property

As of Version 12.1, Property has been superseded by Annotation.

Property[item,namevalue]

associates the property namevalue with item.

Details

  • Properties are used to store and manipulate name->value pairs for specific named items within an object such as Graph, MeshRegion and BoundaryMeshRegion.
  • Property acts as an inert wrapper around items.
  • Objects that support properties include Graph, MeshRegion and BoundaryMeshRegion. Item specifications for each type of object is given in their reference pages.

Examples

open allclose all

Basic Examples  (2)

Specify a vertex property:

Specify an edge property:

Scope  (9)

Basic Uses  (3)

Set properties for vertices:

And edges:

Property can be used to set several properties of vertices:

And edges:

Some properties have equivalent wrappers, including Labeled:

And Style:

Vertex Properties  (3)

Standard vertex properties include VertexStyle:

VertexLabels:

VertexSize:

VertexShape:

VertexShapeFunction:

Non-visual properties include VertexWeight:

Specify a custom property:

Edge Properties  (3)

Standard edge properties include EdgeStyle:

EdgeLabels:

Non-visual properties include EdgeWeight:

Specify a custom property:

Applications  (1)

Use Table to set similar properties for many items:

Properties & Relations  (6)

Use PropertyValue to extract values:

For undefined properties, the value $Failed is returned:

Use PropertyValue to set properties in a graph:

The original graph has changed:

Use PropertyValue to unset properties in a graph:

The original graph has changed:

Use PropertyList to test for the presence of a property:

Generate a list of vertex label rules:

Use SetProperty to set a property without changing the original:

The original graph is unchanged:

Use RemoveProperty to remove a property without changing the original:

The original graph is unchanged:

Introduced in 2010
 (8.0)
 |
Updated in 2014
 (10.0)
2015
 (10.2)