Interface VisualMappingFunction<K,V>

Type Parameters:
K - Attribute object type. This is the key of mapping (Can be any objects)
V - Visual property value type. (can be any type)
All Known Subinterfaces:
ContinuousMapping<K,V>, DiscreteMapping<K,V>, PassthroughMapping<K,V>
All Known Implementing Classes:

public interface VisualMappingFunction<K,V>
This class defines how an attribute gets mapped to a visual property.
It takes two values:
  • Attribute value: node name(Strings), expression values(Numbers), ...
  • Visual Property: node size(Numbers), edge color(Color), node shape(NodeShape), ...
This provides the mapping function from converting the attribute to the visual property. Essentially, this is a map using as the key and as the value. The direction of mapping is ALWAYS:

K(Attribute) ---> V(Visual Property)

K will be used in implementations.

Module: vizmap-api

To use this in your app, include the following dependency in your POM:


Cytoscape Backwards Compatibility (API Interface): We expect that this interface will be used but not implemented by developers using this interface. As such, we reserve the right to add methods to the interface as part of minor version upgrades. We will not remove methods for any changes other than major version upgrades.
  • Method Details

    • getMappingColumnName

      String getMappingColumnName()
      Returns attribute name used in this mapping. This field is immutable.
      name of attribute (a column name in data table) associated with this mapping.
    • getMappingColumnType

      Class<K> getMappingColumnType()
      Returns data type of mapping attribute.
      data type of controlling attribute.
    • getVisualProperty

      VisualProperty<V> getVisualProperty()
      Visual Property associated with this function. This field is immutable.
      VisualProperty used in this mapping.
    • apply

      void apply(CyRow row, View<? extends CyIdentifiable> view)
      Apply mapping to the view model. Once this method is called, Cytoscape updates the view model and fires proper events.
      row - The data row used to create the visual property value for the specified view.
      view - target View model to be updated. View should be one of the following: Node, Edge, or Network.
    • getMappedValue

      V getMappedValue(CyRow row)
      Returns the mapped value for a CyRow.
      row - The data row used to create the visual property value for the specified view.
      The mapped visual property value