Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.

Latest commit

 

History

History
238 lines (169 loc) · 11.2 KB

api.md

File metadata and controls

238 lines (169 loc) · 11.2 KB

Modifiers

Modifiers.modifiers : Object

An object literal containing all available modifiers

Kind: static property of Modifiers

Modifiers.measureBase

Utility functions for accessing input/base properties of a measure

Kind: static constant of Modifiers

measureBase.getExpression(measure) ⇒ string

Get the qDef property - from the base if it exists, otherwise returns qDef.qDef of the measure

Kind: static method of measureBase
Returns: string - The original/input expression

Param Type Description
measure Object Properties for a measure in a hypercube def (from qHyperCubeDef.qMeasures array)

measureBase.getExpressionRef(measure) ⇒ string

Get path to expression (e.g. "qDef.qDef")

Kind: static method of measureBase
Returns: string - Reference to the the original/input expression property (qDef)

Param Type Description
measure Object Properties for a measure in a hypercube def (from qHyperCubeDef.qMeasures array)

measureBase.getLibraryIdRef(measure) ⇒ string

Get path to the qLibraryId property - from the base if it exists, otherwise from the measure as normal

Kind: static method of measureBase
Returns: string - Reference to the original/input libraryId property (qLibraryId)

Param Type Description
measure Object Properties for a measure in a hypercube def (from qHyperCubeDef.qMeasures array)

measureBase.getLibraryId(measure) ⇒ string

Get the qLibraryId property - from the base if it exists, otherwise returns qLibraryId of the measure

Kind: static method of measureBase
Returns: string - The original/input libraryId

Param Type Description
measure Object Properties for a measure in a hypercube def (from qHyperCubeDef.qMeasures array)

measureBase.getLabelRef(measure) ⇒ string

Get the qLabel property - from the base if it exists, otherwise returns qLabel of the measure

Kind: static method of measureBase
Returns: string - Reference to the original/input label property (qLabel)

Param Type Description
measure Object Properties for a measure in a hypercube def (from qHyperCubeDef.qMeasures array)

measureBase.getLabelExpressionRef(measure) ⇒ string

Get the qLabelExpression property - from the base if it exists, otherwise returns qLabelExpression of the measure

Kind: static method of measureBase
Returns: string - Reference to the original/input labelExpression property (qLabelExpression)

Param Type Description
measure Object Properties for a measure in a hypercube def (from qHyperCubeDef.qMeasures array)

Modifiers.initBase(measure, hardSet)

Initialize the base for a measure - Creates a base object literal with the original qDef.qDef and qLibrary properties.

Kind: static method of Modifiers

Param Type Description
measure Object Properties for a measure in a hypercube def (from qHyperCubeDef.qMeasures array)
hardSet Boolean force initialize base

Modifiers.apply(options) ⇒ Promise

Applies defined modifiers to measures in hypercubeDef (!subscribes to master items layout changes, call destroy function to unsubscribe)

Kind: static method of Modifiers
Returns: Promise - Promise resolving with a boolean - modified: true/false (true if a setProperties or applyPatches has run)

Param Type Default Description
options Object An object with all input parameters
options.model Object Enigma model of the object fetched from engine (mandatory)
[options.properties] Object object properties.
[options.isSnapshot] boolean false is it a snapshot or not?
[options.masterItem] Object layout of master item

Modifiers.applyModifiers(options) ⇒ Promise

Applies defined modifiers to measures in hypercubeDef (!subscribes to master items layout changes, call destroy function to unsubscribe)

Kind: static method of Modifiers
Returns: Promise - Promise resolving with a boolean - modified: true/false (true if a setProperties or applyPatches has run)

Param Type Default Description
options Object An object with all input parameters
options.model Object Enigma model of the object fetched from engine (mandatory)
[options.properties] Object Object properties
[options.measures] Array.<Object> An array of measure properties
[options.runUpdateIfChange] boolean false Wether of not properties should be persisted (soft patched when readonly access)
[options.masterItem] Object layout of master item

Modifiers.cleanUpMeasure(measure)

Restores the measure properties to how it was before modifiers were applied

Kind: static method of Modifiers

Param Type Description
measure Object The measure properties object from the enigma model

Modifiers.destroy(model)

Removes layout subscribers (listeners for master items). Make sure to run this when not using the object any longer to avoid memory leaks.

Kind: static method of Modifiers

Param Type Description
model Object Enigma model of the object fetched from engine (mandatory)

Modifiers.hasActiveModifiers(options) ⇒ Boolean

Checks if there is some active modifier in any of the provided measures

Kind: static method of Modifiers
Returns: Boolean - true if the there are any active modifiers

Param Type Description
options Object An object with all input parameters
options.measures Array.<Object> Array with measure properties or layout
[options.properties] Object object properties (needs either this or the layout)
[options.layout] Object object layout (needs either this or the properties)

Modifiers.limitedSorting(options)

Is sorting capabilities limited due to applied modifier? Can operate either on layout or properties

Kind: static method of Modifiers

Param Type Description
options Object An object with all input parameters
options.measures Array.<Object> Array with measure properties or layout
[options.properties] Object object properties (needs either this or the layout)
[options.layout] Object object layout (needs either this or the properties)

Modifiers.getActiveModifier(measure)

Get active modifier

Kind: static method of Modifiers

Param Type Description
measure Object The measure properties object

Modifiers.ifEnableTotalsFunction(measure)

Check if one type of modifier should enable totals function in table

Kind: static method of Modifiers

Param Type Description
measure Object The measure properties object