#image #nodes #pathing

pathfinder

Create nodes, clusters of nodes and connection in between

14 releases

0.4.2 Aug 25, 2018
0.4.1 Aug 16, 2018
0.3.9 Aug 10, 2018
0.3.7 Jun 17, 2018
0.2.2 Apr 2, 2018

#9 in Visualization

Download history 6/week @ 2018-09-01 13/week @ 2018-09-08 5/week @ 2018-09-15 3/week @ 2018-09-22 43/week @ 2018-09-29 7/week @ 2018-10-06 3/week @ 2018-10-13 42/week @ 2018-10-20 10/week @ 2018-10-27 76/week @ 2018-11-03 66/week @ 2018-11-10 52/week @ 2018-11-17 28/week @ 2018-11-24

152 downloads per month

MIT license

65KB
1.5K SLoC

Logo of the project

Build Status Documentation Test coverage GitHub license

Pathfinder

Create large number of Nodes or Groups of Nodes mapped on to an Image.

Placing positioned objects on to an Image can cause many issue. This library is meant to ease the pain of interacting with pixel data and create higher abstractions which makes it easy to populate larger Image surfaces with large number of Objects!

Getting started

Coordinates are integral, and used to position Structures on to the image. Here they are used to create a Group and a Node, and showing basic mapping functionality.

extern crate pathfinder;
use pathfinder::{Node, Coordinate, Group, Map};

fn main() {
    let node = Node::new("Hello", Coordinate::new(0, 0));
    let group = Group::new("world", Coordinate::new(50, 50));
    let mut map = Map::new();
    let map = map
        .map(&[node])
        .map(&[group]);
}

The code above results in the creation of an image which contains 1 Node at positioned 0,0. The group does not have any children Nodes and is not visable.

Example

Easily manipulate larger number of Nodes with less accuracy.

use pathfinder::map::network;
use std::path::Path;

let mut groups = Group::from_list([(0, 0), (100, 100)]);
for group in groups.iter_mut() {
    network::add_children(&mut group, 100);
}
let mut map = Map::new();
map.map(&groups)
   .save(&Path::new("out.png"));

Produces an image with 2 Groups, each with 100 children Nodes.

Example output

Pathfinder Logotype_gif

Groups

Features

Dependencies

~3MB
~51K SLoC