word_cloud/placement/
mod.rs

1//! Everything related to the placement of the words.
2
3use crate::geometry::{Rectangle, Vector};
4
5mod from_center_placer;
6mod horiz_placer;
7mod spiral_placer;
8
9pub use from_center_placer::FromCenterPlacer;
10pub use horiz_placer::HorizontalPlacer;
11pub use spiral_placer::SpiralPlacer;
12
13/// Define a word placement strategy.
14pub trait PlacementStrategy {
15    /// Return the next place to try for the given rectangle, starting with `start_pos`.
16    fn find_next_place(&mut self, start_pos: Option<Vector>, r: &Rectangle) -> Option<Vector>;
17}