Replace pandas + matplotlib with just DuckDB - instant data visualization from SQL
Maintainer(s):
nkwork9999
Installing and Loading
INSTALL miniplot FROM community;
LOAD miniplot;
Example
-- Bar chart example
SELECT bar_chart(
LIST_VALUE('Q1', 'Q2', 'Q3', 'Q4'),
LIST_VALUE(100.0, 150.0, 200.0, 180.0),
'Quarterly Sales'
);
-- Line chart example
SELECT line_chart(
LIST_VALUE('Mon', 'Tue', 'Wed', 'Thu', 'Fri'),
LIST_VALUE(5000.0, 6500.0, 4800.0, 7200.0, 8500.0),
'Weekly Revenue Trend'
);
-- Scatter plot example
SELECT scatter_chart(
LIST_VALUE(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0),
LIST_VALUE(10.0, 25.0, 30.0, 45.0, 60.0, 75.0, 85.0, 95.0),
'Performance vs Time'
);
-- Area chart example
SELECT area_chart(
LIST_VALUE('Jan', 'Feb', 'Mar', 'Apr', 'May'),
LIST_VALUE(1000.0, 1500.0, 1200.0, 1800.0, 2100.0),
'Monthly Growth'
);
About miniplot
Interactive chart visualization extension for DuckDB - bringing pandas + matplotlib style data visualization directly to SQL, without leaving your database.
Mission: Replace pandas + matplotlib with just DuckDB
New in v0.0.2:
- 🔄 Complete C++-only rewrite (no Rust dependencies)
- 🌐 Charts open in browser (universal compatibility)
- 📦 Fully offline - Plotly.js embedded (no CDN, no internet required)
- ✨ Interactive features: zoom, pan, hover, export to PNG
- 🎨 Clean white theme with subtle shadows
- 🚀 Works in DuckDB Community Extensions (worker thread compatible)
Features:
- Bar, Line, Scatter, and Area charts
- Interactive Plotly.js-based rendering
- Simple SQL interface for direct visualization
- Cross-platform support (macOS, Linux, Windows)
- Zero external dependencies at runtime
- Fully offline operation (3MB Plotly.js embedded)
Technical Details:
- Pure C++ implementation
- Plotly.js (~3MB) embedded at compile time
- Charts rendered as standalone HTML files
- Opens in default browser automatically
- No native GUI dependencies
Note: Charts open in your default web browser as standalone HTML files.
Added Functions
function_name | function_type | description | comment | examples |
---|---|---|---|---|
area_chart | scalar | NULL | NULL | |
bar_chart | scalar | NULL | NULL | |
line_chart | scalar | NULL | NULL | |
miniplot | scalar | NULL | NULL | |
miniplot_openssl_version | scalar | NULL | NULL | |
scatter_chart | scalar | NULL | NULL |