Skip to content

Commit d75817e

Browse files
Merge pull request #31 from RohanAdwankar/paths
Paths
2 parents 221e119 + 45fb726 commit d75817e

24 files changed

+1081
-407
lines changed

src/diagram.rs

Lines changed: 652 additions & 76 deletions
Large diffs are not rendered by default.

src/lib.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,13 @@ pub use serve::*;
1414
pub use utils::*;
1515

1616
pub const NODE_WIDTH: f32 = 140.0;
17-
pub const NODE_HEIGHT: f32 = 60.0;
17+
pub const NODE_HEIGHT: f32 = 50.0;
1818
pub const NODE_SPACING: f32 = 160.0;
1919
pub const START_OFFSET: f32 = 120.0;
2020
pub const LAYOUT_MARGIN: f32 = 80.0;
21+
pub const NODE_TEXT_CHAR_WIDTH: f32 = 7.4;
22+
pub const NODE_TEXT_HORIZONTAL_PADDING: f32 = 60.0;
23+
pub const NODE_TEXT_VERTICAL_PADDING: f32 = 22.0;
2124
pub const EDGE_LABEL_MIN_WIDTH: f32 = 36.0;
2225
pub const EDGE_LABEL_MIN_HEIGHT: f32 = 28.0;
2326
pub const EDGE_LABEL_LINE_HEIGHT: f32 = 16.0;
@@ -35,6 +38,7 @@ pub const EDGE_SINGLE_OFFSET: f32 = 32.0;
3538
pub const EDGE_SINGLE_STUB: f32 = 56.0;
3639
pub const EDGE_SINGLE_OFFSET_STEP: f32 = 14.0;
3740
pub const EDGE_SINGLE_STUB_STEP: f32 = 20.0;
41+
pub const EDGE_ORTHO_MIN_STUB: f32 = 28.0;
3842
pub const EDGE_ARROW_EXTENSION: f32 = 1.0;
3943
pub const LAYOUT_BLOCK_START: &str = "%% OXDRAW LAYOUT START";
4044
pub const LAYOUT_BLOCK_END: &str = "%% OXDRAW LAYOUT END";
@@ -126,13 +130,16 @@ pub struct Edge {
126130
pub to: String,
127131
pub label: Option<String>,
128132
pub kind: EdgeKind,
133+
pub arrow: EdgeArrowDirection,
129134
}
130135

131136
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
132137
#[serde(rename_all = "lowercase")]
133138
pub enum EdgeKind {
134139
Solid,
135140
Dashed,
141+
Thick,
142+
Invisible,
136143
}
137144

138145
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]

tests/cli.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ fn generates_svg_for_all_fixtures() -> Result<(), Box<dyn std::error::Error>> {
4444
fs::remove_file(&png_output_path)?;
4545
}
4646

47-
let mut cmd = cargo_bin_cmd!("oxdraw");
47+
let mut cmd = cargo_bin_cmd!("oxdraw");
4848
cmd.arg("--input")
4949
.arg(&path)
5050
.arg("--output")
@@ -61,7 +61,7 @@ fn generates_svg_for_all_fixtures() -> Result<(), Box<dyn std::error::Error>> {
6161
svg_output_path.display()
6262
);
6363

64-
let mut png_cmd = cargo_bin_cmd!("oxdraw");
64+
let mut png_cmd = cargo_bin_cmd!("oxdraw");
6565
png_cmd
6666
.arg("--input")
6767
.arg(&path)

tests/input/conditional.mmd

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
graph TD
2+
Start((开始)) --> A[接收多模态输入];
3+
A --> B(6.1 多模态输入理解引擎);
4+
B --> C(6.1.1 跨模态融合与冲突检测);
5+
C --> D[生成统一需求表示];
6+
D --> E(6.2 需求完整性检查引擎);
7+
E --> F{发现缺失或冲突?};
8+
F -- Yes --> G[生成澄清问题列表];
9+
G --> H(等待用户澄清);
10+
F -- No --> I;
11+
H --> I(6.3 规范文档生成引擎);
12+
I --> J[生成完整规范文档];
13+
J --> K(6.4 规范一致性验证);
14+
K --> L{等待用户反馈};
15+
L -- 收到反馈 --> M(6.5 交互式规范细化);
16+
M --> J;
17+
L -- 无反馈 --> End((结束));

tests/output/png/conditional.png

3.91 MB
Loading

tests/output/png/failure_modes.png

353 KB
Loading

tests/output/png/flow.png

-23 KB
Loading
356 KB
Loading

tests/output/png/html_breaks.png

-11.3 KB
Loading

tests/output/png/image_node.png

280 KB
Loading

0 commit comments

Comments
 (0)