Skip to main content

Pentaho+ documentation has moved!

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

 

Hitachi Vantara Lumada and Pentaho Documentation

Base

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
base :  function
Protected

If a method has been overridden, then the base method provides access to the overridden method.

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.

extend(source, keyArgs) : object

Extend an object with the properties of another.

invert(keyArgs) : Object.<string, pentaho.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

base:  function
Protected

If a method has been overridden, then the base method provides access to the overridden method.

Can also be called from within a constructor function.

Source: javascript/web/pentaho/lang/Base.js, line 299

Inherited From: pentaho.lang.Base#base

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.

extend(source, keyArgs) : object

Extend an object with the properties of another.

Methods that are overridden are accessible through this.base.

This object is extended, but its class doesn't change.

Source: javascript/web/pentaho/lang/Base.js, line 1040

Inherited From: pentaho.lang.Base#extend

Parameters:
Name Default Value Summary
source : object

The instance specification.

keyArgs : object
Optional

The keyword arguments.

Parameters:
Name Default Value Summary
exclude : object
Optional

A map of property names to exclude from source.

Returns:
Name Description
object

This object.

invert(keyArgs) : Object.<string, pentaho.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.<string, pentaho.data.ICell>

A data cells map, possibly empty.

See also: pentaho.visual.scene.util.invertVars