Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Andre de Vries andre347

🏠
Working from home
View GitHub Profile
@andre347
andre347 / index.html
Created Oct 12, 2018
Tableau Extension: Step 2
View index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Data-Refresh Tableau</title>
</head>
@andre347
andre347 / index.html
Created Oct 12, 2018
Tableau Extension: Step 3
View index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Data-Refresh Tableau</title>
</head>
@andre347
andre347 / index.html
Last active Oct 13, 2018
Tableau Extension: Step 4
View index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Data-Refresh Tableau</title>
</head>
@andre347
andre347 / index.html
Created Oct 13, 2018
Tableau Extension: Step 5
View index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Data-Refresh Tableau</title>
</head>
View DataRefresh.trex
<?xml version="1.0" encoding="utf-8"?>
<manifest manifest-version="0.1"
xmlns="http://www.tableau.com/xml/extension_manifest">
<dashboard-extension id="com.theinformationlab.extensions.datarefresh" extension-version="1.0.0">
<default-locale>en_US</default-locale>
<name resource-id="name"/>
<description>Data refresh of Tableau Dashboards</description>
<author name="Andre de Vries" email="andre.devries@theinformationlab.co.uk" organization="The Information Lab" website="https://www.theinformationlab.co.uk"/>
<min-api-version>0.8</min-api-version>
<source-location>
@andre347
andre347 / app.js
Created Aug 20, 2019
Tableau getFilterValues
View app.js
function initializeViz() {
const url = "https://public.tableau.com/views/RegionalSampleWorkbook/Storms";
const div = document.getElementById("container");
let options = {
// when the viz has finished loading get the workbook
onFirstInteractive: () => {
let workbook = viz
.getWorkbook()
.getActiveSheet()
.getWorksheets()
View index.html
<!-- loading the tableau js file -->
<script src="https://public.tableau.com/javascripts/api/tableau-2.min.js"></script>
<!-- setting up the containers for the tableau viz and the buttons -->
<!-- we assign IDs so we can grab on to them in JS -->
<!-- we also add some styles which mean the buttons show up on the right hand side of the dashboards -->
<div id="rootTableau" style="display: flex;">
<div id="vizContainer"></div>
<div
id="buttonContainer"
style="display: flex; flex-direction: column;"
View app.js
const getData = document.getElementById("getData");
let pablosData = [];
async function fetchData() {
const value = document.getElementById("valueForURL").value;
if (value) {
console.log("Getting the data...");
const url = `https://servicios.ine.es/wstempus/js/ES/DATOS_METADATAOPERACION/EPA?g1=115:&&g2=18:454&&g3=3:283910&&g4=141:21387&&p=3&&nult=${value}&&tip=A`;
const resp = await fetch(url);
You can’t perform that action at this time.