Giter Site home page Giter Site logo

webdataconnector's Introduction

Tableau Web Data Connector SDK

Tableau Supported Coverage Status Build Status

Use the Tableau Web Data Connector (WDC) to connect to web data sources from Tableau. This is the repository for the Tableau WDC SDK, which includes developer samples and a simulator to help you create your connectors.

Visit the project website and documentation here.

Want to contribute to the WDC? See our contribution guidelines.

webdataconnector's People

Contributors

austinderrick avatar benlower avatar brandonjbjelland avatar chenteng2016 avatar d45 avatar dduubb avatar dlev- avatar dtreskunov avatar iahmedani avatar iameap avatar illonage avatar interworks-morr avatar jagreene avatar jcopenha avatar jdomingu avatar jimmy-jia avatar juracyamerico avatar k504866430 avatar keshiarose avatar lbrendanl avatar leozusa avatar lshpaner avatar maxrandolph avatar muthukumarsm avatar raqbit avatar rarandall avatar sdesmond46 avatar smarvin avatar thakarevb avatar theoutlander avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

webdataconnector's Issues

Document log file locations?

Two items here:

  • Document where the tabprotosrv.txt and log.txt can be found by default and what will be in each one (interactive vs. data).
  • Add a link out to the new Tableau Log Viewer tool on github.

Need to use MSSQL package but unable to do so

Hello,

I want to use additional npm pckage "mssql" but when I add statement var sql = require('mssql');, it gives me error that require is unknown.

May I know if I can add this package at the start of npm or in wdc-simulator.js somewhere?

Properties are not cleared when using a new connector

The information under the properties area of the simulator (Connection Name, Connection Data, etc) are not reset when you use a new connector. For instance, if you use the Earthquake Multitable connector followed by a connector that does not set either the Connection Name or Connection Data, the values from the previously simulated WDC still appear.

Problems when passing table.appendRows around (v2)

Finally digging into the v2 API and ran into my first issue with the SDK.

Currently at line 160, we have this method:

_tableau.Table = function(tableInfo, incrementValue) {
  _tableau.validateTableInfoObj(tableInfo);

  this.tableInfo = tableInfo;
  this.incrementValue = incrementValue || "";
  this.appendRows = function(data) {
    // Call back with the rows for this table
    _tableau._tableDataCallback(this.tableInfo.id, data);
  }
};

Unfortunately, if I pass around table.appendRows as a callback within my own code, I can get an error stating that I can't read property id of undefined as my getData callback is invoked.

Pretty straightforward fix:

_tableau.Table = function(tableInfo, incrementValue) {
  _tableau.validateTableInfoObj(tableInfo);

  this.tableInfo = tableInfo;
  this.incrementValue = incrementValue || "";
  this.appendRows = function(data) {
    // Call back with the rows for this table
    _tableau._tableDataCallback(tableInfo.id, data); // <-- Right there.
  }
};

out of date issue with google spreadsheet web data connector

I had created a google spreadsheet and published it to web so that it becomes public.
Pulled the data into tableau using web data connector. Published the workbook. Now when I am trying to refresh the workbook, it gives me an error that it is out of date.

web dataconnector--xmlconnector

i found it seems can not parse a xml document with xmlconnector, there are some data will be lost,for example,the data---_SENTIMENT (MIXED,NEGATIVE,NEUTRAL,POSITIVE) in the document as bellow is missing,i don't know how to modify the code, what should i do,kindly please give some advice.thanks very much.

xml_data.txt

Bring back src query parameter to default WDC loaded in simulator

What happened to the src query parameter in the simulator auto-populating the URL? Looks like it was documented in #82, but then got removed somewhere along the way.

It'd be super handy to bring back, I'm trying to standardize a few things in the Web Data Connector Generator like so:

# Runs npm start on WDC, npm start on Simulator, opens simulator + WDC in default browser
npm run simulate

# Same, but instead of npm start on the WDC, it runs grunt / grunt watch
npm run simulate:dev

Variable Domains and Aliases

I am working with Tableau WDC API and testing it on Tableau 10.0.2. This is my situation:

  • I was able to set columnRole for each column in my tables depending on whether the variable has classifications or not.
  • If I go to Tableau’s working sheet I can see my columns grouped into measures and dimensions based on the columnRole attributes I set in the connector, which is correct.

