diff options
author | Lars Wirzenius <liw@liw.fi> | 2019-09-28 19:03:35 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2019-09-28 19:03:35 +0300 |
commit | 83a94bb17868515858b3849a55ef837ea504e81f (patch) | |
tree | f4d68727e65725069feab3ae6717929c08ce9653 | |
parent | 8ddbef2bf73b265f174e8fda5aebef8dc216a60a (diff) | |
download | roadmap-83a94bb17868515858b3849a55ef837ea504e81f.tar.gz |
Change: roadmap
-rw-r--r-- | legend.svg | 104 | ||||
-rw-r--r-- | src/roadmap.rs | 5 |
2 files changed, 55 insertions, 54 deletions
@@ -4,75 +4,75 @@ <!-- Generated by graphviz version 2.40.1 (20161225.0304) --> <!-- Title: roadmap Pages: 1 --> -<svg width="497pt" height="503pt" - viewBox="0.00 0.00 496.58 503.09" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> +<svg width="494pt" height="503pt" + viewBox="0.00 0.00 493.75 503.09" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 499.0854)"> <title>roadmap</title> -<polygon fill="#ffffff" stroke="transparent" points="-4,4 -4,-499.0854 492.5757,-499.0854 492.5757,4 -4,4"/> -<!-- ready --> +<polygon fill="#ffffff" stroke="transparent" points="-4,4 -4,-499.0854 489.7473,-499.0854 489.7473,4 -4,4"/> +<!-- next --> <g id="node1" class="node"> -<title>ready</title> -<ellipse fill="#ffffff" stroke="#000000" cx="90.5097" cy="-457.6087" rx="90.5193" ry="37.4533"/> -<text text-anchor="middle" x="90.5097" y="-468.9087" font-family="Times,serif" font-size="14.00" fill="#000000">This task is ready </text> -<text text-anchor="middle" x="90.5097" y="-453.9087" font-family="Times,serif" font-size="14.00" fill="#000000">to be done: it is not</text> -<text text-anchor="middle" x="90.5097" y="-438.9087" font-family="Times,serif" font-size="14.00" fill="#000000">blocked by anything</text> +<title>next</title> +<ellipse fill="#0cc000" stroke="#000000" cx="87.6812" cy="-457.6087" rx="87.8629" ry="26.7407"/> +<text text-anchor="middle" x="87.6812" y="-461.4087" font-family="Times,serif" font-size="14.00" fill="#000000">This task is chosen </text> +<text text-anchor="middle" x="87.6812" y="-446.4087" font-family="Times,serif" font-size="14.00" fill="#000000">to be done next</text> </g> <!-- blocked --> -<g id="node3" class="node"> -<title>blocked</title> -<polygon fill="#f4bada" stroke="#000000" points="258.5097,-304.566 118.5097,-304.566 118.5097,-251.566 258.5097,-251.566 258.5097,-304.566"/> -<text text-anchor="middle" x="188.5097" y="-289.366" font-family="Times,serif" font-size="14.00" fill="#000000">This task is blocked</text> -<text text-anchor="middle" x="188.5097" y="-274.366" font-family="Times,serif" font-size="14.00" fill="#000000">and can't be done until</text> -<text text-anchor="middle" x="188.5097" y="-259.366" font-family="Times,serif" font-size="14.00" fill="#000000">something happens</text> -</g> -<!-- ready->blocked --> -<g id="edge3" class="edge"> -<title>ready->blocked</title> -<path fill="none" stroke="#000000" d="M110.5779,-420.8423C127.6802,-389.5098 152.1083,-344.7558 169.0375,-313.7404"/> -<polygon fill="#000000" stroke="#000000" points="172.3152,-315.0405 174.0342,-304.5861 166.1709,-311.6868 172.3152,-315.0405"/> -</g> -<!-- goal --> -<g id="node2" class="node"> -<title>goal</title> -<polygon fill="#00eeee" stroke="#000000" points="285.5097,-136 146.5097,-68 285.5097,0 424.5097,-68 285.5097,-136"/> -<text text-anchor="middle" x="285.5097" y="-86.8" font-family="Times,serif" font-size="14.00" fill="#000000">This is the end goal:</text> -<text text-anchor="middle" x="285.5097" y="-71.8" font-family="Times,serif" font-size="14.00" fill="#000000">if we reach here, there</text> -<text text-anchor="middle" x="285.5097" y="-56.8" font-family="Times,serif" font-size="14.00" fill="#000000">is nothing more to be</text> -<text text-anchor="middle" x="285.5097" y="-41.8" font-family="Times,serif" font-size="14.00" fill="#000000">done in the project</text> -</g> -<!-- blocked->goal --> -<g id="edge2" class="edge"> -<title>blocked->goal</title> -<path fill="none" stroke="#000000" d="M200.7948,-251.461C214.5104,-221.7581 237.2033,-172.6136 255.6517,-132.6612"/> -<polygon fill="#000000" stroke="#000000" points="258.8646,-134.052 259.8793,-123.5058 252.5094,-131.1174 258.8646,-134.052"/> -</g> -<!-- next --> <g id="node4" class="node"> -<title>next</title> -<ellipse fill="#0cc000" stroke="#000000" cx="286.5097" cy="-457.6087" rx="87.8629" ry="26.7407"/> -<text text-anchor="middle" x="286.5097" y="-461.4087" font-family="Times,serif" font-size="14.00" fill="#000000">This task is chosen </text> -<text text-anchor="middle" x="286.5097" y="-446.4087" font-family="Times,serif" font-size="14.00" fill="#000000">to be done next</text> +<title>blocked</title> +<polygon fill="#f4bada" stroke="#000000" points="255.6812,-304.566 115.6812,-304.566 115.6812,-251.566 255.6812,-251.566 255.6812,-304.566"/> +<text text-anchor="middle" x="185.6812" y="-289.366" font-family="Times,serif" font-size="14.00" fill="#000000">This task is blocked</text> +<text text-anchor="middle" x="185.6812" y="-274.366" font-family="Times,serif" font-size="14.00" fill="#000000">and can't be done until</text> +<text text-anchor="middle" x="185.6812" y="-259.366" font-family="Times,serif" font-size="14.00" fill="#000000">something happens</text> </g> <!-- next->blocked --> <g id="edge4" class="edge"> <title>next->blocked</title> -<path fill="none" stroke="#000000" d="M271.8381,-430.7293C254.8296,-399.5686 226.7316,-348.0911 207.9257,-313.6375"/> -<polygon fill="#000000" stroke="#000000" points="210.9846,-311.9362 203.1213,-304.8355 204.8403,-315.29 210.9846,-311.9362"/> +<path fill="none" stroke="#000000" d="M102.3528,-430.7293C119.3613,-399.5686 147.4594,-348.0911 166.2652,-313.6375"/> +<polygon fill="#000000" stroke="#000000" points="169.3507,-315.29 171.0696,-304.8355 163.2063,-311.9362 169.3507,-315.29"/> </g> <!-- finished --> -<g id="node5" class="node"> +<g id="node2" class="node"> <title>finished</title> -<ellipse fill="#eeeeee" stroke="#000000" cx="382.5097" cy="-278.066" rx="106.1321" ry="106.1321"/> -<text text-anchor="middle" x="382.5097" y="-296.866" font-family="Times,serif" font-size="14.00" fill="#000000">This task is finished;</text> -<text text-anchor="middle" x="382.5097" y="-281.866" font-family="Times,serif" font-size="14.00" fill="#000000">the arrow indicates what</text> -<text text-anchor="middle" x="382.5097" y="-266.866" font-family="Times,serif" font-size="14.00" fill="#000000">follows this task (unless</text> -<text text-anchor="middle" x="382.5097" y="-251.866" font-family="Times,serif" font-size="14.00" fill="#000000">it's blocked)</text> +<ellipse fill="#eeeeee" stroke="#000000" cx="379.6812" cy="-278.066" rx="106.1321" ry="106.1321"/> +<text text-anchor="middle" x="379.6812" y="-296.866" font-family="Times,serif" font-size="14.00" fill="#000000">This task is finished;</text> +<text text-anchor="middle" x="379.6812" y="-281.866" font-family="Times,serif" font-size="14.00" fill="#000000">the arrow indicates what</text> +<text text-anchor="middle" x="379.6812" y="-266.866" font-family="Times,serif" font-size="14.00" fill="#000000">follows this task (unless</text> +<text text-anchor="middle" x="379.6812" y="-251.866" font-family="Times,serif" font-size="14.00" fill="#000000">it's blocked)</text> +</g> +<!-- goal --> +<g id="node3" class="node"> +<title>goal</title> +<polygon fill="#00eeee" stroke="#000000" points="282.6812,-136 143.6812,-68 282.6812,0 421.6812,-68 282.6812,-136"/> +<text text-anchor="middle" x="282.6812" y="-86.8" font-family="Times,serif" font-size="14.00" fill="#000000">This is the end goal:</text> +<text text-anchor="middle" x="282.6812" y="-71.8" font-family="Times,serif" font-size="14.00" fill="#000000">if we reach here, there</text> +<text text-anchor="middle" x="282.6812" y="-56.8" font-family="Times,serif" font-size="14.00" fill="#000000">is nothing more to be</text> +<text text-anchor="middle" x="282.6812" y="-41.8" font-family="Times,serif" font-size="14.00" fill="#000000">done in the project</text> </g> <!-- finished->goal --> <g id="edge1" class="edge"> <title>finished->goal</title> -<path fill="none" stroke="#000000" d="M337.9842,-181.6404C330.3953,-165.2057 322.6758,-148.488 315.5755,-133.1114"/> -<polygon fill="#000000" stroke="#000000" points="318.6112,-131.3367 311.2413,-123.7251 312.256,-134.2713 318.6112,-131.3367"/> +<path fill="none" stroke="#000000" d="M335.1558,-181.6404C327.5669,-165.2057 319.8473,-148.488 312.7471,-133.1114"/> +<polygon fill="#000000" stroke="#000000" points="315.7827,-131.3367 308.4128,-123.7251 309.4275,-134.2713 315.7827,-131.3367"/> +</g> +<!-- blocked->goal --> +<g id="edge2" class="edge"> +<title>blocked->goal</title> +<path fill="none" stroke="#000000" d="M197.9664,-251.461C211.6819,-221.7581 234.3749,-172.6136 252.8233,-132.6612"/> +<polygon fill="#000000" stroke="#000000" points="256.0362,-134.052 257.0509,-123.5058 249.681,-131.1174 256.0362,-134.052"/> +</g> +<!-- ready --> +<g id="node5" class="node"> +<title>ready</title> +<ellipse fill="#ffffff" stroke="#000000" cx="283.6812" cy="-457.6087" rx="90.5193" ry="37.4533"/> +<text text-anchor="middle" x="283.6812" y="-468.9087" font-family="Times,serif" font-size="14.00" fill="#000000">This task is ready </text> +<text text-anchor="middle" x="283.6812" y="-453.9087" font-family="Times,serif" font-size="14.00" fill="#000000">to be done: it is not</text> +<text text-anchor="middle" x="283.6812" y="-438.9087" font-family="Times,serif" font-size="14.00" fill="#000000">blocked by anything</text> +</g> +<!-- ready->blocked --> +<g id="edge3" class="edge"> +<title>ready->blocked</title> +<path fill="none" stroke="#000000" d="M263.613,-420.8423C246.5107,-389.5098 222.0826,-344.7558 205.1534,-313.7404"/> +<polygon fill="#000000" stroke="#000000" points="208.02,-311.6868 200.1567,-304.5861 201.8757,-315.0405 208.02,-311.6868"/> </g> </g> </svg> diff --git a/src/roadmap.rs b/src/roadmap.rs index c043e1f..19fd337 100644 --- a/src/roadmap.rs +++ b/src/roadmap.rs @@ -5,6 +5,7 @@ pub use crate::Status; pub use crate::Step; /// All the steps to get to the end goal. +#[derive(Clone)] pub struct Roadmap { steps: Vec<Step>, } @@ -131,7 +132,7 @@ impl Roadmap { /// Get a Graphviz dot language representation of a roadmap. This /// is the textual representation, and the caller needs to use the /// Graphviz dot(1) tool to create an image from it. - pub fn as_dot(self, label_width: usize) -> Result<String, Box<dyn std::error::Error>> { + pub fn as_dot(&self, label_width: usize) -> Result<String, Box<dyn std::error::Error>> { let labels = self.steps.iter().map(|step| { format!( "{} [label=\"{}\" style=filled fillcolor=\"{}\" shape=\"{}\"];\n", @@ -167,7 +168,7 @@ impl Roadmap { Status::Ready => "#ffffff", Status::Next => "#0cc00", Status::Goal => "#00eeee", - Status::Unknown => "#rr0000", + Status::Unknown => "#ff0000", } } |