Package org.cytoscape.view.vizmap
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:
AbstractVisualMappingFunction
public interface VisualMappingFunction<K,V>
This class defines how an attribute gets mapped to a visual property.
It takes two values: as the key and as
the value.
The direction of mapping is ALWAYS:
It takes two values:
- Attribute value: node name(Strings), expression values(Numbers), ...
- Visual Property: node size(Numbers), edge color(Color), node shape(NodeShape), ...
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:
<dependency> <groupId>org.cytoscape</groupId> <artifactId>vizmap-api</artifactId> </dependency>
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 Summary
Modifier and TypeMethodDescriptionvoid
apply(CyRow row, View<? extends CyIdentifiable> view)
Apply mapping to the view model.getMappedValue(CyRow row)
Returns the mapped value for a CyRow.Returns attribute name used in this mapping.Returns data type of mapping attribute.Visual Property associated with this function.
-
Method Details
-
getMappingColumnName
String getMappingColumnName()Returns attribute name used in this mapping. This field is immutable.- Returns:
- name of attribute (a column name in data table) associated with this mapping.
-
getMappingColumnType
Returns data type of mapping attribute.- Returns:
- data type of controlling attribute.
-
getVisualProperty
VisualProperty<V> getVisualProperty()Visual Property associated with this function. This field is immutable.- Returns:
- VisualProperty used in this mapping.
-
apply
Apply mapping to the view model. Once this method is called, Cytoscape updates the view model and fires proper events.- Parameters:
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
Returns the mapped value for a CyRow.- Parameters:
row
- The data row used to create the visual property value for the specified view.- Returns:
- The mapped visual property value
-