Functions
#
addDrillthroughColumnReturns 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, })
Argument | Type | Description |
---|---|---|
mdx | MdxDrillthrough | |
{ drillthroughColumnUniqueName, index, } | { drillthroughColumnUniqueName: string; index?: number; } |
#
addFormulaReturns a new MdxSelect corresponding to mdx
where the given formula was added. Does not mutate mdx.
addFormula(mdx, { formulaName, expression, measureIndex, properties, }, cube)
Argument | Type | Description |
---|---|---|
mdx | MdxSelect | |
{ formulaName, expression, measureIndex, properties, } | { formulaName: string; expression: MdxExpression; measureIndex?: number; properties?: MdxMemberPropertyDefinition[]; } | |
cube | Cube |
#
addLevelReturns a new MdxSelect corresponding to mdx
where the given level was added.
addLevel(mdx, { cube, dimensionName, hierarchyName, levelName, axisName, indexOnAxis, shouldCreateNonEmptyAxis, doesIncludeCalculatedMembers, })
Argument | Type | Description |
---|---|---|
mdx | MdxSelect | |
{ cube, dimensionName, hierarchyName, levelName, axisName, indexOnAxis, shouldCreateNonEmptyAxis, doesIncludeCalculatedMembers, } | { cube: Cube; dimensionName: DimensionName; hierarchyName: HierarchyName; levelName: LevelName; axisName?: AxisName; indexOnAxis?: number; shouldCreateNonEmptyAxis?: boolean; doesIncludeCalculatedMembers?: boolean; } |
#
addMeasureReturns a new MdxSelect corresponding to mdx
where the given measure was added. Does not mutate mdx.
addMeasure(mdx, { cube, measureName, measureIndex, shouldCreateNonEmptyAxis, axisName, })
Argument | Type | Description |
---|---|---|
mdx | MdxSelect | |
{ cube, measureName, measureIndex, shouldCreateNonEmptyAxis, axisName, } | { cube: Cube; measureName: MeasureName; measureIndex?: number; shouldCreateNonEmptyAxis?: boolean; axisName?: AxisName; } |
#
addPageAdds 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)
Argument | Type | Description |
---|---|---|
dashboardState | DashboardState | |
options | { page: DashboardPageState; key?: string; index?: number; } |
#
addWidgetReturns a new dashboard with the given widget added at the specified location. Does not mutate dashboard.
addWidget({ dashboardState, initialWidgetState, layoutPath, pageKey, side, })
Argument | Type | Description |
---|---|---|
{ dashboardState, initialWidgetState, layoutPath, pageKey, side, } | { dashboardState: DashboardState; initialWidgetState: AWidgetState; layoutPath: number[]; pageKey: string; side: Side; } |
#
authenticateLogs 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 })
Argument | Type | Description |
---|---|---|
url | string | |
{ username, password } | { username: string; password: string; } |
Promise<string>
#
collapseReturns a new MdxSelect corresponding to mdx
where the given tuple was collapsed. Does not mutate mdx.
collapse(mdx, { cube, tupleCoordinates, })
Argument | Type | Description |
---|---|---|
mdx | MdxSelect | |
{ cube, tupleCoordinates, } | { cube: Cube; tupleCoordinates: TupleCoordinates; } |
#
createActivePivotClientReturns a new ActivePivotClient instance.
createActivePivotClient({ url, version, requestInit, pingPeriod, })
Argument | Type | Description |
---|---|---|
{ url, version, requestInit, pingPeriod, } | { url: string; version: ServiceVersion; requestInit?: RequestInit; pingPeriod?: number; } |
#
createContentClientReturns a new ContentClient instance.
createContentClient({ url, version, requestInit, })
Argument | Type | Description |
---|---|---|
{ url, version, requestInit, } | { url: string; version: ServiceVersion; requestInit?: RequestInit; } |
#
createFilterReturns the filter represented by mdx
(assuming that it represents a filter).
createFilter(mdx, cube)
Argument | Type | Description |
---|---|---|
mdx | Mdx | |
cube | Cube |
#
createMdxForFilterReturns a new Mdx representing filter
.
createMdxForFilter(filter, cube)
Argument | Type | Description |
---|---|---|
filter | Filter | |
cube | Cube |
#
deriveMappingFromMdxReturns a DataVisualizationWidgetMapping inferred from mdx
. Default to the mapping defined in the initialState
of widgetPlugin
.
deriveMappingFromMdx({ mdx, cube, widgetPlugin, })
Argument | Type | Description |
---|---|---|
{ mdx, cube, widgetPlugin, } | { mdx?: MdxSelect; cube: Cube; widgetPlugin: WidgetPlugin<DataVisualizationWidgetState, SelectionType>; } |
DataVisualizationWidgetMapping
#
deserializeDashboardStateReturns 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)
Argument | Type | Description |
---|---|---|
dashboardState | DashboardState<"serialized"> |
DashboardState<"deserialized">
#
deserializeWidgetStateAccepts 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)
Argument | Type | Description |
---|---|---|
widgetState | AWidgetState<"serialized"> |
R
#
expandReturns a new MdxSelect corresponding to mdx
where the given tuple was expanded. Does not mutate mdx.
expand(mdx, { cube, tupleCoordinates, toLevel, doesIncludeCalculatedMembers, })
Argument | Type | Description |
---|---|---|
mdx | MdxSelect | |
{ cube, tupleCoordinates, toLevel, doesIncludeCalculatedMembers, } | { cube: Cube; tupleCoordinates: TupleCoordinates; toLevel: LevelCoordinates; doesIncludeCalculatedMembers?: boolean; } |
#
fetchTranslationsAsynchronously returns the ActiveUI SDK translations for locale
.
fetchTranslations(locale)
Argument | Type | Description |
---|---|---|
locale | Locale |
Promise<{ [key in string]: string; }>
#
findContentRecordsReturns the nodes in tree
with the given ids, indexed by id.
findContentRecords(tree, ids, path)
Argument | Type | Description |
---|---|---|
tree | ContentRecord<T> | |
ids | string[] | |
path | string[] |
{ [id: string]: { node: ContentRecord<T>; pathToParentFolder: string[]; }; }
#
getAntMenuItemPropsReturns the part of an action's menuItem's props that should be forwarded to the Ant Design menu item
getAntMenuItemProps(props)
Argument | Type | Description |
---|---|---|
props | MenuItemProps<WidgetState, SelectionType> |
AntMenuItemProps
#
getCalculatedMeasuresReturns the expression of each calculated measure defined in mdx
.
getCalculatedMeasures(mdx)
Argument | Type | Description |
---|---|---|
mdx | MdxSelect | MdxDrillthrough |
{ [measureName: string]: MdxFormula; }
#
getContentNodesReturns the nodes useful to display a ContentTree
.
getContentNodes(structure, options)
Argument | Type | Description |
---|---|---|
structure | ContentRecord<T> | |
options | { rootNodeMetaData: T; areFilesVisible: boolean; getDragItem?: (id: string, metaData: T) => void; } |
#
getContentRecordAtPathReturns the ContentRecord at path
in tree
.
getContentRecordAtPath({ tree, path, })
Argument | Type | Description |
---|---|---|
{ tree, path, } | { tree?: ContentRecord<AMetaData> | null; path?: string[]; } |
ContentRecord<AMetaData> | undefined
#
getCubeReturns the cube identified by cubeName
in dataModel
.
getCube(dataModel, cubeName)
Argument | Type | Description |
---|---|---|
dataModel | DataModel | |
cubeName | CubeName |
#
getCubeNameReturns the name of the cube used in mdx
, if any.
getCubeName(mdx)
Argument | Type | Description |
---|---|---|
mdx | MdxSelect | MdxSubSelect | MdxDrillthrough | MdxFromClause |
#
getDimensionReturns the dimension identified by dimensionName
in cube
.
getDimension(dimensionName, cube)
Argument | Type | Description |
---|---|---|
dimensionName | DimensionName | |
cube | Cube |
#
getDrawersTranslationsReturns the translations of all drawers for the given locale.
getDrawersTranslations(drawers, locale)
Argument | Type | Description |
---|---|---|
drawers | Drawer[] | null | |
locale | string |
{ [key in string]: string; }
#
getDrillthroughColumnsReturns the DrillthroughColumnUniqueName of each drillthrough column in mdx
.
getDrillthroughColumns(mdx)
Argument | Type | Description |
---|---|---|
mdx | MdxDrillthrough |
DrillthroughColumnUniqueName[]
#
getExpandedTuplesReturns the expanded tuples in mdx
getExpandedTuples(mdx, cube)
Argument | Type | Description |
---|---|---|
mdx | MdxSelect | MdxAxis | |
cube | Cube |
{ tupleCoordinates: TupleCoordinates; toLevel: LevelCoordinates; }[]
#
getFiltersReturns the filters expressed in mdx
.
getFilters(mdx, { cube })
Argument | Type | Description |
---|---|---|
mdx | MdxSelect | MdxSubSelect | MdxDrillthrough | |
{ cube } | { cube: Cube; } |
{ mdx: Mdx; paths: (string | number)[][]; }[]
#
getHierarchyReturns the hierarchy identified by hierarchyCoordinates
in cube
.
getHierarchy(hierarchyCoordinates, cube)
Argument | Type | Description |
---|---|---|
hierarchyCoordinates | HierarchyCoordinates | |
cube | Cube |
#
getLastEditionReturns information about the last edition of the given file by looking at the metadata file's entry attributes.
getLastEdition(node, id)
Argument | Type | Description |
---|---|---|
node | ContentRecord<MetaData> | |
id | string |
{ lastEditor?: string; lastEditedTimestamp?: number; }
#
getLayoutPathReturns the layoutPath of the widget identified by leafKey
in layout
.
getLayoutPath(layout, leafKey)
Argument | Type | Description |
---|---|---|
layout | Layout | |
leafKey | string |
number[]
#
getLevelReturns the level identified by levelCoordinates
in cube
.
getLevel(levelCoordinates, cube)
Argument | Type | Description |
---|---|---|
levelCoordinates | LevelCoordinates | |
cube | Cube |
#
getLevelsReturns the coordinates of every level used in mdx
.
getLevels(mdx, { cube })
Argument | Type | Description |
---|---|---|
mdx | Mdx | |
{ cube } | { cube: Cube; } |
#
getMeasureReturns the measure identified by measureName
in cube
.
getMeasure(measureName, cube)
Argument | Type | Description |
---|---|---|
measureName | string | |
cube | Cube |
Measure | undefined
#
getMeasuresReturns the names of the measures used in the axes of mdx
. Does not return duplicate measures.
getMeasures(mdx)
Argument | Type | Description |
---|---|---|
mdx | MdxSelect | MdxDrillthrough |
{ measureName: MeasureName; }[]
#
getMeasuresAxisNameReturns the name of the axis of mdx
containing the measures.
getMeasuresAxisName(mdx)
Argument | Type | Description |
---|---|---|
mdx | MdxSelect |
#
getMetaDataReturns a dashboard or a widget's metadata, useful to display its corresponding node in a ContentTree.
getMetaData(node, id)
Argument | Type | Description |
---|---|---|
node | ContentRecord<MetaData> | |
id | string |
MetaData
#
getNewPageKeyReturns the next page key based on the existing page keys.
getNewPageKey(pagesOrder)
Argument | Type | Description |
---|---|---|
pagesOrder | string[] |
string
#
getNodeReturns a reference to the node at the given path
getNode(tree, path)
Argument | Type | Description |
---|---|---|
tree | TreeObject<T> | |
path | number[] |
TreeObject<T>
#
getOwnersAndReadersReturns 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)
Argument | Type | Description |
---|---|---|
permissions | Permission[] | |
currentUserName | string |
{ owners: string[]; readers: string[]; }
#
getOwnersAndReadersForNewFileReturns 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 with doesInheritParentFolderPermissions
set to true
, then the file being created initially inherits the permissions of that folder, and its permissions are editable.
getOwnersAndReadersForNewFile({ currentUserName, canShare, parentFolderOwners, parentFolderReaders, isParentFolderRoot, doesInheritParentFolderPermissions, })
Argument | Type | Description |
---|---|---|
{ currentUserName, canShare, parentFolderOwners, parentFolderReaders, isParentFolderRoot, doesInheritParentFolderPermissions, } | { currentUserName: string; canShare: boolean; parentFolderOwners: string[]; parentFolderReaders: string[]; isParentFolderRoot: boolean; doesInheritParentFolderPermissions?: boolean; } |
{ owners: string[]; readers: string[]; }
#
getPageReturns the page with the specified key in the dashboard.
getPage(dashboardState, pageKey)
Argument | Type | Description |
---|---|---|
dashboardState | DashboardState | null | undefined | |
pageKey | string | null |
DashboardPageState | undefined
#
getPathToFolderLooks for the file with the given id in tree
and returns the path (of ids) to its parent folder.
getPathToFolder(tree, id)
Argument | Type | Description |
---|---|---|
tree | ContentRecord | |
id | string |
string[] | undefined
#
getPermissionsReturns 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, })
Argument | Type | Description |
---|---|---|
{ currentUserName, owners, readers, } | { currentUserName: string; owners: string[]; readers: string[]; } |
#
getPermissionsForNewFileReturns the initial permissions that should be displayed in a
when creating a new file or folder.See getOwnersAndReadersForNewFile.
getPermissionsForNewFile(args)
Argument | Type | Description |
---|---|---|
args | { currentUserName: UserName; canShare: boolean; parentFolderOwners: string[]; parentFolderReaders: string[]; isParentFolderRoot: boolean; doesInheritParentFolderPermissions?: boolean; } |
#
getPluginsTranslationsReturns the translations of all plugins for the given locale
getPluginsTranslations(plugins, locale)
Argument | Type | Description |
---|---|---|
plugins | { [key in PluginType]?: PluginsOfType<APlugin>; } | null | |
locale | string |
{ [key in string]: string; }
#
getPrefixedLocalStorageKeyReturns key
, prefixed with the application's name, in order to avoid conflicts on the domain where it is deployed.
getPrefixedLocalStorageKey(key)
Argument | Type | Description |
---|---|---|
key | string |
string
#
getSortReturns 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 })
Argument | Type | Description |
---|---|---|
mdx | MdxSelect | |
{ cube } | { cube: Cube; } |
({ orderMode: OrderMode; } & ({ tupleCoordinates: TupleCoordinates; } | { levelCoordinates: LevelCoordinates; })) | undefined
#
getTargetCubeReturns the serverKey, dataModel and cube targeted by the given cubeName
. When cubeName
is defined, serverKey
defaults to the first server which contains a matching cube. Otherwise, serverKey
defaults to the first provided server, and the cube defaults to the first cube within that server.
getTargetCube({ cubeName, dataModels, serverKey, })
Argument | Type | Description |
---|---|---|
{ cubeName, dataModels, serverKey, } | { cubeName?: CubeName; dataModels: { [serverKey: string]: DataModel; }; serverKey?: string; } |
{ cube: Cube; dataModel: DataModel; serverKey: string; }
#
getWidgetReturns the widget with the specified key in the page at the specified index of the dashboard.
getWidget(dashboardState, pageKey, leafKey)
Argument | Type | Description |
---|---|---|
dashboardState | DashboardState | null | undefined | |
pageKey | string | null | |
leafKey | string | null |
AWidgetState | undefined
#
isActionInDashboardAn 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)
Argument | Type | Description |
---|---|---|
props | ActionProps<WidgetState, SelectionType> |
props is WidgetInDashboardActionProps<WidgetState, SelectionType>
#
isDimensionNodeReturns whether node
is a DimensionNode.
isDimensionNode(node)
Argument | Type | Description |
---|---|---|
node | DataModelNode |
node is DimensionNode
#
isDraggedDimensionReturns whether the given drag item represents a dimension dragged from the data model tree.
isDraggedDimension(item)
Argument | Type | Description |
---|---|---|
item | { type: string; } & any |
item is DimensionDraggedFromDataModelTree
#
isDraggedHierarchyReturns whether the given drag item represents a hierarchy dragged from the data model tree.
isDraggedHierarchy(item)
Argument | Type | Description |
---|---|---|
item | { type: string; } & any |
item is HierarchyDraggedFromDataModelTree
#
isDraggedLevelReturns whether the given drag item represents a level dragged from the data model tree.
isDraggedLevel(item)
Argument | Type | Description |
---|---|---|
item | { type: string; } & any |
item is LevelDraggedFromDataModelTree
#
isDraggedMeasureReturns whether the given drag item represents a measure dragged from the data model tree.
isDraggedMeasure(item)
Argument | Type | Description |
---|---|---|
item | { type: string; } & any |
item is MeasureDraggedFromDataModelTree
#
isFieldDraggedFromDataModelTreeReturns whether the given drag item represents a dimension, hierarchy, level or measure dragged from the data model tree.
isFieldDraggedFromDataModelTree(item)
Argument | Type | Description |
---|---|---|
item | { type: string; } & any |
item is FieldDraggedFromDataModelTree
#
isHierarchyNodeReturns whether node
is a HierarchyNode.
isHierarchyNode(node)
Argument | Type | Description |
---|---|---|
node | DataModelNode |
node is HierarchyNode
#
isLevelNodeReturns whether node
is a LevelNode.
isLevelNode(node)
Argument | Type | Description |
---|---|---|
node | DataModelNode |
node is LevelNode
#
isMeasureNodeReturns whether node
is a MeasureNode.
isMeasureNode(node)
Argument | Type | Description |
---|---|---|
node | DataModelNode |
node is MeasureNode
#
isWidgetInDashboardReturns whether props
are the properties of a widget in a dashboard. In this case, it contains a "dashboardState" and a "pageKey" attribute.
isWidgetInDashboard(props)
Argument | Type | Description |
---|---|---|
props | WidgetPluginProps<T, SelectionType> |
props is WidgetPluginInDashboardProps<T, SelectionType>
#
isWidgetWithQueryStateReturns whether widgetState
is a WidgetWithQueryState.
isWidgetWithQueryState(widgetState)
Argument | Type | Description |
---|---|---|
widgetState | AWidgetState<T> |
widgetState is WidgetWithQueryState<MdxType, T>
#
moveAllMeasuresReturns 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, })
Argument | Type | Description |
---|---|---|
mdx | MdxSelect | |
{ axisName, cube, indexOnAxis, shouldCreateNonEmptyAxis, } | { axisName?: AxisName; cube: Cube; indexOnAxis?: number; shouldCreateNonEmptyAxis?: boolean; } |
#
moveDrillthroughColumnReturns 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, })
Argument | Type | Description |
---|---|---|
mdx | MdxDrillthrough | |
{ drillthroughColumnUniqueName, index, } | { drillthroughColumnUniqueName: string; index: number; } |
#
moveLevelReturns 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, })
Argument | Type | Description |
---|---|---|
mdx | MdxSelect | |
{ cube, dimensionName, hierarchyName, levelName, axisName, indexOnAxis, shouldCreateNonEmptyAxis, } | { cube: Cube; dimensionName: DimensionName; hierarchyName: HierarchyName; levelName: LevelName; axisName?: AxisName; indexOnAxis: number; shouldCreateNonEmptyAxis?: boolean; } |
#
moveMeasureReturns a new MdxSelect corresponding to mdx
where the given measure was moved to measureIndex
. Does not mutate mdx.
moveMeasure(mdx, options)
Argument | Type | Description |
---|---|---|
mdx | MdxSelect | |
options | { cube: Cube; measureName: MeasureName; measureIndex: number; shouldCreateNonEmptyAxis?: boolean; } |
#
moveWidgetReturns 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, })
Argument | Type | Description |
---|---|---|
{ dashboardState, originLayoutPath, pageKey, side, targetLayoutPath, } | { dashboardState: DashboardState; originLayoutPath: number[]; pageKey: string; side: Side; targetLayoutPath: number[]; } |
#
parseReturns the Mdx abstract syntax tree corresponding to mdxString
parse(mdxString)
Argument | Type | Description |
---|---|---|
mdxString | MdxString |
T
Throws:MdxError when mdxString
does not represent a valid Mdx query.
#
pingPings the server at the given URL.
ping(serverUrl, serviceVersion, options)
Argument | Type | Description |
---|---|---|
serverUrl | string | |
serviceVersion | ServiceVersion | |
options | RequestInit |
Promise<void>
#
quoteConverts an array of strings into the corresponding stringified Mdx compound identifier.
quote(path)
Argument | Type | Description |
---|---|---|
path | string[] |
quote('a', 'b') // === '[a].[b]'
#
removeAllMeasuresReturns a new MdxSelect corresponding to mdx
where all measures were removed. Does not mutate mdx
.
removeAllMeasures(mdx, { cube, shouldRemoveCalculatedMeasureExpression, })
Argument | Type | Description |
---|---|---|
mdx | MdxSelect | |
{ cube, shouldRemoveCalculatedMeasureExpression, } | { cube: Cube; shouldRemoveCalculatedMeasureExpression?: boolean; } |
#
removeDrillthroughColumnReturns a new MdxDrillthrough corresponding to mdx
where the column identified by drillthroughColumnUniqueName
was removed. Does not mutate mdx
.
removeDrillthroughColumn(mdx, { drillthroughColumnUniqueName, })
Argument | Type | Description |
---|---|---|
mdx | MdxDrillthrough | |
{ drillthroughColumnUniqueName, } | { drillthroughColumnUniqueName: DrillthroughColumnUniqueName; } |
#
removeLevelReturns a new MdxSelect corresponding to mdx
where the given level was removed. Does not mutate mdx
removeLevel(mdx, { cube, dimensionName, hierarchyName, levelName, })
Argument | Type | Description |
---|---|---|
mdx | MdxSelect | |
{ cube, dimensionName, hierarchyName, levelName, } | { cube: Cube; dimensionName: string; hierarchyName: string; levelName: string; } |
#
removeMeasureReturns a new MdxSelect corresponding to mdx
where the given measure was removed. Does not mutate mdx.
removeMeasure(mdx, { cube, measureName, shouldRemoveCalculatedMeasureExpression, })
Argument | Type | Description |
---|---|---|
mdx | MdxSelect | |
{ cube, measureName, shouldRemoveCalculatedMeasureExpression, } | { cube: Cube; measureName: string; shouldRemoveCalculatedMeasureExpression?: boolean; } |
#
removePageReturns a new DashboardState corresponding to dashboardState
from which the page identified by pageKey
was removed. Does not mutate dashboardState
.
removePage(dashboardState, pageKey)
Argument | Type | Description |
---|---|---|
dashboardState | DashboardState | |
pageKey | string |
#
removeSortReturns a new MdxSelect corresponding to mdx
, unsorted. Does not mutate mdx
.
removeSort(mdx)
Argument | Type | Description |
---|---|---|
mdx | MdxSelect |
#
removeWidgetReturns a new dashboard with the widget at the specified location removed. Does not mutate dashboard.
removeWidget({ dashboardState, layoutPath, pageKey, leafKey, })
Argument | Type | Description |
---|---|---|
{ dashboardState, layoutPath, pageKey, leafKey, } | { dashboardState: DashboardState; layoutPath: number[]; pageKey: string; leafKey: string; } |
#
searchReturns the matches corresponding to searchValue
within list
. Uses a fuzzy search algorithm. See https://fusejs.io/.
search(list, searchValue, options)
Argument | Type | Description |
---|---|---|
list | T[] | |
searchValue | string | |
options | Partial<FuseOptions<T>> |
T[]
#
serializeDashboardStateReturns 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)
Argument | Type | Description |
---|---|---|
dashboardState | DashboardState<"deserialized"> |
DashboardState<"serialized">
#
serializeWidgetStateAccepts 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)
Argument | Type | Description |
---|---|---|
widgetState | AWidgetState<"deserialized"> |
AWidgetState<"serialized">
#
setCubeNameReturns a new MdxSelect or MdxDrillthrough corresponding to mdx
with cubeName
updated as required. Does not mutate mdx.
setCubeName(mdx, { cubeName })
Argument | Type | Description |
---|---|---|
mdx | MdxSelect | MdxDrillthrough | |
{ cubeName } | { cubeName: string; } |
#
setDrillthroughColumnsReturns a new MdxDrillthrough corresponding to mdx
. The columns in the returned mdx are set to the drillthrough columns corresponding to drillthroughColumnUniqueNames
. Does not mutate mdx
.
setDrillthroughColumns(mdx, { drillthroughColumnUniqueNames, })
Argument | Type | Description |
---|---|---|
mdx | MdxDrillthrough | |
{ drillthroughColumnUniqueNames, } | { drillthroughColumnUniqueNames: DrillthroughColumnUniqueName[]; } |
#
setFiltersReturns a new MdxSelect or MdxDrillthrough corresponding to mdx
where the filters were set to filters
. Does not mutate mdx.
setFilters(mdx, { filters, cube })
Argument | Type | Description |
---|---|---|
mdx | MdxSelect | MdxDrillthrough | |
{ filters, cube } | { filters: Mdx[]; cube: Cube; } |
#
setSortReturns a new MdxSelect corresponding to mdx
, sorted as specified. Does not mutate mdx.
setSort(mdx, { cube, levelCoordinates, orderMode, tupleCoordinates, })
Argument | Type | Description |
---|---|---|
mdx | MdxSelect | |
{ cube, levelCoordinates, orderMode, tupleCoordinates, } | { cube: Cube; levelCoordinates?: LevelCoordinates; orderMode: OrderMode; tupleCoordinates?: TupleCoordinates; } |
#
sortTreeReturns a new tree, corresponding to tree
recursively sorted using comparator
. Does not mutate tree
.
sortTree(tree, comparator)
Argument | Type | Description |
---|---|---|
tree | TreeObject<NodeType> | |
comparator | (nodeA: NodeType, nodeB: NodeType) => number |
TreeObject<NodeType>
#
sortTreeAlphabeticallyAndFoldersFirstReturns a new tree, corresponding to tree
recursively sorted alphabetically and folders first. Does not mutate tree
.
sortTreeAlphabeticallyAndFoldersFirst(tree)
Argument | Type | Description |
---|---|---|
tree | TreeObject<NodeType> |
TreeObject<NodeType>
#
stringifyReturns the Mdx string corresponding to mdx
stringify(mdx, options, indenter)
Argument | Type | Description |
---|---|---|
mdx | Mdx | |
options | { indent?: boolean; } | |
indenter | GenericIndenter |
#
TitleA component that wraps antd's Title and allows us to customize its style.
Title({ level, disabled, ...otherProps })
Argument | Type | Description |
---|---|---|
{ level, disabled, ...otherProps } | TitleProps |
JSX.Element
#
unquoteConverts a stringified Mdx compound identifier into the corresponding array of strings.
unquote(str)
Argument | Type | Description |
---|---|---|
str | MdxString |
string[]
For example:unquote('[a].[b]') // === ['a', 'b']
#
updatePageUpdates the page with the specified key in the dashboard. Does not mutate dashboard.
updatePage(dashboardState, pageKey, updater)
Argument | Type | Description |
---|---|---|
dashboardState | DashboardState | |
pageKey | string | |
updater | (page: DashboardPageState) => void |
#
updateWidgetUpdates the widget with the specified key in the specified page in the dashboard. Does not mutate dashboard.
updateWidget(dashboardState, { pageKey, leafKey, }, updater)
Argument | Type | Description |
---|---|---|
dashboardState | DashboardState | |
{ pageKey, leafKey, } | { pageKey: string; leafKey: string; } | |
updater | (widget: WidgetState) => WidgetState |
#
withLazyLoadedQueryResultRuns the widget's query and provides its result to the underlying component. Also provides the query's lazy loading ranges and a callback to change them. Requires the underlying widget plugin to have a widgetPlugin.lazyLoading
attribute, containing the chunkSizes it should load.
withLazyLoadedQueryResult(WrappedComponent)
Argument | Type | Description |
---|---|---|
WrappedComponent | ComponentType<WidgetWithQueryProps<WidgetState, CellSet, Selection>> |
ComponentType<WidgetPluginProps<WidgetState, Selection>>
#
withQueryResultRuns the widget's query and provides its result to the underlying component. The component is wrapped with an
to ensure that it is not unmounted when there is a query error (which in most cases would lead to the query being unregistered, making the error unrecoverable).withQueryResult(WrappedComponent)
Argument | Type | Description |
---|---|---|
WrappedComponent | ComponentType<WidgetWithQueryProps<WidgetState, CellSet, Selection>> |
ComponentType<WidgetPluginProps<WidgetState, Selection> & { queryRanges?: Partial<{ [axisId in AxisId]: QueryRange; }>; onQueryRangesChanged?: (newQueryRanges: Partial<{ [axisId in AxisId]: QueryRange; }>) => void; }>