Skip to main content
Hitachi Vantara Lumada and Pentaho Documentation

MeasurementLevel

pentaho.visual.role.MeasurementLevel

The MeasurementLevel class is a refinement of the String simple type that represents a Level or Measurement, as understood by S. S. Steven.

Currently, the following levels of measurement are supported:

  • nominal - A qualitative measurement level. The lowest in the hierarchy of levels of measurement. A nominal visual role represents data visually preserving the distinction between different things and also, possibly, enabling easy association of different, but somehow similar, things. However, a nominal visual role represents data in a way that conveys no preferential order between the various things.

    An example nominal visual role would be one that used the color hue of distinct visual marks for representing things.

    Any data type can be represented by a nominal visual role.

  • ordinal - A qualitative measurement level. An ordinal visual role adds to the characteristics of nominal visual roles the ability to convey order to the represented things.

    An example ordinal visual role would be using 5 shades of a same color hue to represent the 5 distinct values of a qualitative data property.

    Any data type can be represented by an ordinal visual role, even if order needs to be attributed by some external mechanism (natural/source order, alphabetic, order by other property, explicit given order of values).

  • quantitative - Aggregates the interval and ratio levels of measurement, the highest in the hierarchy of levels of measurement. A quantitative visual role adds to the characteristics of ordinal visual roles the ability to visually represent the proportion between quantities (ratios), or, at least, the proportion between differences of quantities (intervals).

    Only the pentaho.type.Number and pentaho.type.Date data types can be (directly) represented by a quantitative visual role.

AMD Module

require(["{pentaho.type.Factory} pentaho/visual/role/level"], function(MeasurementLevel) { /* code goes here */ });

Extends

Constructor

Name Description
new MeasurementLevel()

Members

Name Description
configure

Configures this simple value with a given configuration.

formatted : string

Gets or sets the formatted value of the property.

isValid : boolean

Determines if this value is a valid instance of its type.

key : string

Gets the key of the simple value.

type : pentaho.type.Value.Type

Gets the type of this instance.

value : string

Gets the underlying string primitive value of the value.

Methods

Name Description
_configure(config)
 
Protected

Configures this value with a given non-nully configuration.

_toJSONValue(keyArgs) : UJsonValue
 
Protected

Converts the value of the simple instance to a JSON-compatible representation.

assertValid()

Ensures that the value is valid, and throws the first validation error if it is not.

clone() : pentaho.type.Simple

Creates a clone of the simple value.

equals(other) : boolean

Determines if a given value, of the same type, represents the same entity.

equalsContent(other) : boolean

Determines if a given value, of the same type, represents the same entity with the same content.

toJSON() : UJsonValue

Creates a top-level JSON specification that describes this instance.

toSpec(keyArgs) : pentaho.type.spec.UInstance

Creates a specification that describes this value.

toSpecInContext(keyArgs) : any

Creates a specification that describes this instance.

toString() : String

Returns a string that represents the current simple value.

validate() : Array.<!pentaho.type.ValidationError>

Determines if this value is a valid instance of its type.

valueOf() : *

Gets the underlying primitive value of the simple value.

Constructor Details

new MeasurementLevel()

Source: javascript/web/pentaho/visual/role/level.js, line 35

Members Details

configure:

Configures this simple value with a given configuration.

Source: javascript/web/pentaho/type/simple.js, line 222

Inherited From: pentaho.type.Simple#configure

formatted: string

Gets or sets the formatted value of the property.

Source: javascript/web/pentaho/type/simple.js, line 142

Inherited From: pentaho.type.Simple#formatted

isValid: boolean

Determines if this value is a valid instance of its type.

This attribute calls validate and returns a boolean value indicating if it returned no errors.

Source: javascript/web/pentaho/type/value.js, line 137

Inherited From: pentaho.type.Value#isValid

key: string

Gets the key of the simple value.

The key of a value identifies it among values of the same concrete type.

If two values have the same concrete type and their keys are equal, then it must also be the case that pentaho.type.Value.Type#areEqual returns true when given the two values. The opposite should be true as well. If two values of the same concrete type have distinct keys, then pentaho.type.Value.Type#areEqual should return false.

The default simple value implementation, returns the result of calling toString() on pentaho.type.Simple#value.

Source: javascript/web/pentaho/type/simple.js, line 199

Inherited From: pentaho.type.Simple#key

type: pentaho.type.Value.Type

Gets the type of this instance.

Source: javascript/web/pentaho/type/value.js, line 262

Inherited From: pentaho.type.Value#type

value: string

Gets the underlying string primitive value of the value.

Source: javascript/web/pentaho/type/string.js, line 39

Inherited From: pentaho.type.String#value

Methods Details

_configure(config)
 
Protected

Configures this value with a given non-nully configuration.

The default implementation does nothing.

Source: javascript/web/pentaho/type/simple.js, line 243

Inherited From: pentaho.type.Simple#_configure

Parameters:
Name Default Value Summary
config : any

The configuration.

_toJSONValue(keyArgs) : UJsonValue
 
Protected

Converts the value of the simple instance to a JSON-compatible representation.

The default implementation returns value itself. Override to implement a custom JSON format for this simple value type.

Source: javascript/web/pentaho/type/simple.js, line 352

Inherited From: pentaho.type.Simple#_toJSONValue

Parameters:
Name Default Value Summary
keyArgs : Object

The keyword arguments object. Please see the documentation of subclasses for information on additional, supported keyword arguments.

Returns:
Name Description
UJsonValue

A JSON-compatible representation of value.

assertValid()

Ensures that the value is valid, and throws the first validation error if it is not.

This method calls the validate method.

Source: javascript/web/pentaho/type/value.js, line 168

