rclement / datasette-dashboards

Datasette plugin providing data dashboards from metadata
https://datasette-dashboards-demo.vercel.app
Apache License 2.0
137 stars 7 forks source link

[Datasette 1.0] `renderTableChart` needs to be updated to support the new Datasette 1.0 JSON API #162

Closed king7532 closed 1 year ago

king7532 commented 1 year ago

Using datasette-dashbaords 0.6.1 library: table with Datasette 1.0a3 or 1.0a4 fails to render and gives following Javascript error:

Unhandled Promise Rejection: TypeError: undefined is not an object (evaluating 'data.columns.forEach')
dashboards.js:234

The new Datasette 1.0 JSON API does not have a columns property anymore. Here's an example of new JSON:

{
  "ok": true,
  "rows": [
    {
      "Parameter": "my-parameter",
      "None": 123,
      "Some": 456,
      "Many": 90
    }
  ],
  "truncated": false
}
rclement commented 1 year ago

Thanks @king7532 for reporting this issue!

PR #163 should make datasette-dashboards compatible with the new JSON API introduced by Datasette 1.0a3.

rclement commented 1 year ago

Fix is included in version 0.6.2