summaryrefslogtreecommitdiff
path: root/viz
diff options
context:
space:
mode:
Diffstat (limited to 'viz')
-rw-r--r--viz/Cargo.toml9
-rw-r--r--viz/src/lib.rs31
2 files changed, 40 insertions, 0 deletions
diff --git a/viz/Cargo.toml b/viz/Cargo.toml
new file mode 100644
index 0000000..2894c21
--- /dev/null
+++ b/viz/Cargo.toml
@@ -0,0 +1,9 @@
+[package]
+name = "viz"
+version = "0.1.0"
+edition = "2021"
+
+# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+
+[dependencies]
+graph = { path = "../graph" } \ No newline at end of file
diff --git a/viz/src/lib.rs b/viz/src/lib.rs
new file mode 100644
index 0000000..b40c78a
--- /dev/null
+++ b/viz/src/lib.rs
@@ -0,0 +1,31 @@
+//! This library defines a binary format to store graph data such that
+//! a client which understands the format can easily print the graph,
+//! centered at any specific node, with any scope. The library also
+//! provides functions to print graphs in this format.
+//!
+//! This way, one does not need a server to print and interact with
+//! graphs.
+//!
+//! # Graph representation
+//!
+//! The library uses the [`Graph`][graph::Graph] trait from the crate
+//! [graph]. Only the functions exposed from the trait are used by
+//! this library. So the users can also implement the trait and then
+//! print the graph data represented by other graph crates.
+
+extern crate graph;
+
+pub fn add(left: usize, right: usize) -> usize {
+ left + right
+}
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+
+ #[test]
+ fn it_works() {
+ let result = add(2, 2);
+ assert_eq!(result, 4);
+ }
+}