tableau-js
v1.0.4
Published
Unofficial Tableau javascript api.
Downloads
15
Maintainers
Readme
Tableau JavaScript API & Type declaration
Tableau provide an official JS API to embed dashboard into webpage link. But the only way to use it is add external reference. The type support for TypeScript wasn't provided as well.
<script src="https://YOUR-SERVER/javascripts/api/tableau-2.min.js"></script>
This project was modified base on Tableau official api. Type support was included.
Install
npm install tableau-js
Usage
// JavaScript
import { Viz } from 'tableau-js'
const url='http://YOUR_DASHBOARD/';
// create container
const div=document.createElement('div');
const viz=new Viz(div, url);
document.body.append(div);
// TypeScript
import { Viz, VizCreateOptions } from 'tableau';
const url='http://YOUR_DASHBOARD/';
// create container
const div=document.createElement('div');
const option: VizCreateOptions = {
height: '800',
width: '600'
};
const viz=new Viz(div, url, option);
document.body.append(div);