However, I noticed these:

  • If I skip the columnRole step in my connector, then the variables in tableau are grouped into dimensions and measures based on their data types. String variables are automatically added to dimensions while numeric variables are added to measures.
  • In tableau, if I take a measure variable and convert it to dimensions, and right click on the converted variable, I can see the “Aliases...” option, where I can see the domains (Member) and values associated to this variable.
  • On the other hand, if I have the columnRoles set in my connector, the variables are grouped in dimensions and measures as expected. In this case, however, right-clicking on the dimension variables omits the “Aliases…” option.
  • It seems like “converting a variable from measures to dimension” is the step that computes the domains of the variable being converted, whereas, if we skip this step, tableau does not automatically recognize the domains.

So, the questions are:

  • How can I set up my connector to make sure that tableau will automatically recognize the domains of my dimension variables?
  • Once I have set the domains (Member) on dimension variables, is there any way I can set aliases (Values) on those domains?

Thank you.

Dimensions vs Measures

I noticed that if I don't specify columnRoles while loading schema, then all variables with float or int data types are automatically classified as measures in Tableau. On the other hand, variables with string data types are classified as dimension in Tableau.
However, when I change my connector to specify the columnRoles and assign dimensions to those variables with number data types while I assign measures to the variables with string data types nothing changes in tableau i.e it looks like the columnRole field is ignored by Tableau.

Is this an intended behaviour? If not, how can one enforce the dimension and measures of variables?

Backwards Compatibility with older Tableau Versions

Receive the following error when accessing from 9.2:
"The version of Tableau that you are using cannot use the web data connector that you are trying to access. The connector requires at least version '1.1.1' of the web data connector API."

Is there a way to maintain backwards compatibility with the older API?

Simulator "Fetch Data" State Misleading

When I have multiple tables in the simulator and I click "Fetch Table Data" for one of them, I see that it does get the data for just that table. But all the Fetch buttons get a little spinner so it LOOKS like it is fetching all of them even though I selected just one.

Document getData call ordering.

When using multiple tables, we do not guarantee a deterministic ordering of the getData calls. It depends on many factors, such as what order the user dragged the tables to the data prep canvas, and what structure the join is.

However, the base table, the left most table in the join structure, will always be called for first.

This could be added to the FAQ potentially.

Switch samples to use updated wdc library

Instead of continuing to use the tableauwdc-2.0.0-beta.js file, we should be using one of these files. We shoudl use .latest for our samples, but probably stick with non-minified for readibility sake.
https://connectors.tableau.com/libs/tableauwdc-2.0.5.js
https://connectors.tableau.com/libs/tableauwdc-2.0.5.min.js
https://connectors.tableau.com/libs/tableauwdc-2.0.latest.js
https://connectors.tableau.com/libs/tableauwdc-2.0.latest.min.js

Examples won't run, error: "Looks like WDC is calling a tableau function before tableau.init()"

I ran into this issue in my local test environment, then verified that it occurs in the hosted examples, too. From this URL: https://tableau.github.io/webdataconnector/Examples/StockQuoteConnector_final.html
Enter a ticket eg. DATA
Click "Get Stock Data"
Observe error in console:
Looks like the WDC is calling a tableau function before tableau.init() has been called.

This is on a Mac, using Chrome (version 49). I tried an incognito window too, same error.

stock_quote_connector-error

Scraping more than 1 year causes error - StockQuoteConnector_final.html

The example WDC works for retrieving Yahoo Finance data for a single stock, for 1 year back.

Modifying line 44 to start back either -2 or -3 years causes the script to fail, with error "no result found for ticker symbol: xxx".

Any ideas why this is so? The Yahoo finance API appears to support multi-year queries.

Tableau does not recognize the version of the web data connector API.

