forked from habedi/graphina
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.rs
More file actions
50 lines (47 loc) · 1.32 KB
/
config.rs
File metadata and controls
50 lines (47 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*!
Visualization configuration and settings
*/
use super::layout::LayoutAlgorithm;
/// Configuration for graph visualization
#[derive(Debug, Clone)]
pub struct VisualizationConfig {
/// Width of the visualization in pixels
pub width: u32,
/// Height of the visualization in pixels
pub height: u32,
/// Layout algorithm to use
pub layout: LayoutAlgorithm,
/// Node color (hex format, like "#69b3a2")
pub node_color: String,
/// Edge color (hex format)
pub edge_color: String,
/// Node size
pub node_size: f64,
/// Edge width
pub edge_width: f64,
/// Whether to show node labels
pub show_labels: bool,
/// Whether to show edge labels
pub show_edge_labels: bool,
/// Background color
pub background_color: String,
/// Font size for labels
pub font_size: u32,
}
impl Default for VisualizationConfig {
fn default() -> Self {
Self {
width: 800,
height: 600,
layout: LayoutAlgorithm::ForceDirected,
node_color: "#69b3a2".to_string(),
edge_color: "#999999".to_string(),
node_size: 10.0,
edge_width: 2.0,
show_labels: true,
show_edge_labels: false,
background_color: "#ffffff".to_string(),
font_size: 12,
}
}
}