Skip to content

v0.1.5 — Guava

Latest

Choose a tag to compare

@neneodonkor neneodonkor released this 03 May 16:54
· 9 commits to master since this release

Added

  • X and Y axis labels via Config::x_axis_label() and Config::y_axis_label().
    The Y-axis label renders flush left above the graph body. The X-axis label
    renders inline on the same row as the axis line, to the right of the tick
    marks. The X-axis label only appears when x_axis_range is also configured.

  • Added examples/axis_labels.rs demonstrating both labels on a 20-point
    dataset with a configured X-axis range.

  • Serde support via an optional serde feature flag. Add
    asciigraph = { version = "0.1.5", features = ["serde"] } to enable
    Serialize and Deserialize for Config, AnsiColor, CharSet,
    ZeroLine, and Threshold. Formatter closure fields are skipped during
    serialization as functions cannot be represented as data.

  • Added examples/serde_config.rs demonstrating serialization and
    deserialization of Config to and from JSON using serde_json.

  • Statistical annotations via StatAnnotations — opt-in horizontal reference
    lines computed automatically from the data and rendered with inline labels.
    Supports minimum, maximum, mean, median, and standard deviation (rendered
    as two lines at ±σ). Each annotation uses a distinct dashed character for
    visual clarity. When two annotation values map to the same grid row, their
    labels are stacked and separated by a comma. In multi-series graphs, the
    target series is configurable via series_index. Enabled through
    Config::stat_annotations().

  • Added examples/stat_annotations.rs demonstrating all five annotations
    rendered in yellow over a 20-point dataset.

Changed

  • Threshold now supports series_index — each threshold is associated
    with a specific series and two rules are applied before rendering. The
    visibility rule skips a threshold if its value falls outside the min/max
    range of its associated series specifically, not just the global graph
    range. The color inheritance rule automatically applies the associated
    series' color to the threshold line when no explicit color is set, creating
    a natural visual association between a threshold and its series. Both rules
    default gracefully — series_index defaults to 0 and an explicit color
    always takes priority over the inherited series color.

  • Updated examples/threshold.rs to demonstrate both single-series and
    multi-series threshold usage, including the visibility rule and color
    inheritance rule.

  • Refactored options.rs into a module directory (src/options/) with three
    focused files, mirroring the structure used by src/asciigraph/:

    • charset.rsCharSet, DEFAULT_CHAR_SET, and create_char_set
    • config.rsConfig struct and all its builder methods
    • extensions.rsZeroLine, Threshold, and StatAnnotations

    No public API changes — all types remain accessible at the same paths as before.