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

View

pentaho.visual.impl View

The impl.View class is an optional base class for visualization views which implements the IView interface.

An application instantiates a view given a specification with the visualization model and the container HTML element.

The first update of the view must be explicitly triggered by a call to model.update.

Over time, the model may be mutated and, whenever its Update:{do} event is emitted, the view automatically updates itself.

The view translates user interaction by perform actions on the model. The standard actions are Select and Execute. There are sugar methods on the model to perform these, select and execute.

When a view is no longer needed, the application must call its dispose method, so that the view can free held resources and not cause memory-leaks.

AMD Module

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

Extends

Implements

Constructor

Name Description
new View(viewSpec)
Abstract

Creates a view instance, given its specification.

Members

Name Description
PropertyGroups : number
Static

The PropertyGroups enumeration contains the entries for the distinct groups of properties that the View class recognizes when categorizing property changes.

domContainer : HTMLElement

Gets the container DOM element where the view is rendered.

hasUpdatedAll : boolean

Gets a value that indicates if a full update has been done.

model : pentaho.visual.Model

Gets the visualization model.

Methods

Name Description
_subclassed()
Static
_update(event, action) : Promise | undefined
Protected

Updates the view by choosing an appropriate _update* method according to the given changeset.

_updateAll(event)
Protected

Fully renders or updates the view.

dispose()

Disposes the view by freeing external resources held by the view.

extend()

Constructor Details

new View(viewSpec)
Abstract

Creates a view instance, given its specification.

Source: javascript/web/pentaho/visual/impl/View.js, line 82

Parameters:
Name Default Value Summary
viewSpec : pentaho.visual.spec.IView

The view specification.

Members Details

PropertyGroups: number
Static

The PropertyGroups enumeration contains the entries for the distinct groups of properties that the View class recognizes when categorizing property changes.

Properties:
Name Default Value Description
All : number ~0

Includes all model properties.

Ignored : number 0

The group of properties whose changes are ignored, because the view does not visually represent these in any way.

General : number 1

The group of properties that don't have a more specific property group.

Data : number 2

The group of data-related properties.

The only property of this group is the data property.

Size : number 4

The group of size-related properties.

The properties of this group are the width and height properties.

Selection : number 8

The group of selection-related properties.

The only property of this group is the selectionFilter property.

Source: javascript/web/pentaho/visual/impl/View.js, line 420

See also: pentaho.visual.impl.View#__onChangeClassify

domContainer: HTMLElement

Gets the container DOM element where the view is rendered.

The container element is the viewport through which the view's rendered content is revealed. and is provided empty, for the exclusive use of the view, by the container application.

Its content is owned by the view, but its attributes (including style and class) are owned by the container application and must not be changed by the view.

Its size is controlled by the container application and does not need to be the same as that implied by the visual model's width and height properties, however, normally, it will.

It is the responsibility of the container application to clean up the container element's content, if needed, after the view is disposed of. When disposed of, the view has the responsibility of cleaning up any DOM event handlers it may hold on the container element or any of its children.

Source: javascript/web/pentaho/visual/impl/View.js, line 149

hasUpdatedAll: boolean

Gets a value that indicates if a full update has been done.

A full update which is unsuccessful is not accounted for. All updates are full updates until a full update is successful.

Source: javascript/web/pentaho/visual/impl/View.js, line 171

model: pentaho.visual.Model

Gets the visualization model.

Source: javascript/web/pentaho/visual/impl/View.js, line 158

Methods Details

_subclassed()
Static

Source: javascript/web/pentaho/visual/impl/View.js, line 397

_update(event, action) : Promise | undefined
Protected

Updates the view by choosing an appropriate _update* method according to the given changeset.

The first update of a visualization is always a complete update of the visualization, as implemented by _updateAll.

BaseView subclasses should override and implement the _updateAll method.

Additionally, view subclasses should consider implementing one or more of the optional partial update methods, like _updateData, _updateSize, _updateSelection and _updateGeneral.

Other appropriate combinations of these can also be implemented, for example, _updateSizeAndSelection, by combining the names of the known property groups: Data, Size, Selection and General, with an And to form a corresponding method name. For more information on property groups, see View.PropertyGroups.

Source: javascript/web/pentaho/visual/impl/View.js, line 213

Parameters:
Name Default Value Summary
event : pentaho.action.Execution

The update action execution.

action : pentaho.visual.action.Update

The update action.

Returns:
Name Description
Promise | undefined

A promise for the completion of the view update.

See also: pentaho.visual.impl.View#hasUpdatedAll , pentaho.visual.impl.View#_updateAll , pentaho.visual.impl.View#_updateData , pentaho.visual.impl.View#_updateSize , pentaho.visual.impl.View#_updateSelection , pentaho.visual.impl.View#_updateGeneral

_updateAll(event)
Protected

Fully renders or updates the view.

The first update of a visualization is always a full update.

The default implementation does nothing.

Source: javascript/web/pentaho/visual/impl/View.js, line 495

Parameters:
Name Default Value Summary
event : pentaho.action.Execution

The update action execution.

See also: pentaho.visual.impl.View#_update , pentaho.visual.impl.View#hasUpdatedAll , pentaho.visual.impl.View.PropertyGroups

dispose()

Disposes the view by freeing external resources held by the view.

The default implementation clears the HTML container reference and stops listening to the model's Update:{do} phase event.

Source: javascript/web/pentaho/visual/impl/View.js, line 345

extend()

Source: javascript/web/pentaho/visual/impl/View.js, line 356