Class: AnalyticsDashboard
A web component for embedding a Tableau Next dashboard.
AnalyticsComponent
new AnalyticsDashboard(
props):AnalyticsDashboard
The constructor for AnalyticsDashboard.
• props: DashboardProps
The initialization properties for the dashboard component.
AnalyticsComponent.constructor
components/analytics-dashboard/AnalyticsDashboard.ts:122
parentIdOrElement:
string|HTMLElement
This ID of the container or the container where the analytics component is embedded.
AnalyticsComponent.parentIdOrElement
components/analytics-component/AnalyticsComponent.ts:73
getcomponentType():string
Returns the component type: 'dashboard'.
string
AnalyticsComponent.componentType
components/analytics-dashboard/AnalyticsDashboard.ts:200
getfilters():UnifiedFilterJson[]
The filters for the component.
setfilters(val):void
• val: UnifiedFilterJson[]
- Returns a list of filters for the component.
AnalyticsComponent.filters
components/analytics-component/AnalyticsComponent.ts:245
getheight():string
The height for the component, in CSS units. Acceptable string formats include:
- Pixel values (e.g., "800px")
- Percentages (e.g., "100%")
- Relative units (e.g., "2rem", "1.5em")
- Other valid CSS height values.
If invalid value is provided, height will by default set to 100%.
setheight(val):void
• val: string
string
- Returns the height of the component.
AnalyticsComponent.height
components/analytics-component/AnalyticsComponent.ts:210
gethideHeader():boolean
Indicates whether the header is currently hidden.
Default is false, meaning the header is visible.
boolean
true if the header is hidden, false otherwise.
components/analytics-dashboard/AnalyticsDashboard.ts:169
getidOrApiName():string
The ID or API name used to identify the Tableau Next component.
setidOrApiName(val):void
• val: string
string
- Returns the ID or API name of the component to embed.
AnalyticsComponent.idOrApiName
components/analytics-component/AnalyticsComponent.ts:189
getpageName():string
Gets the name of the current dashboard page. Useful when you need to reference or display the active page.
string
The name of the current page.
components/analytics-dashboard/AnalyticsDashboard.ts:149
getwidth():string
The width for the component, in CSS units. Acceptable string formats include:
- Pixel values (e.g., "800px")
- Percentages (e.g., "100%")
- Relative units (e.g., "2rem", "1.5em")
- Other valid CSS width values.
If invalid value is provided, width will by default set to 100%.
setwidth(val):void
• val: string
string
- Returns the width of the component.
AnalyticsComponent.width
components/analytics-component/AnalyticsComponent.ts:231
applyFilters(
filters):Promise<void>
Apply the specified filters to the component.
If the filter format is invalid, an ERROR event is thrown and the filter application fails.
Please ensure that all filters are correctly formatted and have correct values for the required properties.
• filters: UnifiedFilterJson[]
A list of filters.
Promise<void>
- A promise that resolves when the filters are applied.
AnalyticsComponent.applyFilters
components/analytics-component/AnalyticsComponent.ts:550
clearFilters():
Promise<void>
Clears the current list of filters for the component.
Promise<void>
A promise that resolves when the fliters are removed.
AnalyticsComponent.clearFilters
components/analytics-component/AnalyticsComponent.ts:734
export(
filename?,filetype?):Promise<void>
Triggers an event requesting an export of the component in the required format.
• filename?: string
The name of the file to export, excluding the file extension. If not provided, the componentName is used.
• filetype?: ExportFileType = ExportFileType.PNG
The format of export. If not provided, defaults to PNG. Supported types: PNG.
Promise<void>
A promise that resolves when the export operation is complete.
Throws an error if the export operation isn't supported.
AnalyticsComponent.export
components/analytics-component/AnalyticsComponent.ts:630
getDataSources():
Promise<DataSource[]>
Returns a list of data sources available for the embedded dashboard. Use this function when applying filters to dashboards, which can have multiple data sources.
Promise<DataSource[]>
A promise that resolves to a list of data sources.
Raises error event for timeouts, permissions, or other issues
components/analytics-dashboard/AnalyticsDashboard.ts:339
getFields(
dataSources?):Promise<Map<string,Field[]>>
Returns a map of fields associated with the component.
• dataSources?: DataSource[]
A list of datasources to retrieve the fields from. This isn't required for visualizations and metrics. If omitted for Dashboards, fields for all available data sources will be returned.
Promise<Map<string, Field[]>>
- A promise that resolves to a map where each key is a string data source API name
and value is an array of Field objects.
AnalyticsComponent.getFields
components/analytics-component/AnalyticsComponent.ts:777
getFilterFieldValues(
fieldApiName,fieldObjectName?,searchTerm?):Promise<any>
Retrieves the values for a specified field.
• fieldApiName: string
Required. The API name of the field to retrieve the values for.
• fieldObjectName?: string
The object name of the field. The fieldObjectName parameter is only required if the specified field has an associated object name. User can know whether field has an associated object name or not in the response of getFields().
• searchTerm?: string
Optional. A search term to filter the field values.
Promise<any>
A promise that resolves with the field values. The exact structure depends on the event handler.
AnalyticsComponent.getFilterFieldValues
components/analytics-component/AnalyticsComponent.ts:897
getFilters():
Promise<UnifiedFilterJson[]>
Returns the list of filters applied to the component.
Promise<UnifiedFilterJson[]>
A promise that resolves to a list of FilterInfo objects.
AnalyticsComponent.getFilters
components/analytics-component/AnalyticsComponent.ts:605
getInteractionDetails():
Promise<InteractionDetails>
Returns a comprehensive map containing all available data sources, fields, and filter fields for the component. This method provides a complete overview of the component.
Note: The dataSources array is only available for DashboardComponent
Promise<InteractionDetails>
A promise that resolves to an InteractionDetails object containing:
dataSources: Array of available data sourcesfields: Map where each key is a string data source API name and value is an array of Field objectsfilterFields: Map where each key is a string data source API name and value is an array of filterable Field objects
AnalyticsComponent.getInteractionDetails
components/analytics-component/AnalyticsComponent.ts:848
getMetadata():
Promise<ComponentMetadata>
Returns the component metadata. Use this to get information about the embedded component, such as its name, description, and configuration.
Promise<ComponentMetadata>
A promise that resolves to the ComponentMetadata object.
AnalyticsComponent.getMetadata
components/analytics-component/AnalyticsComponent.ts:645
getPages():
Promise<string[]>
Returns the list of page labels for the dashboard.
Promise<string[]>
A promise that resolves to a list of page labels.
components/analytics-dashboard/AnalyticsDashboard.ts:301
reload():
Promise<void>
Reloads the component to retrieve the latest data from the server.
Promise<void>
- A promise that resolves when reload is complete.
AnalyticsComponent.reload
components/analytics-component/AnalyticsComponent.ts:490
render():
Promise<string>
Renders the component by appending it to the specified parent element.
Promise<string>
A promise that resolves when the component is loaded successfully, or rejects with an error message if the loading fails.
AnalyticsComponent.render
components/analytics-component/AnalyticsComponent.ts:451
setPage(
pageLabel?):Promise<void>
Sets the embedded dashboard to the specified page label. Only one page of the dashboard can be embedded at a time.
• pageLabel?: string
The label of the page to display. If not specified, displays the first page.
Promise<void>
A promise that resolves when the page is set
components/analytics-dashboard/AnalyticsDashboard.ts:370