Functions

addDrillthroughColumn

Returns a new MdxDrillthrough corresponding to mdx where the column identified by drillthroughColumnUniqueName was added at index if provided or at the last position otherwise. Does not mutate mdx.

addDrillthroughColumn(mdx, {
drillthroughColumnUniqueName,
index,
})
ArgumentTypeDescription
mdxMdxDrillthrough
{
   drillthroughColumnUniqueName,
   index,
}
{
   drillthroughColumnUniqueName: string;
   index?: number;
}
Returns:

MdxDrillthrough

addFormula

Returns a new MdxSelect corresponding to mdx where the given formula was added. Does not mutate mdx.

addFormula(mdx, {
formulaName,
expression,
measureIndex,
properties,
}, cube)
ArgumentTypeDescription
mdxMdxSelect
{
   formulaName,
   expression,
   measureIndex,
   properties,
}
{
   formulaName: string;
   expression: MdxExpression;
   measureIndex?: number;
   properties?: MdxMemberPropertyDefinition[];
}
cubeCube
Returns:

MdxSelect

addLevel

Returns a new MdxSelect corresponding to mdx where the given level was added.

addLevel(mdx, {
cube,
dimensionName,
hierarchyName,
levelName,
axisName,
indexOnAxis,
shouldCreateNonEmptyAxis,
doesIncludeCalculatedMembers,
})
ArgumentTypeDescription
mdxMdxSelect
{
   cube,
   dimensionName,
   hierarchyName,
   levelName,
   axisName,
   indexOnAxis,
   shouldCreateNonEmptyAxis,
   doesIncludeCalculatedMembers,
}
{
   cube: Cube;
   dimensionName: DimensionName;
   hierarchyName: HierarchyName;
   levelName: LevelName;
   axisName?: AxisName;
   indexOnAxis?: number;
   shouldCreateNonEmptyAxis?: boolean;
   doesIncludeCalculatedMembers?: boolean;
}
Returns:

MdxSelect

addMeasure

Returns a new MdxSelect corresponding to mdx where the given measure was added. Does not mutate mdx.

addMeasure(mdx, {
cube,
measureName,
measureIndex,
shouldCreateNonEmptyAxis,
axisName,
})
ArgumentTypeDescription
mdxMdxSelect
{
   cube,
   measureName,
   measureIndex,
   shouldCreateNonEmptyAxis,
   axisName,
}
{
   cube: Cube;
   measureName: MeasureName;
   measureIndex?: number;
   shouldCreateNonEmptyAxis?: boolean;
   axisName?: AxisName;
}
Returns:

MdxSelect

addPage

Adds a page to a dashboard and returns the updated dashboard state with the new page key. Does not mutate the dashboard state.

addPage(dashboardState, options)
ArgumentTypeDescription
dashboardStateDashboardState
options{
   page: DashboardPageState;
   key?: string;
   index?: number;
}
Returns:

DashboardState

addWidget

Returns a new dashboard with the given widget added at the specified location. Does not mutate dashboard.

addWidget({
dashboardState,
initialWidgetState,
layoutPath,
pageKey,
side,
})
ArgumentTypeDescription
{
   dashboardState,
   initialWidgetState,
   layoutPath,
   pageKey,
   side,
}
{
   dashboardState: DashboardState;
   initialWidgetState: AWidgetState;
   layoutPath: number[];
   pageKey: string;
   side: Side;
}
Returns:

DashboardState

authenticate

Logs the current user in and retrieves her Jwt token. Only useful if you use the same authentication mechanism as the ActivePivot sandbox.

authenticate(url, {
username,
password
})
ArgumentTypeDescription
urlstring
{
   username,
   password
}
{
   username: string;
   password: string;
}
Returns:

Promise<string>

collapse

Returns a new MdxSelect corresponding to mdx where the given tuple was collapsed. Does not mutate mdx.

collapse(mdx, {
cube,
tupleCoordinates,
})
ArgumentTypeDescription
mdxMdxSelect
{
   cube,
   tupleCoordinates,
}
{
   cube: Cube;
   tupleCoordinates: TupleCoordinates;
}
Returns:

MdxSelect

createActivePivotClient

Returns a new ActivePivotClient instance.

