Packages
datasette-charts 0.2a1 & datasette-agent 0.7a1: Full-Table SQLite Charts, URL Fragment Sync, and Plugin Architecture
Simon Willison released datasette-charts 0.2a0/0.2a1 and datasette-agent 0.7a1 on November 24, 2026, wiring natural-language chart generation into Datasette's SQLite explorer. Unlike legacy plugins such as datasette-vega that charted only the first 100 paginated rows, datasette-charts compiles every visualization to a full-table SQL GROUP BY query capped at 5,000 output rows and syncs chart state via URL #fragments. Here is how the plugin works, its permission model, and its alpha limitations.
8 min read
datasette-charts 0.2a1 & datasette-agent 0.7a1: Full-Table SQLite Charts, URL Fragment Sync, and Plugin Architecture
Executive Summary
On November 24, 2026, Simon Willison shipped datasette-charts 0.2a0 / 0.2a1 alongside datasette-agent 0.7a1 in the Python/PyPI Datasette ecosystem (Simon Willison's Weblog, GitHub). Released just one day after the initial 0.1a0 launch on November 23, 2026, this update bridges Datasette's new full-table SQLite charting engine with its LLM-powered Datasette Agent side panel—allowing users to request visualizations in natural language, open them in an interactive chart builder, and keep the AI agent aware of manual chart edits via URL #fragment hash synchronization.
Unlike legacy Datasette plugins such as datasette-vega, which silently charted only the currently paginated HTML slice (typically 100 rows), datasette-charts compiles every visualization into a SQL GROUP BY, time-bucketing, or window-function query that aggregates across the entire table or query result set before returning at most 5,000 aggregated rows to a bundled Observable Plot + D3 frontend (GitHub README). Both packages remain in alpha (0.2a1 and 0.7a1), with specific unbuilt spec features—such as background profile persistence and automatic chart verification—that teams should understand before deploying to production SQLite instances.
Adoption Telemetry & Version Changelog
datasette-charts and datasette-agent extend Datasette, Simon Willison's open-source Python tool for exploring and publishing SQLite databases on the web:
- Package Versions & Dates (Verified November 24, 2026):
datasette-charts:0.1a0shipped November 23, 2026;0.2a0and bug-fix0.2a1shipped November 24, 2026 (GitHub Releases).datasette-agent:0.7a1shipped November 24, 2026 (Release Notes), adding fragment-hash iframe navigation specifically to supportdatasette-charts0.2a0/0.2a1.
- Ecosystem Context: The
datasette/datasette-agentrepository holds 124 GitHub stars (Datasette GitHub), while companion agent plugins such asdatasette-agent-edit(0.2a0) require Python >= 3.11. - Related Ecosystem Releases (Nov 23–24, 2026): Alongside
datasette-charts, Willison shippedllm-glm 0.1,ready-for-datasette 0.2,datasette-remote-metadata 0.2,datasette-cluster-map 0.19.1, anddatasette-psutil 0.2.1, following the recent Datasette 1.0 milestone (addingResponse.stream()for TSV/CSV exports and patching a private stored-query disclosure advisory) andsqlite-utils4.0 (schema migrations,db.atomic(), and compound foreign keys).
Security Patches, Breaking Changes & Internals
How Full-Table SQL Compilation & Profiling Work
When a user opens any Datasette table, view, or SQL query page, datasette-charts renders a Charts panel at the top with ranked chart suggestions, thumbnails, and a manual builder:
- Inline Table Profiling: To propose relevant charts without scanning billion-row tables synchronously,
datasette-chartsprofiles the source inline under Datasette'ssql_time_limit_ms. Sources up to 50,000 rows and 1,000,000 cells are profiled in full; larger sources fall back to a sample of up to 10,000 rows (evenly distributed for tables, or the first 10,000 rows for views, queries, and filtered tables), displaying a notice in the UI when sampling occurs. - SQL Aggregation Over Every Row: While suggestions use sampling on large tables, rendering a chart compiles a SQL query (
GROUP BY, time bucketing, window functions) across every row in the source—respecting active column filters (?state=CA,?price__gt=5,?_search=,?_where=,?_through=) and facets—and caps the returned JSON payload at 5,000 rows for Observable Plot + D3 rendering. - Zero-Network Bundled Assets: Both Observable Plot and D3 are vendored locally inside
datasette_charts/static/vendor/, and the built-in map chart renders over a coarse world land outline without external network requests. - URL
#FragmentState & Agent Sync (0.2a1+0.7a1): Every active chart configuration is serialized into the page's URL#fragment. Indatasette-agent 0.7a1, the agent's iframe side panel tracks fragment-hash changes—so when a user opens a chart generated by#statschat, pivots to another table in the builder, and asks "what does the chart show?", the agent reads the updated panel state and describes the new chart.
flowchart LR
A[User Prompt in Datasette Agent<br/>e.g. #stats Table Search] --> B[datasette-charts 0.2a1<br/>Profile <=50K Rows / 10K Sample]
B --> C[Compile Full-Table SQL<br/>GROUP BY + Time Bucketing]
C --> D[Cap Output <=5,000 Rows<br/>Render Observable Plot + D3]
D <-->|URL #Fragment Hash Sync<br/>datasette-agent 0.7a1| E[Interactive Chart Builder<br/>in Agent Side Panel]Filters, Facets & HTTP API Endpoints
A subtle but important design detail in datasette-charts is how it integrates with Datasette's native filtering and faceting URL parameters. When a user filters a table with column queries (?state=CA, ?price__gt=5), full-text search (?_search=), custom SQL clauses (?_where=), or many-to-many joins (?_through=), datasette-charts re-computes chart suggestions strictly over the filtered subset—so a column narrowed to a single value is automatically dropped from suggestions (GitHub README). Moreover, the selected chart persists per table inside the browser tab: as you facet, sort, or paginate through rows, the chart remains open and re-draws against the active filter state until you explicitly close it.
For developers building custom frontends or headless scripts, the plugin exposes two JSON endpoints alongside its CLI (datasette charts suggest and datasette charts profile):
- Suggestions endpoint:
/<db>/<table>/-/charts/suggest.jsonaccepts the exact same query-string filters as the HTML table page and returns ranked chart specs plus asourcedescriptor. - Data endpoint:
data.jsonaccepts thatsourceobject ({"kind": "table", "table": "orders", "filters": [...]}or{"kind": "query", "sql": "...", "params": {}}) and returns the aggregated series capped at 5,000 rows.
In 0.2a0 / 0.2a1, Datasette Agent calls these same underlying suggestion and generation tools when prompted (e.g., "Use #stats to show sqlite-utils downloads over time as a chart"), rendering an inline preview in chat and linking directly to the interactive chart builder via #fragment state (Simon Willison's Weblog).
Permissions, Security Boundaries & Unstable APIs
datasette-charts enforces Datasette's fine-grained actor permission model rather than exposing raw SQL to unprivileged viewers (GitHub README):
- Table & View Charts: Require
view-tablepermission only—users do not needexecute-sql. - Ad-hoc SQL Query Charts: Require
execute-sql. - Stored Query Charts: Require
view-query. - SQL Visibility Guard: The "View and edit this chart's SQL" link is shown only to actors holding
execute-sql.
Because both datasette-charts (0.2a1) and datasette-agent (0.7a1) are alpha releases, the repository explicitly flags several breaking-risk areas and unbuilt spec items:
- Unstable Plugin Hook (
ChartType): Custom chart types registered via@hookimplsubclassingdatasette_charts.ChartTypeare explicitly marked "not stable yet." - No Background Profile Persistence: Profiles are cached in memory for a few minutes only; nothing is written to Datasette's internal database and no background profiling task runs yet.
- No Verify Stage or Precomputed Thumbnails: Suggested charts go straight from
proposetorankwithout checking whether a time series is flat or two measures correlate, and every suggestion thumbnail executes its SQL query when scrolled into view. - Stored Query Magic Parameters: Magic parameters such as
:_actor_idin stored queries are not yet supported.
Configuration, CLI & Chart Spec Snippets
You can install both plugins in an existing Datasette environment and configure higher profiling limits or custom SQL timeouts in datasette.yaml:
datasette install datasette-charts datasette-agent
# datasette.yaml — Increase inline profiling limits for larger SQLite tables
plugins:
datasette-charts:
max_suggestions: 8
inline_row_limit: 5000000
inline_cell_limit: 100000000
databases:
shop:
tables:
orders:
plugins:
datasette-charts:
temporal:
shipped: unix_seconds
The plugin also exposes a CLI (datasette charts suggest data.db orders --json, datasette charts profile data.db orders) and a declarative JSON chart specification (v: 1) plus HTTP endpoints (/<db>/<table>/-/charts/suggest.json):
{
"v": 1,
"type": "line",
"encoding": {
"x": {"column": "created_at", "timeUnit": "month"},
"y": {"aggregate": "count"},
"series": {"column": "status", "limit": 5, "other": true}
},
"options": {}
}
Ecosystem Comparison & Upgrade Checklist
How does datasette-charts compare to older Datasette visualization plugins and companion agent tools?
| Package | Latest Verified Version | Core Rendering & Data Scope | AI / Agent Integration | Key Limitation / Trade-Off |
|---|---|---|---|---|
datasette-charts |
0.2a1 (Nov 24, 2026) |
Bundled Observable Plot + D3; full-table SQL GROUP BY (5,000-row output cap) |
Native datasette-agent 0.7a1 chat + side-panel #fragment sync |
Alpha; no background profile store, no :_actor_id in stored queries |
datasette-vega |
Legacy plugin | Vega-Lite; charts current page only (~100 rows) | None | Silently drops rows beyond page 1 |
datasette-agent-charts |
Companion plugin | Observable Plot charts generated directly inside Datasette Agent | Agent tool-only | Lacks table-page UI, suggestion profiler, and #fragment panel sync |
datasette-cluster-map |
0.19.1 (Nov 23, 2026) |
Geographic point clustering for lat/lon columns | None | Map-specific; not a general chart builder |
Safe Adoption & Pinning Checklist
- Pin Exact Alpha Versions: Because
ChartTypehooks and internal JSON specs are still evolving in0.2a1and0.7a1, pin exact versions inpyproject.tomlorrequirements.txt(datasette-charts==0.2a1,datasette-agent==0.7a1). - Tune
sql_time_limit_msfor Multi-Million-Row Tables: Every suggestion thumbnail runs its aggregation query on scroll. For large tables, test with--setting sql_time_limit_ms 10000or capmax_suggestionsindatasette.yamlso concurrent users do not saturate SQLite read locks. - Audit
execute-sqlvs.view-tablePermissions: Verify that public-facing Datasette deployments keepexecute-sqlrestricted if you do not want anonymous users viewing compiled SQL or running ad-hoc query charts. - Sandbox Companion Agent Tools: If pairing
datasette-agentwith code execution, considerdatasette-agent-micropython(WASM-sandboxed MicroPython with no network or host filesystem access) rather than unrestricted host shell tools.
Frequently Asked Questions
How does datasette-charts handle tables with millions of rows?
It profiles up to 50,000 rows (or 1,000,000 cells) inline to suggest charts, falling back to a 10,000-row sample on larger tables. When rendering a chart, however, it compiles a SQL GROUP BY or time-bucket query across all rows and caps the returned result at 5,000 rows.
What changed in datasette-charts 0.2a0 / 0.2a1 and datasette-agent 0.7a1?
Version 0.2a0 (followed by 0.2a1 on November 24, 2026) integrated datasette-charts with Datasette Agent, while datasette-agent 0.7a1 added URL #fragment hash navigation in its iframe side panel so the agent stays aware of manual chart edits.
Does datasette-charts require external CDN access for JavaScript libraries?
No. Observable Plot and D3 are vendored locally inside datasette_charts/static/vendor/, and the geographic map chart uses a coarse local world land outline with zero external network calls.
Why shouldn't I use datasette-vega instead?
datasette-vega only charts the rows visible on the current paginated HTML page (usually up to 100 rows), whereas datasette-charts aggregates across the entire table or filtered query result set via SQL.
Is datasette-charts ready for production APIs?
It is currently an alpha release (0.2a1). Core table-page charting and Datasette permission checks work today, but the ChartType plugin API is unstable, profiles are not persisted across restarts, and stored queries using :_actor_id are not yet supported.
Sources
- Simon Willison's Weblog — Release: datasette-charts 0.2a0 (November 24, 2026): https://simonwillison.net/2026/Nov/24/datasette-charts/
- Simon Willison's Weblog — Release: datasette-agent 0.7a1 (November 24, 2026): https://simonwillison.net/2026/Nov/24/datasette-agent/
- GitHub (
datasette/datasette-charts) — Official Repository README, Permissions, Config & API (Verified November 24, 2026): https://github.com/datasette/datasette-charts - GitHub (
simonw) — Recent Releases (datasette-charts 0.2a1,datasette-agent 0.7a1) (November 24, 2026): https://github.com/simonw - ExplainX — datasette-charts 0.1a0: Full-Table Charts (Nov 2026) (November 24, 2026): https://explainx.ai/blog/datasette-charts-0-1a0-sql-aggregates-claude-fable-november-2026