Started going through the Examples in the dev branch (which use https://connectors.tableau.com/libs/tableauwdc-2.1.1.js) with a connector from within Tableau 10.0.2 (10000.16.1004.1720) 64-bit Mac and get the error:

An error occurred while communicating with the data Source. Tableau does not recognize the version of the web data connector API. Show Details: The version of Tableau that you are using cannot use the web data connector that you are trying to access. The connector requires at least version '2.1.1' of the web data connector API.

If I substitute https://connectors.tableau.com/libs/tableauwdc-2.1.1.js in the earthquakeUSGS.html with https://connectors.tableau.com/libs/tableauwdc-2.0.beta.js it works fine using a Web Data Connector from within Tableau.
screen shot 2016-10-21 at 11 02 55 am

In short it's erring out while at the same time telling me I need to use 2.1.1 which I am using...

Simulator should not have hardcoded Python paths for Windows, and need documentation to run simulator locallt

The simulator batch file - start_server_windows.bat has hardcoded paths to the Python executable.

I think it should simply require that 'python.exe' is somewhere in the system PATH, and simply invoke it. No need to look for specific directories.

Alternatively, it could require a PYTHON_HOME environment variable be set that gives the location of python.exe.

Finally - there does not seem to be any documentation of running the simulator locally. If this is a supported option, there needs to be some basic instructions on how to use it.

Errors loading schemas

I noticed this error and I wanted to see if you know where it might be coming from.

A bit of background: I have a web api that I hit and returns data, variables and classifications (codes) in a json format. So, my connector expects to load multiple tables. I have implemented a web connector which works correctly on the simulator. When run on tableau desktop (version 10.0.1, trial), I get the following errors:

Either invalid data are present or required fields are empty for class TableInfo. Required fields and respective data types are: { (Name : 'id', Type : QString, IsRequired : true), (Name : 'columns', Type : QVariantList, IsRequired : true), (Name : 'alias', Type : QString, IsRequired : false), (Name : 'description', Type : QString, IsRequired : false), (Name : 'incrementColumnId', Type : QString, IsRequired : false) }.

The error is thrown as "Reporting data source exception. Type='WDCInvalidData' message='...'

This seems to happen only when I am loading more than 2 tables. If I have just one table or 2 I don't get any error and everything works fine. The error I am getting isn't really that descriptive/ helpful. For what I can gather, this error is thrown by Tableau desktop when it's putting the table schemas in place.

Given the fact that my connector works just fine for any number of tables on the simulator and works correctly on Tableau desktop for two tables max, I wonder if this might be a tableau limitation for trial versions.

Earthquake multi table sample fails in Tableau

The earthquake multitable sample fails in Tableau. This is because the ids it uses for it's column does not match the accepted format for ids in Tableau (I believe having underscores was the offender here).

As a side note: Date pickers in the QT WebKit do not function (at least on Mac). You can still manually enter a date though.

Add full page for debugging WDCs

Add debugging tips, including info about:

  • The not supported debugger
  • Where to add breakpoints--both in the simulator page and the popup depending on the phase
  • Using ?src= to maintain the same connector in the simulator

Simulator doesn't ignore 'tableau.submit' in gatherData phase

In Tableau, this is a valid code snippet:

myConnector.init = function(initCallback) {
  initCallback();
  tableau.submit();
}

This auto submits a connector so no interactive phase is required. In the data gathering phase, this submit call is ignored. However in the simulator this causes the simulator to get into an infinite loop.

Update doc links to point to master when dev merges into master

As the docs are in beta until the upcoming release of Tableau 10, the links in the docs will point to the dev branch of the webdataconnector repo.

When we merge dev into master with the release of Tableau 10, we will need to update these links. This is a place holder for that. Only location I am currently aware of this is the Samples section in the docs. But we should do a grep for more locations.

Lifecycle diagram needs to updates

The lifecycle diagram needs two updates:

  1. table.addRows(data) should be table.appendRows(data)
  2. The arrow between dataDoneCallback and connector.getData is meant to indicate that getData is called once for each table. However, this is not specified. We should clarify and also add an spin loop for appendRows to indicate that append rows can be called multiple times, this is how you would do paging.

Tableau log not displayed

The 1.1.0 version of the WDC simluator displays messages written with tableau.log in the bottom area of the Simulator UI.

I see that tableau.log is still part of the WDC 1.1.1 API, but none of the message being written are displayed anywhere. Is there something I need to do to display the tableau log?

Connector works in simulator but hangs in Tableau

I've got a connector that streams data from REST API. It works as expected in the provided simulator . When I load the connector into Tableau 10, I go through the credentials page successfully and then I get stuck at this page:

screen shot 2016-08-22 at 11 09 04

Clicking cancel results in the following being displayed indefinitely:

screen shot 2016-08-22 at 11 09 57

I have to kill Tableau to get out of this screen. The connector file is hosted on a remote server (I couldn't find a way to point Tableau to a local file), while Tableau and the data API are running on localhost for dev purposes. The connector code is

(function (){
    var myConnector = tableau.makeConnector();

    setupConnector = function (){
        tableau.connectionData = {server: "http://127.0.0.1:8081", token: "hello"};
        tableau.connectionName = server + token.substring(0, 5);
    };

    myConnector.getSchema = function (schemaCallback){
        var params = tableau.connectionData;
        var cols = [];
        var apiURL = params.server + "/api/component?target=schema&access_token=" + params.token;

        $.getJSON(apiURL, function (resp){
            cols.push({
                    'id': 'hello',
                    'alias': 'alias',
                    'dataType': tableau.dataTypeEnum.int
                });
        }).success(function (){
            var tableInfo = {
                id: "Data Feed",
                alias: "Read data from API",
                columns: cols
            };

            schemaCallback([tableInfo]);
        });
    };

    myConnector.getData = function (table, doneCallback){
        var params = tableau.connectionData;
        var apiURL = params.server + "/api/component?access_token=" + params.token;

        var getMoreData = function (){
            $.getJSON(apiURL, function (resp){
                if (resp == "Come back later"){
                    doneCallback();
                }
                else{
                    if (!resp.length){
                        console.info("No new data has been fetched.");
                    }
                    table.appendRows(resp);
                    getMoreData();
                }
            });
        }

        getMoreData();

    };

    tableau.registerConnector(myConnector);

    $(document).ready(function (){
        $("#submitButton").click(function (){
            setupConnector();
            tableau.submit();
        });
    });
})();

Add instructions for how to serve jekyll docs locally.

To make contributions to the Docs, devs will need to serve the jekyll documentation locally. This can be done through:

  • Get the gh-pages branch in your fork
  • Make sure you're running ruby >= 2.0.0
  • Run bundle install
  • Run bundle exec jekyll serve

Array for..in and missing Array.includes

While these are two separate issues, the second only appears when trying to make a work around for the first. In developing a WDC for Tableau, I noticed two issues with the Tableau internal browser's javascript engine (while running in Public and Desktop).

  1. The following function is not defined: Array.prototype.includes
    While this is reletively new to the JS spec, a few libraries that I am using depend on this function. To get around this, I polyfilled it like so: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes
    This works great and functions as intended on my arrays. However...
  2. The for(a in b) clause does not work as per W3 specification. Specifically, after adding Array.prototype.includes, the function then is treated as an element in that iteration for any array.

For example. Try the following code (after adding in the includes polyfill above):

(function (){
  var arr = ["a","b","c"]
  for (var x in arr) {
    console.log(x.toString() + ": " + arr[x]);
  }
})();

The console will output:

"0: a"
"1: b"
"2: c"
"includes: function (searchElement) {........"

Using this same code on a modern browser does not have this effect. (It does not iterate over the key "includes")

Because of this, I can not use my libraries (which depend on both includes and for..in to be correctly implemented) and thus can not complete my WDC.

Code Coverage Doesn't Reflect Files Which Aren't Included

Seems like a know issue with the --all flag in, nyc our coverage provider. Currently the flag raises an error and stops all tests, but once their issue is fixed we should add it to the unit:coverage and unit:coveralls npm commands to have our PRs more accurately display our code coverage stats.

Caching issues in the simulator

Here are some things we can try:

  • Add more meta tags to disable caching stackoverflow
  • Add -c-1 to the http-server command in package.json http-server docs
  • Worst case: add docs for using Chrome to empty the cache and hard reload. Maybe add docs anyway to identify when you have a caching issue.

WebDataConnector failing

npm install has these errors:
npm WARN deprecated [email protected]: this package has been reintegrated into npm and is now out of date with respect to npm
npm WARN deprecated [email protected]: to-iso-string has been deprecated, use @segment/to-iso-string instead.
npm WARN deprecated [email protected]: Jade has been renamed to pug, please install the latest version of pug instead of jade
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue

And npm start does not run. The node_modeles/ directory is empty.

Docs is missing the locale feature for 2.0

With the V2.0 API, we have added support to read locale information from Tableau. In Tableau, the user can set the locale of the product by going to Help -> Choose Language.

We now pass this information to the WDC through the tableau.locale property. This allows the WDC to serve up localized content.

We need to add this to the API reference.

Docs is missing "open in external browser" feature

In the new version of WDC with Tableau 10, you can now open URLs from your web data connector pages in an external browser. In your WDC HTML page, for any url that you wish to be opened in an external browser, add the target="_blank" property to the anchor element. For example:

<a href="http://tabsoft.co/wdc" target="_blank">Hello Docs?</a>

This link would open in the user's default browser (chrome, firefox, etc.), instead of redirecting the in Tableau browser.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.