createActivePivotClient({
url,
version,
requestInit,
pingPeriod,
})
ArgumentTypeDescription
{
   url,
   version,
   requestInit,
   pingPeriod,
}
{
   url: string;
   version: ServiceVersion;
   requestInit?: RequestInit;
   pingPeriod?: number;
}
Returns:

ActivePivotClient

createContentClient

Returns a new ContentClient instance.

createContentClient({
url,
version,
requestInit,
})
ArgumentTypeDescription
{
   url,
   version,
   requestInit,
}
{
   url: string;
   version: ServiceVersion;
   requestInit?: RequestInit;
}
Returns:

ContentClient

createFilter

Returns the filter represented by mdx (assuming that it represents a filter).

createFilter(mdx, cube)
ArgumentTypeDescription
mdxMdx
cubeCube
Returns:

Filter

createMdxForFilter

Returns a new Mdx representing filter.

createMdxForFilter(filter, cube)
ArgumentTypeDescription
filterFilter
cubeCube
Returns:

Mdx

deserializeDashboardState

Returns a new dashboard state where: - all MDX strings representing queries and filters are parsed and replaced by AST. - all data visualization widget mappings are deserialized. Does not mutate the passed dashboard state.

deserializeDashboardState(dashboardState)
ArgumentTypeDescription
dashboardStateDashboardState<"serialized">
Returns:

DashboardState<"deserialized">

deserializeWidgetState

Accepts a serialized widgetState, as it is saved on a content server and returns its deserialized version, ready to live in the state of Dashboard.

deserializeWidgetState(widgetState)
ArgumentTypeDescription
widgetStateAWidgetState<"serialized">
Returns:

R

expand

Returns a new MdxSelect corresponding to mdx where the given tuple was expanded. Does not mutate mdx.

expand(mdx, {
cube,
tupleCoordinates,
toLevel,
doesIncludeCalculatedMembers,
})
ArgumentTypeDescription
mdxMdxSelect
{
   cube,
   tupleCoordinates,
   toLevel,
   doesIncludeCalculatedMembers,
}
{
   cube: Cube;
   tupleCoordinates: TupleCoordinates;
   toLevel: LevelCoordinates;
   doesIncludeCalculatedMembers?: boolean;
}
Returns:

MdxSelect

fetchTranslations

Asynchronously returns the ActiveUI SDK translations for locale.

fetchTranslations(locale)
ArgumentTypeDescription
localeLocale
Returns:

Promise<{ [key in string]: string; }>

findContentRecords

Returns the nodes in tree with the given ids, indexed by id.

findContentRecords(tree, ids, path)
ArgumentTypeDescription
treeContentRecord<T>
idsstring[]
pathstring[]
Returns:

{ [id: string]: { node: ContentRecord<T>; pathToParentFolder: string[]; }; }

getAntMenuItemProps

Returns the part of an action's menuItem's props that should be forwarded to the Ant Design menu item

getAntMenuItemProps(props)
ArgumentTypeDescription
propsMenuItemProps<WidgetState, SelectionType>
Returns:

AntMenuItemProps

getContentNodes

Returns the nodes useful to display a ContentTree.

getContentNodes(structure, options)
ArgumentTypeDescription
structureContentRecord<T>
options{
   rootNodeMetaData: T;
   areFilesVisible: boolean;
   getDragItem?: (id: string, metaData: T) => void;
}
Returns:

TreeObject<ContentNode<T>>

getContentRecordAtPath

Returns the ContentRecord at path in tree.

getContentRecordAtPath({
tree,
path,
})
ArgumentTypeDescription
{
   tree,
   path,
}
{
   tree?: ContentRecord<AMetaData> | null;
   path?: string[];
}
Returns:

ContentRecord<AMetaData> | undefined

getCube

Returns the cube identified by cubeName in dataModel.

getCube(dataModel, cubeName)
ArgumentTypeDescription
dataModelDataModel
cubeNameCubeName
Returns:

Cube

getCubeName

Returns the name of the cube used in mdx, if any.

getCubeName(mdx)
ArgumentTypeDescription
mdxMdxSelect | MdxSubSelect | MdxDrillthrough | MdxFromClause
Returns:

CubeName

getDimension

