Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface VizActions

Partially implemented - Actions related to events and state of the viz

Hierarchy

  • VizActions

Index

Properties

automaticUpdatesArePaused

automaticUpdatesArePaused: boolean

Indicates whether automatic updates are currently paused.

Methods

addEventListener

  • addEventListener(type: TableauEventType, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void
  • Adds an event listener to the specified event.

    async function getSelectedMarks(event) {
        const marksSelected = await event.detail.getMarksAsync();
        const numMarks = marksSelected.data[0].data.length;
        console.log(`${numMarks} marks Selected`);
    }
    
    let viz = document.getElementById('tableauViz');
    viz.addEventListener("markselectionchanged", getSelectedMarks);

    Parameters

    • type: TableauEventType
    • listener: EventListenerOrEventListenerObject
    • Optional options: boolean | AddEventListenerOptions

    Returns void

addFilter

  • addFilter(fieldName: string, value: string): void
  • Use this method to filter the viz before initialization. If used after initialization, it will re-render the viz. For filtering after initialization, use the other filtering methods, such as applyFilterAsync.

    If you add the same filter fields using the addFilter() method and by using the <viz-filter> element in the <tableau-viz> web component, you might experience unexpected behavior.

    Parameters

    • fieldName: string

      The name of the field to filter on.

    • value: string

      Single value or a list of comma separated values to filter on.

      viz.addFilter('Region', 'Central,West');

    Returns void

displayDialogAsync

  • Display one of the export dialogs based on the dialogType parameter

    Throws an error if dialogType is invalid

    Parameters

    Returns Promise<void>

exportImageAsync

  • exportImageAsync(): Promise<void>
  • Equivalent to clicking on Download > Image from the toolbar, which creates a PNG file of the current visualization.

    Returns Promise<void>

getCurrentSrcAsync

  • getCurrentSrcAsync(): Promise<string>
  • Gets the visualization's current URL.

    Returns Promise<string>

pauseAutomaticUpdatesAsync

  • pauseAutomaticUpdatesAsync(): Promise<void>
  • Pause layout updates. This is useful if you are resizing the visualization or performing multiple calls that could affect the layout.

    Returns Promise<void>

redoAsync

  • redoAsync(): Promise<void>
  • Redoes the last action performed on a sheet.

    Returns Promise<void>

refreshDataAsync

  • refreshDataAsync(): Promise<void>
  • Equivalent to clicking on the Refresh Data toolbar button.

    Returns Promise<void>

removeEventListener

  • removeEventListener(type: TableauEventType, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void
  • Removes an event listener from the specified event.

    let viz = document.getElementById('tableauViz');
    viz.removeEventListener("markselectionchanged", getSelectedMarks);

    Parameters

    • type: TableauEventType
    • listener: EventListenerOrEventListenerObject
    • Optional options: boolean | EventListenerOptions

    Returns void

resumeAutomaticUpdatesAsync

  • resumeAutomaticUpdatesAsync(): Promise<void>
  • Resume layout updates.

    Returns Promise<void>

revertAllAsync

  • revertAllAsync(): Promise<void>
  • Equivalent to clicking on the Revert All toolbar button, which restores the workbook to its starting state.

    Returns Promise<void>

toggleAutomaticUpdatesAsync

  • toggleAutomaticUpdatesAsync(): Promise<void>
  • Toggle layout updates.

    Returns Promise<void>

undoAsync

  • undoAsync(): Promise<void>
  • Undoes the last action performed on a sheet.

    Returns Promise<void>