Constructor
new ColorAttributeGroupHandler(matchRules)
Creates a color attribute group handler that will generate color attribute values.
Parameters:
Name | Type | Description |
---|---|---|
matchRules |
Object | A map of key value pairs for categories and the matching attribute value e.g. {"soda" : "#336699", "water" : "#CC3300", "iced tea" : "#F7C808"}. Attribute values listed in the matchRules object will be reserved only for the matching categories when getAttributeValue is called. |
- Source:
Methods
-
addMatchRule(category, attributeValue)
-
Reserves an attribute value for the given category
Parameters:
Name Type Description category
String Used for checking inputs to getAttributeValue against when assigning an attribute value attributeValue
String The attribute value to assign for inputs matching the given category e.g. "square" or "circle" - Inherited From:
- Source:
- ojdvt-base/AttributeGroupHandler.js, line 77
-
geCategoryAssignments() → {Array}
-
Returns the current map of key value pairs for categories and the assigned attribute values
- Inherited From:
- Source:
- ojdvt-base/AttributeGroupHandler.js, line 64
Returns:
The current list of category and value pairing- Type
- Array
-
getValue(category) → {Object}
-
Assigns the given category an attribute value. Will consistently return the same attribute value for equal categories.
Parameters:
Name Type Description category
Object The category to assign - Inherited From:
- Source:
- ojdvt-base/AttributeGroupHandler.js, line 44
Returns:
The attribute value for the category- Type
- Object
-
getValueRamp()
-
- Source:
- ojdvt-base/ColorAttributeGroups.js, line 36