Final Class: AttributeGroupHandler

Oracle® JavaScript Extension Toolkit (JET)
16.0.0

F83701-01

Since:
  • 1.0
Module:
  • ojattributegrouphandler

QuickNav

Description

Attribute group handlers generate stylistic attribute values such as colors or shapes based on data categories. AttributeGroupHandler is an abstract superclass that applications should not use directly. Instead, see ColorAttributeGroupHandler and ShapeAttributeGroupHandler.


Usage

Typescript Import Format
//To import this class, use the format below.
import {AttributeGroupHandler} from "ojs/ojattributegrouphandler";

For additional information visit:


Final classes in JET

Classes in JET are generally final and do not support subclassing. At the moment, final is not enforced. However, this will likely change in an upcoming JET release.


Constructor

new AttributeGroupHandler(matchRules)

Creates an attribute group handler that will generate stylistic attribute values such as colors or shapes based on data set categories.
Parameters:
Name Type Argument Description
matchRules {[propName: string]: any} <optional>
A map of key value pairs for categories and the matching attribute value e.g. {"soda" : "square", "water" : "circle", "iced tea" : "triangleUp"}. Attribute values listed in the matchRules object will be reserved only for the matching categories when getAttributeValue is called.

Methods

addMatchRule(category, attributeValue) : {void}

Reserves an attribute value for the given category. All match rules should be added before any category assignments are done with the getValue API. In most cases, use of this method should not be needed as match rules can be configured directly in the constructor.
Parameters:
Name Type Description
category string Used for checking inputs to getAttributeValue against when assigning an attribute value
attributeValue any The attribute value to assign for inputs matching the given category e.g. "square" or "circle"
Returns:
Type
void

getCategoryAssignments : {Array<{[propName: string]: any}>}

Returns the current list of assigned categories as an array of objects with "category" and "value" keys. Note that match rules are not reflected in category assignments.
Returns:

The current list of category and value pairings

Type
Array<{[propName: string]: any}>

getValue(category) : {any}

Assigns the given category an attribute value. Will consistently return the same attribute value for equal categories.
Parameters:
Name Type Description
category string The category to assign
Returns:

The attribute value for the category

Type
any

getValueRamp : {Array.<any>}

Returns the array of possible attribute values for this attribute group handler.
Returns:

The array of attribute values

Type
Array.<any>