heuropt-plot 0.1.0

Lightweight SVG visualization for heuropt Pareto fronts and convergence traces.
Documentation
  • Coverage
  • 100%
    3 out of 3 items documented1 out of 3 items with examples
  • Size
  • Source code size: 19.25 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 354.53 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 30s Average build duration of successful builds.
  • all releases: 30s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • swaits/heuropt
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • swaits

heuropt-plot

Crates.io Documentation License: MIT

Lightweight SVG plotting helpers for heuropt results.

Hand-rolled SVG output (no plotters, no tiny-skia, no heavyweight dependency) so adding heuropt-plot to your project costs ~20 KB of compiled code.

What's in the box

  • pareto_front_svg — render a 2-objective Pareto front as an SVG scatter plot with axes and labels.
  • convergence_svg — render a "best fitness so far" trace as an SVG line plot.

Output is a String of valid SVG. Write it to a file, embed it in HTML, or pipe it to a browser.

Example

use heuropt::prelude::*;
use heuropt_plot::pareto_front_svg;

let space = ObjectiveSpace::new(vec![
    Objective::minimize("f1"),
    Objective::minimize("f2"),
]);
let front = vec![
    Candidate::new((), Evaluation::new(vec![0.0, 1.0])),
    Candidate::new((), Evaluation::new(vec![0.5, 0.5])),
    Candidate::new((), Evaluation::new(vec![1.0, 0.0])),
];

let svg = pareto_front_svg(&front, &space, 600, 400, "Sample front");
std::fs::write("front.svg", svg).unwrap();

License

MIT — see LICENSE at the repo root.