Skip to main content

Pentaho+ documentation is moving!

The new product documentation portal is here. Check it out now at docs.hitachivantara.com

 

Hitachi Vantara Lumada and Pentaho Documentation

util

pentaho.visual.scene. util

AMD Module

require(["pentaho/visual/scene/util"], function(util) { /* code goes here */ });

The util namespace contains functions for common tasks around dealing with visual scenes.

Source: javascript/web/pentaho/visual/scene/util.js, line 23

Methods

Name Description
createFilterFromVars(varsMap, model) : pentaho.data.filter.Abstract

Creates a data filter that represents the values of the specified visual role variables.

invertVars(varsMap, model, keyArgs) : Object.<stringpentaho.data.ICell>

Creates a data cells map corresponding to the values of the specified visual role variables.

Methods Details

createFilterFromVars(varsMap, model) : pentaho.data.filter.Abstract

Creates a data filter that represents the values of the specified visual role variables.

The types pentaho.data.filter.IsEqual and pentaho.data.filter.And must have been loaded already.

If the given variables map entails no distinguishing fields (in the sense of being effective keys, as defined in isColumnKeyEffective) of the associated data table, then the returned filter will be null.

Source: javascript/web/pentaho/visual/scene/util.js, line 55

Parameters:
Name Default Value Summary
varsMap : Object.

A map of visual role names to corresponding variables. All variables, even those from inherited keys are considered.

Map keys which are not the name of a mapper visual role property of model are ignored. Map values can be any value that supports the JavaScript's valueOf method.

model : pentaho.visual.Model

The associated visual model. Must be valid.

Returns:
Name Description
pentaho.data.filter.Abstract | null

The filter, if one can be created; null, otherwise

See also: pentaho.data.util.createFilterFromCellsMap

invertVars(varsMap, model, keyArgs) : Object.<stringpentaho.data.ICell>

Creates a data cells map corresponding to the values of the specified visual role variables.

By default, only data cells for fields which are effective keys are considered, as defined in isColumnKeyEffective. Specify keyArgs.includeMeasureFields as true to include all fields.

Source: javascript/web/pentaho/visual/scene/util.js, line 85

Parameters:
Name Default Value Summary
varsMap : Object.<stringpentaho.data.ICell, >

A map of visual role names to corresponding variables. All variables, even those from inherited keys are considered.

Map keys which are not the name of a mapper visual role property of model are ignored.

model : pentaho.visual.Model

The associated visual model. Must be valid.

keyArgs : object
Optional

The keyword arguments object.

Parameters:
Name Default Value Summary
includeMeasureFields : boolean
Optional
false

Indicates that measure fields should also be included. In practice, indicates that all fields should be included.

Returns:
Name Description
Object.<stringpentaho.data.ICell>

A data cells map, possibly empty.

See also: pentaho.data.util.isColumnKeyEffective