ggplot-rs 0.7.0

A Rust implementation of ggplot2's Grammar of Graphics
Documentation
[package]
name = "ggplot-rs"
version = "0.7.0"
edition = "2021"
# Only the explicit [[bin]] below is a binary; src/bin/load.rs is its module.
autobins = false
description = "A Rust implementation of ggplot2's Grammar of Graphics"
authors = ["Simon Müller <sm@data-zoo.de>"]
license = "MIT OR Apache-2.0"
repository = "https://github.com/sipemu/ggplot-rs"
homepage = "https://github.com/sipemu/ggplot-rs"
documentation = "https://docs.rs/ggplot-rs"
readme = "README.md"
keywords = ["ggplot2", "plotting", "dataviz", "charts", "grammar"]
categories = ["visualization", "science"]

[dependencies]
# Use plotters' `ab_glyph` text backend instead of the default `ttf` (font-kit),
# so rendering needs no system fonts / fontconfig — we register a bundled font at
# render time. This is the default set minus `ttf`, plus `ab_glyph`.
plotters = { version = "0.3", default-features = false, features = [
    "bitmap_backend",
    "bitmap_encoder",
    "bitmap_gif",
    "svg_backend",
    "chrono",
    "image",
    "deprecated_items",
    "all_series",
    "all_elements",
    "full_palette",
    "colormaps",
    "ab_glyph",
] }
indexmap = "2"
rand = "0.8"
# Optional data-source adapters. Neither is needed for the core pipeline —
# they only provide `GGData` conversions for external frame types.
polars = { version = "0.46", features = ["lazy"], optional = true }
arrow = { version = "53", default-features = false, optional = true }
# Regression backend for stat_quantile / geom_smooth glm (issues #10, #11).
anofox-regression = { version = "0.5", optional = true }
faer = { version = "0.23", default-features = false, features = [
    "std",
    "linalg",
], optional = true }
# In-memory PNG encoding for `render_png`. Already pulled in transitively by
# plotters' bitmap backend, so this adds no extra compile cost.
image = { version = "0.24", default-features = false, features = ["png"] }
# CLI tool (`cli` feature): arg parsing + a bundled DuckDB engine for reading
# parquet/CSV and running SQL. Both are optional and off by default.
clap = { version = "4", features = ["derive"], optional = true }
duckdb = { version = "1", features = ["bundled"], optional = true }
# Theme-config parsing for the CLI (TOML/JSON).
serde = { version = "1", features = ["derive"], optional = true }
toml = { version = "0.8", optional = true }
serde_json = { version = "1", optional = true }

[features]
# `polars` is on by default to preserve existing behaviour (prelude re-export +
# `impl GGData for polars::DataFrame`). Downstream crates that don't want the
# heavy polars tree can depend with `default-features = false`.
default = ["polars"]
polars = ["dep:polars"]
# Zero-copy-friendly input path for Arrow-native producers (e.g. DuckDB).
arrow = ["dep:arrow"]
# Regression-backed stats (stat_quantile, glm smooth) via anofox-regression.
regression = ["dep:anofox-regression", "dep:faer"]
# `ggplot-rs` command-line tool: plot parquet files and DuckDB SQL from the shell.
cli = ["dep:clap", "dep:duckdb", "dep:serde", "dep:toml", "dep:serde_json"]

# The CLI binary (built only with `--features cli`).
[[bin]]
name = "ggplot-rs"
path = "src/bin/ggplot.rs"
required-features = ["cli"]

# All bundled examples build their input frames with the polars `df!` macro,
# so they only compile when the `polars` feature is enabled.
[[example]]
name = "gallery"
required-features = ["polars"]

# Polars-free: builds and runs with --no-default-features too.
[[example]]
name = "supplier_leadtime"

[[example]]
name = "scatter"
required-features = ["polars"]

[[example]]
name = "histogram"
required-features = ["polars"]

[[example]]
name = "bar_chart"
required-features = ["polars"]

[[example]]
name = "annotations"
required-features = ["polars"]

[[example]]
name = "color_palettes"
required-features = ["polars"]

[[example]]
name = "continuous_color"
required-features = ["polars"]

[[example]]
name = "coord_flip"
required-features = ["polars"]

[[example]]
name = "density"
required-features = ["polars"]

[[example]]
name = "faceted"
required-features = ["polars"]

[[example]]
name = "loess_smooth"
required-features = ["polars"]

[[example]]
name = "log_scale"
required-features = ["polars"]