The first thing you should notice about this blog post is, that it has got a highly precise name “Tableau Wafer Extension”, but the word “Framework” attached to it. The reason is, this Tableau Extension solves a highly specific problem, but it can be leveraged to solve way more challenges!!! Therefore don’t look at it as a single highly specific Extension, but focus on the different modules and what they’re doing and think about your own scenarios where:
- Using selected marks to trigger something outside of Tableau,
- Generating images on-demand,
- Visualizing images in a certain context,
- Sending JSON data from your Extension to a WebService,
- Calling a Python script from your Extension or
- Writing enriched data back data into a database
would be of value!
How can I get it?
High Level Architecture
First 7minutes: Use Case Description + Wafer Extension Demo. The rest of the time is focusing on a Technical Deep Dive into it in order to let your tech-guys adjust it to your needs.
- Tableau Desktop (2020.2 and higher)
- Port 5000 needs to be open/free (Flask Webserver)
- Postgres database v11 (v12 not yet supported as of post date)
- Postgis installed
- Python 3.8 mit Anaconda
- Admin rights
- Download this Github repostory
- with the Tableau Extension
- the TREX manifest file which points to the Tableau Extension
- The v2020.2 Tableau Workbook
- Python file with Flask Webserver
- Extract somewhere on your machine
- Install Python 3.8 with Anaconda (leverage this ENV file for all the library dependencies: wafer_ext_env)
- Follow up with “Setting up the database” section
Setting up the database
Please install a Postgres database with Postgis and leverage the following CREATE TABLE statements to create the tables within Postgres to let the Extension write data into it once a user selects data points:
(Windows users can find detailed step-by-step instructions from Ludwig Ehlert within this PDF of how to install Postgres 11 with all the packages required to support also the “Geo-Feature” from the lower left of the dashboard)
CREATE TABLE public.wafer ( id integer NOT NULL, wafer_id character varying COLLATE pg_catalog."default", feature character varying COLLATE pg_catalog."default", method character varying COLLATE pg_catalog."default", CONSTRAINT wafer_pkey PRIMARY KEY (id) ) WITH ( OIDS = FALSE ) TABLESPACE pg_default; ALTER TABLE public.wafer OWNER to admin;
-- Table: public.wafer_geom -- DROP TABLE public.wafer_geom; CREATE TABLE public.wafer_geom ( poly_index integer, level double precision, area double precision, wafer character varying COLLATE pg_catalog."default", poly_geom geometry(Polygon,4326), id integer ) WITH ( OIDS = FALSE ) TABLESPACE pg_default; ALTER TABLE public.wafer_geom OWNER to admin; -- Index: join_id_wafer_geom -- DROP INDEX public.join_id_wafer_geom; CREATE INDEX join_id_wafer_geom ON public.wafer_geom USING btree (id ASC NULLS LAST) TABLESPACE pg_default;
-- Table: public.wafer_grid -- DROP TABLE public.wafer_grid; CREATE TABLE public.wafer_grid ( id bigint, x integer, y integer, level double precision ) WITH ( OIDS = FALSE ) TABLESPACE pg_default; ALTER TABLE public.wafer_grid OWNER to admin;
-- Table: public.spatial_ref_sys -- DROP TABLE public.spatial_ref_sys; CREATE TABLE public.spatial_ref_sys ( srid integer NOT NULL, auth_name character varying(256) COLLATE pg_catalog."default", auth_srid integer, srtext character varying(2048) COLLATE pg_catalog."default", proj4text character varying(2048) COLLATE pg_catalog."default", CONSTRAINT spatial_ref_sys_pkey PRIMARY KEY (srid), CONSTRAINT spatial_ref_sys_srid_check CHECK (srid > 0 AND srid <= 998999) ) WITH ( OIDS = FALSE ) TABLESPACE pg_default; ALTER TABLE public.spatial_ref_sys OWNER to postgres; GRANT ALL ON TABLE public.spatial_ref_sys TO postgres; GRANT SELECT ON TABLE public.spatial_ref_sys TO PUBLIC;Open up the "json_io.py" within the 7Zip file within a text editor and adjust the rows underneath "#####DB info" so that they do exactly match with your database setup.
Ready. Set. Go!
Ready. Set. Go!
You can finally start your Flask WebServer which is part of the “json_io.py” script. For Windows open up Anaconda command line console as Administrator and type in the following commands (for Linux users: you know what you’re doing! 😉
cd C:\<THE PATH WHERE YOU EXTRACTED THE WAFER EXTENSION TO> conda activate flask set FLASK_ENV=development python json_io.py
Now you should be all set! So please open up the Tableau Workbook within the 7Zip file and repeat what you can find within the demo video section.
- If you run into issues please try to change the locale settings of the laptop you’re running the Tableau Workbook on to English (United States)
- Make sure port 5000 is free
- Check the logs within the Anaconda console
- Debug the Tableau Extension similar to how I demonstrated it within this video:
- With these steps in mind, please ask questions within the commenting area underneath if you’re having other issues in getting the Extension up and running