Skip to content

Using a reactive javascript sql result in a mosaic plot #1747

Answered by Fil
oscaro00 asked this question in Q&A
Discussion options

You must be logged in to vote

OK I see it now. That problem is discussed here and @mbostock shows a solution
#1598 (comment)

Adapting Mike's solution to the launches example:

```js echo
import * as vgplot from "npm:@uwdata/vgplot";

const db = await DuckDBClient.of({launches: FileAttachment("data/launches.csv")});
const sql = db.sql.bind(db);

const coordinator = new vgplot.Coordinator();
const vg = vgplot.createAPIContext({coordinator});
coordinator.databaseConnector(vgplot.wasmConnector({duckdb: db._db}));

const test_query = sql([`
CREATE TABLE interactive_tbl AS (SELECT * FROM launches
  WHERE state IN ('United States'))
`]);
```

However it's not going to be fully reactive. If 'United States' is selected with an i…

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
7 replies
@oscaro00
Comment options

@Fil
Comment options

@oscaro00
Comment options

@Fil
Comment options

Answer selected by oscaro00
@oscaro00
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants