---
url: /mosaic/examples.md
---
# Examples

Mosaic-powered visualizations created with [vgplot](/vgplot/).
These visualizations can be specified using a JavaScript or Python API, or in a standalone YAML or JSON file. Each example includes code for all four specification formats.

For example, here is a line chart of historical Apple stock prices:

```py \[Python]
import vgplot as vg

aapl = vg.parquet("data/stocks.parquet", where="Symbol = 'AAPL'")

view = vg.plot(
    vg.line_y(aapl, x="Date", y="Close"),
    vg.width(680),
    vg.height(200),
)

```

::: warning
By default Mosaic connects to a DuckDB server. To use a different database connector (such as DuckDB-WASM in the browser), you must first configure the connector. For example:

```js
import { coordinator, wasmConnector } from "@uwdata/vgplot";
coordinator().databaseConnector(wasmConnector());
```

:::

::: tip
For greater scalability and performance, consider using a local [DuckDB data server](/duckdb/) or viewing examples in [Jupyter](/jupyter/).
:::
