First example of (hopefully) many "annotations" to the package graph. While this is explicit information for now, over time I expect this to evolve into a more generic structure.
OPTMCUTBEZQT3HETRWVBU4HYSB7NNBA4TY7QOOKCN3YLSMDKNM2QC
.map(|(id, node)| charming::series::GraphNode {
id: id.repr().to_string(),
name: graph.metadata(id).unwrap().name().to_string(),
x: node.pos.x(),
y: node.pos.y(),
value: 1_f64,
category: 0,
symbol_size: 1_f64,
label: None,
.map(|(id, node)| {
let unit_time = if let Some(duration) = timings.pkg_time(id) {
duration
} else {
// TODO: once using the resolved crate graph, `None` should never appear
println!("Queried node outside cargo's unit graph: {id}");
0_f64
};
// TODO: figure out the difference between `value` and `symbol_size`
charming::series::GraphNode {
id: id.repr().to_string(),
name: graph.metadata(id).unwrap().name().to_string(),
x: node.pos.x(),
y: node.pos.y(),
value: unit_time,
category: 0,
symbol_size: unit_time,
label: None,
}