Supplier
The purpose of the supplier class is to provide values associated with particular graph elements based on various criteria. This superclass is for interfacing with the NetworkX graph objects or other suppliers to create a supplier. The main objective is to derive values from either NetworkX graph elements or suppliers and assign them to individual graph elements. The subclasses of supplier are tailored to specific use cases and calculations. This supplier is passed to the Mapping strategy to properly map each graph element value to the corresponding visual attribute.
Element attribute
The Element Attribute supplier is for attributes that are directly tied to the
Graph Element and not calculated based on graph structure. The _get_values()
method uses a keyword, under which the attributes can be retrieved, to retrieve
an attribute from graph elements.
Structural Attribute
The Structural Attribute supplier is for attributes that are derived from the
graph structure. These are attributes like degree or centrality which need
to be calculated via their respective NetworkX functions. It is possible to
directly pass an alternative Networkx function to calculate the values in
_get_values() via the constructor, to allow for more flexibility and direct
interfacing with NetworkX.
Percentile
The Percentile supplier uses a percentile range to assign False to the Graph Element, if the passed supplier value is within the range. If it is outside the range, the value is set to True. This supplier requires a supplier object to be set in the constructor. The values for the percentile calculation are derived from this supplier.
Raw Dictionary
The RawDictionary supplier allows any dictionary to be a supplier. This is the most flexible supplier and should be used only in cases where developers can assure the dictionary supplies the correct graph elements and values.
EgoNetwork
The EgoNetwork supplier determines an ego network from within a larger NetworkX
graph. The _get_values() method identifies the ego as well as all incoming,
outgoing and mutual neighbors. The fallback is assigned to all values not found
in the ego network.