Returns the dimension identified by dimensionName in cube.

getDimension(dimensionName, cube)
ArgumentTypeDescription
dimensionNameDimensionName
cubeCube
Returns:

Dimension

getDrawersTranslations

Returns the translations of all drawers for the given locale.

getDrawersTranslations(drawers, locale)
ArgumentTypeDescription
drawersDrawer[] | null
localestring
Returns:

{ [key in string]: string; }

getDrillthroughColumns

Returns the DrillthroughColumnUniqueName of each drillthrough column in mdx.

getDrillthroughColumns(mdx)
ArgumentTypeDescription
mdxMdxDrillthrough
Returns:

DrillthroughColumnUniqueName[]

getExpandedTuples

Returns the expanded tuples in mdx

getExpandedTuples(mdx, cube)
ArgumentTypeDescription
mdxMdxSelect | MdxAxis
cubeCube
Returns:

{ tupleCoordinates: TupleCoordinates; toLevel: LevelCoordinates; }[]

getFilters

Returns the filters expressed in mdx.

getFilters(mdx, {
cube
})
ArgumentTypeDescription
mdxMdxSelect | MdxSubSelect | MdxDrillthrough
{
   cube
}
{
   cube: Cube;
}
Returns:

{ mdx: Mdx; paths: (string | number)[][]; }[]

getHierarchy

Returns the hierarchy identified by hierarchyCoordinates in cube.

getHierarchy(hierarchyCoordinates, cube)
ArgumentTypeDescription
hierarchyCoordinatesHierarchyCoordinates
cubeCube
Returns:

Hierarchy

getLayoutPath

Returns the layoutPath of the widget identified by leafKey in layout.

getLayoutPath(layout, leafKey)
ArgumentTypeDescription
layoutLayout
leafKeystring
Returns:

number[]

getLevel

Returns the level identified by levelCoordinates in cube.

getLevel(levelCoordinates, cube)
ArgumentTypeDescription
levelCoordinatesLevelCoordinates
cubeCube
Returns:

Level

getLevels

Returns the coordinates of every level used in mdx.

getLevels(mdx, {
cube
})
ArgumentTypeDescription
mdxMdx
{
   cube
}
{
   cube: Cube;
}
Returns:

LevelCoordinates[]

getMeasure

Returns the measure identified by measureName in cube.

getMeasure(measureName, cube)
ArgumentTypeDescription
measureNamestring
cubeCube
Returns:

Measure | undefined

getMeasures

Returns the names of the measures used in the axes of mdx. Does not return duplicate measures.

getMeasures(mdx)
ArgumentTypeDescription
mdxMdxSelect
Returns:

{ measureName: MeasureName; }[]

getMeasuresAxisName

Returns the name of the axis of mdx containing the measures.

getMeasuresAxisName(mdx)
ArgumentTypeDescription
mdxMdxSelect
Returns:

AxisName

getMetaData

Returns a dashboard or a widget's metadata, useful to display its corresponding node in a ContentTree.

getMetaData(node, id)
ArgumentTypeDescription
nodeContentRecord<MetaData>
idstring
Returns:

MetaData

getNewPageKey

Returns the next page key based on the existing page keys.

getNewPageKey(pagesOrder)
ArgumentTypeDescription
pagesOrderstring[]
Returns:

string

getNode

Returns a reference to the node at the given path

getNode(tree, path)
ArgumentTypeDescription
treeTreeObject<T>
pathnumber[]
Returns:

TreeObject<T>

getOwnersAndReaders

Returns the ContentEntry owners and readers corresponding to the given permissions. - Permissions of type "editor" are converted to "owners". - Permissions of type "reader" are converted both to "owners" and "readers". - The current user is added both as "owner" and "reader".

getOwnersAndReaders(permissions, currentUserName)
ArgumentTypeDescription
permissionsPermission[]
currentUserNamestring
Returns:

{ owners: string[]; readers: string[]; }

getOwnersAndReadersForNewFile

Returns the ContentEntry owners and readers for a new file or folder.

The reasoning is as follows: - if the user is not allowed to share, then she is the only owner/reader for the file being created and is not allowed to edit those permissions. - if the user is allowed to share.. - ..and is saving at the root, then she is initially the only owner/reader for the file being created, but is allowed to edit those permissions. - ..and is saving under a folder, then the file being created initially inherits the permissions of that folder, and its permissions are editable.

