· AI dev tools
datasette-charts 0.2a0 integrates with Datasette Agent to create charts from chat prompts
The ability to ask for a chart via chat is now integrated with the new charting plugin for Datasette, allowing users to generate visualizations using the existing suggestion and creation mechanisms.
This latest enhancement builds upon the introduction of the charting plugin yesterday, connecting it directly with Datasette Agent. A demonstration video, available on agent.datasette.io where users can log in with GitHub, showcases this functionality. In the video, the user prompts Datasette Agent with, "Use #stats to show sqlite-utils downloads over time as a chart," where typing "#stats" triggers a table search box. The agent then displays a chart directly within the chat interface; upon clicking "Open in the chart builder," this chart opens in a panel alongside the relevant table page. Furthermore, the user can interact with the agent by asking, "what does the chart show?" after changing the content within the panel, and the agent will accurately describe the newly displayed Datasette chart. A Markdown export of the conversation from that video is also provided.
The initial release of the plugin, version 0.1a0, was born from over a year of contemplation, finally coming to life after the author utilized Claude Fable 5.2 to construct a preliminary prototype last Sunday. This successful prototype has since evolved into a complete plugin, which users can test out in Datasette Lite. This new charting capability operates across any table or arbitrary SQL query within Datasette. It incorporates several distinct chart types, leveraging vendored libraries such as D3, Observable Plot, and topojson-client. Each chart type possesses a specific set of heuristics designed to determine if it is a suitable match for a given collection of data rows. Those preview thumbnails displayed at the top are not mere placeholders; they are genuine visualizations derived from the data, and selecting one loads the complete chart along with tools enabling modifications. Developers also retain the option to build a chart entirely from scratch. Consistent with other Datasette visualization plugins, the current configuration of any chart is retained within a #fragment in the URL, facilitating easy bookmarking or sharing among colleagues.
A crucial advancement in this plugin is its comprehensive handling of all data rows. Prior charting tools, such as datasette-vega, were limited to displaying charts based only on the currently viewed page of results, typically capping out around 100 rows. The new plugin addresses this by compiling every chart into a SQL query that aggregates data across the entire result set—which could encompass millions of rows—utilizing functions like GROUP BY, time bucketing, and window functions. Each of these generated queries returns a result set limited to 5,000 rows, a size appropriate for visual display on the chart. To assist in suggesting appropriate charts for larger tables without needing to process the entire dataset, the plugin employs a sampling technique. The author expressed considerable satisfaction with this preliminary version, noting that while it remains in an alpha state, it represents the closest realization to the goal of Datasette assisting in data visualization with minimal required guidance from the user.
Why it matters
This tooling release significantly enhances data exploration within Datasette by enabling comprehensive visualization of large datasets without manual query writing. The integration with Datasette Agent lowers the barrier to entry for generating complex charts from natural language prompts.



