sphereql_layout/types.rs
1use sphereql_core::SphericalPoint;
2
3#[derive(Debug, Clone)]
4pub struct LayoutEntry<T> {
5 pub item: T,
6 pub position: SphericalPoint,
7}
8
9#[derive(Debug, Clone)]
10pub struct LayoutResult<T> {
11 pub entries: Vec<LayoutEntry<T>>,
12 pub quality: LayoutQuality,
13}
14
15#[derive(Debug, Clone, Copy, Default)]
16pub struct LayoutQuality {
17 /// How evenly spread points are (0.0 = clustered, 1.0 = maximally dispersed)
18 pub dispersion_score: f64,
19 /// Fraction of point pairs closer than a threshold (0.0 = no overlaps, 1.0 = all overlapping)
20 pub overlap_score: f64,
21 /// Silhouette coefficient for cluster quality (-1.0 to 1.0, higher = better separated clusters)
22 pub silhouette_score: f64,
23}