getOwnersAndReadersForNewFile({
currentUserName,
canShare,
parentFolderOwners,
parentFolderReaders,
isParentFolderRoot,
})
ArgumentTypeDescription
{
   currentUserName,
   canShare,
   parentFolderOwners,
   parentFolderReaders,
   isParentFolderRoot,
}
{
   currentUserName: string;
   canShare: boolean;
   parentFolderOwners: string[];
   parentFolderReaders: string[];
   isParentFolderRoot: boolean;
}
Returns:

{ owners: string[]; readers: string[]; }

getPage

Returns the page with the specified key in the dashboard.

getPage(dashboardState, pageKey)
ArgumentTypeDescription
dashboardStateDashboardState | null | undefined
pageKeystring | null
Returns:

DashboardPageState | undefined

getPathToFolder

Looks for the file with the given id in tree and returns the path (of ids) to its parent folder.

getPathToFolder(tree, id)
ArgumentTypeDescription
treeContentRecord
idstring
Returns:

string[] | undefined

getPermissions

Returns an array of Permission corresponding to the given ContentEntry owners and readers, meant to be displayed in a

  • Owners are converted to editor permissions. - Readers that are not in the list of owners are converted to reader permissions. The readers that are also owners are ignored. - The current user is stripped both from the editors and readers: it is always granted implicitly, and does not need to be displayed.
getPermissions({
currentUserName,
owners,
readers,
})
ArgumentTypeDescription
{
   currentUserName,
   owners,
   readers,
}
{
   currentUserName: string;
   owners: string[];
   readers: string[];
}
Returns:

Permission[]

getPermissionsForNewFile

Returns the initial permissions that should be displayed in a

when creating a new file or folder.

See getOwnersAndReadersForNewFile.

getPermissionsForNewFile(args)
ArgumentTypeDescription
args{
   currentUserName: UserName;
   canShare: boolean;
   parentFolderOwners: string[];
   parentFolderReaders: string[];
   isParentFolderRoot: boolean;
}
Returns:

Permission[]

getPluginsTranslations

Returns the translations of all plugins for the given locale

getPluginsTranslations(plugins, locale)
ArgumentTypeDescription
plugins{
   [key in PluginType]?: PluginsOfType<APlugin>;
} | null
localestring
Returns:

{ [key in string]: string; }

getSort

Returns the OrderMode defining the sort and the LevelCoordinates if it is alphabetical or the TupleCoordinates if it is numerical. Returns undefined if mdx is not sorted.

getSort(mdx, {
cube
})
ArgumentTypeDescription
mdxMdxSelect
{
   cube
}
{
   cube: Cube;
}
Returns:

({ orderMode: OrderMode; } & ({ tupleCoordinates: TupleCoordinates; } | { levelCoordinates: LevelCoordinates; })) | undefined

getWidget

Returns the widget with the specified key in the page at the specified index of the dashboard.

getWidget(dashboardState, pageKey, leafKey)
ArgumentTypeDescription
dashboardStateDashboardState | null | undefined
pageKeystring | null
leafKeystring | null
Returns:

AWidgetState | undefined

isActionInDashboard

An action can be used in or outside a dashboard. Some actions make sense in any context (e.g. "sort the current widget"). Some others only make sense in a dashboard (e.g. "remove widget"). This function returns whether the action is being used in a dashboard.

isActionInDashboard(props)
ArgumentTypeDescription
propsActionProps<WidgetState, SelectionType>
Returns:

props is WidgetInDashboardActionProps<WidgetState, SelectionType>

isDimensionNode

Returns whether node is a DimensionNode.

isDimensionNode(node)
ArgumentTypeDescription
nodeDataModelNode
Returns:

node is DimensionNode

isDraggedDimension

Returns whether the given drag item represents a dimension dragged from the data model tree.

isDraggedDimension(item)
ArgumentTypeDescription
item{
   type: string;
} & any
Returns:

item is DimensionDraggedFromDataModelTree

isDraggedHierarchy

Returns whether the given drag item represents a hierarchy dragged from the data model tree.

