-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjsapi_embed_interactions_action.js
More file actions
33 lines (29 loc) · 1017 Bytes
/
Copy pathjsapi_embed_interactions_action.js
File metadata and controls
33 lines (29 loc) · 1017 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Initialize the viz variable
var viz;
window.onload= function() {
// When the webpage has loaded, load the viz
var vizDiv = document.getElementById('myViz');
var vizURL = 'https://public.tableau.com/views/Presents/TreeMap';
var options = {
width: '600px',
height: '540px',
hideToolbar: true,
hideTabs: true
};
viz = new tableau.Viz(vizDiv, vizURL, options);
};
// Switch the viz to the sheet specified
function switchView(sheetName) {
var workbook = viz.getWorkbook();
workbook.activateSheetAsync(sheetName);
}
// Filter the specified dimension to the specified value(s)
function show(filterName, values) {
var sheet = viz.getWorkbook().getActiveSheet();
sheet.applyFilterAsync(filterName, values, tableau.FilterUpdateType.REPLACE);
}
// Select the marks that have the specified value(s) for the specified dimension
function selectMarks(filterName, values) {
var sheet = viz.getWorkbook().getActiveSheet();
sheet.selectMarksAsync(filterName, values, tableau.FilterUpdateType.REPLACE);
}