use lievisual::Color;
use lievisual::text::{TextAlign, TextBaseline, TextStyle};
pub const Z_BACKGROUND: i32 = 0;
pub const Z_SUBGRAPH: i32 = 5;
pub const Z_GRID: i32 = 10;
pub const Z_SERIES: i32 = 20;
pub const Z_LABEL: i32 = 40;
pub const Z_TITLE: i32 = 50;
pub const BACKGROUND: Color = Color::new(255, 255, 255, 255);
pub const FONT_FAMILY: &str = "'trebuchet ms', verdana, arial, sans-serif";
pub const FONT_SIZE: f64 = 16.0;
pub const LINE_HEIGHT: f64 = 1.5;
pub const NODE_RADIUS: f64 = 5.0;
pub const STADIUM_RADIUS: f64 = 5.0;
pub const NODE_PAD_X: f64 = 30.0;
pub const NODE_PAD_Y: f64 = 15.0;
pub const NODE_MIN_W: f64 = 16.0;
pub const NODE_MIN_H: f64 = 16.0;
pub const EDGE_COLOR: Color = Color::new(51, 51, 51, 255); pub const EDGE_WIDTH: f64 = 1.0;
pub const EDGE_WIDTH_THICK: f64 = 3.5;
pub const TEXT_COLOR: Color = Color::new(19, 19, 0, 255);
pub fn text_style(color: Color, size: f64, align: TextAlign, baseline: TextBaseline) -> TextStyle {
TextStyle::new(color, size, FONT_FAMILY)
.with_align(align)
.with_baseline(baseline)
.with_line_height(size * LINE_HEIGHT)
}
pub mod flowchart {
use super::Color;
pub const FILL: Color = Color::new(236, 236, 255, 255); pub const STROKE: Color = Color::new(147, 112, 219, 255); pub const TEXT: Color = super::TEXT_COLOR;
pub const EDGE: Color = super::EDGE_COLOR; pub const SUBGRAPH_STROKE: Color = Color::new(170, 170, 51, 255); pub const SUBGRAPH_FILL: Color = Color::new(255, 255, 222, 255); pub const SUBGRAPH_TITLE: Color = Color::new(51, 51, 51, 255); pub const EDGE_LABEL_BG: Color = Color::new(232, 232, 232, 128);
}
pub mod state {
use super::Color;
pub const FILL: Color = Color::new(236, 236, 255, 255); pub const STROKE: Color = Color::new(147, 112, 219, 255); pub const TEXT: Color = super::TEXT_COLOR;
pub const EDGE: Color = super::EDGE_COLOR;
pub const START_FILL: Color = Color::new(236, 236, 255, 255); pub const END_STROKE: Color = Color::new(147, 112, 219, 255); pub const SPECIAL: Color = Color::new(51, 51, 51, 255); }
pub mod class {
use super::Color;
pub const FILL: Color = Color::new(236, 236, 255, 255); pub const HEADER_FILL: Color = Color::new(236, 236, 255, 255); pub const STROKE: Color = Color::new(147, 112, 219, 255); pub const TEXT: Color = Color::new(19, 19, 0, 255); pub const EDGE: Color = super::EDGE_COLOR;
pub const SEPARATOR: Color = Color::new(147, 112, 219, 255); pub const DIAMOND_FILL: Color = Color::new(147, 112, 219, 255); pub const EDGE_LABEL_BG: Color = Color::new(236, 236, 255, 255);
pub const MEMBER_FONT_SIZE: f64 = 16.0;
}
pub mod sequence {
use super::Color;
pub const ACTOR_FILL: Color = Color::new(236, 236, 255, 255); pub const ACTOR_STROKE: Color = Color::new(147, 112, 219, 255); pub const ACTOR_RADIUS: f64 = 3.0;
pub const FILL: Color = Color::new(236, 236, 255, 255); pub const STROKE: Color = Color::new(147, 112, 219, 255); pub const TEXT: Color = Color::new(51, 51, 51, 255); pub const ACTOR_TEXT: Color = Color::new(0, 0, 0, 255); pub const EDGE: Color = super::EDGE_COLOR;
pub const LIFELINE: Color = Color::new(147, 112, 219, 255); pub const LIFELINE_WIDTH: f64 = 2.0;
pub const LIFELINE_DASH: [f64; 0] = [];
pub const MESSAGE_WIDTH: f64 = 1.5;
pub const MESSAGE_DASH: [f64; 2] = [3.0, 3.0];
pub const ACTIVATION_FILL: Color = Color::new(244, 244, 244, 255); pub const ACTIVATION_STROKE: Color = Color::new(102, 102, 102, 255); pub const ACTIVATION_WIDTH: f64 = 10.0;
pub const NOTE_FILL: Color = Color::new(255, 245, 173, 255); pub const NOTE_STROKE: Color = Color::new(170, 170, 51, 255); pub const NOTE_TEXT: Color = Color::new(0, 0, 0, 255); pub const BLOCK_TEXT: Color = Color::new(0, 0, 0, 255); pub const BLOCK_FILL: Color = Color::new(236, 236, 255, 255); pub const BLOCK_STROKE: Color = Color::new(147, 112, 219, 255); }
pub mod er {
use super::Color;
pub const FILL: Color = Color::new(236, 236, 255, 255); pub const HEADER_FILL: Color = Color::new(236, 236, 255, 255); pub const ATTR_ROW_LIGHT: Color = Color::new(255, 255, 255, 255); pub const ATTR_ROW_DARK: Color = Color::new(236, 236, 255, 255); pub const STROKE: Color = Color::new(147, 112, 219, 255); pub const TEXT: Color = super::TEXT_COLOR;
pub const EDGE: Color = super::EDGE_COLOR;
pub const EDGE_LABEL_BG: Color = Color::new(248, 255, 236, 128);
}
pub mod timeline {
use super::Color;
pub const LINE: Color = Color::new(0, 0, 0, 255);
pub const AXIS_WIDTH: f64 = 4.0;
pub const CONNECTOR_W: f64 = 2.0;
pub const ARROW_SIZE: f64 = 10.0;
pub const AXIS_HEAD: f64 = 50.0;
pub const AXIS_TAIL: f64 = 250.0;
pub const CONNECTOR_TAIL: f64 = 60.0;
pub const BLOCK_LINE_W: f64 = 3.0;
pub const TITLE: Color = Color::new(0, 0, 0, 255);
pub const TITLE_SIZE: f64 = 64.0;
pub const BLOCK_TEXT_SIZE: f64 = 16.0;
pub const BLOCK_COLORS: [Color; 12] = [
Color::new(134, 134, 255, 255), Color::new(255, 255, 120, 255), Color::new(215, 255, 134, 255), Color::new(194, 134, 255, 255), Color::new(255, 134, 255, 255), Color::new(255, 134, 194, 255), Color::new(255, 134, 134, 255), Color::new(255, 194, 134, 255), Color::new(194, 255, 134, 255), Color::new(134, 255, 194, 255), Color::new(134, 255, 255, 255), Color::new(134, 194, 255, 255), ];
pub const BLOCK_LINE_COLORS: [Color; 12] = [
Color::new(255, 255, 185, 255), Color::new(171, 171, 255, 255), Color::new(208, 185, 255, 255), Color::new(220, 255, 185, 255), Color::new(185, 255, 185, 255), Color::new(185, 255, 220, 255), Color::new(185, 255, 255, 255), Color::new(185, 220, 255, 255), Color::new(220, 185, 255, 255), Color::new(255, 185, 220, 255), Color::new(255, 185, 185, 255), Color::new(255, 220, 185, 255), ];
pub const BLOCK_TEXT_WHITE: [usize; 2] = [0, 3];
pub const TEXT_WHITE: Color = Color::new(255, 255, 255, 255);
pub const TEXT_BLACK: Color = Color::new(0, 0, 0, 255);
pub fn block_color(idx: usize) -> Color {
BLOCK_COLORS[idx % BLOCK_COLORS.len()]
}
pub fn block_text_color(idx: usize) -> Color {
let i = idx % BLOCK_COLORS.len();
if BLOCK_TEXT_WHITE.contains(&i) {
TEXT_WHITE
} else {
TEXT_BLACK
}
}
pub fn block_line_color(idx: usize) -> Color {
BLOCK_LINE_COLORS[idx % BLOCK_LINE_COLORS.len()]
}
pub const BLOCK_W: f64 = 190.0;
pub const BLOCK_H: f64 = 65.8;
pub const EVENT_H: f64 = 50.0;
pub const BLOCK_RX: f64 = 5.0;
pub const COL_PITCH: f64 = 200.0;
pub const SECTION_DY: f64 = 200.0;
pub const PERIOD_DY: f64 = 83.0;
pub const EVENT_DY: f64 = 109.0;
pub const EVENT_GAP: f64 = 50.0;
}
pub mod gitgraph {
use super::Color;
pub const BRANCH_COLORS: [Color; 8] = [
Color::new(0, 0, 204, 255), Color::new(255, 200, 0, 255), Color::new(34, 139, 34, 255), Color::new(220, 20, 60, 255), Color::new(148, 0, 211, 255), Color::new(30, 144, 255, 255), Color::new(255, 140, 0, 255), Color::new(50, 205, 50, 255), ];
pub const TEXT: Color = super::TEXT_COLOR;
pub const COMMIT_STROKE: Color = Color::new(255, 255, 255, 255);
pub const COMMIT_RADIUS: f64 = 10.0; pub const BRANCH_SPACING: f64 = 60.0; pub const COMMIT_SPACING: f64 = 70.0; pub const LABEL_OFFSET: f64 = 20.0; pub const LEFT_MARGIN: f64 = 120.0; pub const TOP_MARGIN: f64 = 35.0; pub const LINE_WIDTH: f64 = 4.0;
pub const LABEL_FONT: f64 = 10.0; pub const COMMIT_LABEL_FILL: Color = Color::new(0, 0, 33, 255); pub const COMMIT_LABEL_BKG: Color = Color::new(255, 255, 222, 128); pub const TAG_LABEL_FILL: Color = Color::new(19, 19, 0, 255); pub const TAG_BKG: Color = Color::new(224, 224, 224, 255); pub const TAG_BKG_STROKE: Color = Color::new(184, 184, 184, 255); pub const HIGHLIGHT_OUTER: Color = Color::new(19, 19, 0, 255); pub const MERGE_INNER: Color = Color::new(236, 236, 255, 255); }
pub mod pie {
use super::Color;
pub const RADIUS: f64 = 185.0;
pub const OUTER_RADIUS: f64 = 186.0;
pub const OUTER_STROKE: Color = Color::new(0, 0, 0, 255); pub const OUTER_STROKE_WIDTH: f64 = 2.0;
pub const SLICE_STROKE: Color = Color::new(0, 0, 0, 255);
pub const SLICE_STROKE_WIDTH: f64 = 2.0;
pub const LABEL_RADIUS_RATIO: f64 = 0.75;
pub const LEGEND_SWATCH: f64 = 18.0;
pub const LEGEND_TEXT_DX: f64 = 22.0;
pub const LEGEND_ROW_H: f64 = 22.0;
pub const LEGEND_DX: f64 = 31.0;
pub const TITLE_DY: f64 = 200.0;
pub const TITLE_FONT: f64 = 24.0;
pub const LABEL_FONT: f64 = 16.0;
pub const COLORS: [Color; 12] = [
Color::new(236, 236, 255, 255), Color::new(255, 255, 222, 255), Color::new(185, 255, 32, 255), Color::new(185, 185, 255, 255), Color::new(255, 255, 69, 255), Color::new(217, 255, 134, 255), Color::new(255, 134, 255, 255), Color::new(32, 255, 255, 255), Color::new(255, 32, 32, 255), Color::new(255, 32, 255, 255), Color::new(32, 255, 144, 255), Color::new(255, 83, 83, 255), ];
}