isDraggedHierarchy(item)
ArgumentTypeDescription
item{
   type: string;
} & any
Returns:

item is HierarchyDraggedFromDataModelTree

isDraggedLevel

Returns whether the given drag item represents a level dragged from the data model tree.

isDraggedLevel(item)
ArgumentTypeDescription
item{
   type: string;
} & any
Returns:

item is LevelDraggedFromDataModelTree

isDraggedMeasure

Returns whether the given drag item represents a measure dragged from the data model tree.

isDraggedMeasure(item)
ArgumentTypeDescription
item{
   type: string;
} & any
Returns:

item is MeasureDraggedFromDataModelTree

isFieldDraggedFromDataModelTree

Returns whether the given drag item represents a dimension, hierarchy, level or measure dragged from the data model tree.

isFieldDraggedFromDataModelTree(item)
ArgumentTypeDescription
item{
   type: string;
} & any
Returns:

item is FieldDraggedFromDataModelTree

isHierarchyNode

Returns whether node is a HierarchyNode.

isHierarchyNode(node)
ArgumentTypeDescription
nodeDataModelNode
Returns:

node is HierarchyNode

isLevelNode

Returns whether node is a LevelNode.

isLevelNode(node)
ArgumentTypeDescription
nodeDataModelNode
Returns:

node is LevelNode

isMeasureNode

Returns whether node is a MeasureNode.

isMeasureNode(node)
ArgumentTypeDescription
nodeDataModelNode
Returns:

node is MeasureNode

isWidgetWithQueryState

Returns whether widgetState is a WidgetWithQueryState.

isWidgetWithQueryState(widgetState)
ArgumentTypeDescription
widgetStateAWidgetState<T>
Returns:

widgetState is WidgetWithQueryState<MdxType, T>

moveAllMeasures

Returns a new MdxSelect corresponding to mdx where all measures were moved to indexOnAxis on the axis with axisName. Does not mutate mdx.

moveAllMeasures(mdx, {
axisName,
cube,
indexOnAxis,
shouldCreateNonEmptyAxis,
})
ArgumentTypeDescription
mdxMdxSelect
{
   axisName,
   cube,
   indexOnAxis,
   shouldCreateNonEmptyAxis,
}
{
   axisName?: AxisName;
   cube: Cube;
   indexOnAxis?: number;
   shouldCreateNonEmptyAxis?: boolean;
}
Returns:

MdxSelect

moveDrillthroughColumn

Returns a new MdxDrillthrough corresponding to mdx where the column identified by drillthroughColumnUniqueName has been moved to index. Does not mutate mdx.

moveDrillthroughColumn(mdx, {
drillthroughColumnUniqueName,
index,
})
ArgumentTypeDescription
mdxMdxDrillthrough
{
   drillthroughColumnUniqueName,
   index,
}
{
   drillthroughColumnUniqueName: string;
   index: number;
}
Returns:

MdxDrillthrough

moveLevel

Returns a new MdxSelect corresponding to mdx where the given level is moved at indexOnAxis on the axis with axisName. Does not mutate mdx.

moveLevel(mdx, {
cube,
dimensionName,
hierarchyName,
levelName,
axisName,
indexOnAxis,
shouldCreateNonEmptyAxis,
})
ArgumentTypeDescription
mdxMdxSelect
{
   cube,
   dimensionName,
   hierarchyName,
   levelName,
   axisName,
   indexOnAxis,
   shouldCreateNonEmptyAxis,
}
{
   cube: Cube;
   dimensionName: DimensionName;
   hierarchyName: HierarchyName;
   levelName: LevelName;
   axisName?: AxisName;
   indexOnAxis: number;
   shouldCreateNonEmptyAxis?: boolean;
}
Returns:

MdxSelect

moveMeasure

Returns a new MdxSelect corresponding to mdx where the given measure was moved to measureIndex. Does not mutate mdx.

moveMeasure(mdx, options)
ArgumentTypeDescription
mdxMdxSelect
options{
   cube: Cube;
   measureName: MeasureName;
   measureIndex: number;
   shouldCreateNonEmptyAxis?: boolean;
}
Returns:

MdxSelect

moveWidget

Returns a new dashboard with the given widget moved from the specified origin to the specified target. Does not mutate dashboard.

moveWidget({
dashboardState,
originLayoutPath,
pageKey,
side,
targetLayoutPath,
})
ArgumentTypeDescription
{
   dashboardState,
   originLayoutPath,
   pageKey,
   side,
   targetLayoutPath,
}
{
   dashboardState: DashboardState;
   originLayoutPath: number[];
   pageKey: string;
   side: Side;
   targetLayoutPath: number[];
}
Returns:

DashboardState

parse

Returns the Mdx abstract syntax tree corresponding to mdxString

parse(mdxString)
ArgumentTypeDescription
mdxStringMdxString
Returns:

T

Throws:

MdxError when mdxString does not represent a valid Mdx query.

ping

Pings the server at the given URL.

ping(serverUrl, serviceVersion, options)
ArgumentTypeDescription
serverUrlstring
serviceVersionServiceVersion
optionsRequestInit
Returns:

Promise<void>

quote

Converts an array of strings into the corresponding stringified Mdx compound identifier.

quote(path)
ArgumentTypeDescription
pathstring[]
Returns:

MdxString

For example:
quote('a', 'b') // === '[a].[b]'

removeAllMeasures

Returns a new MdxSelect corresponding to mdx where all measures were removed. Does not mutate mdx.

removeAllMeasures(mdx, {
cube
})
ArgumentTypeDescription
mdxMdxSelect
{
   cube
}
{
   cube: Cube;
}
Returns:

MdxSelect

removeDrillthroughColumn

Returns a new MdxDrillthrough corresponding to mdx where the column identified by drillthroughColumnUniqueName was removed. Does not mutate mdx.

removeDrillthroughColumn(mdx, {
drillthroughColumnUniqueName,
})
ArgumentTypeDescription
mdxMdxDrillthrough
{
   drillthroughColumnUniqueName,
}
{
   drillthroughColumnUniqueName: DrillthroughColumnUniqueName;
}
Returns:

MdxDrillthrough

removeLevel

Returns a new MdxSelect corresponding to mdx where the given level was removed. Does not mutate mdx

removeLevel(mdx, {
cube,
dimensionName,
hierarchyName,
levelName,
})
ArgumentTypeDescription
mdxMdxSelect
{
   cube,
   dimensionName,
   hierarchyName,
   levelName,
}
{
   cube: Cube;
   dimensionName: string;
   hierarchyName: string;
   levelName: string;
}
Returns:

MdxSelect

removeMeasure

Returns a new MdxSelect corresponding to mdx where the given measure was removed. Does not mutate mdx.

removeMeasure(mdx, {
cube,
measureName
})
ArgumentTypeDescription
mdxMdxSelect
{
   cube,
   measureName
}
{
   cube: Cube;
   measureName: string;
}
Returns:

MdxSelect

removePage

Returns a new DashboardState corresponding to dashboardState from which the page identified by pageKey was removed. Does not mutate dashboardState.

removePage(dashboardState, pageKey)
ArgumentTypeDescription
dashboardStateDashboardState
pageKeystring
Returns:

DashboardState

removeSort

Returns a new MdxSelect corresponding to mdx, unsorted. Does not mutate mdx.

removeSort(mdx)
ArgumentTypeDescription
mdxMdxSelect
Returns:

MdxSelect

removeWidget

Returns a new dashboard with the widget at the specified location removed. Does not mutate dashboard.

removeWidget({
dashboardState,
layoutPath,
pageKey,
leafKey,
})
ArgumentTypeDescription
{
   dashboardState,
   layoutPath,
   pageKey,
   leafKey,
}
{
   dashboardState: DashboardState;
   layoutPath: number[];
   pageKey: string;
   leafKey: string;
}
Returns:

DashboardState

search

Returns the matches corresponding to searchValue within list. Uses a fuzzy search algorithm. See https://fusejs.io/.

search(list, searchValue, options)
ArgumentTypeDescription
listT[]
searchValuestring
optionsPartial<FuseOptions<T>>
Returns:

T[]

serializeDashboardState

Returns a new dashboard state where: - all MDX AST objects of filters and queries are replaced by their stringified versions - all data visualization widget mappings are serialized. Does not mutate the passed dashboard state.

