Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Feature/multicolor wires on refactored code #96

Merged

Conversation

aakatz3
Copy link
Contributor

@aakatz3 aakatz3 commented Jul 16, 2020

This is a rewrite/merge for #17, after a development reset. I decided to do this in a new branch instead of in the existing one due to the difficulty in directly merging it. This is now fully ready for review! 😃

Please see #17 for additional history

This closes #17 and closes #12

It should also close #52

It also removes prebuilt examples from the dev branch, and adds artifacts to examples from GitHub actions

Requesting review from @formatc1702 and @kvid

@aakatz3 aakatz3 changed the title Implement Feature/multicolor wires on refactored code Implement Feature/multicolor wires on refactored code (#12, #17) Jul 16, 2020
@aakatz3 aakatz3 changed the title Implement Feature/multicolor wires on refactored code (#12, #17) Implement Feature/multicolor wires on refactored code Jul 16, 2020
@aakatz3 aakatz3 force-pushed the feature/multicolor-wires branch 2 times, most recently from bbfd131 to 6013d05 Compare July 16, 2020 23:42
@formatc1702 formatc1702 changed the base branch from dev to feature/multicolor-wires-2 July 17, 2020 05:07
@formatc1702 formatc1702 merged commit feee3c0 into wireviz:feature/multicolor-wires-2 Jul 17, 2020
@formatc1702
Copy link
Collaborator

formatc1702 commented Jul 17, 2020

Thanks. I will try it out later today and will let you know my thoughts!

I might do some light tweaking before merging into dev.

In the meantime, please have a look at my comments in #94, I'm not 100% convinced just cleaning the examples is the best way forward.

@davidrea
Copy link

Gave this a try this morning, works great!

image

@SnowMB
Copy link
Contributor

SnowMB commented Jul 17, 2020

I played a little bit directly with graphviz and the ex10.gv example and could produce an output like this:
ex10 gv

Unfortunately it only seems to work by stacking subgraph that have more than one edge. I'm not sure if this is a feasable way to achieve an even better looking output or if I accidentally found a bug in graphviz. 😁

Anyway here is the file content (Done with dot - graphviz version 2.44.0 (0)):

graph {
// Graph generated by WireViz
// https://github.com/formatc1702/WireViz
	graph [bgcolor="#ffffff" fontname=arial nodesep=0.33 rankdir=LR ranksep=2]
	
	node [fillcolor=white fontname=arial shape=record style=filled]
	X1 [label=<<table border="0" cellspacing="0" cellpadding="0"><tr><td><table border="0" cellspacing="0" cellpadding="3" cellborder="1"><tr><td balign="left">X1</td></tr></table></td></tr><tr><td><table border="0" cellspacing="0" cellpadding="3" cellborder="1"><tr><td balign="left">Stewart Connector SS-37000-002</td><td balign="left">male</td><td balign="left">8-pin</td></tr></table></td></tr><tr><td><table border="0" cellspacing="0" cellpadding="3" cellborder="1"><tr><td>DA+</td><td port="p1r">1</td></tr><tr><td>DA-</td><td port="p2r">2</td></tr><tr><td>DB+</td><td port="p3r">3</td></tr><tr><td>DC+</td><td port="p4r">4</td></tr><tr><td>DC-</td><td port="p5r">5</td></tr><tr><td>DB-</td><td port="p6r">6</td></tr><tr><td>DD+</td><td port="p7r">7</td></tr><tr><td>DD-</td><td port="p8r">8</td></tr></table></td></tr></table>> fillcolor=white margin=0 shape=none style=filled]
	X2 [label=<<table border="0" cellspacing="0" cellpadding="0"><tr><td><table border="0" cellspacing="0" cellpadding="3" cellborder="1"><tr><td balign="left">X2</td></tr></table></td></tr><tr><td><table border="0" cellspacing="0" cellpadding="3" cellborder="1"><tr><td balign="left">Stewart Connector SS-37000-002</td><td balign="left">male</td><td balign="left">8-pin</td></tr></table></td></tr><tr><td><table border="0" cellspacing="0" cellpadding="3" cellborder="1"><tr><td port="p1l">1</td><td>DB+</td></tr><tr><td port="p2l">2</td><td>DB-</td></tr><tr><td port="p3l">3</td><td>DA+</td></tr><tr><td port="p4l">4</td><td>DD+</td></tr><tr><td port="p5l">5</td><td>DD-</td></tr><tr><td port="p6l">6</td><td>DA-</td></tr><tr><td port="p7l">7</td><td>DC+</td></tr><tr><td port="p8l">8</td><td>DC-</td></tr></table></td></tr></table>> fillcolor=white margin=0 shape=none style=filled]
	W1 [label=<<table border="0" cellspacing="0" cellpadding="0"><tr><td><table border="0" cellspacing="0" cellpadding="3" cellborder="1"><tr><td colspan="4">W1</td></tr><tr><td balign="left">CAT5e</td><td balign="left">8x</td><td balign="left">24 AWG</td><td balign="left">1 m</td></tr></table></td></tr><tr><td>&nbsp;</td></tr><tr><td><table border="0" cellspacing="0" cellborder="0"><tr><td>X1:1</td><td>WHGN</td><td>X2:3</td></tr><tr><td colspan="3" border="0" cellspacing="0" cellpadding="0" port="w1" height="10"><table cellspacing="0" cellborder="0" border = "0"><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#000000" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#ffffff" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#00ff00" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#ffffff" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#000000" border="0"></td></tr></table></td></tr><tr><td>X1:2</td><td>GN</td><td>X2:6</td></tr><tr><td colspan="3" border="0" cellspacing="0" cellpadding="0" port="w2" height="10"><table cellspacing="0" cellborder="0" border = "0"><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#000000" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#00ff00" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#00ff00" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#00ff00" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#000000" border="0"></td></tr></table></td></tr><tr><td>X1:3</td><td>WHOG</td><td>X2:1</td></tr><tr><td colspan="3" border="0" cellspacing="0" cellpadding="0" port="w3" height="10"><table cellspacing="0" cellborder="0" border = "0"><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#000000" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#ffffff" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#ff8000" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#ffffff" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#000000" border="0"></td></tr></table></td></tr><tr><td>X1:4</td><td>BU</td><td>X2:7</td></tr><tr><td colspan="3" border="0" cellspacing="0" cellpadding="0" port="w4" height="10"><table cellspacing="0" cellborder="0" border = "0"><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#000000" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#0066ff" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#0066ff" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#0066ff" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#000000" border="0"></td></tr></table></td></tr><tr><td>X1:5</td><td>WHBU</td><td>X2:8</td></tr><tr><td colspan="3" border="0" cellspacing="0" cellpadding="0" port="w5" height="10"><table cellspacing="0" cellborder="0" border = "0"><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#000000" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#ffffff" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#0066ff" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#ffffff" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#000000" border="0"></td></tr></table></td></tr><tr><td>X1:6</td><td>OG</td><td>X2:2</td></tr><tr><td colspan="3" border="0" cellspacing="0" cellpadding="0" port="w6" height="10"><table cellspacing="0" cellborder="0" border = "0"><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#000000" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#ff8000" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#ff8000" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#ff8000" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#000000" border="0"></td></tr></table></td></tr><tr><td>X1:7</td><td>WHBN</td><td>X2:4</td></tr><tr><td colspan="3" border="0" cellspacing="0" cellpadding="0" port="w7" height="10"><table cellspacing="0" cellborder="0" border = "0"><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#000000" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#ffffff" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#895956" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#ffffff" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#000000" border="0"></td></tr></table></td></tr><tr><td>X1:8</td><td>BN</td><td>X2:5</td></tr><tr><td colspan="3" border="0" cellspacing="0" cellpadding="0" port="w8" height="10"><table cellspacing="0" cellborder="0" border = "0"><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#000000" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#895956" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#895956" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#895956" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#000000" border="0"></td></tr></table></td></tr><tr><td>&nbsp;</td></tr></table></td></tr></table>> fillcolor=white margin=0 shape=box style=""]
	
	subgraph{
		edge [penwidth=10.0 color="#000000"]
		X1:p1r:e -- W1:w1:w
		W1:w1:e -- X2:p3l:w
		edge [penwidth=10.0 color="#000000"];
		X1:p2r:e -- W1:w2:w
		W1:w2:e -- X2:p6l:w
		edge [penwidth=10.0 color="#000000"];
		X1:p3r:e -- W1:w3:w
		W1:w3:e -- X2:p1l:w
		edge [penwidth=10.0 color="#000000"];
		X1:p4r:e -- W1:w4:w
		W1:w4:e -- X2:p7l:w
		edge [penwidth=10.0 color="#000000"];
		X1:p5r:e -- W1:w5:w
		W1:w5:e -- X2:p8l:w
		edge [penwidth=10.0 color="#000000"];
		X1:p6r:e -- W1:w6:w
		W1:w6:e -- X2:p2l:w
		edge [penwidth=10.0 color="#000000"];
		X1:p7r:e -- W1:w7:w
		W1:w7:e -- X2:p4l:w
		edge [penwidth=10.0 color="#000000"];
		X1:p8r:e -- W1:w8:w
		W1:w8:e -- X2:p5l:w
	}

	subgraph colors{
		edge [penwidth=6.0 color="#ffffff;0.1:#00ff00;0.1:#ffffff;0.1:#00ff00;0.1:#ffffff;0.1:#00ff00;0.1:#ffffff;0.1:#00ff00;0.1:#ffffff;0.1:#00ff00;0.1"]
		X1:p1r:e -- W1:w1:w
		W1:w1:e -- X2:p3l:w
		edge [penwidth=6.0 color="#00ff00"]
		X1:p2r:e -- W1:w2:w
		W1:w2:e -- X2:p6l:w
		edge [penwidth=6.0 color="#ffffff;0.1:#ff8000;0.1:#ffffff;0.1:#ff8000;0.1:#ffffff;0.1:#ff8000;0.1:#ffffff;0.1:#ff8000;0.1:#ffffff;0.1:#ff8000;0.1"]
		X1:p3r:e -- W1:w3:w
		W1:w3:e -- X2:p1l:w
		edge [penwidth=6.0 color="#0066ff"]
		X1:p4r:e -- W1:w4:w
		W1:w4:e -- X2:p7l:w
		edge [penwidth=6.0 color="#ffffff;0.1:#0066ff;0.1:#ffffff;0.1:#0066ff;0.1:#ffffff;0.1:#0066ff;0.1:#ffffff;0.1:#0066ff;0.1:#ffffff;0.1:#0066ff;0.1"]
		X1:p5r:e -- W1:w5:w
		W1:w5:e -- X2:p8l:w
		edge [penwidth=6.0 color="#ff8000"]
		X1:p6r:e -- W1:w6:w
		W1:w6:e -- X2:p2l:w
		edge [penwidth=6.0 color="#ffffff;0.1:#895956;0.1:#ffffff;0.1:#895956;0.1:#ffffff;0.1:#895956;0.1:#ffffff;0.1:#895956;0.1:#ffffff;0.1:#895956;0.1"]
		X1:p7r:e -- W1:w7:w
		W1:w7:e -- X2:p4l:w
		edge [penwidth=6.0 color="#895956"]
		X1:p8r:e -- W1:w8:w
		W1:w8:e -- X2:p5l:w
	}

	
}

@kvid
Copy link
Collaborator

kvid commented Jul 17, 2020

I like the color band output as an optional alternative to the stripes as there are wires of both kind of multi-coloring. It is easy to also support banded wire coloring inside the cable node to match the edges. However, as already mentioned by others, we have no knowledge about the length of each edge, and hence, it's hard to decide how many colored bands each edge should be split into. You have selected 5 white + 5 colored bands on each edge, and that fits well in this diagram, but a different diagram might have some long edges and some short ones. A 5+5 split for long edges will have long bands and for short edges will have short bands. I don't know how to keep the bands equal along a short edge on one side, inside the cable node, and along a long edge on the other side.

@formatc1702
Copy link
Collaborator

that does look pretty nice, and you could even achieve the effect inside the cable node by splitting the colored cell vertically into stripes as well!

For now, I'm happy to have multicolor lengthwise stripes working, but I think it's fitting to create a new [feature] issue out of @SnowMB 's comment, and work on it a bit later on. Thanks!

@SnowMB
Copy link
Contributor

SnowMB commented Jul 17, 2020

I like the color band output as an optional alternative to the stripes as there are wires of both kind of multi-coloring. It is easy to also support banded wire coloring inside the cable node to match the edges. However, as already mentioned by others, we have no knowledge about the length of each edge, and hence, it's hard to decide how many colored bands each edge should be split into. You have selected 5 white + 5 colored bands on each edge, and that fits well in this diagram, but a different diagram might have some long edges and some short ones. A 5+5 split for long edges will have long bands and for short edges will have short bands. I don't know how to keep the bands equal along a short edge on one side, inside the cable node, and along a long edge on the other side.

I agree. Unfortunately using a solid color as background and using style=dashed does not look as nice because the dashes are to small. I think for a certain range having a hard coded number of stripes is fine but at some point, when the edge gets to long it does not look nice anymore.

Sadly graphviz is rather limited in styling the edges.

A minor annoyance is that the crossings are not drawn correctly because all of the background is drawn first and the colors are drawn after that. It would look nicer if background and foreground of an edge would be drawn together before the next edge is drawn. But when I use a subgraph for each connection or try to draw foreground and background inside the same subgraph graphviz does not draw them on top of each other. That's why I suspect that my working example is actually a bug in graphviz.

I will try more the next days.

@SnowMB
Copy link
Contributor

SnowMB commented Jul 18, 2020

Hey,

playing around further I can produce nice crossings of the edges. I also found out that subgraphs are not needed. Interestingly it is enough to throw in an invisible edge. After that edge graphviz draws edges on top of each other just as we want to.

ex10_withCrossings gv

graph {
// Graph generated by WireViz
// https://github.com/formatc1702/WireViz
	graph [bgcolor="#ffffff" fontname=arial nodesep=0.33 rankdir=LR ranksep=2]
	
	node [fillcolor=white fontname=arial shape=record style=filled]
	X1 [label=<<table border="0" cellspacing="0" cellpadding="0"><tr><td><table border="0" cellspacing="0" cellpadding="3" cellborder="1"><tr><td balign="left">X1</td></tr></table></td></tr><tr><td><table border="0" cellspacing="0" cellpadding="3" cellborder="1"><tr><td balign="left">Stewart Connector SS-37000-002</td><td balign="left">male</td><td balign="left">8-pin</td></tr></table></td></tr><tr><td><table border="0" cellspacing="0" cellpadding="3" cellborder="1"><tr><td>DA+</td><td port="p1r">1</td></tr><tr><td>DA-</td><td port="p2r">2</td></tr><tr><td>DB+</td><td port="p3r">3</td></tr><tr><td>DC+</td><td port="p4r">4</td></tr><tr><td>DC-</td><td port="p5r">5</td></tr><tr><td>DB-</td><td port="p6r">6</td></tr><tr><td>DD+</td><td port="p7r">7</td></tr><tr><td>DD-</td><td port="p8r">8</td></tr></table></td></tr></table>> fillcolor=white margin=0 shape=none style=filled]
	X2 [label=<<table border="0" cellspacing="0" cellpadding="0"><tr><td><table border="0" cellspacing="0" cellpadding="3" cellborder="1"><tr><td balign="left">X2</td></tr></table></td></tr><tr><td><table border="0" cellspacing="0" cellpadding="3" cellborder="1"><tr><td balign="left">Stewart Connector SS-37000-002</td><td balign="left">male</td><td balign="left">8-pin</td></tr></table></td></tr><tr><td><table border="0" cellspacing="0" cellpadding="3" cellborder="1"><tr><td port="p1l">1</td><td>DB+</td></tr><tr><td port="p2l">2</td><td>DB-</td></tr><tr><td port="p3l">3</td><td>DA+</td></tr><tr><td port="p4l">4</td><td>DD+</td></tr><tr><td port="p5l">5</td><td>DD-</td></tr><tr><td port="p6l">6</td><td>DA-</td></tr><tr><td port="p7l">7</td><td>DC+</td></tr><tr><td port="p8l">8</td><td>DC-</td></tr></table></td></tr></table>> fillcolor=white margin=0 shape=none style=filled]
	W1 [label=<<table border="0" cellspacing="0" cellpadding="0"><tr><td><table border="0" cellspacing="0" cellpadding="3" cellborder="1"><tr><td colspan="4">W1</td></tr><tr><td balign="left">CAT5e</td><td balign="left">8x</td><td balign="left">24 AWG</td><td balign="left">1 m</td></tr></table></td></tr><tr><td>&nbsp;</td></tr><tr><td><table border="0" cellspacing="0" cellborder="0"><tr><td>X1:1</td><td>WHGN</td><td>X2:3</td></tr><tr><td colspan="3" border="0" cellspacing="0" cellpadding="0" port="w1" height="10"><table cellspacing="0" cellborder="0" border = "0"><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#000000" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#ffffff" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#00ff00" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#ffffff" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#000000" border="0"></td></tr></table></td></tr><tr><td>X1:2</td><td>GN</td><td>X2:6</td></tr><tr><td colspan="3" border="0" cellspacing="0" cellpadding="0" port="w2" height="10"><table cellspacing="0" cellborder="0" border = "0"><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#000000" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#00ff00" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#00ff00" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#00ff00" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#000000" border="0"></td></tr></table></td></tr><tr><td>X1:3</td><td>WHOG</td><td>X2:1</td></tr><tr><td colspan="3" border="0" cellspacing="0" cellpadding="0" port="w3" height="10"><table cellspacing="0" cellborder="0" border = "0"><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#000000" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#ffffff" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#ff8000" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#ffffff" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#000000" border="0"></td></tr></table></td></tr><tr><td>X1:4</td><td>BU</td><td>X2:7</td></tr><tr><td colspan="3" border="0" cellspacing="0" cellpadding="0" port="w4" height="10"><table cellspacing="0" cellborder="0" border = "0"><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#000000" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#0066ff" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#0066ff" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#0066ff" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#000000" border="0"></td></tr></table></td></tr><tr><td>X1:5</td><td>WHBU</td><td>X2:8</td></tr><tr><td colspan="3" border="0" cellspacing="0" cellpadding="0" port="w5" height="10"><table cellspacing="0" cellborder="0" border = "0"><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#000000" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#ffffff" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#0066ff" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#ffffff" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#000000" border="0"></td></tr></table></td></tr><tr><td>X1:6</td><td>OG</td><td>X2:2</td></tr><tr><td colspan="3" border="0" cellspacing="0" cellpadding="0" port="w6" height="10"><table cellspacing="0" cellborder="0" border = "0"><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#000000" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#ff8000" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#ff8000" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#ff8000" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#000000" border="0"></td></tr></table></td></tr><tr><td>X1:7</td><td>WHBN</td><td>X2:4</td></tr><tr><td colspan="3" border="0" cellspacing="0" cellpadding="0" port="w7" height="10"><table cellspacing="0" cellborder="0" border = "0"><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#000000" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#ffffff" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#895956" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#ffffff" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#000000" border="0"></td></tr></table></td></tr><tr><td>X1:8</td><td>BN</td><td>X2:5</td></tr><tr><td colspan="3" border="0" cellspacing="0" cellpadding="0" port="w8" height="10"><table cellspacing="0" cellborder="0" border = "0"><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#000000" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#895956" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#895956" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#895956" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#000000" border="0"></td></tr></table></td></tr><tr><td>&nbsp;</td></tr></table></td></tr></table>> fillcolor=white margin=0 shape=box style=""]
	

	edge [penwidth=10.0 color="#000000"]
	X1:p1r:e -- W1:w1:w
	W1:w1:e -- X2:p3l:w
	edge [style="invis"]
	X1 -- W1
	W1 -- X2
	edge [penwidth=6.0 style="" color="#ffffff;0.1:#00ff00;0.1:#ffffff;0.1:#00ff00;0.1:#ffffff;0.1:#00ff00;0.1:#ffffff;0.1:#00ff00;0.1:#ffffff;0.1:#00ff00;0.1"]
	X1:p1r:e -- W1:w1:w
	W1:w1:e -- X2:p3l:w

	edge [penwidth=10.0 color="#000000"];
	X1:p2r:e -- W1:w2:w
	W1:w2:e -- X2:p6l:w
	edge [style="invis"]
	X1 -- W1
	W1 -- X2
	edge [penwidth=6.0 style="" color="#00ff00"]
	X1:p2r:e -- W1:w2:w
	W1:w2:e -- X2:p6l:w

	edge [penwidth=10.0 color="#000000"];
	X1:p3r:e -- W1:w3:w
	W1:w3:e -- X2:p1l:w
	edge [style="invis"]
	X1 -- W1
	W1 -- X2
	edge [penwidth=6.0 style="" color="#ffffff;0.1:#ff8000;0.1:#ffffff;0.1:#ff8000;0.1:#ffffff;0.1:#ff8000;0.1:#ffffff;0.1:#ff8000;0.1:#ffffff;0.1:#ff8000;0.1"]
	X1:p3r:e -- W1:w3:w
	W1:w3:e -- X2:p1l:w

	edge [penwidth=10.0 color="#000000"];
	X1:p4r:e -- W1:w4:w
	W1:w4:e -- X2:p7l:w
	edge [style="invis"]
	X1 -- W1
	W1 -- X2
	edge [penwidth=6.0 style="" color="#0066ff"]
	X1:p4r:e -- W1:w4:w
	W1:w4:e -- X2:p7l:w

	edge [penwidth=10.0 color="#000000"];
	X1:p5r:e -- W1:w5:w
	W1:w5:e -- X2:p8l:w
	edge [style="invis"]
	X1 -- W1
	W1 -- X2
	edge [penwidth=6.0 style="" color="#ffffff;0.1:#0066ff;0.1:#ffffff;0.1:#0066ff;0.1:#ffffff;0.1:#0066ff;0.1:#ffffff;0.1:#0066ff;0.1:#ffffff;0.1:#0066ff;0.1"]
	X1:p5r:e -- W1:w5:w
	W1:w5:e -- X2:p8l:w

	edge [penwidth=10.0 color="#000000"];
	X1:p6r:e -- W1:w6:w
	W1:w6:e -- X2:p2l:w
	edge [style="invis"]
	X1 -- W1
	W1 -- X2
	edge [penwidth=6.0 style="" color="#ff8000"]
	X1:p6r:e -- W1:w6:w
	W1:w6:e -- X2:p2l:w
	
	edge [penwidth=10.0 color="#000000"];
	X1:p7r:e -- W1:w7:w
	W1:w7:e -- X2:p4l:w
	edge [style="invis"]
	X1 -- W1
	W1 -- X2
	edge [penwidth=6.0 style="" color="#ffffff;0.1:#895956;0.1:#ffffff;0.1:#895956;0.1:#ffffff;0.1:#895956;0.1:#ffffff;0.1:#895956;0.1:#ffffff;0.1:#895956;0.1"]
	X1:p7r:e -- W1:w7:w
	W1:w7:e -- X2:p4l:w

	edge [penwidth=10.0 color="#000000"];
	X1:p8r:e -- W1:w8:w
	W1:w8:e -- X2:p5l:w
	edge [style="invis"]
	X1 -- W1
	W1 -- X2
	edge [penwidth=6.0 style="" color="#895956"]
	X1:p8r:e -- W1:w8:w
	W1:w8:e -- X2:p5l:w
}

@kvid For your point about stripes and wire length I have no solution for now. I can use multiple graphs (black, first color and second color dashed) but I don't like the output. It heavenly depends on the format and renderer (in case of for example svg, pdf) how the output will look like. In general I also think that dashes are to short.

Left is dashed, right is dotted:

ex10_dash_dot gv

And for example a screenshot of the svg rendered in firefox has uneven dashes and whitespace 🤔

image

graph {
// Graph generated by WireViz
// https://github.com/formatc1702/WireViz
	graph [bgcolor="#ffffff" fontname=arial nodesep=0.33 rankdir=LR ranksep=2]
	
	node [fillcolor=white fontname=arial shape=record style=filled]
	X1 [label=<<table border="0" cellspacing="0" cellpadding="0"><tr><td><table border="0" cellspacing="0" cellpadding="3" cellborder="1"><tr><td balign="left">X1</td></tr></table></td></tr><tr><td><table border="0" cellspacing="0" cellpadding="3" cellborder="1"><tr><td balign="left">Stewart Connector SS-37000-002</td><td balign="left">male</td><td balign="left">8-pin</td></tr></table></td></tr><tr><td><table border="0" cellspacing="0" cellpadding="3" cellborder="1"><tr><td>DA+</td><td port="p1r">1</td></tr><tr><td>DA-</td><td port="p2r">2</td></tr><tr><td>DB+</td><td port="p3r">3</td></tr><tr><td>DC+</td><td port="p4r">4</td></tr><tr><td>DC-</td><td port="p5r">5</td></tr><tr><td>DB-</td><td port="p6r">6</td></tr><tr><td>DD+</td><td port="p7r">7</td></tr><tr><td>DD-</td><td port="p8r">8</td></tr></table></td></tr></table>> fillcolor=white margin=0 shape=none style=filled]
	X2 [label=<<table border="0" cellspacing="0" cellpadding="0"><tr><td><table border="0" cellspacing="0" cellpadding="3" cellborder="1"><tr><td balign="left">X2</td></tr></table></td></tr><tr><td><table border="0" cellspacing="0" cellpadding="3" cellborder="1"><tr><td balign="left">Stewart Connector SS-37000-002</td><td balign="left">male</td><td balign="left">8-pin</td></tr></table></td></tr><tr><td><table border="0" cellspacing="0" cellpadding="3" cellborder="1"><tr><td port="p1l">1</td><td>DB+</td></tr><tr><td port="p2l">2</td><td>DB-</td></tr><tr><td port="p3l">3</td><td>DA+</td></tr><tr><td port="p4l">4</td><td>DD+</td></tr><tr><td port="p5l">5</td><td>DD-</td></tr><tr><td port="p6l">6</td><td>DA-</td></tr><tr><td port="p7l">7</td><td>DC+</td></tr><tr><td port="p8l">8</td><td>DC-</td></tr></table></td></tr></table>> fillcolor=white margin=0 shape=none style=filled]
	W1 [label=<<table border="0" cellspacing="0" cellpadding="0"><tr><td><table border="0" cellspacing="0" cellpadding="3" cellborder="1"><tr><td colspan="4">W1</td></tr><tr><td balign="left">CAT5e</td><td balign="left">8x</td><td balign="left">24 AWG</td><td balign="left">1 m</td></tr></table></td></tr><tr><td>&nbsp;</td></tr><tr><td><table border="0" cellspacing="0" cellborder="0"><tr><td>X1:1</td><td>WHGN</td><td>X2:3</td></tr><tr><td colspan="3" border="0" cellspacing="0" cellpadding="0" port="w1" height="10"><table cellspacing="0" cellborder="0" border = "0"><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#000000" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#ffffff" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#00ff00" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#ffffff" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#000000" border="0"></td></tr></table></td></tr><tr><td>X1:2</td><td>GN</td><td>X2:6</td></tr><tr><td colspan="3" border="0" cellspacing="0" cellpadding="0" port="w2" height="10"><table cellspacing="0" cellborder="0" border = "0"><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#000000" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#00ff00" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#00ff00" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#00ff00" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#000000" border="0"></td></tr></table></td></tr><tr><td>X1:3</td><td>WHOG</td><td>X2:1</td></tr><tr><td colspan="3" border="0" cellspacing="0" cellpadding="0" port="w3" height="10"><table cellspacing="0" cellborder="0" border = "0"><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#000000" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#ffffff" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#ff8000" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#ffffff" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#000000" border="0"></td></tr></table></td></tr><tr><td>X1:4</td><td>BU</td><td>X2:7</td></tr><tr><td colspan="3" border="0" cellspacing="0" cellpadding="0" port="w4" height="10"><table cellspacing="0" cellborder="0" border = "0"><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#000000" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#0066ff" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#0066ff" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#0066ff" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#000000" border="0"></td></tr></table></td></tr><tr><td>X1:5</td><td>WHBU</td><td>X2:8</td></tr><tr><td colspan="3" border="0" cellspacing="0" cellpadding="0" port="w5" height="10"><table cellspacing="0" cellborder="0" border = "0"><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#000000" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#ffffff" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#0066ff" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#ffffff" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#000000" border="0"></td></tr></table></td></tr><tr><td>X1:6</td><td>OG</td><td>X2:2</td></tr><tr><td colspan="3" border="0" cellspacing="0" cellpadding="0" port="w6" height="10"><table cellspacing="0" cellborder="0" border = "0"><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#000000" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#ff8000" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#ff8000" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#ff8000" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#000000" border="0"></td></tr></table></td></tr><tr><td>X1:7</td><td>WHBN</td><td>X2:4</td></tr><tr><td colspan="3" border="0" cellspacing="0" cellpadding="0" port="w7" height="10"><table cellspacing="0" cellborder="0" border = "0"><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#000000" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#ffffff" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#895956" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#ffffff" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#000000" border="0"></td></tr></table></td></tr><tr><td>X1:8</td><td>BN</td><td>X2:5</td></tr><tr><td colspan="3" border="0" cellspacing="0" cellpadding="0" port="w8" height="10"><table cellspacing="0" cellborder="0" border = "0"><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#000000" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#895956" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#895956" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#895956" border="0"></td></tr><tr><td colspan="3" cellpadding="0" height="2" bgcolor="#000000" border="0"></td></tr></table></td></tr><tr><td>&nbsp;</td></tr></table></td></tr></table>> fillcolor=white margin=0 shape=box style=""]
	
	//1
	edge [penwidth=10.0 color="#000000"]
	X1:p1r:e -- W1:w1:w
	W1:w1:e -- X2:p3l:w
	edge [style="invis"]
	X1 -- W1
	W1 -- X2
	edge [penwidth=6.0 style="" color="#ffffff"]
	X1:p1r:e -- W1:w1:w
	W1:w1:e -- X2:p3l:w
	edge [style="invis"]
	X1 -- W1
	W1 -- X2
	edge [penwidth=6.0 style="dashed" color="#00ff00"]
	X1:p1r:e -- W1:w1:w
	edge [penwidth=6.0 style="dotted" color="#00ff00"]
	W1:w1:e -- X2:p3l:w

	//2
	edge [penwidth=10.0 style="" color="#000000"];
	X1:p2r:e -- W1:w2:w
	W1:w2:e -- X2:p6l:w
	edge [style="invis"]
	X1 -- W1
	W1 -- X2
	edge [penwidth=6.0 style="" color="#00ff00"]
	X1:p2r:e -- W1:w2:w
	W1:w2:e -- X2:p6l:w

	//3
	edge [penwidth=10.0 color="#000000"];
	X1:p3r:e -- W1:w3:w
	W1:w3:e -- X2:p1l:w
	edge [style="invis"]
	X1 -- W1
	W1 -- X2
	edge [penwidth=6.0 style="" color="#ffffff"]
	X1:p3r:e -- W1:w3:w
	W1:w3:e -- X2:p1l:w
	edge [style="invis"]
	X1 -- W1
	W1 -- X2
	edge [penwidth=6.0 style="dashed" color="#ff8000"]
	X1:p3r:e -- W1:w3:w
	edge [penwidth=6.0 style="dotted" color="#ff8000"]
	W1:w3:e -- X2:p1l:w


}

@formatc1702
Copy link
Collaborator

@SnowMB this is fantastic work! Please start a new issue (something like banded vs. striped wires) so it doesn't get buried in an old PR :) Feel free to copy & paste your existing examples there!

@formatc1702 formatc1702 added this to the v0.2 milestone Jul 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants