Plotly.rs builds interactive and static charts from Rust code using Plotly.js rendering. Figures can open in a browser or export to HTML and several image formats.
Overview
Plotly.rs is a Rust crate for constructing plots powered by the Plotly.js JavaScript library. It exposes traces and layouts for chart types such as scatter, bar, candlestick, heat maps, contours, 3D surfaces, sankey diagrams, and tables through a typed API.
Interactive figures can be written to standalone HTML files or shown directly in a browser, usually loading Plotly.js from a CDN or optionally embedding the library for offline viewing. WASM frontends are supported without the static export features that depend on native browser automation.
Static image export is handled primarily through the plotlystatic backend, which drives Chrome or Firefox via WebDriver, with optional legacy Kaleido-based export on Linux, Windows, and macOS hosts. Feature flags control ndarray integration, embedded JavaScript, and image trace helpers.
Documentation and recipes in the project book cover basic plotting, static exporters, downsampling large time series before plotting, and integration patterns for data analysis workflows in Rust.
Key features
- Plotly.js-powered interactive HTML figures
- Broad chart and trace type coverage
- CDN or embedded Plotly.js in HTML output
- Static PNG, JPEG, SVG, PDF export paths
- plotlystatic WebDriver rendering backend
- Optional Kaleido legacy static export
- WASM frontend usage support
- ndarray and image crate integrations via features
Use cases
- Interactive dashboards from Rust analytics code
- Sharing self-contained HTML visualizations
- Static chart images for reports
- Financial and scientific plotting in Rust