| Crates.io | icentral-color-map |
| lib.rs | icentral-color-map |
| version | 0.1.0 |
| created_at | 2025-04-04 20:48:31.163211+00 |
| updated_at | 2025-04-04 20:48:31.163211+00 |
| description | A robust Rust crate for managing color maps associated with nodes in graphs or similar data structures, supporting dynamic manipulation and query of node color state. |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1620727 |
| size | 52,614 |
The icentral-color-map crate provides an efficient mechanism for representing, manipulating, and accessing color mapping for nodes in computational graphs or similar structures. This library is designed for high-performance applications requiring dynamic manipulation of node attributes, specifically node coloration.
Color enum, which currently supports two distinct states: None and Grey. Additional states can be integrated to extend functionality.MaybeIndexedMap. This struct offers numerous utilities for color manipulation and query.fmt::Display trait for clear and human-readable node color output.empty_indexed, empty_mapped, and initialization from existing nodes with new_from_nodes.Assume you have a list of nodes for which you want to initialize a color map:
use icentral_color_map::{ColorMap, Color};
// Initialize with nodes
let nodes = vec![NodeId(1), NodeId(2), NodeId(3)];
let mut color_map = ColorMap::new_from_nodes(nodes, "ExampleColorMap");
// Set node color
color_map.set_color_for_node_grey(NodeId(1));
// Check if node is colored
if color_map.is_colored(NodeId(1)) {
println!("Node 1 is colored grey");
}
Advanced implementations can push the boundaries further by extending the permitted states of the Color enum or integrating this crate with larger centralized graph-processing systems.
This README.md file was generated by an AI model and may not be 100% accurate. However, it should be informative and useful for understanding the main functionalities of the icentral-color-map crate.
This crate is in the process of being translated from c++ to rust. Currently, it still needs exhaustive testing. It is likely there currently exist many glitches which need to be fixed before proper usage. This crate is based on the original icentral program developed by Fuad Jamor. Please see the following repository for details: https://github.com/fjamour/icentral.
For progress updates, see the workspacer rust project.