Functions
addCalculatedMeasure
Returns a new MdxSelect corresponding to mdx
where the given calculated measure was added. Does not mutate mdx.
addCalculatedMeasure(mdx, {
calculatedMeasureName,
expression,
measureIndex,
properties,
}, cube)
Argument | Type | Description |
---|---|---|
mdx | MdxSelect | |
{ calculatedMeasureName, expression, measureIndex, properties, } | { calculatedMeasureName: string; expression: MdxExpression; measureIndex?: number; properties?: MdxMemberPropertyDefinition[]; } | |
cube | Cube |
Returns:
addLevel
Returns 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; } |
Returns:
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,
})
Argument | Type | Description |
---|---|---|
mdx | MdxSelect | |
{ cube, measureName, measureIndex, shouldCreateNonEmptyAxis, axisName, } | { cube: Cube; measureName: MeasureName; measureIndex?: number; shouldCreateNonEmptyAxis?: boolean; axisName?: AxisName; } |
Returns:
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)
Argument | Type | Description |
---|---|---|
dashboardState | DashboardState | |
options | { page: DashboardPageState; key?: string; index?: number; } |
Returns:
addWidget
Returns 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; } |
Returns:
areHierarchiesEqual
Returns whether hierarchyCoordinatesA
and hierarchyCoordinatesB
represent the same hierarchy.
areHierarchiesEqual(hierarchyCoordinatesA, hierarchyCoordinatesB)
Argument | Type | Description |
---|---|---|
hierarchyCoordinatesA | HierarchyCoordinates | undefined | |
hierarchyCoordinatesB | HierarchyCoordinates | undefined |
Returns:
boolean
areLevelsEqual
Returns whether levelCoordinatesA
and levelCoordinatesB
represent the same level.
areLevelsEqual(levelCoordinatesA, levelCoordinatesB)
Argument | Type | Description |
---|---|---|
levelCoordinatesA | LevelCoordinates | undefined | |
levelCoordinatesB | LevelCoordinates | undefined |
Returns:
boolean
areTuplesEqual
Returns whether tupleCoordinatesA
and tupleCoordinatesB
represent the same tuple
areTuplesEqual(tupleCoordinatesA, tupleCoordinatesB)
Argument | Type | Description |
---|---|---|
tupleCoordinatesA | TupleCoordinates | undefined | |
tupleCoordinatesB | TupleCoordinates | undefined |
Returns:
boolean
collapse
Returns 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; } |
Returns:
createAtotiClient
Returns a new AtotiClient instance.
createAtotiClient({
url,
serverVersion,
serviceVersion,
requestInit,
pingPeriod,
})
Argument | Type | Description |
---|---|---|
{ url, serverVersion, serviceVersion, requestInit, pingPeriod, } | { url: string; serverVersion: string; serviceVersion: ServiceVersion; requestInit?: RequestInit; pingPeriod?: number; } |
Returns:
createContentClient
Returns a new ContentClient instance.
createContentClient({
url,
serverVersion,
serviceVersion,
requestInit,
})
Argument | Type | Description |
---|---|---|
{ url, serverVersion, serviceVersion, requestInit, } | { url: string; serverVersion: string; serviceVersion: ServiceVersion; requestInit?: RequestInit; } |
Returns:
createFilter
Returns the Filter represented by mdx
(assuming that it represents a filter).
createFilter(mdx, {
cube,
nonVisualTotals
})
Argument | Type | Description |
---|---|---|
mdx | MdxExpression | |
{ cube, nonVisualTotals } | { cube: Cube; nonVisualTotals?: boolean; } |
Returns:
createLevelCompoundIdentifier
Returns the MdxLevelCompoundIdentifier corresponding to the given level coordinates.
createLevelCompoundIdentifier({
dimensionName,
hierarchyName,
levelName,
})
Argument | Type | Description |
---|---|---|
{ dimensionName, hierarchyName, levelName, } | LevelCoordinates |
Returns:
createMdxForFilter
Returns a new MdxExpression representing filter
. Returns undefined
for a filter on members where there are no members selected.
createMdxForFilter(filter, cube)
Argument | Type | Description |
---|---|---|
filter | Filter | |
cube | Cube |
Returns:
MdxExpression | undefined
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)
Argument | Type | Description |
---|---|---|
dashboardState | DashboardState<"serialized"> |
Returns:
DashboardState<"deserialized">
deserializeFilter
Deserializes a Filter, making it usable in Atoti UI.
deserializeFilter(filter)
Argument | Type | Description |
---|---|---|
filter | Filter<"serialized"> |
Returns:
Filter<"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)
Argument | Type | Description |
---|---|---|
widgetState | AWidgetState<"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,
})
Argument | Type | Description |
---|---|---|
mdx | MdxSelect | |
{ cube, tupleCoordinates, toLevel, doesIncludeCalculatedMembers, } | { cube: Cube; tupleCoordinates: TupleCoordinates; toLevel: LevelCoordinates; doesIncludeCalculatedMembers?: boolean; } |
Returns:
fetchTranslations
Asynchronously returns the Atoti UI translations for locale
.
fetchTranslations(locale)
Argument | Type | Description |
---|---|---|
locale | string |
Returns:
Promise<{ [key in string]: string; }>
findContentRecords
Returns 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[] |
Returns:
{ [id: string]: { node: ContentRecord<T>; pathToParentFolder: string[]; }; }
findMappingFieldForHierarchy
Returns the coordinates of the DataVisualizationMappingField in mapping
that corresponds to the given hierarchy. Returns undefined
if the hierarchy is not expressed in the mapping.
findMappingFieldForHierarchy(mapping, {
dimensionName,
hierarchyName
})
Argument | Type | Description |
---|---|---|
mapping | DataVisualizationWidgetMapping | |
{ dimensionName, hierarchyName } | HierarchyCoordinates |
Returns:
{ attributeName: string; fieldIndex: number; type: "hierarchy"; } | { attributeName: string; fieldIndex: number; hierarchyIndex: number; type: "compositeHierarchy"; } | undefined
getActiveToolKey
Redux selector returning the key of the active tool tab. See activeToolKey
in State.
getActiveToolKey(state)
Argument | Type | Description |
---|---|---|
state | State |
Returns:
string | undefined
getAntdTheme
Returns the Ant Desgin ThemeConfig based on the provided $Theme.
getAntdTheme(atotiTheme)
Argument | Type | Description |
---|---|---|
atotiTheme | Theme |
Returns:
ThemeConfig
getCalculatedMeasures
Returns the expression of each calculated measure defined in mdx
.
getCalculatedMeasures(mdx)
Argument | Type | Description |
---|---|---|
mdx | MdxSelect | MdxDrillthrough |
Returns:
{ [measureName: string]: MdxFormula; }
getContentNodes
Returns the nodes useful to display a ContentTree
.
getContentNodes(structure, options)
Argument | Type | Description |
---|---|---|
structure | ContentRecord<T> | |
options | { areFilesVisible: boolean; getDragItem?: (id: string, metaData: T) => void; } |
Returns:
TreeObject<ContentNode<T>>[]
getContentRecordAtPath
Returns the ContentRecord at path
in tree
.
getContentRecordAtPath({
tree,
path,
})
Argument | Type | Description |
---|---|---|
{ tree, path, } | { tree?: ContentRecord<MetaData, T> | null; path?: string[]; } |
Returns:
ContentRecord<MetaData, T> | undefined
getCube
Returns the cube identified by cubeName
in dataModel
.
getCube(dataModel, cubeName)
Argument | Type | Description |
---|---|---|
dataModel | DataModel | |
cubeName | CubeName |
Returns:
getCubeName
Returns the name of the cube used in mdx
, if any.
getCubeName(mdx)
Argument | Type | Description |
---|---|---|
mdx | MdxSelect | MdxSubSelect | MdxDrillthrough | MdxFromClause |
Returns:
getDashboardState
Redux selector returning the state of the dashboard. See dashboard
in State.
getDashboardState(state)
Argument | Type | Description |
---|---|---|
state | State |
Returns:
DashboardState | undefined
getDimension
Returns the dimension identified by dimensionName
in cube
.
getDimension(dimensionName, cube)
Argument | Type | Description |
---|---|---|
dimensionName | DimensionName | |
cube | Cube |
Returns:
getDrillthroughColumns
Returns the DrillthroughColumnUniqueName of each drillthrough column in mdx
.
getDrillthroughColumns(mdx)
Argument | Type | Description |
---|---|---|
mdx | MdxDrillthrough |
Returns:
DrillthroughColumnUniqueName[]
getExpandedFolderPathsInHomePage
Redux selector returning the expanded folder paths of the homepage. See expandedFolderPathsInHomePage
in State.
getExpandedFolderPathsInHomePage(state)
Argument | Type | Description |
---|---|---|
state | State |
Returns:
string[][]
getExpandedTuples
Returns the drilled down tuples in mdx
.
getExpandedTuples(mdx, cube)
Argument | Type | Description |
---|---|---|
mdx | MdxSelect | MdxAxis | |
cube | Cube |
Returns:
{ tupleCoordinates: TupleCoordinates; toLevel: LevelCoordinates; }[]
getFilters
Returns the filters expressed in mdx
.
getFilters(mdx, {
cube
})
Argument | Type | Description |
---|---|---|
mdx | MdxSelect | MdxSubSelect | MdxDrillthrough | |
{ cube } | { cube: Cube; } |
Returns:
{ mdx: MdxExpression; paths: (string | number)[][]; nonVisualTotals?: boolean; }[]
getHasUnsavedChanges
Redux selector returning whether the dashboard has unsaved changes. See dashboard
and lastSavedDashboardHash
in State.
getHasUnsavedChanges(state)
Argument | Type | Description |
---|---|---|
state | State |
Returns:
boolean
getHierarchy
Returns the hierarchy identified by hierarchyCoordinates
in cube
.
getHierarchy(hierarchyCoordinates, cube)
Argument | Type | Description |
---|---|---|
hierarchyCoordinates | HierarchyCoordinates | |
cube | Cube |
Returns:
getIsDeferred
Redux selector returning whether deferred updates are enabled. See isDeferred
in State.
getIsDeferred(state)
Argument | Type | Description |
---|---|---|
state | State |
Returns:
boolean
getIsOpenDashboardPopupVisible
Redux selector returning whether the 'Open Dashboard' popup is visible. See isOpenDashboardPopupVisible
in State.
getIsOpenDashboardPopupVisible(state)
Argument | Type | Description |
---|---|---|
state | State |
Returns:
boolean
getIsPresenting
Redux selector returning whether the application is displayed in "Present" mode. See isPresenting
in State.
getIsPresenting(state)
Argument | Type | Description |
---|---|---|
state | State |
Returns:
boolean
getIsSettingsPopupVisible
Redux selector returning whether the 'Settings' popup is visible. See isSettingsPopupVisible
in State.
getIsSettingsPopupVisible(state)
Argument | Type | Description |
---|---|---|
state | State |
Returns:
boolean
getIsWidgetsPanelVisible
Redux selector returning whether the widgets panel is visible. See isWidgetsPanelVisible
in State.
getIsWidgetsPanelVisible(state)
Argument | Type | Description |
---|---|---|
state | State |
Returns:
boolean
getLayoutPath
Returns the layoutPath of the widget identified by leafKey
in layout
.
getLayoutPath(layout, leafKey)
Argument | Type | Description |
---|---|---|
layout | Layout | |
leafKey | string |
Returns:
number[]
getLevel
Returns the level identified by levelCoordinates
in cube
.
getLevel(levelCoordinates, cube)
Argument | Type | Description |
---|---|---|
levelCoordinates | LevelCoordinates | |
cube | Cube |
Returns:
getLevels
Returns the coordinates of every level used in mdx
.
getLevels(mdx, {
cube
})
Argument | Type | Description |
---|---|---|
mdx | Mdx | |
{ cube } | { cube: Cube; } |
Returns:
getMeasure
Returns the measure identified by measureName
in cube
.
getMeasure(measureName, cube)
Argument | Type | Description |
---|---|---|
measureName | string | |
cube | Cube |
Returns:
getMeasureNames
Returns the names of the measures used in the axes of mdx
. Does not return duplicate measures.
getMeasureNames(mdx)
Argument | Type | Description |
---|---|---|
mdx | MdxSelect | MdxDrillthrough |
Returns:
getMetaData
Returns a file's metadata content, useful to display its corresponding node in a ContentTree.
getMetaData(node, id)
Argument | Type | Description |
---|---|---|
node | ContentRecord<MetaData> | |
id | string |
Returns:
MetaData
getMetaDataRecord
Returns a file's metadata record, containing information about when and by whom this file was saved and who can access it.
getMetaDataRecord(node, id)
Argument | Type | Description |
---|---|---|
node | ContentRecord<MetaData, T> | |
id | string |
Returns:
ContentRecord<MetaData, T>
getNode
Returns a reference to the node at the given path
getNode(tree, path)
Argument | Type | Description |
---|---|---|
tree | TreeObject<T> | TreeObject<T>[] | |
path | number[] |
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)
Argument | Type | Description |
---|---|---|
permissions | Permission[] | |
currentUserName | string |
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 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; } |
Returns:
{ owners: string[]; readers: string[]; }
getPage
Returns the page with the specified key in the dashboard.
getPage(dashboardState, pageKey)
Argument | Type | Description |
---|---|---|
dashboardState | DashboardState | null | undefined | |
pageKey | string | null |
Returns:
DashboardPageState | undefined
getParentPaths
Returns the paths to the parents of the nodes identified by the given paths
getParentPaths(paths)
Argument | Type | Description |
---|---|---|
paths | T[][] |
Returns:
T[][]
getPluginsTranslations
Returns the translations of all plugins for the given locale
getPluginsTranslations(plugins, locale)
Argument | Type | Description |
---|---|---|
plugins | { [key in PluginType]?: PluginsOfType<APlugin>; } | null | |
locale | string |
Returns:
{ [key in string]: string; }
getPrefixedLocalStorageKey
Returns 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 |
Returns:
string
getResourcesPanelKey
Redux selector returning the key of the currently open resources panel. See resourcesPanelKey
in State.
getResourcesPanelKey(state)
Argument | Type | Description |
---|---|---|
state | State |
Returns:
"data-model" | "widgets" | "filters"
getSelectedLeafKey
Redux selector returning the key of the selected widget, identifying it in its parent dashboard page. See widgetSelection
in State. It is useful to retrieve the selected widget state.
getSelectedLeafKey(state, activePageKey)
Argument | Type | Description |
---|---|---|
state | State | |
activePageKey | string | undefined |
Returns:
string | undefined
For example:
import { useSelector } from "react-redux";
import { getWidget } from "@activeviam/atoti-ui-sdk"
const dashboardState = useSelector(getDashboardState);
const activePageKey = useActivePageKeyFromUrl();
const selectedLeafKey = useSelector((state) =>
getSelectedLeafKey(state, activePageKey),
);
const selectedWidgetState = getWidget(dashboardState, activePageKey, selectedLeafKey);
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
})
Argument | Type | Description |
---|---|---|
mdx | MdxSelect | |
{ cube } | { cube: Cube; } |
Returns:
({ orderMode: OrderMode; } & ({ tupleCoordinates: TupleCoordinates; } | { levelCoordinates: LevelCoordinates; })) | undefined
getStatusNotifications
Redux selector return the state corresponding to the status notifications of the current asynchronous actions. See statusNotifications
in State.
getStatusNotifications(state)
Argument | Type | Description |
---|---|---|
state | State |
Returns:
getTargetCube
Returns the serverKey, dataModel and cube targeted by the given cubeName
. If serverKey
is defined but cubeName
is not, defaults to the first cube from that server. If cubeName
is defined but serverKey
is not, defaults to the first server containing a cube with that name. If neither serverKey
nor cubeName
are defined, defaults to the last cube the user used if it is still valid, and the first cube of the first provided server otherwise.
getTargetCube({
dataModels,
serverKey,
cubeName,
lastUsedCube,
})
Argument | Type | Description |
---|---|---|
{ dataModels, serverKey, cubeName, lastUsedCube, } | { dataModels: { [serverKey: string]: DataModel; }; serverKey?: string; cubeName?: CubeName; lastUsedCube?: { cubeName: CubeName; serverKey: string; } | null; } |
Returns:
{ cube: Cube; dataModel: DataModel; serverKey: string; }
getToolsTranslations
Returns the translations of all tools for the given locale.
getToolsTranslations(tools, locale)
Argument | Type | Description |
---|---|---|
tools | Tool[] | null | |
locale | string |
Returns:
{ [key in string]: string; }
getUserFromJwt
Extracts the user name and roles from an Atoti server sandbox authentication token.
getUserFromJwt(jwt)
Argument | Type | Description |
---|---|---|
jwt | string |
Returns:
getUserRoles
Use getUserFromJwt instead.
Decodes the user roles from the authentication token.
getUserRoles(token)
Argument | Type | Description |
---|---|---|
token | string |
Returns:
string[]
getWidget
Returns 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 |
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)
Argument | Type | Description |
---|---|---|
props | ActionProps<WidgetState, SelectionType> |
Returns:
props is WidgetInDashboardActionProps<WidgetState, SelectionType>
isBodyCell
Returns whether props
represent a body cell in a cellset table.
isBodyCell(props)
Argument | Type | Description |
---|---|---|
props | CellSetTableCellProps |
Returns:
props is CellSetTableBodyCellProps
isHeaderCell
Returns whether props
represent a header cell in a cellset table.
isHeaderCell(props)
Argument | Type | Description |
---|---|---|
props | CellSetTableCellProps |
Returns:
props is CellSetTableHeaderCellProps
isLevelNode
Returns whether node
is a LevelNode.
isLevelNode(node)
Argument | Type | Description |
---|---|---|
node | DataModelNode |
Returns:
node is LevelNode
isStaticHeaderCell
Returns whether props
represent a static header cell in a cellset table.
isStaticHeaderCell(props)
Argument | Type | Description |
---|---|---|
props | CellSetTableCellProps |
Returns:
props is CellSetTableStaticHeaderCellProps
isTotal
Determines whether the member is a total given its hierarchy
isTotal(hierarchy, member)
Argument | Type | Description |
---|---|---|
hierarchy | Hierarchy | |
member | MemberCoordinates | Member |
Returns:
boolean
isWidgetInDashboard
Returns 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> |
Returns:
props is WidgetPluginInDashboardProps<T, SelectionType>
isWidgetWithQueryState
Returns whether widgetState
is a WidgetWithQueryState.
isWidgetWithQueryState(widgetState)
Argument | Type | Description |
---|---|---|
widgetState | AWidgetState<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,
})
Argument | Type | Description |
---|---|---|
mdx | MdxSelect | |
{ axisName, cube, indexOnAxis, shouldCreateNonEmptyAxis, } | { axisName?: AxisName; cube: Cube; indexOnAxis?: number; shouldCreateNonEmptyAxis?: boolean; } |
Returns:
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,
})
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; } |
Returns:
moveMeasure
Returns 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; } |
Returns:
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,
originPageKey: _originPageKey,
targetPageKey: _targetPageKey,
side,
targetLayoutPath,
})
Argument | Type | Description |
---|---|---|
{ dashboardState, originLayoutPath, pageKey, originPageKey: _originPageKey, targetPageKey: _targetPageKey, side, targetLayoutPath, } | { dashboardState: DashboardState; originLayoutPath: number[]; pageKey?: string; originPageKey?: string; targetPageKey?: string; side: Side; targetLayoutPath: number[]; } |
Returns:
opacitize
Returns the rgba color corresponding to the given color with the given opacity
opacitize(color, opacity)
Argument | Type | Description |
---|---|---|
color | Color | |
opacity | number |
Returns:
parse
Returns the Mdx abstract syntax tree corresponding to mdxString
parse(mdxString)
Argument | Type | Description |
---|---|---|
mdxString | MdxString |
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)
Argument | Type | Description |
---|---|---|
serverUrl | string | |
serviceVersion | ServiceVersion | |
options | RequestInit |
Returns:
Promise<void>
quote
Converts an array of strings into the corresponding stringified Mdx compound identifier.
quote(path)
Argument | Type | Description |
---|---|---|
path | string[] |
Returns:
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,
shouldRemoveCalculatedMeasureExpression,
})
Argument | Type | Description |
---|---|---|
mdx | MdxSelect | |
{ cube, shouldRemoveCalculatedMeasureExpression, } | { cube: Cube; shouldRemoveCalculatedMeasureExpression?: boolean; } |
Returns:
removeLevel
Returns 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; } |
Returns:
removeMeasure
Returns 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; } |
Returns:
removePage
Returns 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 |
Returns:
removeSort
Returns a new MdxSelect corresponding to mdx
, unsorted. Does not mutate mdx
.
removeSort(mdx)
Argument | Type | Description |
---|---|---|
mdx | MdxSelect |
Returns:
removeWidget
Returns 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; } |
Returns:
search
Returns 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>> & { limit?: number; } |
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)
Argument | Type | Description |
---|---|---|
dashboardState | DashboardState<"deserialized"> |
Returns:
DashboardState<"serialized">
serializeFilter
Serializes a Filter, making it lighter to store on the Content Server.
serializeFilter(filter)
Argument | Type | Description |
---|---|---|
filter | Filter<"deserialized"> |
Returns:
Filter<"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)
Argument | Type | Description |
---|---|---|
widgetState | AWidgetState<"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
})
Argument | Type | Description |
---|---|---|
mdx | MdxSelect | MdxDrillthrough | |
{ cubeName } | { cubeName: string; } |
Returns:
setDrillthroughColumns
Returns 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[]; } |
Returns:
setFilters
Returns 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: (MdxExpression | { mdx: MdxExpression; nonVisualTotals?: boolean; })[]; cube: Cube; } |
Returns:
setSort
Returns 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; } |
Returns:
sortTree
Returns 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 |
Returns:
TreeObject<NodeType>[]