JavaScript Notebooks in Tableau
Reactive JS notebook using Observable Runtime can be embedded into Tableau Workbooks using the extensions framework. Read more about the Iridium Embedded Computational Notebooks in this Medium Article
This article is a step-by-step walkthrough to get you started on using interactive JavaScript inside Tableau.
Step 1: Create a Tableau Workbook with your data
Step 2: Setup a Dashboard to use the extension
Add a new Dashboard to your workbook, choose a layout that works for you, and add the sheet you created in the previous step to it.
Step 3: Download and use the Tableau Iridium Extension
Download the TREX file for the extension: https://wishyoulization.github.io/iridium/tableau-iridium.trex
Step 4: Write some JS to fetch Worksheet data to Notebook
The extension window is the notebook interface to create, edit and remove cells, you run them using shift+enter or the play icon . You can also pin/unpin the code section.
worksheets = tableau.extensions.initializeAsync().then(() => tableau.extensions.dashboardContent.dashboard.worksheets)
data = worksheets[0].getSummaryDataAsync()
sheet1 = data.data.map(row => {
var tmp = {}
data.columns.map((col, col_index) => {
tmp[col.fieldName] = row[col_index].value
})
return tmp
})
Step 5: Use any Observable Notebook cell/imports as needed for your analysis
We can build complex bespoke data visualizations using JavaScript within Tableau without having to open any other tools now!