Skip to content

Mapping

The mappings provided in this module are used to map values contained in Suppliers (see) to visual attributes for use when drawing graphs. The types of visual attributes are flexible and can include strings for colors or integers. To ensure type security, all type checking is handled in the Mapping module via helper functions. This includes parsing colors in various formats and colormaps. All scaling and formatting is handled by the individual mapping strategies. Each mapping has a corresponding helper function which returns the Mapping object. These helper functions are intended to be used by users for ease of use.

All mappings inherit from the GenericMapping interface and have a supplier and fallback field. The fallback value is the value assigned when a passed value is None.

FixedValue

The FixedValue mapping strategy is for mapping a singular visual value to all graph elements.

NodeDerivedValue

The NodeDerivedValue mapping strategy is used when visual attributes should be derived from a node's position in the graph. From the edges of the graph, we can determine the incoming and outgoing node, as well as if the edge relationship is mutual. Based the categorization of the edge as incoming, outgoing, and matching (matching meaning the edge is bidirectional) the visual attributes can be assigned to the graph elements.

Qualitative

The Qualitative mapping strategy is suited for mapping visual values to non-parametric, non-continuous ordinal graph element attributes.

Sequential

The Sequential mapping strategy is for continuous parametric graph element attributes. The get() function normalizes the data based on the in range before mapping them to the calculated scaled values. The values are scaled based on the given out range.

Filter

For more complex filtering, the Filter mapping strategy allows for the most flexible mapping by taking a boolean expression to evaluate the Supplier values against.