Skip to main content

weighted_points

Function weighted_points 

Source
pub fn weighted_points(
    points: &[(FloatType, FloatType, FloatType)],
    min_diameter: FloatType,
    max_diameter: FloatType,
) -> Vec<WeightedPoint>
Expand description

Each point of a weighted scatter graph, sized by its count between the two diameters and stretched so it draws round on unequal axes: music21’s GraphScatterWeighted.renderSubplot.

use music21::graph::primitives::weighted_points;

let drawn = weighted_points(&[(0.0, 0.0, 1.0), (10.0, 10.0, 3.0)], 0.25, 1.25);
assert_eq!(drawn[0].width, 0.25);
assert_eq!(drawn[1].width, 1.25);
assert!(drawn[0].label_at.is_none());