npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ngx-tableau

v2.1.0

Published

ngx-tableau is an Angular module that allows to embed a [Tableau](https://www.tableau.com) report in an Angular webapp. You can see a working **DEMO** [here](https://stackblitz.com/edit/ngx-tableau).

Downloads

19,552

Readme

ngx-tableau

ngx-tableau is an Angular module that allows to embed a Tableau report in an Angular webapp. You can see a working DEMO here.

Prerequisites

  • NodeJS version 16+ for 2.x versions
  • NodeJS version 10+ for 1.x versions

Getting started

Install ngx-tableau library using npm:

npm install ngx-tableau

Add TableauModule to imports section of your app.module.ts file:

import { TableauModule } from 'ngx-tableau';

@NgModule({
  declarations: [AppComponent],
  imports: [BrowserModule, TableauModule],
  bootstrap: [AppComponent],
})
export class AppModule {}

The most basic use is just passing a public Tableau visualization URL.

<!-- Using report URL directly on HTML -->
<ngx-tableau
  tableauVizUrl="https://public.tableau.com/views/HurricaneMichaelPowerOutages/Outages"
></ngx-tableau>

<!-- Using report URL defined on view controller -->
<ngx-tableau [tableauVizUrl]="tableauVizUrl"></ngx-tableau>

Configuration options

You can pass configuration options to ngx-tableau using the following inputs to the component:

tableauVizUrl

URL of a Tableau visualization to embed. Perfect for public visualizations or if you know the exact URL of the Tableau visualization. If this input is defined, the component will ignore the configuration options serverUrl and report. Example:

<ngx-tableau
  tableauVizUrl="https://public.tableau.com/views/AroundtheAntarctic/MapClean"
></ngx-tableau>

tableauJsApiUrl

URL of Tableau JavaScript API v2, to be able to load a custom version (public or from your own Tableau Server). The default Tableau JavaScript API loaded if this variable is not set is https://public.tableau.com/javascripts/api/tableau-2.9.1.min.js. Example:

<ngx-tableau
  tableauJsApiUrl="https://public.tableau.com/javascripts/api/tableau-2.9.1.min.js"
  tableauVizUrl="https://public.tableau.com/views/AroundtheAntarctic/MapClean"
></ngx-tableau>

options

Visualization options for the Tableau view available in the JavaScript API. It should be a JSON object. Example:

import { VizCreateOptions, ToolbarPosition } from 'ngx-tableau'

// Options
options: VizCreateOptions = {
  hideTabs: true,
  hideToolbar: false,
  disableUrlActionsPopups: true,
  toolbarPosition: ToolbarPosition.TOP,
  onFirstInteractive: (event) => {
    console.log('On first interactive event!', event);
  }
};
<ngx-tableau
  tableauVizUrl="https://public.tableau.com/views/SuperSampleSuperstore/SuperDescriptive"
  [options]="options"
></ngx-tableau>

filters

Filters to pass to the Tableau visualization. It should be a JSON object. Example:

<ngx-tableau
  tableauVizUrl="https://public.tableau.com/views/SuperSampleSuperstore/SuperDescriptive"
  filters="{ Parameter3: 'Central' }"
></ngx-tableau>

serverUrl

URL of Tableau server. If this input is defined, it is mandatory to fill at least report input. Example:

<ngx-tableau
  serverUrl="https://public.tableau.com"
  report="AutonomousVehicles/AV"
></ngx-tableau>

report

The name of the workbook and the view ypu want to embed separated by a slash. Mandatory if using serverUrl. Example:

<ngx-tableau
  serverUrl="https://public.tableau.com"
  report="CityEyes/CityEyes"
></ngx-tableau>

ticket

If you want to embed a private Tableau visuzalization skipping sign in page for your end users, you should set up trusted authentication. Passing the obtained ticket to this option saves your users from having to sign in Tableau Server. Example:

<ngx-tableau
  serverUrl="https://myprivatetableau.mycompany.com"
  report="SomeWorkbook/SomeView"
  ticket="QUQub0EdSAaE39Eyg1oaLA==:9qT6oMvKUwXGr7TDpYKT9lvt"
></ngx-tableau>

site

If it is a multi-site site server you will need to pass the name of the site. If you are using trusted authentication take into account that you should pass a target_site attribute to the request to obtain the ticket or the ticket will not be valid to embed your visualization.

<ngx-tableau
  serverUrl="https://myprivatetableau.mycompany.com"
  report="myWorkbook/myView"
  ticket="QUQub0EdSAaE39Eyg1oaLA==:9qT6oMvKUwXGr7TDpYKT9lvt"
  site="mySite"
></ngx-tableau>

debugMode

Enables the debug mode of the component, which will show log traces in thde console.

<ngx-tableau
  tableauVizUrl="https://public.tableau.com/views/SuperSampleSuperstore/SuperDescriptive"
  [debugMode]="true"
></ngx-tableau>

Handling events

You can add or remove event listeners for the Tableau Viz object.

<ngx-tableau
  serverUrl="https://public.tableau.com/views/SuperSampleSuperstore/SuperDescriptive"
  (tableauVizLoaded)="handleOnTableauVizLoaded($event)"
></ngx-tableau>
import { TableauEvents } from 'ngx-tableau';

handleOnTableauVizLoaded = (tableauViz) => {
  console.log("Tableau viz loaded", tableauViz);

  tableauViz.addEventListener(TableauEvents.TAB_SWITCH, (event)=>{
    console.log(`Tab changed from '${event.getOldSheetName()}' to '${event.getNewSheetName()}'`, event)
  })
}

For a complete reference about Viz event types and specific handling, see the official documentation.