Published
Edited
Apr 10, 2019
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
viz = {
let oldViz = window.tableau.VizManager.getVizs()[0];
if (oldViz) {
mutable vizLoaded = 0
oldViz.dispose();
}
yield new tableau.Viz(placeholderDiv, url, options);
}
Insert cell
workbook =
{
if (vizLoaded == 1) {
yield viz.getWorkbook();
}
}
Insert cell
Insert cell
Insert cell
workbook.getParametersAsync().then(
function(params) {
return params.get("Parameter").getAllowableValues()[0].formattedValue
})
Insert cell
list=workbook.getParametersAsync().then(
function(params) {
var Parameter= params.get("Parameter");
var allValues=[];
var pas;
for (pas = 0; pas < Parameter.getAllowableValues().length; pas++) {
var str = Parameter.getAllowableValues()[pas].formattedValue;
allValues.push(str);
}
return allValues;
}
)
Insert cell
Insert cell
Insert cell
Insert cell
timer =
{
let i=0; //First year in the dataset
while (vizLoaded == 1)
{
await Promises.delay(3000);
yield filterViz(i > list.length? i=0:i+=1); //We loop through every value in Parameter
}
}
Insert cell
filterViz = (Frame)=>{
workbook.changeParameterValueAsync("Parameter",list[Frame])
;
}
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more