[package]
name = "ggplot-rs"
version = "0.6.0"
edition = "2021"
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"] }

[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"]

# 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"]
