zarino / plot-a-graph-tool

A ScraperWiki tool for making graphs out of datasets.
0 stars 2 forks source link

Uncaught TypeError: Cannot read property 'table' of undefined #13

Open frabcus opened 11 years ago

frabcus commented 11 years ago

I get a mainly blank page, and this error message in the console.

code.js:214
Uncaught TypeError: Cannot read property 'table' of undefined code.js:65

On this "UN peackeeping stats" scraper in my datahub: https://beta.scraperwiki.com/dataset/c5jrnyq/view/asnpodi

frabcus commented 11 years ago

This is because I have an empty table.

frabcus commented 11 years ago

So I guess that it should check for result[0] having length 0, and somehow show as an empty table in that case.

IanHopkinson commented 11 years ago

Just encountered this on the Romanian dataset. Output of the meta-endpoint was

{"table": {"swdata": {"columnNames": ["company_id", "name", "status", "status_words", "status_date", "year", "total_equity", "social_capital", "turnover", "gross_loss", "net_loss", "employees", "activity", "gross_profit", "net_profit", "post_value"], "type": "table"}, "_missing_fields": {"columnNames": ["field_name", "company_id", "year", "post_value"], "type": "table"}, "_perfect": {"columnNames": ["scape_time", "company_id"], "type": "table"}, "_view_field_count": {"columnNames": ["field_name", "count(*)"], "type": "view"}, "_num_missing_by_report": {"columnNames": ["company_id", "year", "num_missing_fields"], "type": "view"}}, "databaseType": "sqlite3"}