Class: AnalyticsVisualization

A web component for embedding a Tableau Next visualization.

  • AnalyticsComponent

new AnalyticsVisualization(props): AnalyticsVisualization

The constructor for AnalyticsVisualization.

props: ComponentProps

AnalyticsVisualization

AnalyticsComponent.constructor

components/analytics-visualization/AnalyticsVisualization.ts:116

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

get componentType(): string

Returns the component type: 'visualization'.

string

AnalyticsComponent.componentType

components/analytics-visualization/AnalyticsVisualization.ts:158


get filters(): UnifiedFilterJson[]

The filters for the component.

set filters(val): void

val: UnifiedFilterJson[]

UnifiedFilterJson[]

  • Returns a list of filters for the component.

AnalyticsComponent.filters

components/analytics-component/AnalyticsComponent.ts:245


get height(): 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%.

set height(val): void

val: string

string

  • Returns the height of the component.

AnalyticsComponent.height

components/analytics-component/AnalyticsComponent.ts:210


get idOrApiName(): string

The ID or API name used to identify the Tableau Next component.

set idOrApiName(val): void

val: string

string

  • Returns the ID or API name of the component to embed.

AnalyticsComponent.idOrApiName

components/analytics-component/AnalyticsComponent.ts:189


get width(): 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%.

set width(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


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 sources
  • fields: Map where each key is a string data source API name and value is an array of Field objects
  • filterFields: 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


getSelections(): Promise<SelectionData>

Returns the data selections. Use this to retrieve the current selection state of the component, highlighted data points applied by the user.

Promise<SelectionData>

The data selections.

components/analytics-visualization/AnalyticsVisualization.ts:225


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