A version of the JS API for Tableau wrapped as an NPM module.
Requirements:
- Node.js
- npm (Node.js package manager)
npm install tableau-api-js
To use this package:
app.component.ts:
import { Component, OnInit } from '@angular/core';
import * as Tableau from 'tableau-api-js';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class AppComponent implements OnInit {
constructor() {}
public initViz(): void {
const containerDiv = document.getElementById('vizContainer');
const vizUrl = 'https://public.tableau.com/views/WorldIndicators/GDPpercapita';
const options = {
width: containerDiv.offsetWidth,
height: 700
};
const viz = new Tableau.Viz(containerDiv, vizUrl, options);
}
public ngOnInit(): void {
this.initViz();
}
}
app.component.html:
<div id="vizContainer"></div>
This will provide you with the most up-to-date functionality in the API.
More details in the API documentation