Inherited From: pentaho.type.Value#assertValid

Throws:
Name Description
pentaho.type.ValidationError

When the value is not valid, the first error returned by the validate method.

clone() : pentaho.type.Simple

Creates a clone of the simple value.

Source: javascript/web/pentaho/type/simple.js, line 90

Inherited From: pentaho.type.Simple#clone

Returns:
Name Description
pentaho.type.Simple

The simple value clone.

equals(other) : boolean

Determines if a given value, of the same type, represents the same entity.

The given value must be of the same concrete type (or the result is undefined).

To test equality for any two arbitrary values, in a robust way, use pentaho.type.Value.Type#areEqual.

If two values are equal, they must have an equal pentaho.type.Value#key. Otherwise, if they are different, they must have a different key.

The default implementation returns true if the two values have the same key; or, false, otherwise.

Source: javascript/web/pentaho/type/value.js, line 122

Inherited From: pentaho.type.Value#equals

Parameters:
Name Default Value Summary
other : pentaho.type.Value

A value to test for equality.

Returns:
Name Description
boolean

true if the given value is equal to this one; or, false, otherwise.

equalsContent(other) : boolean

Determines if a given value, of the same type, represents the same entity with the same content.

The given value must be of the same concrete type (or the result is undefined).

If two values are equal, they must have an equal key, value, formatted value.

Source: javascript/web/pentaho/type/simple.js, line 214

Inherited From: pentaho.type.Simple#equalsContent

Parameters:
Name Default Value Summary
other : pentaho.type.Simple

A simple value to test for equality.

Returns:
Name Description
boolean

true if the given simple value is equal to this one; false, otherwise.

toJSON() : UJsonValue

Creates a top-level JSON specification that describes this instance.

Attributes which do not have a JSON-compatible specification are omitted. Specifically, for inline types, attributes with a function value are not supported.

This method simply calls pentaho.type.Instance#toSpec with argument keyArgs.isJson as true and exists for seamless integration with JavaScript's JSON.stringify method.

Source: javascript/web/pentaho/type/instance.js, line 206

Inherited From: pentaho.type.Instance#toJSON

Returns:
Name Description
UJsonValue

A JSON-compatible specification.

See also:  pentaho.type.Instance#toSpec

Implements:
toSpec(keyArgs) : pentaho.type.spec.UInstance

Creates a specification that describes this value.

If an ambient specification context, currently exists, it is used to manage the serialization process. Otherwise, one is created and set as current. Then, the actual work is delegated to pentaho.type.Instance#toSpecInContext.

Source: javascript/web/pentaho/type/value.js, line 200

Inherited From: pentaho.type.Value#toSpec

Parameters:
Name Default Value Summary
keyArgs : Object
 
Optional

The keyword arguments object. Passed to every value and type serialized within this scope.

Please see the documentation of value subclasses for information on additional, supported keyword arguments.

Parameters:
Name Default Value Summary
isJson : boolean
 
Optional
false

Generates a JSON-compatible specification. Attributes which do not have a JSON-compatible specification are omitted.

declaredType : pentaho.type.Type
 
Optional

The base type of this value's storage location. If the value does not have this exact type, its inline type property must be included in the specification. Otherwise, it can be omitted. When unspecified, the inline type property is only included if forceType is true.

forceType : boolean
 
Optional
false

Forces inclusion of the inline type property, _, in the specification.

omitFormatted : boolean
 
Optional
false

Omits the formatted value on Simple values' specifications.

preferPropertyArray : boolean
 
Optional
false

Indicates that, if possible, array form is used for Complex values' specifications.

The array form of a complex value cannot be used when its type must be inlined.

includeDefaults : boolean
 
Optional
false

When true, all of the properties of Complex values are serialized. When false, the default, only properties whose value is different from their default value are serialized.

Only applies to complex values that are serialized in object form. In array form, all of the properties of complex values are serialized independently of their value.

omitProps : Object
 
Optional

An object whose own property names with a truthy value are the names of the properties of the current complex type to omit from the serialization.

Only applies when a complex is output in object form. In array form, all properties are output whatever their value.

This argument only applies to complex values and is not passed through to the values of their properties.

Returns:
Name Description
pentaho.type.spec.UInstance

A specification of this value.

toSpecInContext(keyArgs) : any

Creates a specification that describes this instance.

Source: javascript/web/pentaho/type/instance.js, line 186

Inherited From: pentaho.type.Instance#toSpecInContext

Parameters:
Name Default Value Summary
keyArgs : Object
 
Optional

The keyword arguments' object. Passed to every instance and type serialized within this scope.

Please see the documentation of subclasses for information on additional, supported keyword arguments.

Returns:
Name Description
any

A specification of this instance.

See also:  pentaho.type.Instance#toSpec

toString() : String

Returns a string that represents the current simple value.

Source: javascript/web/pentaho/type/simple.js, line 175

Inherited From: pentaho.type.Simple#toString

Returns:
Name Description
String

The string representation.

validate() : Array.<!pentaho.type.ValidationError>

Determines if this value is a valid instance of its type.

The default implementation does nothing and considers the instance valid. Override to implement a type's specific validation logic.

You can use the error utilities in pentaho.type.Util to help in the implementation.

Source: javascript/web/pentaho/type/value.js, line 154

Inherited From: pentaho.type.Value#validate

Returns:
Name Description
Array.<!pentaho.type.ValidationError>

A non-empty array of errors or null.

See also:  pentaho.type.Value#isValid

valueOf() : *

Gets the underlying primitive value of the simple value.

Source: javascript/web/pentaho/type/simple.js, line 166

Inherited From: pentaho.type.Simple#valueOf

Returns:
Name Description
*

The underlying value.