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

Base

pentaho.visual.scene Base

The Scene class represents one distinct visual state which is represented visually by one or more visual elements.

Scenes are not needed to implement visualization views. However, their use simplifies their implementation in many use cases.

Scenes have a map of visual variables, vars whose values are inherited from parent to child scenes.

To create scenes, most view implementations can simply use the [scene.Base.buildScenesFlat] method. This method creates one parent scene having one child scene per row of the model's dataset. In child scenes, for each visual role there will be a correspondingly named variable having the value of the visual role.

For handling user interaction, the scene instances' createFilter method provides an easy way to create a filter that selects the data from which the scene was generated based on its distinguishing field values. This filter can then be passed to a data action such as Select or Execute.

When communicating with external parties, field values must be used and visual variable values are not generally meaningful. The invert method allows directly obtaining the distinguishing field values that are associated with a scene.

Extends

Constructor

Name Description
new Base(parent, model)

Creates a scene instance.

Members

Name Description
children : Array.<pentaho.visual.scene.Base>

Gets the array of child scenes.

index : number

Gets the child index of this scene, if it has a parent, or -1 if not.

model : pentaho.visual.Model

Gets the associated visualization model.

parent : pentaho.visual.scene.Base

Gets the parent scene, if any, or null if none.

root : pentaho.visual.scene.Base

Gets the root scene of the tree that this scene belongs to.

Methods

Name Description
buildScenesFlat(model) : pentaho.visual.scene.Base
Static

Builds a flat, single-level scene tree according to the data and visual roles of a given model.

createFilter() : pentaho.data.filter.Abstract

Creates a filter that selects the data represented by this scene.

invert(keyArgs) : Object.<stringpentaho.data.ICell>

Gets a data cells map which corresponds to the values of visual role variables of this scene.

Constructor Details

new Base(parent, model)

Creates a scene instance.

Source: javascript/web/pentaho/visual/scene/Base.js, line 64

Parameters:
Name Default Value Summary
parent : pentaho.visual.scene.Base

The parent scene, if any.

model : pentaho.visual.Model

The model. Required if parent is not specified.

Members Details

children: Array.<pentaho.visual.scene.Base>

Gets the array of child scenes.

The returned array cannot be modified directly.

Source: javascript/web/pentaho/visual/scene/Base.js, line 110

index: number

Gets the child index of this scene, if it has a parent, or -1 if not.

Source: javascript/web/pentaho/visual/scene/Base.js, line 100

model: pentaho.visual.Model

Gets the associated visualization model.

Source: javascript/web/pentaho/visual/scene/Base.js, line 128

parent: pentaho.visual.scene.Base

Gets the parent scene, if any, or null if none.

Source: javascript/web/pentaho/visual/scene/Base.js, line 92

root: pentaho.visual.scene.Base

Gets the root scene of the tree that this scene belongs to.

Source: javascript/web/pentaho/visual/scene/Base.js, line 118

Methods Details

buildScenesFlat(model) : pentaho.visual.scene.Base
Static

Builds a flat, single-level scene tree according to the data and visual roles of a given model.

This method creates one parent scene having one child scene per row of the model's dataset. In child scenes, for each visual role there will be a correspondingly named variable having the value of the visual role.

Source: javascript/web/pentaho/visual/scene/Base.js, line 199

Parameters:
Name Default Value Summary
model : pentaho.visual.Model

The visualization model. Must be valid.

Returns:
Name Description
pentaho.visual.scene.Base

The parent scene.

createFilter() : pentaho.data.filter.Abstract

Creates a filter that selects the data represented by this scene.

This method provides an easy way to create a filter that selects the data that this scene visually represents based on its distinguishing field values.

This filter can then be passed to a data action such as Select or Execute.

In certain circumstances, the returned value may be null. A filter can only be created for a scene if its variables entail distinguishing fields (in the sense of being effective keys, as defined in scene.util.invertVars) of the associated model's data.

Source: javascript/web/pentaho/visual/scene/Base.js, line 164

Returns:
Name Description
pentaho.data.filter.Abstract

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

invert(keyArgs) : Object.<stringpentaho.data.ICell>

Gets a data cells map which corresponds to the values of visual role variables of this scene.

When communicating with external parties, field values must be used and visual variable values are not generally meaningful. Use this method to obtain the distinguishing field values represented by this scene.

Source: javascript/web/pentaho/visual/scene/Base.js, line 183

Parameters:
Name Default Value Summary
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.visual.scene.util.invertVars