Annotations allow you to associate arbitrary data with entities in a graph. The special thing about annotations is that they allow you to weakly associate data. When the annotation is garbage-collected, all data associated with the annotation is garbage collected, even though the graph may still contain the entities that have been annotated.
However, data in the annotation is not garbage collected when entities are
removed from the Graph. You MUST remove the annotated data manually when
entities are removed from the Graph. This is typically done by adding a
listener to the Graph's 'removenode' and 'removeedge' events.
Tests if this annotation has data associated with this entity.
true if this annotation has data associated with this entity
Call a function once for every entity that has data associated with it.
the function
an optional object to be used as the "this" pointer when calling the function
Get the data associated with an entity
the entity to get the associated data for
the data, or undefined if no data was associated
Remove the data associated with an entity
the entity to remove the associated data for
the data, or undefined if no data was associated
Associate data with an entity.
this annotation