tableau-api-js

2.8.1 • Public • Published

Tableau API JS

A version of the JS API for Tableau wrapped as an NPM module.

Node.js (Install)

Requirements:

  • Node.js
  • npm (Node.js package manager)
npm install tableau-api-js

Usage

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.

Using a JS library in a TS project

To use the library (without type declarations) in a TypeScript project follow the steps in the following post

More details in the API documentation

Package Sidebar

Install

npm i tableau-api-js

Weekly Downloads

2,428

Version

2.8.1

License

MIT

Unpacked Size

202 kB

Total Files

4

Last publish

Collaborators

  • jemutorres