AMD Module
require(["pentaho/visual/role/util"], function(util) { /* code goes here */ });
The util
namespace contains functions for common tasks around dealing with visual roles.
Source: javascript/web/pentaho/visual/role/util.js, line 25
Methods
Name | Description |
getBestRoleForAddingField(vizModel, fieldName, keyArgs) : Array.<pentaho.visual.role.IAddUsage > | Gets the "best" visual role usage for adding a field to a visualization model. |
getValidRolesForAddingField(vizModel, fieldName, keyArgs) : Array.<pentaho.visual.role.IAddUsage > | Gets a list of visual role usages for valid additions of a field to a visualization model |
testAddField(vizModel, roleName, fieldName, keyArgs) : pentaho.visual.role.IAddUsage | Tests if it would be valid to add a field to a visual role at a specific position. |
testAddFieldAtAutoPosition(vizModel, roleName, fieldName, keyArgs) : pentaho.visual.role.IAddUsage | Tests if it would be valid to add a field to a visual role, at one of the possible positions. |
Methods Details
getBestRoleForAddingField(vizModel, fieldName, keyArgs) : Array.<pentaho.visual.role.IAddUsage > |
Gets the "best" visual role usage for adding a field to a visualization model. This method selects one of the visual role usages returned by pentaho.visual.role.util.getValidRolesForAddingField by using the following total ordering: The visual role has its minimum fields requirement satisfied. The field's data type is such that it matches directly the isContinuous property of the visual role usage . The visual role has a lower number of mapped fields. The visual order of the visual role, according to its ordinal property. The definition order of the visual role, according to its index property. Source: javascript/web/pentaho/visual/role/util.js, line 295 Parameters: Name | Default Value | Summary | vizModel : pentaho.visual.base.AbstractModel | | The visualization model. | fieldName : string | | The name of the field. | keyArgs : object | | The keyword arguments object. Parameters: Name | Default Value | Summary | alternateData : pentaho.data.Table | | An alternate data table which certainly contains all of the currently mapped fields plus the new field. | replaceTarget : boolean | auto | false | For each of the determined visual role usages, indicates if an existing field at the automatically determined positions should be replaced by the new field. When "auto" is specified, the target is replaced only if the visual role has no more available space for another field. | | See also: pentaho.visual.role.util.testAddFieldAtAutoPosition |
testAddField(vizModel, roleName, fieldName, keyArgs) : pentaho.visual.role.IAddUsage |
Tests if it would be valid to add a field to a visual role at a specific position. This method allows moving, appending/inserting or replacing a field in a visual role. When valid, returns the corresponding visual role usage. Source: javascript/web/pentaho/visual/role/util.js, line 71 Parameters: Name | Default Value | Summary | vizModel : pentaho.visual.base.AbstractModel | | The visualization model. | roleName : string | | The name of the visual role. | fieldName : string | | The name of the field. | keyArgs : object | | The keyword arguments object. Parameters: Name | Default Value | Summary | alternateData : pentaho.data.Table | | An alternate data table which certainly contains all of the currently mapped fields plus the new field. | fieldPosition : number | | The new index of the field in the visual role's field list. The default value is the number of fields, causing the field to become the last one. When specified to an existing position the field is either inserted at that position or replaces the field at that position, depending on the value of keyArgs.replaceTarget . | replaceTarget : boolean | auto | false | When keyArgs.fieldPosition is specified and a field mapping exists at that position, indicates if it should be replaced by the new field. When "auto" is specified, the target is replaced only if the visual role has no more available space for another field. This argument is ignored if keyArgs.fieldPosition is not specified. | | See also: pentaho.visual.role.util.testAddFieldAtAutoPosition |
testAddFieldAtAutoPosition(vizModel, roleName, fieldName, keyArgs) : pentaho.visual.role.IAddUsage |
Tests if it would be valid to add a field to a visual role, at one of the possible positions. This method is similar to pentaho.visual.role.util.testAddField , however, it automatically determines the first position from end, if any, at which it would be possible to add the field to the visual role. When valid, returns the corresponding visual role usage. Source: javascript/web/pentaho/visual/role/util.js, line 196 Parameters: Name | Default Value | Summary | vizModel : pentaho.visual.base.AbstractModel | | The visualization model. | roleName : string | | The name of the visual role. | fieldName : string | | The name of the field. | keyArgs : object | | The keyword arguments object. Parameters: Name | Default Value | Summary | alternateData : pentaho.data.Table | | An alternate data table which certainly contains all of the currently mapped fields plus the new field. | replaceTarget : boolean | auto | false | Indicates if an existing field at an automatically determined position should be replaced by the new field. When "auto" is specified, the target is replaced only if the visual role has no more available space for another field. | | See also: pentaho.visual.role.util.testAddField |