serializeDashboardState(dashboardState)
ArgumentTypeDescription
dashboardStateDashboardState<"deserialized">
Returns:

DashboardState<"serialized">

serializeWidgetState

Accepts a deserialized widgetState, as it lives in the state of Dashboard and returns its serialized version, ready to be saved on a content server.

serializeWidgetState(widgetState)
ArgumentTypeDescription
widgetStateAWidgetState<"deserialized">
Returns:

AWidgetState<"serialized">

setCubeName

Returns a new MdxSelect or MdxDrillthrough corresponding to mdx with cubeName updated as required. Does not mutate mdx.

setCubeName(mdx, {
cubeName
})
ArgumentTypeDescription
mdxMdxSelect | MdxDrillthrough
{
   cubeName
}
{
   cubeName: string;
}
Returns:

MdxSelect | MdxDrillthrough

setFilters

Returns a new MdxSelect or MdxDrillthrough corresponding to mdx where the filters were set to mdxFilters. Does not mutate mdx.

setFilters(mdx, {
filters,
cube
})
ArgumentTypeDescription
mdxMdxSelect | MdxDrillthrough
{
   filters,
   cube
}
{
   filters: Mdx[];
   cube: Cube;
}
Returns:

MdxSelect | MdxDrillthrough

setSort

Returns a new MdxSelect corresponding to mdx, sorted as specified. Does not mutate mdx.

setSort(mdx, {
cube,
levelCoordinates,
orderMode,
tupleCoordinates,
})
ArgumentTypeDescription
mdxMdxSelect
{
   cube,
   levelCoordinates,
   orderMode,
   tupleCoordinates,
}
{
   cube: Cube;
   levelCoordinates?: LevelCoordinates;
   orderMode: OrderMode;
   tupleCoordinates?: TupleCoordinates;
}
Returns:

MdxSelect

sortTree

Returns a new tree, corresponding to tree recursively sorted using comparator. Does not mutate tree.

sortTree(tree, comparator)
ArgumentTypeDescription
treeTreeObject<NodeType>
comparator(nodeA: NodeType, nodeB: NodeType) => number
Returns:

TreeObject<NodeType>

sortTreeAlphabeticallyAndFoldersFirst

Returns a new tree, corresponding to tree recursively sorted alphabetically and folders first. Does not mutate tree.

sortTreeAlphabeticallyAndFoldersFirst(tree)
ArgumentTypeDescription
treeTreeObject<NodeType>
Returns:

TreeObject<NodeType>

stringify

Returns the Mdx string corresponding to mdx

stringify(mdx, options, indenter)
ArgumentTypeDescription
mdxMdx
options{
   indent?: boolean;
}
indenterGenericIndenter
Returns:

MdxString

Title

A component that wraps antd's Title and allows us to customize its style.

Title({
level,
disabled,
...otherProps
})
ArgumentTypeDescription
{
   level,
   disabled,
   ...otherProps
}
TitleProps
Returns:

JSX.Element

unquote

Converts a stringified Mdx compound identifier into the corresponding array of strings.

unquote(str)
ArgumentTypeDescription
strMdxString
Returns:

string[]

For example:
unquote('[a].[b]') // === ['a', 'b']

updatePage

Updates the page with the specified key in the dashboard. Does not mutate dashboard.

updatePage(dashboardState, pageKey, updater)
ArgumentTypeDescription
dashboardStateDashboardState
pageKeystring
updater(page: DashboardPageState) => void
Returns:

DashboardState

updateWidget

Updates the widget with the specified key in the specified page in the dashboard. Does not mutate dashboard.

updateWidget(dashboardState, {
pageKey,
leafKey,
}, updater)
ArgumentTypeDescription
dashboardStateDashboardState
{
   pageKey,
   leafKey,
}
{
   pageKey: string;
   leafKey: string;
}
updater(widget: WidgetState) => WidgetState
Returns:

DashboardState

withQueryResult

Runs the widget's query. Provides the queryResult to the underlying Component.

withQueryResult(WrappedComponent)
ArgumentTypeDescription
WrappedComponentComponentType<WidgetWithQueryProps<WidgetState, CellSet, Selection>>
Returns:

ComponentType<WidgetPluginProps<WidgetState, Selection>>