duckdb-wasm-examples / observableplot-svelte-typescript

Using DuckDB-Wasm to query a parquet file and plot the results using Observable Plot.

Repository from Github https://github.comduckdb-wasm-examples/observableplot-svelte-typescriptRepository from Github https://github.comduckdb-wasm-examples/observableplot-svelte-typescript

DuckDB-Wasm + Observable Plot + Svelte & TypeScript

Screenshot of output

Using DuckDB-Wasm to query a parquet file and plotting the results using Observable Plot.

Svelte is used, although this example should generalize well to other frameworks using Vite.

Recommended IDE Setup

VS Code + Svelte.

How to run

  1. Clone repository to local machine
  2. Install dependencies with npm i
  3. Open browser at http://localhost:5173/

Sources

  1. Most of the DuckDB interface code is based off the sveltekit-typescript example
  2. The parquet file comes from Voltron Data's nyc-taxi-tiny dataset, which they host freely. They have an awesome tutorial on how to access the entire dataset as part of the vignette for the {arrow} R package.
  3. The scaffolding for this repository is provided by Vite's svelte-ts template. A new project with this template can be created using npm create vite@latest myapp -- --template svelte-ts.

About

Using DuckDB-Wasm to query a parquet file and plot the results using Observable Plot.


Languages

Language:Svelte 43.2%Language:TypeScript 23.9%Language:CSS 23.0%Language:HTML 6.3%Language:JavaScript 3.6%