Scripts or plug-ins for Tableau?

Kevin H. Lin picture Kevin H. Lin · Sep 12, 2013 · Viewed 11.9k times · Source

Can one write plug-ins for Tableau? Is Tableau equipped with any sort of general-purpose scripting language?

e.g., for generating visualizations that cannot be created using the default Tableau tools, or for doing k-means clustering on a dataset using various metrics, etc...

Answer

Alex Blakemore picture Alex Blakemore · Sep 12, 2013

Tableau has several extension points at the moment.

  • If you publish to Tableau Server, On-Line or Public, then you can use Tableau's JavaScript API to interact between your web app client and the Tableau visualization. Your javascript can be notified of events in the Tableau viz, and also effectively command it.
  • Instead of using the JavaScript API, you can include URL query parameters to pass filters, adjust the sizes and control a few other aspects. Similarly, you can append a format string like ".png" or ".pdf" or ".csv" to request a static snapshot in a particular format instead of an interactive object. You can't control as much via the URL as you can via the Javascript API, but the URL approach is very simple and easy for common cases.

  • With both Tableau Server visualizations and Tableau desktop visualizations, you can create URL actions, so that users can select data and then cause HTTP GET requests to URLS that are based on info in the selected data.

  • If you have a data source that Tableau doesn't yet provide a driver for (there are many including ODBC), then you can write a program using their data extract API to extract data from your custom source and make it available to Tableau. You can also publish that source to Tableau server as frequently as needed to keep your visualizations current.

  • If you have specialized functions on your database server, you can access them from Tableau calculations using their SQL pass through functions. You can also define a Tableau connection using arbitrary custom SQL which gives you another place to insert customizations.

  • Version 8.1 added integration with R so you can call R scripts from Tableau calculated fields.

  • Version 8.2 added a REST API to Tableau Server for administrative functions

  • Version 9.1 adds a Web Connector that is designed to let you provide custom code to connect to web accessible data sources

  • Version 10.1 Tableau added TabPy a local HTTP Python server that lets you execute Python functions from Tableau in the same way you can call R functions. The same hooks have now been extended to allow calls to Matlab functions.

  • There are also command line programs, tabcmd and tabadmin, that work with Tableau server that you can use to send commands to the server from your own scripts, but the REST API may be more convenient in many cases.

  • Tableau released several open source libraries, tools and examples at https://github.com/tableau One of these libraries, the document API, allows you to programmatically modify some attributes of Tableau workbook files.

  • Tableau released an extensions API in 2018 to allow developers to add custom functionality to Tableau dashboards.

  • Version 2019.3 adds a MetaData API using GraphQL to allow clients to query for information about the fields, types and attributes available in data sources published to Tableau Server's data catalog.

Hopefully, they'll continue to add additional APIs and integration hooks, but those are most of the options available now.