fix: refine mermaid diagram style

This commit is contained in:
Zixuan Chen 2022-08-04 13:21:49 +08:00
parent d1e135ec30
commit bb3eb7b7a0
3 changed files with 9 additions and 3 deletions

View file

@ -192,6 +192,8 @@ pub(crate) trait Dag {
iter_dag(self)
}
/// You can visualize and generate img link at https://mermaid.live/
#[inline]
fn mermaid(&self) -> String
where
Self: Sized,

View file

@ -43,8 +43,12 @@ fn to_str(output: Output) -> String {
is_first = false;
s += format!(
"{}-{}(ctr: {}..{})",
id_span.client_id, id_span.counter.from, id_span.counter.from, id_span.counter.to
"{}-{}(\"c{}: [{}, {})\")",
id_span.client_id,
id_span.counter.from,
id_span.client_id,
id_span.counter.from,
id_span.counter.to
)
.as_str();
}

View file

@ -473,7 +473,7 @@ mod find_common_ancestors {
);
}
/// ![](https://i.ibb.co/C5xLG53/image.png)
/// ![](https://mermaid.ink/img/pako:eNqNkTFPwzAQhf_K6SYqOZJ9CYsHJroxwYgXY7skInEq1xFCVf87jg5XVQQSnk6fz_feO5_RzT6gxsM4f7repgzPTyZCOafl7T3ZYw9uHELMkqls2juDTmp4bQV0O4M7aJqHwqlyEtDecFW5EkA3XFYuBaiVs0CInotfXSimqunW16q87gTcX6cqdqe27hSrKVZr_6tGTImn0nYqcWbaZiZWI1ajP9WK2zqnClFd5jVn3SIKnEKa7ODLb53Xa4O5D1MwqEvpbfowaOKl9C1Hb3PY-yHPCfXBjqcg0C55fvmKDnVOS6hNj4Mtgaefrss3dp6HFg)
#[test]
fn large_lamport_with_longer_path() {
let mut a0 = TestDag::new(0);