diff --git a/docs/README.md b/docs/README.md index 5e14600f9..759c946fc 100644 --- a/docs/README.md +++ b/docs/README.md @@ -148,6 +148,11 @@ To see how to specify the output formats, as well as additional options, run: $ wireviz --help ``` +For using the .gv output one needs to use the following command: + +``` +dot .gv | gvpr -q -cf _pin2pin.gvpr | neato -n2 -T -o . +``` ### (Re-)Building the example projects diff --git a/docs/syntax.md b/docs/syntax.md index 77fce9ab9..47bc1b57c 100644 --- a/docs/syntax.md +++ b/docs/syntax.md @@ -83,8 +83,24 @@ tweak: # optional tweaking of .gv output hide_disconnected_pins: # defaults to false # loops - loops: # every list item is itself a list of exactly two pins - # on the connector that are to be shorted + loops: # a list(dict) of loops + - : # every list item is itself a list of pins + # on the connector that are to be shorted with a cable loop + # more information about the loop can be added by additional + # components definition (see below) + # OR + - # a list of pins to be looped + # Shorts + shorts: # a list(dict) of shorts + : # every list item is itself a list of pins + # on the connector that are to be shorted represented inside + # the connector table + # more information about the loop can be added by additional + # components definition (see below) + # OR + - # a list of pins to be shorted + # it is not posable to combine those two + shorts_hide_lable: # A Boolean to control if the lable of the shorts should be shown, if a list is used this is automatically turned true. ``` ## Cable attributes diff --git a/examples/demo01.gv b/examples/demo01.gv index 8b9144d29..7142f4ffd 100644 --- a/examples/demo01.gv +++ b/examples/demo01.gv @@ -70,6 +70,8 @@ graph { > shape=box style=filled] + edge [color="#000000"] + X1:p7r:e -- X1:p8r:e [label=" " color="#000000" noLabel=noLabel] X2 [label=< @@ -149,19 +151,7 @@ graph { - + @@ -171,19 +161,7 @@ graph { - + @@ -193,19 +171,7 @@ graph { - + @@ -218,13 +184,7 @@ graph { - + @@ -245,4 +205,8 @@ graph { W1:w3:e -- X2:p2l:w edge [color="#000000"] X1:p5r:e -- W1:w4:w + W1:w1:e -- W1:w1:w [color="#000000:#FFFFFF:#000000" straight=straight] + W1:w2:e -- W1:w2:w [color="#000000:#895956:#000000" straight=straight] + W1:w3:e -- W1:w3:w [color="#000000:#00AA00:#000000" straight=straight] + W1:w4:e -- W1:w4:w [color="#000000" straight=straight] } diff --git a/examples/demo01.html b/examples/demo01.html index f33a787b0..f1cc9fada 100644 --- a/examples/demo01.html +++ b/examples/demo01.html @@ -30,184 +30,205 @@

Diagram

- - - - + + + X1 - - - -X1 - -D-Sub - -female - -9-pin - -DCD - -1 - -RX - -2 - -TX - -3 - -DTR - -4 - -GND - -5 - -DSR - -6 - -RTS - -7 - -CTS - -8 - -RI - -9 + + + +X1 + +D-Sub + +female + +9-pin + +DCD + +1 + +RX + +2 + +TX + +3 + +DTR + +4 + +GND + +5 + +DSR + +6 + +RTS + +7 + +CTS + +8 + +RI + +9 + + + +X1:e--X1:e + - + W1 - - - -W1 - -3x - -0.25 mm² - -+ S - -0.2 m -  - X1:5:GND - -1:WH - -X2:1:GND - - - - X1:2:RX - -2:BN - -X2:3:TX - - - - X1:3:TX - -3:GN - -X2:2:RX - - - -  - X1:5:GND - -Shield - - - -  + + + +W1 + +3x + +0.25 mm² + ++ S + +0.2 m +  + X1:5:GND + +1:WH + +X2:1:GND + X1:2:RX + +2:BN + +X2:3:TX + X1:3:TX + +3:GN + +X2:2:RX +  + X1:5:GND + +Shield + + +  - + X1:e--W1:w - - - + + + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + - + X2 - - - -X2 - -Molex KK 254 - -female - -3-pin - -1 - -GND - -2 - -RX - -3 - -TX + + + +X2 + +Molex KK 254 + +female + +3-pin + +1 + +GND + +2 + +RX + +3 + +TX - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + diff --git a/examples/demo01.png b/examples/demo01.png index 12bb94e23..9b81975c1 100644 Binary files a/examples/demo01.png and b/examples/demo01.png differ diff --git a/examples/demo01.svg b/examples/demo01.svg index fea5cb3c9..4f691a0fd 100644 --- a/examples/demo01.svg +++ b/examples/demo01.svg @@ -1,184 +1,205 @@ - - - - + + + X1 - - - -X1 - -D-Sub - -female - -9-pin - -DCD - -1 - -RX - -2 - -TX - -3 - -DTR - -4 - -GND - -5 - -DSR - -6 - -RTS - -7 - -CTS - -8 - -RI - -9 + + + +X1 + +D-Sub + +female + +9-pin + +DCD + +1 + +RX + +2 + +TX + +3 + +DTR + +4 + +GND + +5 + +DSR + +6 + +RTS + +7 + +CTS + +8 + +RI + +9 + + + +X1:e--X1:e + - + W1 - - - -W1 - -3x - -0.25 mm² - -+ S - -0.2 m -  - X1:5:GND - -1:WH - -X2:1:GND - - - - X1:2:RX - -2:BN - -X2:3:TX - - - - X1:3:TX - -3:GN - -X2:2:RX - - - -  - X1:5:GND - -Shield - - - -  + + + +W1 + +3x + +0.25 mm² + ++ S + +0.2 m +  + X1:5:GND + +1:WH + +X2:1:GND + X1:2:RX + +2:BN + +X2:3:TX + X1:3:TX + +3:GN + +X2:2:RX +  + X1:5:GND + +Shield + + +  - + X1:e--W1:w - - - + + + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + - + X2 - - - -X2 - -Molex KK 254 - -female - -3-pin - -1 - -GND - -2 - -RX - -3 - -TX + + + +X2 + +Molex KK 254 + +female + +3-pin + +1 + +GND + +2 + +RX + +3 + +TX - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + diff --git a/examples/demo01.yml b/examples/demo01.yml index b44cb5486..aed5079f1 100644 --- a/examples/demo01.yml +++ b/examples/demo01.yml @@ -6,6 +6,8 @@ connectors: type: D-Sub subtype: female pinlabels: [DCD, RX, TX, DTR, GND, DSR, RTS, CTS, RI] + loops: + L1: [7,8] X2: type: Molex KK 254 subtype: female diff --git a/examples/demo01_wv_gvpr.gvpr b/examples/demo01_wv_gvpr.gvpr new file mode 100644 index 000000000..7bfced78e --- /dev/null +++ b/examples/demo01_wv_gvpr.gvpr @@ -0,0 +1,64 @@ +/******************************************************************* + + see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 + input must include pos values (must be output from one of the engines w/ -Tdot)# + Thanks to steveroush and FeRDNYC + +*******************************************************************/ +BEG_G{ + double x1,y1,x2,y2,x3,y3,x4,y4; + string ptSize, tok[int], pt[]; + int cnt, circ, i; + node_t aNode; + + circ=0; + +/*************************************** + $G.bb=""; + $G.nodesep=""; + $G.ranksep=""; + $G.splines="true"; +****************************************/ +} + +// This removes the label text but keeps the position +E[noLabel] { + $.label=""; // remove pesky label + // $.lp=""; // remove peskier label pos +} + +E[straight] { + cnt=tokens($.pos,tok," "); + $.oldpos=$.pos; + x1 = xOf(tok[0]); + y1 = yOf(tok[0]); + x4 = xOf(tok[cnt-1]); + y4 = yOf(tok[cnt-1]); + x2 = x1 + (x4-x1)/3.; + y2 = y1 + (y4-y1)/3.; + x3 = x1 + 2.*(x4-x1)/3.; + y3 = y1 + 2.*(y4-y1)/3.; + pos=sprintf("%.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f", x1,y1, x2,y2, x3,y3, x4,y4); + $.label=""; // remove pesky label + $.lp=""; // remove peskier label pos + + if (hasAttr($, "addPTS") && $.addPTS!="" && $.colorPTS!=""){ + // now we place point nodes at the edge ends + pt[1] = tok[0]; + pt[2] = tok[cnt-1]; + ptSize=$.addPTS; + for (pt[i]) { + if (i==2 && pt[1]==pt[2]) + continue; + aNode=node($G, "__CIRCLE__" + (string)++circ); + aNode.pos=pt[i]; + aNode.shape="point"; + aNode.width=ptSize; + aNode.height=ptSize; + aNode.style="filled"; + aNode.fillcolor=$.colorPTS; + aNode.color=$.colorPTS; + } + } + +} \ No newline at end of file diff --git a/examples/demo02.gv b/examples/demo02.gv index b51cc65bc..8ce63ea06 100644 --- a/examples/demo02.gv +++ b/examples/demo02.gv @@ -277,19 +277,7 @@ graph { X2:1:GND
- + @@ -300,19 +288,7 @@ graph { - + @@ -323,19 +299,7 @@ graph { - + @@ -346,19 +310,7 @@ graph { - + @@ -380,6 +332,10 @@ graph { edge [color="#000000:#00AA00:#000000"] X1:p4r:e -- W1:w4:w W1:w4:e -- X2:p4l:w + W1:w1:e -- W1:w1:w [color="#000000:#000000:#000000" straight=straight] + W1:w2:e -- W1:w2:w [color="#000000:#FF0000:#000000" straight=straight] + W1:w3:e -- W1:w3:w [color="#000000:#FFFF00:#000000" straight=straight] + W1:w4:e -- W1:w4:w [color="#000000:#00AA00:#000000" straight=straight] W2 [label=<
X2:1:GND
- - - - - - - - - - -
-
X1:2:RXX2:3:TX
- - - - - - - - - - -
-
X1:3:TXX2:2:RX
- - - - - - - - - - -
-
 
- - - - -
-
 
- - - - - - - - - - -
-
X1:2:+5VX2:2:+5V
- - - - - - - - - - -
-
X1:3:SCLX2:3:SCL
- - - - - - - - - - -
-
X1:4:SDAX2:4:SDA
- - - - - - - - - - -
-
 
@@ -417,19 +373,7 @@ graph { - + @@ -440,19 +384,7 @@ graph { - + @@ -463,19 +395,7 @@ graph { - + @@ -486,19 +406,7 @@ graph { - + @@ -520,6 +428,10 @@ graph { edge [color="#000000:#00AA00:#000000"] X1:p4r:e -- W2:w4:w W2:w4:e -- X3:p4l:w + W2:w1:e -- W2:w1:w [color="#000000:#000000:#000000" straight=straight] + W2:w2:e -- W2:w2:w [color="#000000:#FF0000:#000000" straight=straight] + W2:w3:e -- W2:w3:w [color="#000000:#FFFF00:#000000" straight=straight] + W2:w4:e -- W2:w4:w [color="#000000:#00AA00:#000000" straight=straight] W3 [label=<
X3:1:GND
- - - - - - - - - - -
-
X1:2:+5VX3:2:+5V
- - - - - - - - - - -
-
X1:3:SCLX3:3:SCL
- - - - - - - - - - -
-
X1:4:SDAX3:4:SDA
- - - - - - - - - - -
-
 
@@ -557,19 +469,7 @@ graph { - + @@ -580,19 +480,7 @@ graph { - + @@ -603,19 +491,7 @@ graph { - + @@ -626,19 +502,7 @@ graph { - + @@ -660,6 +524,10 @@ graph { edge [color="#000000:#8000FF:#000000"] X1:p7r:e -- W3:w4:w W3:w4:e -- X4:p5l:w + W3:w1:e -- W3:w1:w [color="#000000:#000000:#000000" straight=straight] + W3:w2:e -- W3:w2:w [color="#000000:#0066FF:#000000" straight=straight] + W3:w3:e -- W3:w3:w [color="#000000:#FF8000:#000000" straight=straight] + W3:w4:e -- W3:w4:w [color="#000000:#8000FF:#000000" straight=straight] W4 [label=<
X4:1:GND
- - - - - - - - - - -
-
X1:5:MISOX4:3:MISO
- - - - - - - - - - -
-
X1:6:MOSIX4:4:MOSI
- - - - - - - - - - -
-
X1:7:SCKX4:5:SCK
- - - - - - - - - - -
-
 
@@ -696,19 +564,7 @@ graph { - + @@ -718,19 +574,7 @@ graph { - + @@ -746,4 +590,6 @@ graph { edge [color="#000000:#FF0000:#000000"] AUTOGENERATED_F_2:e -- W4:w2:w W4:w2:e -- X4:p2l:w + W4:w1:e -- W4:w1:w [color="#000000:#000000:#000000" straight=straight] + W4:w2:e -- W4:w2:w [color="#000000:#FF0000:#000000" straight=straight] } diff --git a/examples/demo02.html b/examples/demo02.html index 460efefac..6eadb3bc0 100644 --- a/examples/demo02.html +++ b/examples/demo02.html @@ -202,552 +202,608 @@ - - - - + + + X1 - - - -X1 - -Molex KK 254 - -female - -8-pin - -GND - -1 - -+5V - -2 - -SCL - -3 - -SDA - -4 - -MISO - -5 - -MOSI - -6 - -SCK - -7 - -N/C - -8 + + + +X1 + +Molex KK 254 + +female + +8-pin + +GND + +1 + ++5V + +2 + +SCL + +3 + +SDA + +4 + +MISO + +5 + +MOSI + +6 + +SCK + +7 + +N/C + +8 - + W1 - - - -W1 - -4x - -0.14 mm² (26 AWG) - -0.2 m -  - X1:1:GND - -BK - -X2:1:GND - - - - X1:2:+5V - -RD - -X2:2:+5V - - - - X1:3:SCL - -YE - -X2:3:SCL - - - - X1:4:SDA - -GN - -X2:4:SDA - - - -  + + + +W1 + +4x + +0.14 mm² (26 AWG) + +0.2 m +  + X1:1:GND + +BK + +X2:1:GND + X1:2:+5V + +RD + +X2:2:+5V + X1:3:SCL + +YE + +X2:3:SCL + X1:4:SDA + +GN + +X2:4:SDA +  X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + W2 - - - -W2 - -4x - -0.14 mm² (26 AWG) - -0.4 m -  - X1:1:GND - -BK - -X3:1:GND - - - - X1:2:+5V - -RD - -X3:2:+5V - - - - X1:3:SCL - -YE - -X3:3:SCL - - - - X1:4:SDA - -GN - -X3:4:SDA - - - -  + + + +W2 + +4x + +0.14 mm² (26 AWG) + +0.4 m +  + X1:1:GND + +BK + +X3:1:GND + X1:2:+5V + +RD + +X3:2:+5V + X1:3:SCL + +YE + +X3:3:SCL + X1:4:SDA + +GN + +X3:4:SDA +  - + X1:e--W2:w - - - + + + - + X1:e--W2:w - - - + + + - + X1:e--W2:w - - - + + + - + X1:e--W2:w - - - + + + - + W3 - - - -W3 - -4x - -0.14 mm² (26 AWG) - -0.3 m -  - X1:1:GND - -BK - -X4:1:GND - - - - X1:5:MISO - -BU - -X4:3:MISO - - - - X1:6:MOSI - -OG - -X4:4:MOSI - - - - X1:7:SCK - -VT - -X4:5:SCK - - - -  + + + +W3 + +4x + +0.14 mm² (26 AWG) + +0.3 m +  + X1:1:GND + +BK + +X4:1:GND + X1:5:MISO + +BU + +X4:3:MISO + X1:6:MOSI + +OG + +X4:4:MOSI + X1:7:SCK + +VT + +X4:5:SCK +  - + X1:e--W3:w - - - + + + - + X1:e--W3:w - - - + + + - + X1:e--W3:w - - - + + + - + X1:e--W3:w - - - + + + - - -X2 - - - -X2 - -Molex KK 254 - -female - -4-pin - -1 - -GND - -2 - -+5V - -3 - -SCL - -4 - -SDA - - - -X3 - - - -X3 - -Molex KK 254 - -female - -4-pin - -1 - -GND - -2 - -+5V - -3 - -SCL - -4 - -SDA - - - -X4 - - - -X4 - -Molex KK 254 - -female - -5-pin - -1 - -GND - -2 - -+12V - -3 - -MISO - -4 - -MOSI - -5 - -SCK - - - -AUTOGENERATED_F_1 - - - -Crimp ferrule - -0.25 mm² - -YE - - + + +W1:e--W1:w + + + - - -W4 - - - -W4 - -2x - -0.25 mm² (24 AWG) - -0.3 m -  - - -1:BK - -X4:1:GND - - - - - -2:RD - -X4:2:+12V - - - -  + + +W1:e--W1:w + + + - - -AUTOGENERATED_F_1:e--W4:w - - - + + +W1:e--W1:w + + + - - -AUTOGENERATED_F_2 - - - -Crimp ferrule - -0.25 mm² - -YE - - + + +W1:e--W1:w + + + - - -AUTOGENERATED_F_2:e--W4:w - - - + + +X2 + + + +X2 + +Molex KK 254 + +female + +4-pin + +1 + +GND + +2 + ++5V + +3 + +SCL + +4 + +SDA - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + + + + +W2:e--W2:w + + + + + + +W2:e--W2:w + + + + + + +W2:e--W2:w + + + + + + +W2:e--W2:w + + + + + + +X3 + + + +X3 + +Molex KK 254 + +female + +4-pin + +1 + +GND + +2 + ++5V + +3 + +SCL + +4 + +SDA - + W2:e--X3:w - - - + + + - + W2:e--X3:w - - - + + + - + W2:e--X3:w - - - + + + - + W2:e--X3:w - - - + + + + + + +W3:e--W3:w + + + + + + +W3:e--W3:w + + + + + + +W3:e--W3:w + + + + + + +W3:e--W3:w + + + + + + +X4 + + + +X4 + +Molex KK 254 + +female + +5-pin + +1 + +GND + +2 + ++12V + +3 + +MISO + +4 + +MOSI + +5 + +SCK - + W3:e--X4:w - - - + + + - + W3:e--X4:w - - - + + + - + W3:e--X4:w - - - + + + - + W3:e--X4:w - - - + + + + + + +AUTOGENERATED_F_1 + + + +Crimp ferrule + +0.25 mm² + +YE + + + + + +W4 + + + +W4 + +2x + +0.25 mm² (24 AWG) + +0.3 m +  + + +1:BK + +X4:1:GND + + +2:RD + +X4:2:+12V +  + + + +AUTOGENERATED_F_1:e--W4:w + + + - + W4:e--X4:w - - - + + + - + W4:e--X4:w - - - + + + + + + +W4:e--W4:w + + + + + + +W4:e--W4:w + + + + + + +AUTOGENERATED_F_2 + + + +Crimp ferrule + +0.25 mm² + +YE + + + + + +AUTOGENERATED_F_2:e--W4:w + + + diff --git a/examples/demo02.png b/examples/demo02.png index 1b4294a32..7987b7b8f 100644 Binary files a/examples/demo02.png and b/examples/demo02.png differ diff --git a/examples/demo02.svg b/examples/demo02.svg index 362f66f3a..d17192978 100644 --- a/examples/demo02.svg +++ b/examples/demo02.svg @@ -1,552 +1,608 @@ - - - - + + + X1 - - - -X1 - -Molex KK 254 - -female - -8-pin - -GND - -1 - -+5V - -2 - -SCL - -3 - -SDA - -4 - -MISO - -5 - -MOSI - -6 - -SCK - -7 - -N/C - -8 + + + +X1 + +Molex KK 254 + +female + +8-pin + +GND + +1 + ++5V + +2 + +SCL + +3 + +SDA + +4 + +MISO + +5 + +MOSI + +6 + +SCK + +7 + +N/C + +8 - + W1 - - - -W1 - -4x - -0.14 mm² (26 AWG) - -0.2 m -  - X1:1:GND - -BK - -X2:1:GND - - - - X1:2:+5V - -RD - -X2:2:+5V - - - - X1:3:SCL - -YE - -X2:3:SCL - - - - X1:4:SDA - -GN - -X2:4:SDA - - - -  + + + +W1 + +4x + +0.14 mm² (26 AWG) + +0.2 m +  + X1:1:GND + +BK + +X2:1:GND + X1:2:+5V + +RD + +X2:2:+5V + X1:3:SCL + +YE + +X2:3:SCL + X1:4:SDA + +GN + +X2:4:SDA +  X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + W2 - - - -W2 - -4x - -0.14 mm² (26 AWG) - -0.4 m -  - X1:1:GND - -BK - -X3:1:GND - - - - X1:2:+5V - -RD - -X3:2:+5V - - - - X1:3:SCL - -YE - -X3:3:SCL - - - - X1:4:SDA - -GN - -X3:4:SDA - - - -  + + + +W2 + +4x + +0.14 mm² (26 AWG) + +0.4 m +  + X1:1:GND + +BK + +X3:1:GND + X1:2:+5V + +RD + +X3:2:+5V + X1:3:SCL + +YE + +X3:3:SCL + X1:4:SDA + +GN + +X3:4:SDA +  - + X1:e--W2:w - - - + + + - + X1:e--W2:w - - - + + + - + X1:e--W2:w - - - + + + - + X1:e--W2:w - - - + + + - + W3 - - - -W3 - -4x - -0.14 mm² (26 AWG) - -0.3 m -  - X1:1:GND - -BK - -X4:1:GND - - - - X1:5:MISO - -BU - -X4:3:MISO - - - - X1:6:MOSI - -OG - -X4:4:MOSI - - - - X1:7:SCK - -VT - -X4:5:SCK - - - -  + + + +W3 + +4x + +0.14 mm² (26 AWG) + +0.3 m +  + X1:1:GND + +BK + +X4:1:GND + X1:5:MISO + +BU + +X4:3:MISO + X1:6:MOSI + +OG + +X4:4:MOSI + X1:7:SCK + +VT + +X4:5:SCK +  - + X1:e--W3:w - - - + + + - + X1:e--W3:w - - - + + + - + X1:e--W3:w - - - + + + - + X1:e--W3:w - - - + + + - - -X2 - - - -X2 - -Molex KK 254 - -female - -4-pin - -1 - -GND - -2 - -+5V - -3 - -SCL - -4 - -SDA - - - -X3 - - - -X3 - -Molex KK 254 - -female - -4-pin - -1 - -GND - -2 - -+5V - -3 - -SCL - -4 - -SDA - - - -X4 - - - -X4 - -Molex KK 254 - -female - -5-pin - -1 - -GND - -2 - -+12V - -3 - -MISO - -4 - -MOSI - -5 - -SCK - - - -AUTOGENERATED_F_1 - - - -Crimp ferrule - -0.25 mm² - -YE - - + + +W1:e--W1:w + + + - - -W4 - - - -W4 - -2x - -0.25 mm² (24 AWG) - -0.3 m -  - - -1:BK - -X4:1:GND - - - - - -2:RD - -X4:2:+12V - - - -  + + +W1:e--W1:w + + + - - -AUTOGENERATED_F_1:e--W4:w - - - + + +W1:e--W1:w + + + - - -AUTOGENERATED_F_2 - - - -Crimp ferrule - -0.25 mm² - -YE - - + + +W1:e--W1:w + + + - - -AUTOGENERATED_F_2:e--W4:w - - - + + +X2 + + + +X2 + +Molex KK 254 + +female + +4-pin + +1 + +GND + +2 + ++5V + +3 + +SCL + +4 + +SDA - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + + + + +W2:e--W2:w + + + + + + +W2:e--W2:w + + + + + + +W2:e--W2:w + + + + + + +W2:e--W2:w + + + + + + +X3 + + + +X3 + +Molex KK 254 + +female + +4-pin + +1 + +GND + +2 + ++5V + +3 + +SCL + +4 + +SDA - + W2:e--X3:w - - - + + + - + W2:e--X3:w - - - + + + - + W2:e--X3:w - - - + + + - + W2:e--X3:w - - - + + + + + + +W3:e--W3:w + + + + + + +W3:e--W3:w + + + + + + +W3:e--W3:w + + + + + + +W3:e--W3:w + + + + + + +X4 + + + +X4 + +Molex KK 254 + +female + +5-pin + +1 + +GND + +2 + ++12V + +3 + +MISO + +4 + +MOSI + +5 + +SCK - + W3:e--X4:w - - - + + + - + W3:e--X4:w - - - + + + - + W3:e--X4:w - - - + + + - + W3:e--X4:w - - - + + + + + + +AUTOGENERATED_F_1 + + + +Crimp ferrule + +0.25 mm² + +YE + + + + + +W4 + + + +W4 + +2x + +0.25 mm² (24 AWG) + +0.3 m +  + + +1:BK + +X4:1:GND + + +2:RD + +X4:2:+12V +  + + + +AUTOGENERATED_F_1:e--W4:w + + + - + W4:e--X4:w - - - + + + - + W4:e--X4:w - - - + + + + + + +W4:e--W4:w + + + + + + +W4:e--W4:w + + + + + + +AUTOGENERATED_F_2 + + + +Crimp ferrule + +0.25 mm² + +YE + + + + + +AUTOGENERATED_F_2:e--W4:w + + + diff --git a/examples/demo02_wv_gvpr.gvpr b/examples/demo02_wv_gvpr.gvpr new file mode 100644 index 000000000..7bfced78e --- /dev/null +++ b/examples/demo02_wv_gvpr.gvpr @@ -0,0 +1,64 @@ +/******************************************************************* + + see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 + input must include pos values (must be output from one of the engines w/ -Tdot)# + Thanks to steveroush and FeRDNYC + +*******************************************************************/ +BEG_G{ + double x1,y1,x2,y2,x3,y3,x4,y4; + string ptSize, tok[int], pt[]; + int cnt, circ, i; + node_t aNode; + + circ=0; + +/*************************************** + $G.bb=""; + $G.nodesep=""; + $G.ranksep=""; + $G.splines="true"; +****************************************/ +} + +// This removes the label text but keeps the position +E[noLabel] { + $.label=""; // remove pesky label + // $.lp=""; // remove peskier label pos +} + +E[straight] { + cnt=tokens($.pos,tok," "); + $.oldpos=$.pos; + x1 = xOf(tok[0]); + y1 = yOf(tok[0]); + x4 = xOf(tok[cnt-1]); + y4 = yOf(tok[cnt-1]); + x2 = x1 + (x4-x1)/3.; + y2 = y1 + (y4-y1)/3.; + x3 = x1 + 2.*(x4-x1)/3.; + y3 = y1 + 2.*(y4-y1)/3.; + pos=sprintf("%.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f", x1,y1, x2,y2, x3,y3, x4,y4); + $.label=""; // remove pesky label + $.lp=""; // remove peskier label pos + + if (hasAttr($, "addPTS") && $.addPTS!="" && $.colorPTS!=""){ + // now we place point nodes at the edge ends + pt[1] = tok[0]; + pt[2] = tok[cnt-1]; + ptSize=$.addPTS; + for (pt[i]) { + if (i==2 && pt[1]==pt[2]) + continue; + aNode=node($G, "__CIRCLE__" + (string)++circ); + aNode.pos=pt[i]; + aNode.shape="point"; + aNode.width=ptSize; + aNode.height=ptSize; + aNode.style="filled"; + aNode.fillcolor=$.colorPTS; + aNode.color=$.colorPTS; + } + } + +} \ No newline at end of file diff --git a/examples/ex01.gv b/examples/ex01.gv index a622dc0c2..753b16dc5 100644 --- a/examples/ex01.gv +++ b/examples/ex01.gv @@ -134,19 +134,7 @@ graph { X2:1:GND - + @@ -156,19 +144,7 @@ graph { - + @@ -178,19 +154,7 @@ graph { - + @@ -200,19 +164,7 @@ graph { - + @@ -225,13 +177,7 @@ graph { - + @@ -255,4 +201,9 @@ graph { W1:w4:e -- X2:p3l:w edge [color="#000000"] X1:p1r:e -- W1:w5:w + W1:w1:e -- W1:w1:w [color="#000000:#895956:#000000" straight=straight] + W1:w2:e -- W1:w2:w [color="#000000:#FF0000:#000000" straight=straight] + W1:w3:e -- W1:w3:w [color="#000000:#FF8000:#000000" straight=straight] + W1:w4:e -- W1:w4:w [color="#000000:#FFFF00:#000000" straight=straight] + W1:w5:e -- W1:w5:w [color="#000000" straight=straight] } diff --git a/examples/ex01.html b/examples/ex01.html index 22e9e30af..8f2a7cb68 100644 --- a/examples/ex01.html +++ b/examples/ex01.html @@ -30,192 +30,212 @@

Diagram

- - - - + + + X1 - - - -X1 - -Molex KK 254 - -female - -4-pin - -GND - -1 - -VCC - -2 - -RX - -3 - -TX - -4 + + + +X1 + +Molex KK 254 + +female + +4-pin + +GND + +1 + +VCC + +2 + +RX + +3 + +TX + +4 - + W1 - - - -W1 - -Serial - -4x - -0.25 mm² (24 AWG) - -+ S - -0.2 m -  - X1:1:GND - -1:BN - -X2:1:GND - - - - X1:2:VCC - -2:RD - -X2:2:VCC - - - - X1:3:RX - -3:OG - -X2:4:TX - - - - X1:4:TX - -4:YE - -X2:3:RX - - - -  - X1:1:GND - -Shield - - - -  + + + +W1 + +Serial + +4x + +0.25 mm² (24 AWG) + ++ S + +0.2 m +  + X1:1:GND + +1:BN + +X2:1:GND + X1:2:VCC + +2:RD + +X2:2:VCC + X1:3:RX + +3:OG + +X2:4:TX + X1:4:TX + +4:YE + +X2:3:RX +  + X1:1:GND + +Shield + + +  X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + - + X2 - - - -X2 - -Molex KK 254 - -female - -4-pin - -1 - -GND - -2 - -VCC - -3 - -RX - -4 - -TX + + + +X2 + +Molex KK 254 + +female + +4-pin + +1 + +GND + +2 + +VCC + +3 + +RX + +4 + +TX - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + diff --git a/examples/ex01.png b/examples/ex01.png index a477fd77b..8d34a9a56 100644 Binary files a/examples/ex01.png and b/examples/ex01.png differ diff --git a/examples/ex01.svg b/examples/ex01.svg index ff9dd8d59..1f0c616a8 100644 --- a/examples/ex01.svg +++ b/examples/ex01.svg @@ -1,192 +1,212 @@ - - - - + + + X1 - - - -X1 - -Molex KK 254 - -female - -4-pin - -GND - -1 - -VCC - -2 - -RX - -3 - -TX - -4 + + + +X1 + +Molex KK 254 + +female + +4-pin + +GND + +1 + +VCC + +2 + +RX + +3 + +TX + +4 - + W1 - - - -W1 - -Serial - -4x - -0.25 mm² (24 AWG) - -+ S - -0.2 m -  - X1:1:GND - -1:BN - -X2:1:GND - - - - X1:2:VCC - -2:RD - -X2:2:VCC - - - - X1:3:RX - -3:OG - -X2:4:TX - - - - X1:4:TX - -4:YE - -X2:3:RX - - - -  - X1:1:GND - -Shield - - - -  + + + +W1 + +Serial + +4x + +0.25 mm² (24 AWG) + ++ S + +0.2 m +  + X1:1:GND + +1:BN + +X2:1:GND + X1:2:VCC + +2:RD + +X2:2:VCC + X1:3:RX + +3:OG + +X2:4:TX + X1:4:TX + +4:YE + +X2:3:RX +  + X1:1:GND + +Shield + + +  X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + - + X2 - - - -X2 - -Molex KK 254 - -female - -4-pin - -1 - -GND - -2 - -VCC - -3 - -RX - -4 - -TX + + + +X2 + +Molex KK 254 + +female + +4-pin + +1 + +GND + +2 + +VCC + +3 + +RX + +4 + +TX - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + diff --git a/examples/ex01_wv_gvpr.gvpr b/examples/ex01_wv_gvpr.gvpr new file mode 100644 index 000000000..7bfced78e --- /dev/null +++ b/examples/ex01_wv_gvpr.gvpr @@ -0,0 +1,64 @@ +/******************************************************************* + + see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 + input must include pos values (must be output from one of the engines w/ -Tdot)# + Thanks to steveroush and FeRDNYC + +*******************************************************************/ +BEG_G{ + double x1,y1,x2,y2,x3,y3,x4,y4; + string ptSize, tok[int], pt[]; + int cnt, circ, i; + node_t aNode; + + circ=0; + +/*************************************** + $G.bb=""; + $G.nodesep=""; + $G.ranksep=""; + $G.splines="true"; +****************************************/ +} + +// This removes the label text but keeps the position +E[noLabel] { + $.label=""; // remove pesky label + // $.lp=""; // remove peskier label pos +} + +E[straight] { + cnt=tokens($.pos,tok," "); + $.oldpos=$.pos; + x1 = xOf(tok[0]); + y1 = yOf(tok[0]); + x4 = xOf(tok[cnt-1]); + y4 = yOf(tok[cnt-1]); + x2 = x1 + (x4-x1)/3.; + y2 = y1 + (y4-y1)/3.; + x3 = x1 + 2.*(x4-x1)/3.; + y3 = y1 + 2.*(y4-y1)/3.; + pos=sprintf("%.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f", x1,y1, x2,y2, x3,y3, x4,y4); + $.label=""; // remove pesky label + $.lp=""; // remove peskier label pos + + if (hasAttr($, "addPTS") && $.addPTS!="" && $.colorPTS!=""){ + // now we place point nodes at the edge ends + pt[1] = tok[0]; + pt[2] = tok[cnt-1]; + ptSize=$.addPTS; + for (pt[i]) { + if (i==2 && pt[1]==pt[2]) + continue; + aNode=node($G, "__CIRCLE__" + (string)++circ); + aNode.pos=pt[i]; + aNode.shape="point"; + aNode.width=ptSize; + aNode.height=ptSize; + aNode.style="filled"; + aNode.fillcolor=$.colorPTS; + aNode.color=$.colorPTS; + } + } + +} \ No newline at end of file diff --git a/examples/ex02.gv b/examples/ex02.gv index 251d262dd..e309df413 100644 --- a/examples/ex02.gv +++ b/examples/ex02.gv @@ -192,19 +192,7 @@ graph { X2:1:GND
- + @@ -214,19 +202,7 @@ graph { - + @@ -242,6 +218,8 @@ graph { edge [color="#000000:#FF0000:#000000"] X1:p2r:e -- W1:w2:w W1:w2:e -- X2:p2l:w + W1:w1:e -- W1:w1:w [color="#000000:#000000:#000000" straight=straight] + W1:w2:e -- W1:w2:w [color="#000000:#FF0000:#000000" straight=straight] W2 [label=<
X4:1:GND
- - - - - - - - - - -
-
X4:2:+12V
- - - - - - - - - - -
-
 
- - - - - - - - - - -
-
X1:2:VCCX2:2:VCC
- - - - - - - - - - -
-
X1:3:RXX2:4:TX
- - - - - - - - - - -
-
X1:4:TXX2:3:RX
- - - - - - - - - - -
-
 
- - - - -
-
 
- - - - - - - - - - -
-
X1:2:VCCX2:2:VCC
- - - - - - - - - - -
-
 
@@ -278,19 +256,7 @@ graph { - + @@ -300,19 +266,7 @@ graph { - + @@ -328,6 +282,8 @@ graph { edge [color="#000000:#FF0000:#000000"] X1:p2r:e -- W2:w2:w W2:w2:e -- X3:p2l:w + W2:w1:e -- W2:w1:w [color="#000000:#000000:#000000" straight=straight] + W2:w2:e -- W2:w2:w [color="#000000:#FF0000:#000000" straight=straight] W3 [label=<
X3:1:GND
- - - - - - - - - - -
-
X1:2:VCCX3:2:VCC
- - - - - - - - - - -
-
 
@@ -364,19 +320,7 @@ graph { - + @@ -386,19 +330,7 @@ graph { - + @@ -414,4 +346,6 @@ graph { edge [color="#000000:#FF0000:#000000"] X1:p2r:e -- W3:w2:w W3:w2:e -- X4:p2l:w + W3:w1:e -- W3:w1:w [color="#000000:#000000:#000000" straight=straight] + W3:w2:e -- W3:w2:w [color="#000000:#FF0000:#000000" straight=straight] } diff --git a/examples/ex02.html b/examples/ex02.html index 17d91515a..5d0b13a50 100644 --- a/examples/ex02.html +++ b/examples/ex02.html @@ -30,280 +30,304 @@

Diagram

- - - - + + + X1 - - - -X1 - -Molex Micro-Fit - -male - -2-pin - -GND - -1 - -VCC - -2 + + + +X1 + +Molex Micro-Fit + +male + +2-pin + +GND + +1 + +VCC + +2 - + W1 - - - -W1 - -2x - -0.25 mm² (24 AWG) - -0.2 m -  - X1:1:GND - -1:BK - -X2:1:GND - - - - X1:2:VCC - -2:RD - -X2:2:VCC - - - -  + + + +W1 + +2x + +0.25 mm² (24 AWG) + +0.2 m +  + X1:1:GND + +1:BK + +X2:1:GND + X1:2:VCC + +2:RD + +X2:2:VCC +  X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + W2 - - - -W2 - -2x - -0.25 mm² (24 AWG) - -0.2 m -  - X1:1:GND - -1:BK - -X3:1:GND - - - - X1:2:VCC - -2:RD - -X3:2:VCC - - - -  + + + +W2 + +2x + +0.25 mm² (24 AWG) + +0.2 m +  + X1:1:GND + +1:BK + +X3:1:GND + X1:2:VCC + +2:RD + +X3:2:VCC +  - + X1:e--W2:w - - - + + + - + X1:e--W2:w - - - + + + - + W3 - - - -W3 - -2x - -20 awg (0.75 mm²) - -0.2 m -  - X1:1:GND - -1:BK - -X4:1:GND - - - - X1:2:VCC - -2:RD - -X4:2:VCC - - - -  + + + +W3 + +2x + +20 awg (0.75 mm²) + +0.2 m +  + X1:1:GND + +1:BK + +X4:1:GND + X1:2:VCC + +2:RD + +X4:2:VCC +  - + X1:e--W3:w - - - + + + - + X1:e--W3:w - - - + + + - - -X2 - - - -X2 - -Molex Micro-Fit - -female - -2-pin - -1 - -GND - -2 - -VCC + + +W1:e--W1:w + + + - - -X3 - - - -X3 - -Molex Micro-Fit - -female - -2-pin - -1 - -GND - -2 - -VCC + + +W1:e--W1:w + + + - - -X4 - - - -X4 - -Molex Micro-Fit - -female - -2-pin - -1 - -GND - -2 - -VCC + + +X2 + + + +X2 + +Molex Micro-Fit + +female + +2-pin + +1 + +GND + +2 + +VCC - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + + + + +W2:e--W2:w + + + + + + +W2:e--W2:w + + + + + + +X3 + + + +X3 + +Molex Micro-Fit + +female + +2-pin + +1 + +GND + +2 + +VCC - + W2:e--X3:w - - - + + + - + W2:e--X3:w - - - + + + + + + +W3:e--W3:w + + + + + + +W3:e--W3:w + + + + + + +X4 + + + +X4 + +Molex Micro-Fit + +female + +2-pin + +1 + +GND + +2 + +VCC - + W3:e--X4:w - - - + + + - + W3:e--X4:w - - - + + + diff --git a/examples/ex02.png b/examples/ex02.png index d723cf330..e4b39d445 100644 Binary files a/examples/ex02.png and b/examples/ex02.png differ diff --git a/examples/ex02.svg b/examples/ex02.svg index 3dcff6fe4..8c732592f 100644 --- a/examples/ex02.svg +++ b/examples/ex02.svg @@ -1,280 +1,304 @@ - - - - + + + X1 - - - -X1 - -Molex Micro-Fit - -male - -2-pin - -GND - -1 - -VCC - -2 + + + +X1 + +Molex Micro-Fit + +male + +2-pin + +GND + +1 + +VCC + +2 - + W1 - - - -W1 - -2x - -0.25 mm² (24 AWG) - -0.2 m -  - X1:1:GND - -1:BK - -X2:1:GND - - - - X1:2:VCC - -2:RD - -X2:2:VCC - - - -  + + + +W1 + +2x + +0.25 mm² (24 AWG) + +0.2 m +  + X1:1:GND + +1:BK + +X2:1:GND + X1:2:VCC + +2:RD + +X2:2:VCC +  X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + W2 - - - -W2 - -2x - -0.25 mm² (24 AWG) - -0.2 m -  - X1:1:GND - -1:BK - -X3:1:GND - - - - X1:2:VCC - -2:RD - -X3:2:VCC - - - -  + + + +W2 + +2x + +0.25 mm² (24 AWG) + +0.2 m +  + X1:1:GND + +1:BK + +X3:1:GND + X1:2:VCC + +2:RD + +X3:2:VCC +  - + X1:e--W2:w - - - + + + - + X1:e--W2:w - - - + + + - + W3 - - - -W3 - -2x - -20 awg (0.75 mm²) - -0.2 m -  - X1:1:GND - -1:BK - -X4:1:GND - - - - X1:2:VCC - -2:RD - -X4:2:VCC - - - -  + + + +W3 + +2x + +20 awg (0.75 mm²) + +0.2 m +  + X1:1:GND + +1:BK + +X4:1:GND + X1:2:VCC + +2:RD + +X4:2:VCC +  - + X1:e--W3:w - - - + + + - + X1:e--W3:w - - - + + + - - -X2 - - - -X2 - -Molex Micro-Fit - -female - -2-pin - -1 - -GND - -2 - -VCC + + +W1:e--W1:w + + + - - -X3 - - - -X3 - -Molex Micro-Fit - -female - -2-pin - -1 - -GND - -2 - -VCC + + +W1:e--W1:w + + + - - -X4 - - - -X4 - -Molex Micro-Fit - -female - -2-pin - -1 - -GND - -2 - -VCC + + +X2 + + + +X2 + +Molex Micro-Fit + +female + +2-pin + +1 + +GND + +2 + +VCC - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + + + + +W2:e--W2:w + + + + + + +W2:e--W2:w + + + + + + +X3 + + + +X3 + +Molex Micro-Fit + +female + +2-pin + +1 + +GND + +2 + +VCC - + W2:e--X3:w - - - + + + - + W2:e--X3:w - - - + + + + + + +W3:e--W3:w + + + + + + +W3:e--W3:w + + + + + + +X4 + + + +X4 + +Molex Micro-Fit + +female + +2-pin + +1 + +GND + +2 + +VCC - + W3:e--X4:w - - - + + + - + W3:e--X4:w - - - + + + diff --git a/examples/ex02_wv_gvpr.gvpr b/examples/ex02_wv_gvpr.gvpr new file mode 100644 index 000000000..7bfced78e --- /dev/null +++ b/examples/ex02_wv_gvpr.gvpr @@ -0,0 +1,64 @@ +/******************************************************************* + + see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 + input must include pos values (must be output from one of the engines w/ -Tdot)# + Thanks to steveroush and FeRDNYC + +*******************************************************************/ +BEG_G{ + double x1,y1,x2,y2,x3,y3,x4,y4; + string ptSize, tok[int], pt[]; + int cnt, circ, i; + node_t aNode; + + circ=0; + +/*************************************** + $G.bb=""; + $G.nodesep=""; + $G.ranksep=""; + $G.splines="true"; +****************************************/ +} + +// This removes the label text but keeps the position +E[noLabel] { + $.label=""; // remove pesky label + // $.lp=""; // remove peskier label pos +} + +E[straight] { + cnt=tokens($.pos,tok," "); + $.oldpos=$.pos; + x1 = xOf(tok[0]); + y1 = yOf(tok[0]); + x4 = xOf(tok[cnt-1]); + y4 = yOf(tok[cnt-1]); + x2 = x1 + (x4-x1)/3.; + y2 = y1 + (y4-y1)/3.; + x3 = x1 + 2.*(x4-x1)/3.; + y3 = y1 + 2.*(y4-y1)/3.; + pos=sprintf("%.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f", x1,y1, x2,y2, x3,y3, x4,y4); + $.label=""; // remove pesky label + $.lp=""; // remove peskier label pos + + if (hasAttr($, "addPTS") && $.addPTS!="" && $.colorPTS!=""){ + // now we place point nodes at the edge ends + pt[1] = tok[0]; + pt[2] = tok[cnt-1]; + ptSize=$.addPTS; + for (pt[i]) { + if (i==2 && pt[1]==pt[2]) + continue; + aNode=node($G, "__CIRCLE__" + (string)++circ); + aNode.pos=pt[i]; + aNode.shape="point"; + aNode.width=ptSize; + aNode.height=ptSize; + aNode.style="filled"; + aNode.fillcolor=$.colorPTS; + aNode.color=$.colorPTS; + } + } + +} \ No newline at end of file diff --git a/examples/ex03.gv b/examples/ex03.gv index 309c1d6fa..fb145a3f2 100644 --- a/examples/ex03.gv +++ b/examples/ex03.gv @@ -193,19 +193,7 @@ graph { X2:1:GND
- + @@ -216,19 +204,7 @@ graph { - + @@ -239,19 +215,7 @@ graph { - + @@ -262,19 +226,7 @@ graph { - + @@ -285,19 +237,7 @@ graph { - + @@ -308,19 +248,7 @@ graph { - + @@ -348,4 +276,10 @@ graph { edge [color="#000000:#FF0000:#000000"] X1:p2r:e -- W1:w6:w W1:w6:e -- X4:p2l:w + W1:w1:e -- W1:w1:w [color="#000000:#000000:#000000" straight=straight] + W1:w2:e -- W1:w2:w [color="#000000:#FF0000:#000000" straight=straight] + W1:w3:e -- W1:w3:w [color="#000000:#000000:#000000" straight=straight] + W1:w4:e -- W1:w4:w [color="#000000:#FF0000:#000000" straight=straight] + W1:w5:e -- W1:w5:w [color="#000000:#000000:#000000" straight=straight] + W1:w6:e -- W1:w6:w [color="#000000:#FF0000:#000000" straight=straight] } diff --git a/examples/ex03.html b/examples/ex03.html index 680c7e31f..715264346 100644 --- a/examples/ex03.html +++ b/examples/ex03.html @@ -30,248 +30,272 @@

Diagram

- - - - + + + X1 - - - -X1 - -Molex Micro-Fit - -male - -2-pin - -GND - -1 - -VCC - -2 + + + +X1 + +Molex Micro-Fit + +male + +2-pin + +GND + +1 + +VCC + +2 - + W1 - - - -W1 - -6x - -0.25 mm² (24 AWG) - -0.2 m -  - X1:1:GND - -BK - -X2:1:GND - - - - X1:2:VCC - -RD - -X2:2:VCC - - - - X1:1:GND - -BK - -X3:1:GND - - - - X1:2:VCC - -RD - -X3:2:VCC - - - - X1:1:GND - -BK - -X4:1:GND - - - - X1:2:VCC - -RD - -X4:2:VCC - - - -  + + + +W1 + +6x + +0.25 mm² (24 AWG) + +0.2 m +  + X1:1:GND + +BK + +X2:1:GND + X1:2:VCC + +RD + +X2:2:VCC + X1:1:GND + +BK + +X3:1:GND + X1:2:VCC + +RD + +X3:2:VCC + X1:1:GND + +BK + +X4:1:GND + X1:2:VCC + +RD + +X4:2:VCC +  X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - - -X2 - - - -X2 - -Molex Micro-Fit - -female - -2-pin - -1 - -GND - -2 - -VCC + + +W1:e--W1:w + + + - - -X3 - - - -X3 - -Molex Micro-Fit - -female - -2-pin - -1 - -GND - -2 - -VCC + + +W1:e--W1:w + + + - - -X4 - - - -X4 - -Molex Micro-Fit - -female - -2-pin - -1 - -GND - -2 - -VCC + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +X2 + + + +X2 + +Molex Micro-Fit + +female + +2-pin + +1 + +GND + +2 + +VCC - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + + + + +X3 + + + +X3 + +Molex Micro-Fit + +female + +2-pin + +1 + +GND + +2 + +VCC - + W1:e--X3:w - - - + + + - + W1:e--X3:w - - - + + + + + + +X4 + + + +X4 + +Molex Micro-Fit + +female + +2-pin + +1 + +GND + +2 + +VCC - + W1:e--X4:w - - - + + + - + W1:e--X4:w - - - + + + diff --git a/examples/ex03.png b/examples/ex03.png index a139ee916..c9b616642 100644 Binary files a/examples/ex03.png and b/examples/ex03.png differ diff --git a/examples/ex03.svg b/examples/ex03.svg index 49610e22e..d5e6b374a 100644 --- a/examples/ex03.svg +++ b/examples/ex03.svg @@ -1,248 +1,272 @@ - - - - + + + X1 - - - -X1 - -Molex Micro-Fit - -male - -2-pin - -GND - -1 - -VCC - -2 + + + +X1 + +Molex Micro-Fit + +male + +2-pin + +GND + +1 + +VCC + +2 - + W1 - - - -W1 - -6x - -0.25 mm² (24 AWG) - -0.2 m -  - X1:1:GND - -BK - -X2:1:GND - - - - X1:2:VCC - -RD - -X2:2:VCC - - - - X1:1:GND - -BK - -X3:1:GND - - - - X1:2:VCC - -RD - -X3:2:VCC - - - - X1:1:GND - -BK - -X4:1:GND - - - - X1:2:VCC - -RD - -X4:2:VCC - - - -  + + + +W1 + +6x + +0.25 mm² (24 AWG) + +0.2 m +  + X1:1:GND + +BK + +X2:1:GND + X1:2:VCC + +RD + +X2:2:VCC + X1:1:GND + +BK + +X3:1:GND + X1:2:VCC + +RD + +X3:2:VCC + X1:1:GND + +BK + +X4:1:GND + X1:2:VCC + +RD + +X4:2:VCC +  X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - - -X2 - - - -X2 - -Molex Micro-Fit - -female - -2-pin - -1 - -GND - -2 - -VCC + + +W1:e--W1:w + + + - - -X3 - - - -X3 - -Molex Micro-Fit - -female - -2-pin - -1 - -GND - -2 - -VCC + + +W1:e--W1:w + + + - - -X4 - - - -X4 - -Molex Micro-Fit - -female - -2-pin - -1 - -GND - -2 - -VCC + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +X2 + + + +X2 + +Molex Micro-Fit + +female + +2-pin + +1 + +GND + +2 + +VCC - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + + + + +X3 + + + +X3 + +Molex Micro-Fit + +female + +2-pin + +1 + +GND + +2 + +VCC - + W1:e--X3:w - - - + + + - + W1:e--X3:w - - - + + + + + + +X4 + + + +X4 + +Molex Micro-Fit + +female + +2-pin + +1 + +GND + +2 + +VCC - + W1:e--X4:w - - - + + + - + W1:e--X4:w - - - + + + diff --git a/examples/ex03_wv_gvpr.gvpr b/examples/ex03_wv_gvpr.gvpr new file mode 100644 index 000000000..7bfced78e --- /dev/null +++ b/examples/ex03_wv_gvpr.gvpr @@ -0,0 +1,64 @@ +/******************************************************************* + + see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 + input must include pos values (must be output from one of the engines w/ -Tdot)# + Thanks to steveroush and FeRDNYC + +*******************************************************************/ +BEG_G{ + double x1,y1,x2,y2,x3,y3,x4,y4; + string ptSize, tok[int], pt[]; + int cnt, circ, i; + node_t aNode; + + circ=0; + +/*************************************** + $G.bb=""; + $G.nodesep=""; + $G.ranksep=""; + $G.splines="true"; +****************************************/ +} + +// This removes the label text but keeps the position +E[noLabel] { + $.label=""; // remove pesky label + // $.lp=""; // remove peskier label pos +} + +E[straight] { + cnt=tokens($.pos,tok," "); + $.oldpos=$.pos; + x1 = xOf(tok[0]); + y1 = yOf(tok[0]); + x4 = xOf(tok[cnt-1]); + y4 = yOf(tok[cnt-1]); + x2 = x1 + (x4-x1)/3.; + y2 = y1 + (y4-y1)/3.; + x3 = x1 + 2.*(x4-x1)/3.; + y3 = y1 + 2.*(y4-y1)/3.; + pos=sprintf("%.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f", x1,y1, x2,y2, x3,y3, x4,y4); + $.label=""; // remove pesky label + $.lp=""; // remove peskier label pos + + if (hasAttr($, "addPTS") && $.addPTS!="" && $.colorPTS!=""){ + // now we place point nodes at the edge ends + pt[1] = tok[0]; + pt[2] = tok[cnt-1]; + ptSize=$.addPTS; + for (pt[i]) { + if (i==2 && pt[1]==pt[2]) + continue; + aNode=node($G, "__CIRCLE__" + (string)++circ); + aNode.pos=pt[i]; + aNode.shape="point"; + aNode.width=ptSize; + aNode.height=ptSize; + aNode.style="filled"; + aNode.fillcolor=$.colorPTS; + aNode.color=$.colorPTS; + } + } + +} \ No newline at end of file diff --git a/examples/ex04.gv b/examples/ex04.gv index 5cfb1aea1..4c23323a1 100644 --- a/examples/ex04.gv +++ b/examples/ex04.gv @@ -197,19 +197,7 @@ graph {
- + @@ -220,19 +208,7 @@ graph { - + @@ -243,19 +219,7 @@ graph { - + @@ -266,19 +230,7 @@ graph { - + @@ -289,19 +241,7 @@ graph { - + @@ -312,19 +252,7 @@ graph { - + @@ -352,4 +280,10 @@ graph { edge [color="#000000:#0066FF:#000000"] AUTOGENERATED_F_6:e -- W1:w6:w W1:w6:e -- AUTOGENERATED_F_12:w + W1:w1:e -- W1:w1:w [color="#000000:#895956:#000000" straight=straight] + W1:w2:e -- W1:w2:w [color="#000000:#FF0000:#000000" straight=straight] + W1:w3:e -- W1:w3:w [color="#000000:#FF8000:#000000" straight=straight] + W1:w4:e -- W1:w4:w [color="#000000:#FFFF00:#000000" straight=straight] + W1:w5:e -- W1:w5:w [color="#000000:#00AA00:#000000" straight=straight] + W1:w6:e -- W1:w6:w [color="#000000:#0066FF:#000000" straight=straight] } diff --git a/examples/ex04.html b/examples/ex04.html index c1a2259d2..4135dc233 100644 --- a/examples/ex04.html +++ b/examples/ex04.html @@ -30,256 +30,280 @@

Diagram

- - - - + + + AUTOGENERATED_F_1 - - - -Crimp ferrule + + + +Crimp ferrule - + W1 - - - -W1 - -6x - -0.25 mm² (24 AWG) - -0.2 m -  - - -BN - - - - - - - -RD - - - - - - - -OG - - - - - - - -YE - - - - - - - -GN - - - - - - - -BU - - - - - -  + + + +W1 + +6x + +0.25 mm² (24 AWG) + +0.2 m +  + + +BN + + + + +RD + + + + +OG + + + + +YE + + + + +GN + + + + +BU + + +  AUTOGENERATED_F_1:e--W1:w - - - + + + - - -AUTOGENERATED_F_2 - - - -Crimp ferrule + + +W1:e--W1:w + + + - + -AUTOGENERATED_F_2:e--W1:w - - - +W1:e--W1:w + + + - - -AUTOGENERATED_F_3 - - - -Crimp ferrule + + +W1:e--W1:w + + + - + -AUTOGENERATED_F_3:e--W1:w - - - +W1:e--W1:w + + + - - -AUTOGENERATED_F_4 - - - -Crimp ferrule + + +W1:e--W1:w + + + - + -AUTOGENERATED_F_4:e--W1:w - - - - - - -AUTOGENERATED_F_5 - - - -Crimp ferrule - - - -AUTOGENERATED_F_5:e--W1:w - - - - - - -AUTOGENERATED_F_6 - - - -Crimp ferrule - - - -AUTOGENERATED_F_6:e--W1:w - - - +W1:e--W1:w + + + - + AUTOGENERATED_F_7 - - - -Crimp ferrule + + + +Crimp ferrule + + + +W1:e--AUTOGENERATED_F_7:w + + + - + AUTOGENERATED_F_8 - - - -Crimp ferrule + + + +Crimp ferrule + + + +W1:e--AUTOGENERATED_F_8:w + + + - + AUTOGENERATED_F_9 - - - -Crimp ferrule + + + +Crimp ferrule + + + +W1:e--AUTOGENERATED_F_9:w + + + - + AUTOGENERATED_F_10 - - - -Crimp ferrule + + + +Crimp ferrule + + + +W1:e--AUTOGENERATED_F_10:w + + + - + AUTOGENERATED_F_11 - - - -Crimp ferrule + + + +Crimp ferrule + + + +W1:e--AUTOGENERATED_F_11:w + + + - + AUTOGENERATED_F_12 - - - -Crimp ferrule + + + +Crimp ferrule - - -W1:e--AUTOGENERATED_F_7:w - - - + + +W1:e--AUTOGENERATED_F_12:w + + + - - -W1:e--AUTOGENERATED_F_8:w - - - + + +AUTOGENERATED_F_2 + + + +Crimp ferrule - - -W1:e--AUTOGENERATED_F_9:w - - - + + +AUTOGENERATED_F_2:e--W1:w + + + - - -W1:e--AUTOGENERATED_F_10:w - - - + + +AUTOGENERATED_F_3 + + + +Crimp ferrule - - -W1:e--AUTOGENERATED_F_11:w - - - + + +AUTOGENERATED_F_3:e--W1:w + + + - - -W1:e--AUTOGENERATED_F_12:w - - - + + +AUTOGENERATED_F_4 + + + +Crimp ferrule + + + +AUTOGENERATED_F_4:e--W1:w + + + + + + +AUTOGENERATED_F_5 + + + +Crimp ferrule + + + +AUTOGENERATED_F_5:e--W1:w + + + + + + +AUTOGENERATED_F_6 + + + +Crimp ferrule + + + +AUTOGENERATED_F_6:e--W1:w + + + diff --git a/examples/ex04.png b/examples/ex04.png index 2eaa25130..55d6c26bf 100644 Binary files a/examples/ex04.png and b/examples/ex04.png differ diff --git a/examples/ex04.svg b/examples/ex04.svg index f77b00f68..b539bbabb 100644 --- a/examples/ex04.svg +++ b/examples/ex04.svg @@ -1,256 +1,280 @@ - - - - + + + AUTOGENERATED_F_1 - - - -Crimp ferrule + + + +Crimp ferrule - + W1 - - - -W1 - -6x - -0.25 mm² (24 AWG) - -0.2 m -  - - -BN - - - - - - - -RD - - - - - - - -OG - - - - - - - -YE - - - - - - - -GN - - - - - - - -BU - - - - - -  + + + +W1 + +6x + +0.25 mm² (24 AWG) + +0.2 m +  + + +BN + + + + +RD + + + + +OG + + + + +YE + + + + +GN + + + + +BU + + +  AUTOGENERATED_F_1:e--W1:w - - - + + + - - -AUTOGENERATED_F_2 - - - -Crimp ferrule + + +W1:e--W1:w + + + - + -AUTOGENERATED_F_2:e--W1:w - - - +W1:e--W1:w + + + - - -AUTOGENERATED_F_3 - - - -Crimp ferrule + + +W1:e--W1:w + + + - + -AUTOGENERATED_F_3:e--W1:w - - - +W1:e--W1:w + + + - - -AUTOGENERATED_F_4 - - - -Crimp ferrule + + +W1:e--W1:w + + + - + -AUTOGENERATED_F_4:e--W1:w - - - - - - -AUTOGENERATED_F_5 - - - -Crimp ferrule - - - -AUTOGENERATED_F_5:e--W1:w - - - - - - -AUTOGENERATED_F_6 - - - -Crimp ferrule - - - -AUTOGENERATED_F_6:e--W1:w - - - +W1:e--W1:w + + + - + AUTOGENERATED_F_7 - - - -Crimp ferrule + + + +Crimp ferrule + + + +W1:e--AUTOGENERATED_F_7:w + + + - + AUTOGENERATED_F_8 - - - -Crimp ferrule + + + +Crimp ferrule + + + +W1:e--AUTOGENERATED_F_8:w + + + - + AUTOGENERATED_F_9 - - - -Crimp ferrule + + + +Crimp ferrule + + + +W1:e--AUTOGENERATED_F_9:w + + + - + AUTOGENERATED_F_10 - - - -Crimp ferrule + + + +Crimp ferrule + + + +W1:e--AUTOGENERATED_F_10:w + + + - + AUTOGENERATED_F_11 - - - -Crimp ferrule + + + +Crimp ferrule + + + +W1:e--AUTOGENERATED_F_11:w + + + - + AUTOGENERATED_F_12 - - - -Crimp ferrule + + + +Crimp ferrule - - -W1:e--AUTOGENERATED_F_7:w - - - + + +W1:e--AUTOGENERATED_F_12:w + + + - - -W1:e--AUTOGENERATED_F_8:w - - - + + +AUTOGENERATED_F_2 + + + +Crimp ferrule - - -W1:e--AUTOGENERATED_F_9:w - - - + + +AUTOGENERATED_F_2:e--W1:w + + + - - -W1:e--AUTOGENERATED_F_10:w - - - + + +AUTOGENERATED_F_3 + + + +Crimp ferrule - - -W1:e--AUTOGENERATED_F_11:w - - - + + +AUTOGENERATED_F_3:e--W1:w + + + - - -W1:e--AUTOGENERATED_F_12:w - - - + + +AUTOGENERATED_F_4 + + + +Crimp ferrule + + + +AUTOGENERATED_F_4:e--W1:w + + + + + + +AUTOGENERATED_F_5 + + + +Crimp ferrule + + + +AUTOGENERATED_F_5:e--W1:w + + + + + + +AUTOGENERATED_F_6 + + + +Crimp ferrule + + + +AUTOGENERATED_F_6:e--W1:w + + + diff --git a/examples/ex04_wv_gvpr.gvpr b/examples/ex04_wv_gvpr.gvpr new file mode 100644 index 000000000..7bfced78e --- /dev/null +++ b/examples/ex04_wv_gvpr.gvpr @@ -0,0 +1,64 @@ +/******************************************************************* + + see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 + input must include pos values (must be output from one of the engines w/ -Tdot)# + Thanks to steveroush and FeRDNYC + +*******************************************************************/ +BEG_G{ + double x1,y1,x2,y2,x3,y3,x4,y4; + string ptSize, tok[int], pt[]; + int cnt, circ, i; + node_t aNode; + + circ=0; + +/*************************************** + $G.bb=""; + $G.nodesep=""; + $G.ranksep=""; + $G.splines="true"; +****************************************/ +} + +// This removes the label text but keeps the position +E[noLabel] { + $.label=""; // remove pesky label + // $.lp=""; // remove peskier label pos +} + +E[straight] { + cnt=tokens($.pos,tok," "); + $.oldpos=$.pos; + x1 = xOf(tok[0]); + y1 = yOf(tok[0]); + x4 = xOf(tok[cnt-1]); + y4 = yOf(tok[cnt-1]); + x2 = x1 + (x4-x1)/3.; + y2 = y1 + (y4-y1)/3.; + x3 = x1 + 2.*(x4-x1)/3.; + y3 = y1 + 2.*(y4-y1)/3.; + pos=sprintf("%.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f", x1,y1, x2,y2, x3,y3, x4,y4); + $.label=""; // remove pesky label + $.lp=""; // remove peskier label pos + + if (hasAttr($, "addPTS") && $.addPTS!="" && $.colorPTS!=""){ + // now we place point nodes at the edge ends + pt[1] = tok[0]; + pt[2] = tok[cnt-1]; + ptSize=$.addPTS; + for (pt[i]) { + if (i==2 && pt[1]==pt[2]) + continue; + aNode=node($G, "__CIRCLE__" + (string)++circ); + aNode.pos=pt[i]; + aNode.shape="point"; + aNode.width=ptSize; + aNode.height=ptSize; + aNode.style="filled"; + aNode.fillcolor=$.colorPTS; + aNode.color=$.colorPTS; + } + } + +} \ No newline at end of file diff --git a/examples/ex05.gv b/examples/ex05.gv index 852146faa..b34e3fd75 100644 --- a/examples/ex05.gv +++ b/examples/ex05.gv @@ -184,19 +184,7 @@ graph { X2:1:GND
- + @@ -207,19 +195,7 @@ graph { - + @@ -230,19 +206,7 @@ graph { - + @@ -253,19 +217,7 @@ graph { - + @@ -287,6 +239,10 @@ graph { edge [color="#000000:#8000FF:#000000"] X1:p4r:e -- W1:w4:w W1:w4:e -- X2:p4l:w + W1:w1:e -- W1:w1:w [color="#000000:#FF66CC:#000000" straight=straight] + W1:w2:e -- W1:w2:w [color="#000000:#00FFFF:#000000" straight=straight] + W1:w3:e -- W1:w3:w [color="#000000:#FFFF00:#000000" straight=straight] + W1:w4:e -- W1:w4:w [color="#000000:#8000FF:#000000" straight=straight] W2 [label=<
X4:1:GND
- - - - - - - - - - -
-
X1:2:VCCX4:2:VCC
- - - - - - - - - - -
-
 
- - - - - - - - - - -
-
X1:2:VCCX2:2:VCC
- - - - - - - - - - -
-
X1:1:GNDX3:1:GND
- - - - - - - - - - -
-
X1:2:VCCX3:2:VCC
- - - - - - - - - - -
-
X1:1:GNDX4:1:GND
- - - - - - - - - - -
-
X1:2:VCCX4:2:VCC
- - - - - - - - - - -
-
 
- - - - - - - - - - -
-
- - - - - - - - - - -
-
- - - - - - - - - - -
-
- - - - - - - - - - -
-
- - - - - - - - - - -
-
- - - - - - - - - - -
-
 
- - - - - - - - - - -
-
X1:2:VCCX2:2:VCC
- - - - - - - - - - -
-
X1:3:SCLX2:3:SCL
- - - - - - - - - - -
-
X1:4:SDAX2:4:SDA
- - - - - - - - - - -
-
 
@@ -325,19 +281,7 @@ graph { - + @@ -348,19 +292,7 @@ graph { - + @@ -371,19 +303,7 @@ graph { - + @@ -394,19 +314,7 @@ graph { - + @@ -428,4 +336,8 @@ graph { edge [color="#000000:#8000FF:#000000"] X2:p4r:e -- W2:w4:w W2:w4:e -- X3:p4l:w + W2:w1:e -- W2:w1:w [color="#000000:#FF66CC:#000000" straight=straight] + W2:w2:e -- W2:w2:w [color="#000000:#00FFFF:#000000" straight=straight] + W2:w3:e -- W2:w3:w [color="#000000:#FFFF00:#000000" straight=straight] + W2:w4:e -- W2:w4:w [color="#000000:#8000FF:#000000" straight=straight] } diff --git a/examples/ex05.html b/examples/ex05.html index f476b9da1..01675b736 100644 --- a/examples/ex05.html +++ b/examples/ex05.html @@ -30,322 +30,354 @@

Diagram

- - - - + + + X1 - - - -X1 - -Molex KK 254 - -female - -4-pin - -GND - -1 - -VCC - -2 - -SCL - -3 - -SDA - -4 + + + +X1 + +Molex KK 254 + +female + +4-pin + +GND + +1 + +VCC + +2 + +SCL + +3 + +SDA + +4 - + W1 - - - -W1 - -I2C - -4x - -0.25 mm² - -0.2 m -  - X1:1:GND - -PK - -X2:1:GND - - - - X1:2:VCC - -TQ - -X2:2:VCC - - - - X1:3:SCL - -YE - -X2:3:SCL - - - - X1:4:SDA - -VT - -X2:4:SDA - - - -  + + + +W1 + +I2C + +4x + +0.25 mm² + +0.2 m +  + X1:1:GND + +PK + +X2:1:GND + X1:2:VCC + +TQ + +X2:2:VCC + X1:3:SCL + +YE + +X2:3:SCL + X1:4:SDA + +VT + +X2:4:SDA +  X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + - + X2 - - - -X2 - -Molex KK 254 - -female - -4-pin - -1 - -GND - -1 - -2 - -VCC - -2 - -3 - -SCL - -3 - -4 - -SDA - -4 + + + +X2 + +Molex KK 254 + +female + +4-pin + +1 + +GND + +1 + +2 + +VCC + +2 + +3 + +SCL + +3 + +4 + +SDA + +4 + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + - + W2 - - - -W2 - -I2C - -4x - -0.25 mm² - -0.2 m -  - X2:1:GND - -PK - -X3:1:GND - - - - X2:2:VCC - -TQ - -X3:2:VCC - - - - X2:3:SCL - -YE - -X3:3:SCL - - - - X2:4:SDA - -VT - -X3:4:SDA - - - -  + + + +W2 + +I2C + +4x + +0.25 mm² + +0.2 m +  + X2:1:GND + +PK + +X3:1:GND + X2:2:VCC + +TQ + +X3:2:VCC + X2:3:SCL + +YE + +X3:3:SCL + X2:4:SDA + +VT + +X3:4:SDA +  - + X2:e--W2:w - - - + + + - + X2:e--W2:w - - - + + + - + X2:e--W2:w - - - + + + - + X2:e--W2:w - - - + + + - - -X3 - - - -X3 - -Molex KK 254 - -female - -4-pin - -1 - -GND - -2 - -VCC - -3 - -SCL - -4 - -SDA + + +W2:e--W2:w + + + - - -W1:e--X2:w - - - + + +W2:e--W2:w + + + - - -W1:e--X2:w - - - + + +W2:e--W2:w + + + - - -W1:e--X2:w - - - + + +W2:e--W2:w + + + - - -W1:e--X2:w - - - + + +X3 + + + +X3 + +Molex KK 254 + +female + +4-pin + +1 + +GND + +2 + +VCC + +3 + +SCL + +4 + +SDA - + W2:e--X3:w - - - + + + - + W2:e--X3:w - - - + + + - + W2:e--X3:w - - - + + + - + W2:e--X3:w - - - + + + diff --git a/examples/ex05.png b/examples/ex05.png index bf3d27f7a..9c3edd9e2 100644 Binary files a/examples/ex05.png and b/examples/ex05.png differ diff --git a/examples/ex05.svg b/examples/ex05.svg index ef9e7408a..815a59b62 100644 --- a/examples/ex05.svg +++ b/examples/ex05.svg @@ -1,322 +1,354 @@ - - - - + + + X1 - - - -X1 - -Molex KK 254 - -female - -4-pin - -GND - -1 - -VCC - -2 - -SCL - -3 - -SDA - -4 + + + +X1 + +Molex KK 254 + +female + +4-pin + +GND + +1 + +VCC + +2 + +SCL + +3 + +SDA + +4 - + W1 - - - -W1 - -I2C - -4x - -0.25 mm² - -0.2 m -  - X1:1:GND - -PK - -X2:1:GND - - - - X1:2:VCC - -TQ - -X2:2:VCC - - - - X1:3:SCL - -YE - -X2:3:SCL - - - - X1:4:SDA - -VT - -X2:4:SDA - - - -  + + + +W1 + +I2C + +4x + +0.25 mm² + +0.2 m +  + X1:1:GND + +PK + +X2:1:GND + X1:2:VCC + +TQ + +X2:2:VCC + X1:3:SCL + +YE + +X2:3:SCL + X1:4:SDA + +VT + +X2:4:SDA +  X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + - + X2 - - - -X2 - -Molex KK 254 - -female - -4-pin - -1 - -GND - -1 - -2 - -VCC - -2 - -3 - -SCL - -3 - -4 - -SDA - -4 + + + +X2 + +Molex KK 254 + +female + +4-pin + +1 + +GND + +1 + +2 + +VCC + +2 + +3 + +SCL + +3 + +4 + +SDA + +4 + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + - + W2 - - - -W2 - -I2C - -4x - -0.25 mm² - -0.2 m -  - X2:1:GND - -PK - -X3:1:GND - - - - X2:2:VCC - -TQ - -X3:2:VCC - - - - X2:3:SCL - -YE - -X3:3:SCL - - - - X2:4:SDA - -VT - -X3:4:SDA - - - -  + + + +W2 + +I2C + +4x + +0.25 mm² + +0.2 m +  + X2:1:GND + +PK + +X3:1:GND + X2:2:VCC + +TQ + +X3:2:VCC + X2:3:SCL + +YE + +X3:3:SCL + X2:4:SDA + +VT + +X3:4:SDA +  - + X2:e--W2:w - - - + + + - + X2:e--W2:w - - - + + + - + X2:e--W2:w - - - + + + - + X2:e--W2:w - - - + + + - - -X3 - - - -X3 - -Molex KK 254 - -female - -4-pin - -1 - -GND - -2 - -VCC - -3 - -SCL - -4 - -SDA + + +W2:e--W2:w + + + - - -W1:e--X2:w - - - + + +W2:e--W2:w + + + - - -W1:e--X2:w - - - + + +W2:e--W2:w + + + - - -W1:e--X2:w - - - + + +W2:e--W2:w + + + - - -W1:e--X2:w - - - + + +X3 + + + +X3 + +Molex KK 254 + +female + +4-pin + +1 + +GND + +2 + +VCC + +3 + +SCL + +4 + +SDA - + W2:e--X3:w - - - + + + - + W2:e--X3:w - - - + + + - + W2:e--X3:w - - - + + + - + W2:e--X3:w - - - + + + diff --git a/examples/ex05_wv_gvpr.gvpr b/examples/ex05_wv_gvpr.gvpr new file mode 100644 index 000000000..7bfced78e --- /dev/null +++ b/examples/ex05_wv_gvpr.gvpr @@ -0,0 +1,64 @@ +/******************************************************************* + + see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 + input must include pos values (must be output from one of the engines w/ -Tdot)# + Thanks to steveroush and FeRDNYC + +*******************************************************************/ +BEG_G{ + double x1,y1,x2,y2,x3,y3,x4,y4; + string ptSize, tok[int], pt[]; + int cnt, circ, i; + node_t aNode; + + circ=0; + +/*************************************** + $G.bb=""; + $G.nodesep=""; + $G.ranksep=""; + $G.splines="true"; +****************************************/ +} + +// This removes the label text but keeps the position +E[noLabel] { + $.label=""; // remove pesky label + // $.lp=""; // remove peskier label pos +} + +E[straight] { + cnt=tokens($.pos,tok," "); + $.oldpos=$.pos; + x1 = xOf(tok[0]); + y1 = yOf(tok[0]); + x4 = xOf(tok[cnt-1]); + y4 = yOf(tok[cnt-1]); + x2 = x1 + (x4-x1)/3.; + y2 = y1 + (y4-y1)/3.; + x3 = x1 + 2.*(x4-x1)/3.; + y3 = y1 + 2.*(y4-y1)/3.; + pos=sprintf("%.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f", x1,y1, x2,y2, x3,y3, x4,y4); + $.label=""; // remove pesky label + $.lp=""; // remove peskier label pos + + if (hasAttr($, "addPTS") && $.addPTS!="" && $.colorPTS!=""){ + // now we place point nodes at the edge ends + pt[1] = tok[0]; + pt[2] = tok[cnt-1]; + ptSize=$.addPTS; + for (pt[i]) { + if (i==2 && pt[1]==pt[2]) + continue; + aNode=node($G, "__CIRCLE__" + (string)++circ); + aNode.pos=pt[i]; + aNode.shape="point"; + aNode.width=ptSize; + aNode.height=ptSize; + aNode.style="filled"; + aNode.fillcolor=$.colorPTS; + aNode.color=$.colorPTS; + } + } + +} \ No newline at end of file diff --git a/examples/ex06.gv b/examples/ex06.gv index be1231e7b..274592b18 100644 --- a/examples/ex06.gv +++ b/examples/ex06.gv @@ -317,19 +317,7 @@ graph { X2:1:GND
- + @@ -340,19 +328,7 @@ graph { - + @@ -363,19 +339,7 @@ graph { - + @@ -386,19 +350,7 @@ graph { - + @@ -420,6 +372,10 @@ graph { edge [color="#000000:#8000FF:#000000"] X1:p4r:e -- W1:w4:w W1:w4:e -- X2:p4l:w + W1:w1:e -- W1:w1:w [color="#000000:#FF66CC:#000000" straight=straight] + W1:w2:e -- W1:w2:w [color="#000000:#00FFFF:#000000" straight=straight] + W1:w3:e -- W1:w3:w [color="#000000:#FFFF00:#000000" straight=straight] + W1:w4:e -- W1:w4:w [color="#000000:#8000FF:#000000" straight=straight] W2 [label=<
X3:1:GND
- - - - - - - - - - -
-
X2:2:VCCX3:2:VCC
- - - - - - - - - - -
-
X2:3:SCLX3:3:SCL
- - - - - - - - - - -
-
X2:4:SDAX3:4:SDA
- - - - - - - - - - -
-
 
- - - - - - - - - - -
-
X1:2:VCCX2:2:VCC
- - - - - - - - - - -
-
X1:3:SCLX2:3:SCL
- - - - - - - - - - -
-
X1:4:SDAX2:4:SDA
- - - - - - - - - - -
-
 
@@ -457,19 +413,7 @@ graph { - + @@ -480,19 +424,7 @@ graph { - + @@ -503,19 +435,7 @@ graph { - + @@ -526,19 +446,7 @@ graph { - + @@ -560,6 +468,10 @@ graph { edge [color="#000000:#8000FF:#000000"] X3:p4r:e -- W2:w4:w W2:w4:e -- X2:p4l:w + W2:w1:e -- W2:w1:w [color="#000000:#FF66CC:#000000" straight=straight] + W2:w2:e -- W2:w2:w [color="#000000:#00FFFF:#000000" straight=straight] + W2:w3:e -- W2:w3:w [color="#000000:#FFFF00:#000000" straight=straight] + W2:w4:e -- W2:w4:w [color="#000000:#8000FF:#000000" straight=straight] W3 [label=<
X2:1:GND
- - - - - - - - - - -
-
X3:2:VCCX2:2:VCC
- - - - - - - - - - -
-
X3:3:SCLX2:3:SCL
- - - - - - - - - - -
-
X3:4:SDAX2:4:SDA
- - - - - - - - - - -
-
 
@@ -597,19 +509,7 @@ graph { - + @@ -620,19 +520,7 @@ graph { - + @@ -643,19 +531,7 @@ graph { - + @@ -666,19 +542,7 @@ graph { - + @@ -700,6 +564,10 @@ graph { edge [color="#000000:#8000FF:#000000"] X3:p4r:e -- W3:w4:w W3:w4:e -- X4:p4l:w + W3:w1:e -- W3:w1:w [color="#000000:#FF66CC:#000000" straight=straight] + W3:w2:e -- W3:w2:w [color="#000000:#00FFFF:#000000" straight=straight] + W3:w3:e -- W3:w3:w [color="#000000:#FFFF00:#000000" straight=straight] + W3:w4:e -- W3:w4:w [color="#000000:#8000FF:#000000" straight=straight] W4 [label=<
X4:1:GND
- - - - - - - - - - -
-
X3:2:VCCX4:2:VCC
- - - - - - - - - - -
-
X3:3:SCLX4:3:SCL
- - - - - - - - - - -
-
X3:4:SDAX4:4:SDA
- - - - - - - - - - -
-
 
@@ -737,19 +605,7 @@ graph { - + @@ -760,19 +616,7 @@ graph { - + @@ -783,19 +627,7 @@ graph { - + @@ -806,19 +638,7 @@ graph { - + @@ -840,6 +660,10 @@ graph { edge [color="#000000:#8000FF:#000000"] X5:p4r:e -- W4:w4:w W4:w4:e -- X4:p4l:w + W4:w1:e -- W4:w1:w [color="#000000:#FF66CC:#000000" straight=straight] + W4:w2:e -- W4:w2:w [color="#000000:#00FFFF:#000000" straight=straight] + W4:w3:e -- W4:w3:w [color="#000000:#FFFF00:#000000" straight=straight] + W4:w4:e -- W4:w4:w [color="#000000:#8000FF:#000000" straight=straight] W5 [label=<
X4:1:GND
- - - - - - - - - - -
-
X5:2:VCCX4:2:VCC
- - - - - - - - - - -
-
X5:3:SCLX4:3:SCL
- - - - - - - - - - -
-
X5:4:SDAX4:4:SDA
- - - - - - - - - - -
-
 
@@ -877,19 +701,7 @@ graph { - + @@ -900,19 +712,7 @@ graph { - + @@ -923,19 +723,7 @@ graph { - + @@ -946,19 +734,7 @@ graph { - + @@ -980,4 +756,8 @@ graph { edge [color="#000000:#8000FF:#000000"] X5:p4r:e -- W5:w4:w W5:w4:e -- X6:p4l:w + W5:w1:e -- W5:w1:w [color="#000000:#FF66CC:#000000" straight=straight] + W5:w2:e -- W5:w2:w [color="#000000:#00FFFF:#000000" straight=straight] + W5:w3:e -- W5:w3:w [color="#000000:#FFFF00:#000000" straight=straight] + W5:w4:e -- W5:w4:w [color="#000000:#8000FF:#000000" straight=straight] } diff --git a/examples/ex06.html b/examples/ex06.html index f71705031..db5a2d824 100644 --- a/examples/ex06.html +++ b/examples/ex06.html @@ -30,712 +30,792 @@

Diagram

- - - - + + + X1 - - - -X1 - -Molex KK 254 - -female - -4-pin - -GND - -1 - -VCC - -2 - -SCL - -3 - -SDA - -4 + + + +X1 + +Molex KK 254 + +female + +4-pin + +GND + +1 + +VCC + +2 + +SCL + +3 + +SDA + +4 - + W1 - - - -W1 - -4x - -0.25 mm² - -0.2 m -  - X1:1:GND - -PK - -X2:1:GND - - - - X1:2:VCC - -TQ - -X2:2:VCC - - - - X1:3:SCL - -YE - -X2:3:SCL - - - - X1:4:SDA - -VT - -X2:4:SDA - - - -  + + + +W1 + +4x + +0.25 mm² + +0.2 m +  + X1:1:GND + +PK + +X2:1:GND + X1:2:VCC + +TQ + +X2:2:VCC + X1:3:SCL + +YE + +X2:3:SCL + X1:4:SDA + +VT + +X2:4:SDA +  X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + - + X2 - - - -X2 - -Molex KK 254 - -female - -4-pin - -1 - -GND - -2 - -VCC - -3 - -SCL - -4 - -SDA + + + +X2 + +Molex KK 254 + +female + +4-pin + +1 + +GND + +2 + +VCC + +3 + +SCL + +4 + +SDA + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + - + X3 - - - -X3 - -Molex KK 254 - -female - -4-pin - -GND - -1 - -VCC - -2 - -SCL - -3 - -SDA - -4 + + + +X3 + +Molex KK 254 + +female + +4-pin + +GND + +1 + +VCC + +2 + +SCL + +3 + +SDA + +4 - + W2 - - - -W2 - -4x - -0.25 mm² - -0.2 m -  - X3:1:GND - -PK - -X2:1:GND - - - - X3:2:VCC - -TQ - -X2:2:VCC - - - - X3:3:SCL - -YE - -X2:3:SCL - - - - X3:4:SDA - -VT - -X2:4:SDA - - - -  + + + +W2 + +4x + +0.25 mm² + +0.2 m +  + X3:1:GND + +PK + +X2:1:GND + X3:2:VCC + +TQ + +X2:2:VCC + X3:3:SCL + +YE + +X2:3:SCL + X3:4:SDA + +VT + +X2:4:SDA +  - + X3:e--W2:w - - - + + + - + X3:e--W2:w - - - + + + - + X3:e--W2:w - - - + + + - + X3:e--W2:w - - - + + + - + W3 - - - -W3 - -4x - -0.25 mm² - -0.2 m -  - X3:1:GND - -PK - -X4:1:GND - - - - X3:2:VCC - -TQ - -X4:2:VCC - - - - X3:3:SCL - -YE - -X4:3:SCL - - - - X3:4:SDA - -VT - -X4:4:SDA - - - -  + + + +W3 + +4x + +0.25 mm² + +0.2 m +  + X3:1:GND + +PK + +X4:1:GND + X3:2:VCC + +TQ + +X4:2:VCC + X3:3:SCL + +YE + +X4:3:SCL + X3:4:SDA + +VT + +X4:4:SDA +  X3:e--W3:w - - - + + + - + X3:e--W3:w - - - + + + - + X3:e--W3:w - - - + + + - + X3:e--W3:w - - - + + + + + + +W2:e--X2:w + + + + + + +W2:e--X2:w + + + + + + +W2:e--X2:w + + + + + + +W2:e--X2:w + + + + + + +W2:e--W2:w + + + + + + +W2:e--W2:w + + + + + + +W2:e--W2:w + + + + + + +W2:e--W2:w + + + + + + +W3:e--W3:w + + + + + + +W3:e--W3:w + + + + + + +W3:e--W3:w + + + + + + +W3:e--W3:w + + + - + X4 - - - -X4 - -Molex KK 254 - -female - -4-pin - -1 - -GND - -2 - -VCC - -3 - -SCL - -4 - -SDA + + + +X4 + +Molex KK 254 + +female + +4-pin + +1 + +GND + +2 + +VCC + +3 + +SCL + +4 + +SDA + + + +W3:e--X4:w + + + + + + +W3:e--X4:w + + + + + + +W3:e--X4:w + + + + + + +W3:e--X4:w + + + - + X5 - - - -X5 - -Molex KK 254 - -female - -4-pin - -GND - -1 - -VCC - -2 - -SCL - -3 - -SDA - -4 + + + +X5 + +Molex KK 254 + +female + +4-pin + +GND + +1 + +VCC + +2 + +SCL + +3 + +SDA + +4 - + W4 - - - -W4 - -4x - -0.25 mm² - -0.2 m -  - X5:1:GND - -PK - -X4:1:GND - - - - X5:2:VCC - -TQ - -X4:2:VCC - - - - X5:3:SCL - -YE - -X4:3:SCL - - - - X5:4:SDA - -VT - -X4:4:SDA - - - -  + + + +W4 + +4x + +0.25 mm² + +0.2 m +  + X5:1:GND + +PK + +X4:1:GND + X5:2:VCC + +TQ + +X4:2:VCC + X5:3:SCL + +YE + +X4:3:SCL + X5:4:SDA + +VT + +X4:4:SDA +  - + X5:e--W4:w - - - + + + - + X5:e--W4:w - - - + + + - + X5:e--W4:w - - - + + + - + X5:e--W4:w - - - + + + - + W5 - - - -W5 - -4x - -0.25 mm² - -0.2 m -  - X5:1:GND - -PK - -X6:1:GND - - - - X5:2:VCC - -TQ - -X6:2:VCC - - - - X5:3:SCL - -YE - -X6:3:SCL - - - - X5:4:SDA - -VT - -X6:4:SDA - - - -  + + + +W5 + +4x + +0.25 mm² + +0.2 m +  + X5:1:GND + +PK + +X6:1:GND + X5:2:VCC + +TQ + +X6:2:VCC + X5:3:SCL + +YE + +X6:3:SCL + X5:4:SDA + +VT + +X6:4:SDA +  - + X5:e--W5:w - - - + + + - + X5:e--W5:w - - - + + + - + X5:e--W5:w - - - + + + - + X5:e--W5:w - - - - - - -X6 - - - -X6 - -Molex KK 254 - -female - -4-pin - -1 - -GND - -2 - -VCC - -3 - -SCL - -4 - -SDA - - - -W1:e--X2:w - - - - - - -W1:e--X2:w - - - - - - -W1:e--X2:w - - - - - - -W1:e--X2:w - - - - - - -W2:e--X2:w - - - - - - -W2:e--X2:w - - - - - - -W2:e--X2:w - - - - - - -W2:e--X2:w - - - - - - -W3:e--X4:w - - - - - - -W3:e--X4:w - - - - - - -W3:e--X4:w - - - - - - -W3:e--X4:w - - - + + + - + W4:e--X4:w - - - + + + - + W4:e--X4:w - - - + + + - + W4:e--X4:w - - - + + + - + W4:e--X4:w - - - + + + + + + +W4:e--W4:w + + + + + + +W4:e--W4:w + + + + + + +W4:e--W4:w + + + + + + +W4:e--W4:w + + + + + + +W5:e--W5:w + + + + + + +W5:e--W5:w + + + + + + +W5:e--W5:w + + + + + + +W5:e--W5:w + + + + + + +X6 + + + +X6 + +Molex KK 254 + +female + +4-pin + +1 + +GND + +2 + +VCC + +3 + +SCL + +4 + +SDA - + W5:e--X6:w - - - + + + - + W5:e--X6:w - - - + + + - + W5:e--X6:w - - - + + + - + W5:e--X6:w - - - + + + diff --git a/examples/ex06.png b/examples/ex06.png index d42cdf9e0..c6f519245 100644 Binary files a/examples/ex06.png and b/examples/ex06.png differ diff --git a/examples/ex06.svg b/examples/ex06.svg index 9939f615b..94f5be1fb 100644 --- a/examples/ex06.svg +++ b/examples/ex06.svg @@ -1,712 +1,792 @@ - - - - + + + X1 - - - -X1 - -Molex KK 254 - -female - -4-pin - -GND - -1 - -VCC - -2 - -SCL - -3 - -SDA - -4 + + + +X1 + +Molex KK 254 + +female + +4-pin + +GND + +1 + +VCC + +2 + +SCL + +3 + +SDA + +4 - + W1 - - - -W1 - -4x - -0.25 mm² - -0.2 m -  - X1:1:GND - -PK - -X2:1:GND - - - - X1:2:VCC - -TQ - -X2:2:VCC - - - - X1:3:SCL - -YE - -X2:3:SCL - - - - X1:4:SDA - -VT - -X2:4:SDA - - - -  + + + +W1 + +4x + +0.25 mm² + +0.2 m +  + X1:1:GND + +PK + +X2:1:GND + X1:2:VCC + +TQ + +X2:2:VCC + X1:3:SCL + +YE + +X2:3:SCL + X1:4:SDA + +VT + +X2:4:SDA +  X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + - + X2 - - - -X2 - -Molex KK 254 - -female - -4-pin - -1 - -GND - -2 - -VCC - -3 - -SCL - -4 - -SDA + + + +X2 + +Molex KK 254 + +female + +4-pin + +1 + +GND + +2 + +VCC + +3 + +SCL + +4 + +SDA + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + - + X3 - - - -X3 - -Molex KK 254 - -female - -4-pin - -GND - -1 - -VCC - -2 - -SCL - -3 - -SDA - -4 + + + +X3 + +Molex KK 254 + +female + +4-pin + +GND + +1 + +VCC + +2 + +SCL + +3 + +SDA + +4 - + W2 - - - -W2 - -4x - -0.25 mm² - -0.2 m -  - X3:1:GND - -PK - -X2:1:GND - - - - X3:2:VCC - -TQ - -X2:2:VCC - - - - X3:3:SCL - -YE - -X2:3:SCL - - - - X3:4:SDA - -VT - -X2:4:SDA - - - -  + + + +W2 + +4x + +0.25 mm² + +0.2 m +  + X3:1:GND + +PK + +X2:1:GND + X3:2:VCC + +TQ + +X2:2:VCC + X3:3:SCL + +YE + +X2:3:SCL + X3:4:SDA + +VT + +X2:4:SDA +  - + X3:e--W2:w - - - + + + - + X3:e--W2:w - - - + + + - + X3:e--W2:w - - - + + + - + X3:e--W2:w - - - + + + - + W3 - - - -W3 - -4x - -0.25 mm² - -0.2 m -  - X3:1:GND - -PK - -X4:1:GND - - - - X3:2:VCC - -TQ - -X4:2:VCC - - - - X3:3:SCL - -YE - -X4:3:SCL - - - - X3:4:SDA - -VT - -X4:4:SDA - - - -  + + + +W3 + +4x + +0.25 mm² + +0.2 m +  + X3:1:GND + +PK + +X4:1:GND + X3:2:VCC + +TQ + +X4:2:VCC + X3:3:SCL + +YE + +X4:3:SCL + X3:4:SDA + +VT + +X4:4:SDA +  X3:e--W3:w - - - + + + - + X3:e--W3:w - - - + + + - + X3:e--W3:w - - - + + + - + X3:e--W3:w - - - + + + + + + +W2:e--X2:w + + + + + + +W2:e--X2:w + + + + + + +W2:e--X2:w + + + + + + +W2:e--X2:w + + + + + + +W2:e--W2:w + + + + + + +W2:e--W2:w + + + + + + +W2:e--W2:w + + + + + + +W2:e--W2:w + + + + + + +W3:e--W3:w + + + + + + +W3:e--W3:w + + + + + + +W3:e--W3:w + + + + + + +W3:e--W3:w + + + - + X4 - - - -X4 - -Molex KK 254 - -female - -4-pin - -1 - -GND - -2 - -VCC - -3 - -SCL - -4 - -SDA + + + +X4 + +Molex KK 254 + +female + +4-pin + +1 + +GND + +2 + +VCC + +3 + +SCL + +4 + +SDA + + + +W3:e--X4:w + + + + + + +W3:e--X4:w + + + + + + +W3:e--X4:w + + + + + + +W3:e--X4:w + + + - + X5 - - - -X5 - -Molex KK 254 - -female - -4-pin - -GND - -1 - -VCC - -2 - -SCL - -3 - -SDA - -4 + + + +X5 + +Molex KK 254 + +female + +4-pin + +GND + +1 + +VCC + +2 + +SCL + +3 + +SDA + +4 - + W4 - - - -W4 - -4x - -0.25 mm² - -0.2 m -  - X5:1:GND - -PK - -X4:1:GND - - - - X5:2:VCC - -TQ - -X4:2:VCC - - - - X5:3:SCL - -YE - -X4:3:SCL - - - - X5:4:SDA - -VT - -X4:4:SDA - - - -  + + + +W4 + +4x + +0.25 mm² + +0.2 m +  + X5:1:GND + +PK + +X4:1:GND + X5:2:VCC + +TQ + +X4:2:VCC + X5:3:SCL + +YE + +X4:3:SCL + X5:4:SDA + +VT + +X4:4:SDA +  - + X5:e--W4:w - - - + + + - + X5:e--W4:w - - - + + + - + X5:e--W4:w - - - + + + - + X5:e--W4:w - - - + + + - + W5 - - - -W5 - -4x - -0.25 mm² - -0.2 m -  - X5:1:GND - -PK - -X6:1:GND - - - - X5:2:VCC - -TQ - -X6:2:VCC - - - - X5:3:SCL - -YE - -X6:3:SCL - - - - X5:4:SDA - -VT - -X6:4:SDA - - - -  + + + +W5 + +4x + +0.25 mm² + +0.2 m +  + X5:1:GND + +PK + +X6:1:GND + X5:2:VCC + +TQ + +X6:2:VCC + X5:3:SCL + +YE + +X6:3:SCL + X5:4:SDA + +VT + +X6:4:SDA +  - + X5:e--W5:w - - - + + + - + X5:e--W5:w - - - + + + - + X5:e--W5:w - - - + + + - + X5:e--W5:w - - - - - - -X6 - - - -X6 - -Molex KK 254 - -female - -4-pin - -1 - -GND - -2 - -VCC - -3 - -SCL - -4 - -SDA - - - -W1:e--X2:w - - - - - - -W1:e--X2:w - - - - - - -W1:e--X2:w - - - - - - -W1:e--X2:w - - - - - - -W2:e--X2:w - - - - - - -W2:e--X2:w - - - - - - -W2:e--X2:w - - - - - - -W2:e--X2:w - - - - - - -W3:e--X4:w - - - - - - -W3:e--X4:w - - - - - - -W3:e--X4:w - - - - - - -W3:e--X4:w - - - + + + - + W4:e--X4:w - - - + + + - + W4:e--X4:w - - - + + + - + W4:e--X4:w - - - + + + - + W4:e--X4:w - - - + + + + + + +W4:e--W4:w + + + + + + +W4:e--W4:w + + + + + + +W4:e--W4:w + + + + + + +W4:e--W4:w + + + + + + +W5:e--W5:w + + + + + + +W5:e--W5:w + + + + + + +W5:e--W5:w + + + + + + +W5:e--W5:w + + + + + + +X6 + + + +X6 + +Molex KK 254 + +female + +4-pin + +1 + +GND + +2 + +VCC + +3 + +SCL + +4 + +SDA - + W5:e--X6:w - - - + + + - + W5:e--X6:w - - - + + + - + W5:e--X6:w - - - + + + - + W5:e--X6:w - - - + + + diff --git a/examples/ex06_wv_gvpr.gvpr b/examples/ex06_wv_gvpr.gvpr new file mode 100644 index 000000000..7bfced78e --- /dev/null +++ b/examples/ex06_wv_gvpr.gvpr @@ -0,0 +1,64 @@ +/******************************************************************* + + see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 + input must include pos values (must be output from one of the engines w/ -Tdot)# + Thanks to steveroush and FeRDNYC + +*******************************************************************/ +BEG_G{ + double x1,y1,x2,y2,x3,y3,x4,y4; + string ptSize, tok[int], pt[]; + int cnt, circ, i; + node_t aNode; + + circ=0; + +/*************************************** + $G.bb=""; + $G.nodesep=""; + $G.ranksep=""; + $G.splines="true"; +****************************************/ +} + +// This removes the label text but keeps the position +E[noLabel] { + $.label=""; // remove pesky label + // $.lp=""; // remove peskier label pos +} + +E[straight] { + cnt=tokens($.pos,tok," "); + $.oldpos=$.pos; + x1 = xOf(tok[0]); + y1 = yOf(tok[0]); + x4 = xOf(tok[cnt-1]); + y4 = yOf(tok[cnt-1]); + x2 = x1 + (x4-x1)/3.; + y2 = y1 + (y4-y1)/3.; + x3 = x1 + 2.*(x4-x1)/3.; + y3 = y1 + 2.*(y4-y1)/3.; + pos=sprintf("%.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f", x1,y1, x2,y2, x3,y3, x4,y4); + $.label=""; // remove pesky label + $.lp=""; // remove peskier label pos + + if (hasAttr($, "addPTS") && $.addPTS!="" && $.colorPTS!=""){ + // now we place point nodes at the edge ends + pt[1] = tok[0]; + pt[2] = tok[cnt-1]; + ptSize=$.addPTS; + for (pt[i]) { + if (i==2 && pt[1]==pt[2]) + continue; + aNode=node($G, "__CIRCLE__" + (string)++circ); + aNode.pos=pt[i]; + aNode.shape="point"; + aNode.width=ptSize; + aNode.height=ptSize; + aNode.style="filled"; + aNode.fillcolor=$.colorPTS; + aNode.color=$.colorPTS; + } + } + +} \ No newline at end of file diff --git a/examples/ex07.gv b/examples/ex07.gv index 0dc76b8b4..1da26b39d 100644 --- a/examples/ex07.gv +++ b/examples/ex07.gv @@ -134,19 +134,7 @@ graph { X2:7
- + @@ -156,19 +144,7 @@ graph { - + @@ -184,4 +160,6 @@ graph { edge [color="#000000:#00AA00:#000000"] X1:p6r:e -- C1:w2:w C1:w2:e -- X2:p2l:w + C1:w1:e -- C1:w1:w [color="#000000:#FFFF00:#000000" straight=straight] + C1:w2:e -- C1:w2:w [color="#000000:#00AA00:#000000" straight=straight] } diff --git a/examples/ex07.html b/examples/ex07.html index 3b33e2b3c..b9f4684e4 100644 --- a/examples/ex07.html +++ b/examples/ex07.html @@ -30,112 +30,120 @@

Diagram

- - - - + + + X1 - - - -X1 - -TE 776164-1 - -female - -35-pin - -5 - -6 - -Unconnected pins are not shown + + + +X1 + +TE 776164-1 + +female + +35-pin + +5 + +6 + +Unconnected pins are not shown - + C1 - - - -C1 - -2x - -20 AWG - -1 m -  - X1:5 - -1:YE - -X2:7 - - - - X1:6 - -2:GN - -X2:2 - - - -  + + + +C1 + +2x + +20 AWG + +1 m +  + X1:5 + +1:YE + +X2:7 + X1:6 + +2:GN + +X2:2 +  X1:e--C1:w - - - + + + - + X1:e--C1:w - - - + + + + + + +C1:e--C1:w + + + + + + +C1:e--C1:w + + + - + X2 - - - -X2 - -D-Sub - -female - -9-pin - -2 - -7 - -Unconnected pins are not shown + + + +X2 + +D-Sub + +female + +9-pin + +2 + +7 + +Unconnected pins are not shown - + C1:e--X2:w - - - + + + - + C1:e--X2:w - - - + + + diff --git a/examples/ex07.png b/examples/ex07.png index 79b086b28..2fd5c84e8 100644 Binary files a/examples/ex07.png and b/examples/ex07.png differ diff --git a/examples/ex07.svg b/examples/ex07.svg index 16ef2662a..16baab447 100644 --- a/examples/ex07.svg +++ b/examples/ex07.svg @@ -1,112 +1,120 @@ - - - - + + + X1 - - - -X1 - -TE 776164-1 - -female - -35-pin - -5 - -6 - -Unconnected pins are not shown + + + +X1 + +TE 776164-1 + +female + +35-pin + +5 + +6 + +Unconnected pins are not shown - + C1 - - - -C1 - -2x - -20 AWG - -1 m -  - X1:5 - -1:YE - -X2:7 - - - - X1:6 - -2:GN - -X2:2 - - - -  + + + +C1 + +2x + +20 AWG + +1 m +  + X1:5 + +1:YE + +X2:7 + X1:6 + +2:GN + +X2:2 +  X1:e--C1:w - - - + + + - + X1:e--C1:w - - - + + + + + + +C1:e--C1:w + + + + + + +C1:e--C1:w + + + - + X2 - - - -X2 - -D-Sub - -female - -9-pin - -2 - -7 - -Unconnected pins are not shown + + + +X2 + +D-Sub + +female + +9-pin + +2 + +7 + +Unconnected pins are not shown - + C1:e--X2:w - - - + + + - + C1:e--X2:w - - - + + + diff --git a/examples/ex07_wv_gvpr.gvpr b/examples/ex07_wv_gvpr.gvpr new file mode 100644 index 000000000..7bfced78e --- /dev/null +++ b/examples/ex07_wv_gvpr.gvpr @@ -0,0 +1,64 @@ +/******************************************************************* + + see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 + input must include pos values (must be output from one of the engines w/ -Tdot)# + Thanks to steveroush and FeRDNYC + +*******************************************************************/ +BEG_G{ + double x1,y1,x2,y2,x3,y3,x4,y4; + string ptSize, tok[int], pt[]; + int cnt, circ, i; + node_t aNode; + + circ=0; + +/*************************************** + $G.bb=""; + $G.nodesep=""; + $G.ranksep=""; + $G.splines="true"; +****************************************/ +} + +// This removes the label text but keeps the position +E[noLabel] { + $.label=""; // remove pesky label + // $.lp=""; // remove peskier label pos +} + +E[straight] { + cnt=tokens($.pos,tok," "); + $.oldpos=$.pos; + x1 = xOf(tok[0]); + y1 = yOf(tok[0]); + x4 = xOf(tok[cnt-1]); + y4 = yOf(tok[cnt-1]); + x2 = x1 + (x4-x1)/3.; + y2 = y1 + (y4-y1)/3.; + x3 = x1 + 2.*(x4-x1)/3.; + y3 = y1 + 2.*(y4-y1)/3.; + pos=sprintf("%.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f", x1,y1, x2,y2, x3,y3, x4,y4); + $.label=""; // remove pesky label + $.lp=""; // remove peskier label pos + + if (hasAttr($, "addPTS") && $.addPTS!="" && $.colorPTS!=""){ + // now we place point nodes at the edge ends + pt[1] = tok[0]; + pt[2] = tok[cnt-1]; + ptSize=$.addPTS; + for (pt[i]) { + if (i==2 && pt[1]==pt[2]) + continue; + aNode=node($G, "__CIRCLE__" + (string)++circ); + aNode.pos=pt[i]; + aNode.shape="point"; + aNode.width=ptSize; + aNode.height=ptSize; + aNode.style="filled"; + aNode.fillcolor=$.colorPTS; + aNode.color=$.colorPTS; + } + } + +} \ No newline at end of file diff --git a/examples/ex08.gv b/examples/ex08.gv index d85f41572..7178d8b49 100644 --- a/examples/ex08.gv +++ b/examples/ex08.gv @@ -47,7 +47,7 @@ graph {
X6:1:GND
- - - - - - - - - - -
-
X5:2:VCCX6:2:VCC
- - - - - - - - - - -
-
X5:3:SCLX6:3:SCL
- - - - - - - - - - -
-
X5:4:SDAX6:4:SDA
- - - - - - - - - - -
-
 
- - - - - - - - - - -
-
X1:6X2:2
- - - - - - - - - - -
-
 
- +
@@ -102,19 +102,7 @@ graph { - - - - - - - - - - - -
- + Key:R:Dash @@ -124,19 +112,7 @@ graph { - - - - - - - - - - - -
- + Key:T:Dot @@ -146,19 +122,7 @@ graph { - - - - - - - - - - - -
- +   @@ -171,19 +135,7 @@ graph { - - - - - - - - - - - -
- +   @@ -198,7 +150,7 @@ graph { - +
@@ -225,4 +177,8 @@ graph { Key:p1r:e -- W1:w3:w edge [color="#000000:#AAAAAA:#000000"] Key:p3r:e -- W1:w4:w + W1:w1:e -- W1:w1:w [color="#000000:#FFFFFF:#000000" straight=straight] + W1:w2:e -- W1:w2:w [color="#000000:#895956:#000000" straight=straight] + W1:w3:e -- W1:w3:w [color="#000000:#00AA00:#000000" straight=straight] + W1:w4:e -- W1:w4:w [color="#000000:#AAAAAA:#000000" straight=straight] } diff --git a/examples/ex08.html b/examples/ex08.html index 7dda0092e..06e8ae713 100644 --- a/examples/ex08.html +++ b/examples/ex08.html @@ -30,127 +30,143 @@

Diagram

- - - - + + + Key - - - -Key - -Phone Connector - -male 3.5 - -Dot - -T - -Dash - -R - -Ground - -S - - - -Tip, Ring, and Sleeve + + + +Key + +Phone Connector + +male 3.5 + +Dot + +T + +Dash + +R + +Ground + +S + + + +Tip, Ring, and Sleeve W1 - - - -W1 - -3x - -24 AWG - -+ S - -0.2 m - -BK - - -  - Key:S:Ground - -1:WH - - - - - - Key:R:Dash - -2:BN - - - - - - Key:T:Dot - -3:GN - - - - - -  - Key:S:Ground - -SN:Shield - - - - - -  - - - -Cross-section + + + +W1 + +3x + +24 AWG + ++ S + +0.2 m + +BK + + +  + Key:S:Ground + +1:WH + + + Key:R:Dash + +2:BN + + + Key:T:Dot + +3:GN + + +  + Key:S:Ground + +SN:Shield + + +  + + + +Cross-section Key:e--W1:w - - - + + + Key:e--W1:w - - - + + + Key:e--W1:w - - - + + + Key:e--W1:w - - - + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + diff --git a/examples/ex08.png b/examples/ex08.png index 7732c3894..f59caf1f5 100644 Binary files a/examples/ex08.png and b/examples/ex08.png differ diff --git a/examples/ex08.svg b/examples/ex08.svg index 4b57e0202..c3b04f81b 100644 --- a/examples/ex08.svg +++ b/examples/ex08.svg @@ -1,127 +1,143 @@ - - - - + + + Key - - - -Key - -Phone Connector - -male 3.5 - -Dot - -T - -Dash - -R - -Ground - -S - - - -Tip, Ring, and Sleeve + + + +Key + +Phone Connector + +male 3.5 + +Dot + +T + +Dash + +R + +Ground + +S + + + +Tip, Ring, and Sleeve W1 - - - -W1 - -3x - -24 AWG - -+ S - -0.2 m - -BK - - -  - Key:S:Ground - -1:WH - - - - - - Key:R:Dash - -2:BN - - - - - - Key:T:Dot - -3:GN - - - - - -  - Key:S:Ground - -SN:Shield - - - - - -  - - - -Cross-section + + + +W1 + +3x + +24 AWG + ++ S + +0.2 m + +BK + + +  + Key:S:Ground + +1:WH + + + Key:R:Dash + +2:BN + + + Key:T:Dot + +3:GN + + +  + Key:S:Ground + +SN:Shield + + +  + + + +Cross-section Key:e--W1:w - - - + + + Key:e--W1:w - - - + + + Key:e--W1:w - - - + + + Key:e--W1:w - - - + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + diff --git a/examples/ex08_wv_gvpr.gvpr b/examples/ex08_wv_gvpr.gvpr new file mode 100644 index 000000000..7bfced78e --- /dev/null +++ b/examples/ex08_wv_gvpr.gvpr @@ -0,0 +1,64 @@ +/******************************************************************* + + see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 + input must include pos values (must be output from one of the engines w/ -Tdot)# + Thanks to steveroush and FeRDNYC + +*******************************************************************/ +BEG_G{ + double x1,y1,x2,y2,x3,y3,x4,y4; + string ptSize, tok[int], pt[]; + int cnt, circ, i; + node_t aNode; + + circ=0; + +/*************************************** + $G.bb=""; + $G.nodesep=""; + $G.ranksep=""; + $G.splines="true"; +****************************************/ +} + +// This removes the label text but keeps the position +E[noLabel] { + $.label=""; // remove pesky label + // $.lp=""; // remove peskier label pos +} + +E[straight] { + cnt=tokens($.pos,tok," "); + $.oldpos=$.pos; + x1 = xOf(tok[0]); + y1 = yOf(tok[0]); + x4 = xOf(tok[cnt-1]); + y4 = yOf(tok[cnt-1]); + x2 = x1 + (x4-x1)/3.; + y2 = y1 + (y4-y1)/3.; + x3 = x1 + 2.*(x4-x1)/3.; + y3 = y1 + 2.*(y4-y1)/3.; + pos=sprintf("%.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f", x1,y1, x2,y2, x3,y3, x4,y4); + $.label=""; // remove pesky label + $.lp=""; // remove peskier label pos + + if (hasAttr($, "addPTS") && $.addPTS!="" && $.colorPTS!=""){ + // now we place point nodes at the edge ends + pt[1] = tok[0]; + pt[2] = tok[cnt-1]; + ptSize=$.addPTS; + for (pt[i]) { + if (i==2 && pt[1]==pt[2]) + continue; + aNode=node($G, "__CIRCLE__" + (string)++circ); + aNode.pos=pt[i]; + aNode.shape="point"; + aNode.width=ptSize; + aNode.height=ptSize; + aNode.style="filled"; + aNode.fillcolor=$.colorPTS; + aNode.color=$.colorPTS; + } + } + +} \ No newline at end of file diff --git a/examples/ex09.gv b/examples/ex09.gv index 5a41dd015..424dd96cc 100644 --- a/examples/ex09.gv +++ b/examples/ex09.gv @@ -345,25 +345,7 @@ graph { X2:z2
- -
- - - - - - - - - - - - - - - -
- + X1:1:SENSE_P_1 @@ -373,25 +355,7 @@ graph { X2:d4 - - - - - - - - - - - - - - - - - -
- + X1:16:SENSE_N_2 @@ -401,25 +365,7 @@ graph { X2:z8 - - - - - - - - - - - - - - - - - -
- + X1:3:SENSE_P_2 @@ -429,25 +375,7 @@ graph { X2:d10 - - - - - - - - - - - - - - - - - -
- + X1:18:SENSE_N_3 @@ -457,25 +385,7 @@ graph { X2:z14 - - - - - - - - - - - - - - - - - -
- + X1:5:SENSE_P_3 @@ -485,25 +395,7 @@ graph { X2:d16 - - - - - - - - - - - - - - - - - -
- + X1:20:SENSE_N_4 @@ -513,25 +405,7 @@ graph { X2:z18 - - - - - - - - - - - - - - - - - -
- + X1:7:SENSE_P_4 @@ -541,25 +415,7 @@ graph { X2:d20 - - - - - - - - - - - - - - - - - -
- + X1:22:SENSE_N_5 @@ -569,25 +425,7 @@ graph { X2:z24 - - - - - - - - - - - - - - - - - -
- + X1:9:SENSE_P_5 @@ -597,25 +435,7 @@ graph { X2:d26 - - - - - - - - - - - - - - - - - -
- + X1:24:SENSE_N_6 @@ -625,25 +445,7 @@ graph { X2:z30 - - - - - - - - - - - - - - - - - -
- + X1:11:SENSE_P_6 @@ -653,25 +455,7 @@ graph { X2:d32 - - - - - - - - - - - - - - - - - -
- +   @@ -684,13 +468,7 @@ graph { - - - - - -
- +   @@ -738,4 +516,17 @@ graph { W1:w11:e -- X2:p43l:w edge [color="#000000"] X1:p13r:e -- W1:w13:w + W1:w1:e -- W1:w1:w [color="#000000:#FFFFFF:#FFFFFF:#FFFFFF:#000000" straight=straight] + W1:w2:e -- W1:w2:w [color="#000000:#895956:#895956:#895956:#000000" straight=straight] + W1:w3:e -- W1:w3:w [color="#000000:#00AA00:#00AA00:#00AA00:#000000" straight=straight] + W1:w4:e -- W1:w4:w [color="#000000:#FFFF00:#FFFF00:#FFFF00:#000000" straight=straight] + W1:w5:e -- W1:w5:w [color="#000000:#999999:#999999:#999999:#000000" straight=straight] + W1:w6:e -- W1:w6:w [color="#000000:#FF66CC:#FF66CC:#FF66CC:#000000" straight=straight] + W1:w7:e -- W1:w7:w [color="#000000:#0066FF:#0066FF:#0066FF:#000000" straight=straight] + W1:w8:e -- W1:w8:w [color="#000000:#FF0000:#FF0000:#FF0000:#000000" straight=straight] + W1:w9:e -- W1:w9:w [color="#000000:#000000:#000000:#000000:#000000" straight=straight] + W1:w10:e -- W1:w10:w [color="#000000:#8000FF:#8000FF:#8000FF:#000000" straight=straight] + W1:w11:e -- W1:w11:w [color="#000000:#999999:#FF66CC:#999999:#000000" straight=straight] + W1:w12:e -- W1:w12:w [color="#000000:#FF0000:#0066FF:#FF0000:#000000" straight=straight] + W1:w13:e -- W1:w13:w [color="#000000" straight=straight] } diff --git a/examples/ex09.html b/examples/ex09.html index 7d0a6fa3a..4c45c20a7 100644 --- a/examples/ex09.html +++ b/examples/ex09.html @@ -30,554 +30,606 @@

Diagram

- - - - + + + X1 - - - -X1 - -D-Sub - -male - -25-pin - -SENSE_P_1 - -1 - -SENSE_N_1 - -14 - -SENSE_P_2 - -3 - -SENSE_N_2 - -16 - -SENSE_P_3 - -5 - -SENSE_N_3 - -18 - -SENSE_P_4 - -7 - -SENSE_N_4 - -20 - -SENSE_P_5 - -9 - -SENSE_N_5 - -22 - -SENSE_P_6 - -11 - -SENSE_N_6 - -24 - -GND - -13 + + + +X1 + +D-Sub + +male + +25-pin + +SENSE_P_1 + +1 + +SENSE_N_1 + +14 + +SENSE_P_2 + +3 + +SENSE_N_2 + +16 + +SENSE_P_3 + +5 + +SENSE_N_3 + +18 + +SENSE_P_4 + +7 + +SENSE_N_4 + +20 + +SENSE_P_5 + +9 + +SENSE_N_5 + +22 + +SENSE_P_6 + +11 + +SENSE_N_6 + +24 + +GND + +13 - + W1 - - - -W1 - -12x - -0.25 mm² - -+ S - -0.2 m -  - X1:14:SENSE_N_1 - -1:WH - -X2:z2 - - - - - - X1:1:SENSE_P_1 - -2:BN - -X2:d4 - - - - - - X1:16:SENSE_N_2 - -3:GN - -X2:z8 - - - - - - X1:3:SENSE_P_2 - -4:YE - -X2:d10 - - - - - - X1:18:SENSE_N_3 - -5:GY - -X2:z14 - - - - - - X1:5:SENSE_P_3 - -6:PK - -X2:d16 - - - - - - X1:20:SENSE_N_4 - -7:BU - -X2:z18 - - - - - - X1:7:SENSE_P_4 - -8:RD - -X2:d20 - - - - - - X1:22:SENSE_N_5 - -9:BK - -X2:z24 - - - - - - X1:9:SENSE_P_5 - -10:VT - -X2:d26 - - - - - - X1:24:SENSE_N_6 - -11:GYPK - -X2:z30 - - - - - - X1:11:SENSE_P_6 - -12:RDBU - -X2:d32 - - - - - -  - X1:13:GND - -Shield - - - -  + + + +W1 + +12x + +0.25 mm² + ++ S + +0.2 m +  + X1:14:SENSE_N_1 + +1:WH + +X2:z2 + X1:1:SENSE_P_1 + +2:BN + +X2:d4 + X1:16:SENSE_N_2 + +3:GN + +X2:z8 + X1:3:SENSE_P_2 + +4:YE + +X2:d10 + X1:18:SENSE_N_3 + +5:GY + +X2:z14 + X1:5:SENSE_P_3 + +6:PK + +X2:d16 + X1:20:SENSE_N_4 + +7:BU + +X2:z18 + X1:7:SENSE_P_4 + +8:RD + +X2:d20 + X1:22:SENSE_N_5 + +9:BK + +X2:z24 + X1:9:SENSE_P_5 + +10:VT + +X2:d26 + X1:24:SENSE_N_6 + +11:GYPK + +X2:z30 + X1:11:SENSE_P_6 + +12:RDBU + +X2:d32 +  + X1:13:GND + +Shield + + +  X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + - + X2 - - - -X2 - -F48 - -female - -48-pin - -z2 - -b2 - -d2 - -z4 - -b4 - -d4 - -z6 - -b6 - -d6 - -z8 - -b8 - -d8 - -z10 - -b10 - -d10 - -z12 - -b12 - -d12 - -z14 - -b14 - -d14 - -z16 - -b16 - -d16 - -z18 - -b18 - -d18 - -z20 - -b20 - -d20 - -z22 - -b22 - -d22 - -z24 - -b24 - -d24 - -z26 - -b26 - -d26 - -z28 - -b28 - -d28 - -z30 - -b30 - -d30 - -z32 - -b32 - -d32 + + + +X2 + +F48 + +female + +48-pin + +z2 + +b2 + +d2 + +z4 + +b4 + +d4 + +z6 + +b6 + +d6 + +z8 + +b8 + +d8 + +z10 + +b10 + +d10 + +z12 + +b12 + +d12 + +z14 + +b14 + +d14 + +z16 + +b16 + +d16 + +z18 + +b18 + +d18 + +z20 + +b20 + +d20 + +z22 + +b22 + +d22 + +z24 + +b24 + +d24 + +z26 + +b26 + +d26 + +z28 + +b28 + +d28 + +z30 + +b30 + +d30 + +z32 + +b32 + +d32 - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + diff --git a/examples/ex09.png b/examples/ex09.png index 66c1496b6..5d8e6236c 100644 Binary files a/examples/ex09.png and b/examples/ex09.png differ diff --git a/examples/ex09.svg b/examples/ex09.svg index afe271e2b..0008ebb39 100644 --- a/examples/ex09.svg +++ b/examples/ex09.svg @@ -1,554 +1,606 @@ - - - - + + + X1 - - - -X1 - -D-Sub - -male - -25-pin - -SENSE_P_1 - -1 - -SENSE_N_1 - -14 - -SENSE_P_2 - -3 - -SENSE_N_2 - -16 - -SENSE_P_3 - -5 - -SENSE_N_3 - -18 - -SENSE_P_4 - -7 - -SENSE_N_4 - -20 - -SENSE_P_5 - -9 - -SENSE_N_5 - -22 - -SENSE_P_6 - -11 - -SENSE_N_6 - -24 - -GND - -13 + + + +X1 + +D-Sub + +male + +25-pin + +SENSE_P_1 + +1 + +SENSE_N_1 + +14 + +SENSE_P_2 + +3 + +SENSE_N_2 + +16 + +SENSE_P_3 + +5 + +SENSE_N_3 + +18 + +SENSE_P_4 + +7 + +SENSE_N_4 + +20 + +SENSE_P_5 + +9 + +SENSE_N_5 + +22 + +SENSE_P_6 + +11 + +SENSE_N_6 + +24 + +GND + +13 - + W1 - - - -W1 - -12x - -0.25 mm² - -+ S - -0.2 m -  - X1:14:SENSE_N_1 - -1:WH - -X2:z2 - - - - - - X1:1:SENSE_P_1 - -2:BN - -X2:d4 - - - - - - X1:16:SENSE_N_2 - -3:GN - -X2:z8 - - - - - - X1:3:SENSE_P_2 - -4:YE - -X2:d10 - - - - - - X1:18:SENSE_N_3 - -5:GY - -X2:z14 - - - - - - X1:5:SENSE_P_3 - -6:PK - -X2:d16 - - - - - - X1:20:SENSE_N_4 - -7:BU - -X2:z18 - - - - - - X1:7:SENSE_P_4 - -8:RD - -X2:d20 - - - - - - X1:22:SENSE_N_5 - -9:BK - -X2:z24 - - - - - - X1:9:SENSE_P_5 - -10:VT - -X2:d26 - - - - - - X1:24:SENSE_N_6 - -11:GYPK - -X2:z30 - - - - - - X1:11:SENSE_P_6 - -12:RDBU - -X2:d32 - - - - - -  - X1:13:GND - -Shield - - - -  + + + +W1 + +12x + +0.25 mm² + ++ S + +0.2 m +  + X1:14:SENSE_N_1 + +1:WH + +X2:z2 + X1:1:SENSE_P_1 + +2:BN + +X2:d4 + X1:16:SENSE_N_2 + +3:GN + +X2:z8 + X1:3:SENSE_P_2 + +4:YE + +X2:d10 + X1:18:SENSE_N_3 + +5:GY + +X2:z14 + X1:5:SENSE_P_3 + +6:PK + +X2:d16 + X1:20:SENSE_N_4 + +7:BU + +X2:z18 + X1:7:SENSE_P_4 + +8:RD + +X2:d20 + X1:22:SENSE_N_5 + +9:BK + +X2:z24 + X1:9:SENSE_P_5 + +10:VT + +X2:d26 + X1:24:SENSE_N_6 + +11:GYPK + +X2:z30 + X1:11:SENSE_P_6 + +12:RDBU + +X2:d32 +  + X1:13:GND + +Shield + + +  X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + - + X2 - - - -X2 - -F48 - -female - -48-pin - -z2 - -b2 - -d2 - -z4 - -b4 - -d4 - -z6 - -b6 - -d6 - -z8 - -b8 - -d8 - -z10 - -b10 - -d10 - -z12 - -b12 - -d12 - -z14 - -b14 - -d14 - -z16 - -b16 - -d16 - -z18 - -b18 - -d18 - -z20 - -b20 - -d20 - -z22 - -b22 - -d22 - -z24 - -b24 - -d24 - -z26 - -b26 - -d26 - -z28 - -b28 - -d28 - -z30 - -b30 - -d30 - -z32 - -b32 - -d32 + + + +X2 + +F48 + +female + +48-pin + +z2 + +b2 + +d2 + +z4 + +b4 + +d4 + +z6 + +b6 + +d6 + +z8 + +b8 + +d8 + +z10 + +b10 + +d10 + +z12 + +b12 + +d12 + +z14 + +b14 + +d14 + +z16 + +b16 + +d16 + +z18 + +b18 + +d18 + +z20 + +b20 + +d20 + +z22 + +b22 + +d22 + +z24 + +b24 + +d24 + +z26 + +b26 + +d26 + +z28 + +b28 + +d28 + +z30 + +b30 + +d30 + +z32 + +b32 + +d32 - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + diff --git a/examples/ex09_wv_gvpr.gvpr b/examples/ex09_wv_gvpr.gvpr new file mode 100644 index 000000000..7bfced78e --- /dev/null +++ b/examples/ex09_wv_gvpr.gvpr @@ -0,0 +1,64 @@ +/******************************************************************* + + see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 + input must include pos values (must be output from one of the engines w/ -Tdot)# + Thanks to steveroush and FeRDNYC + +*******************************************************************/ +BEG_G{ + double x1,y1,x2,y2,x3,y3,x4,y4; + string ptSize, tok[int], pt[]; + int cnt, circ, i; + node_t aNode; + + circ=0; + +/*************************************** + $G.bb=""; + $G.nodesep=""; + $G.ranksep=""; + $G.splines="true"; +****************************************/ +} + +// This removes the label text but keeps the position +E[noLabel] { + $.label=""; // remove pesky label + // $.lp=""; // remove peskier label pos +} + +E[straight] { + cnt=tokens($.pos,tok," "); + $.oldpos=$.pos; + x1 = xOf(tok[0]); + y1 = yOf(tok[0]); + x4 = xOf(tok[cnt-1]); + y4 = yOf(tok[cnt-1]); + x2 = x1 + (x4-x1)/3.; + y2 = y1 + (y4-y1)/3.; + x3 = x1 + 2.*(x4-x1)/3.; + y3 = y1 + 2.*(y4-y1)/3.; + pos=sprintf("%.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f", x1,y1, x2,y2, x3,y3, x4,y4); + $.label=""; // remove pesky label + $.lp=""; // remove peskier label pos + + if (hasAttr($, "addPTS") && $.addPTS!="" && $.colorPTS!=""){ + // now we place point nodes at the edge ends + pt[1] = tok[0]; + pt[2] = tok[cnt-1]; + ptSize=$.addPTS; + for (pt[i]) { + if (i==2 && pt[1]==pt[2]) + continue; + aNode=node($G, "__CIRCLE__" + (string)++circ); + aNode.pos=pt[i]; + aNode.shape="point"; + aNode.width=ptSize; + aNode.height=ptSize; + aNode.style="filled"; + aNode.fillcolor=$.colorPTS; + aNode.color=$.colorPTS; + } + } + +} \ No newline at end of file diff --git a/examples/ex10.gv b/examples/ex10.gv index 3f7542fc0..602af91b9 100644 --- a/examples/ex10.gv +++ b/examples/ex10.gv @@ -165,25 +165,7 @@ graph { X2:3:DA+
- -
- - - - - - - - - - - - - - - -
- + X1:2:DA- @@ -193,25 +175,7 @@ graph { X2:6:DA- - - - - - - - - - - - - - - - - - -
- + X1:3:DB+ @@ -221,25 +185,7 @@ graph { X2:1:DB+ - - - - - - - - - - - - - - - - - -
- + X1:4:DC+ @@ -249,25 +195,7 @@ graph { X2:7:DC+ - - - - - - - - - - - - - - - - - -
- + X1:5:DC- @@ -277,25 +205,7 @@ graph { X2:8:DC- - - - - - - - - - - - - - - - - - -
- + X1:6:DB- @@ -305,25 +215,7 @@ graph { X2:2:DB- - - - - - - - - - - - - - - - - - -
- + X1:7:DD+ @@ -333,25 +225,7 @@ graph { X2:4:DD+ - - - - - - - - - - - - - - - - - -
- + X1:8:DD- @@ -361,25 +235,7 @@ graph { X2:5:DD- - - - - - - - - - - - - - - - - - -
- +   @@ -413,4 +269,12 @@ graph { edge [color="#000000:#895956:#895956:#895956:#000000"] X1:p8r:e -- W1:w8:w W1:w8:e -- X2:p5l:w + W1:w1:e -- W1:w1:w [color="#000000:#FFFFFF:#00AA00:#FFFFFF:#000000" straight=straight] + W1:w2:e -- W1:w2:w [color="#000000:#00AA00:#00AA00:#00AA00:#000000" straight=straight] + W1:w3:e -- W1:w3:w [color="#000000:#FFFFFF:#FF8000:#FFFFFF:#000000" straight=straight] + W1:w4:e -- W1:w4:w [color="#000000:#0066FF:#0066FF:#0066FF:#000000" straight=straight] + W1:w5:e -- W1:w5:w [color="#000000:#FFFFFF:#0066FF:#FFFFFF:#000000" straight=straight] + W1:w6:e -- W1:w6:w [color="#000000:#FF8000:#FF8000:#FF8000:#000000" straight=straight] + W1:w7:e -- W1:w7:w [color="#000000:#FFFFFF:#895956:#FFFFFF:#000000" straight=straight] + W1:w8:e -- W1:w8:w [color="#000000:#895956:#895956:#895956:#000000" straight=straight] } diff --git a/examples/ex10.html b/examples/ex10.html index 2eaa9e192..ccee404ef 100644 --- a/examples/ex10.html +++ b/examples/ex10.html @@ -30,346 +30,378 @@

Diagram

- - - - + + + X1 - - - -X1 - -Stewart Connector SS-37000-002 - -male - -8-pin - -DA+ - -1 - -DA- - -2 - -DB+ - -3 - -DC+ - -4 - -DC- - -5 - -DB- - -6 - -DD+ - -7 - -DD- - -8 + + + +X1 + +Stewart Connector SS-37000-002 + +male + +8-pin + +DA+ + +1 + +DA- + +2 + +DB+ + +3 + +DC+ + +4 + +DC- + +5 + +DB- + +6 + +DD+ + +7 + +DD- + +8 - + W1 - - - -W1 - -CAT5e - -8x - -24 AWG - -1 m -  - X1:1:DA+ - -1:WHGN - -X2:3:DA+ - - - - - - X1:2:DA- - -2:GN - -X2:6:DA- - - - - - - X1:3:DB+ - -3:WHOG - -X2:1:DB+ - - - - - - X1:4:DC+ - -4:BU - -X2:7:DC+ - - - - - - X1:5:DC- - -5:WHBU - -X2:8:DC- - - - - - - X1:6:DB- - -6:OG - -X2:2:DB- - - - - - - X1:7:DD+ - -7:WHBN - -X2:4:DD+ - - - - - - X1:8:DD- - -8:BN - -X2:5:DD- - - - - - -  + + + +W1 + +CAT5e + +8x + +24 AWG + +1 m +  + X1:1:DA+ + +1:WHGN + +X2:3:DA+ + X1:2:DA- + +2:GN + +X2:6:DA- + X1:3:DB+ + +3:WHOG + +X2:1:DB+ + X1:4:DC+ + +4:BU + +X2:7:DC+ + X1:5:DC- + +5:WHBU + +X2:8:DC- + X1:6:DB- + +6:OG + +X2:2:DB- + X1:7:DD+ + +7:WHBN + +X2:4:DD+ + X1:8:DD- + +8:BN + +X2:5:DD- +  X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + - + X2 - - - -X2 - -Stewart Connector SS-37000-002 - -male - -8-pin - -1 - -DB+ - -2 - -DB- - -3 - -DA+ - -4 - -DD+ - -5 - -DD- - -6 - -DA- - -7 - -DC+ - -8 - -DC- + + + +X2 + +Stewart Connector SS-37000-002 + +male + +8-pin + +1 + +DB+ + +2 + +DB- + +3 + +DA+ + +4 + +DD+ + +5 + +DD- + +6 + +DA- + +7 + +DC+ + +8 + +DC- - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + diff --git a/examples/ex10.png b/examples/ex10.png index 0942d5271..7333e4d7e 100644 Binary files a/examples/ex10.png and b/examples/ex10.png differ diff --git a/examples/ex10.svg b/examples/ex10.svg index 32b096952..662f8ea72 100644 --- a/examples/ex10.svg +++ b/examples/ex10.svg @@ -1,346 +1,378 @@ - - - - + + + X1 - - - -X1 - -Stewart Connector SS-37000-002 - -male - -8-pin - -DA+ - -1 - -DA- - -2 - -DB+ - -3 - -DC+ - -4 - -DC- - -5 - -DB- - -6 - -DD+ - -7 - -DD- - -8 + + + +X1 + +Stewart Connector SS-37000-002 + +male + +8-pin + +DA+ + +1 + +DA- + +2 + +DB+ + +3 + +DC+ + +4 + +DC- + +5 + +DB- + +6 + +DD+ + +7 + +DD- + +8 - + W1 - - - -W1 - -CAT5e - -8x - -24 AWG - -1 m -  - X1:1:DA+ - -1:WHGN - -X2:3:DA+ - - - - - - X1:2:DA- - -2:GN - -X2:6:DA- - - - - - - X1:3:DB+ - -3:WHOG - -X2:1:DB+ - - - - - - X1:4:DC+ - -4:BU - -X2:7:DC+ - - - - - - X1:5:DC- - -5:WHBU - -X2:8:DC- - - - - - - X1:6:DB- - -6:OG - -X2:2:DB- - - - - - - X1:7:DD+ - -7:WHBN - -X2:4:DD+ - - - - - - X1:8:DD- - -8:BN - -X2:5:DD- - - - - - -  + + + +W1 + +CAT5e + +8x + +24 AWG + +1 m +  + X1:1:DA+ + +1:WHGN + +X2:3:DA+ + X1:2:DA- + +2:GN + +X2:6:DA- + X1:3:DB+ + +3:WHOG + +X2:1:DB+ + X1:4:DC+ + +4:BU + +X2:7:DC+ + X1:5:DC- + +5:WHBU + +X2:8:DC- + X1:6:DB- + +6:OG + +X2:2:DB- + X1:7:DD+ + +7:WHBN + +X2:4:DD+ + X1:8:DD- + +8:BN + +X2:5:DD- +  X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + - + X1:e--W1:w - - - - - + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + - + X2 - - - -X2 - -Stewart Connector SS-37000-002 - -male - -8-pin - -1 - -DB+ - -2 - -DB- - -3 - -DA+ - -4 - -DD+ - -5 - -DD- - -6 - -DA- - -7 - -DC+ - -8 - -DC- + + + +X2 + +Stewart Connector SS-37000-002 + +male + +8-pin + +1 + +DB+ + +2 + +DB- + +3 + +DA+ + +4 + +DD+ + +5 + +DD- + +6 + +DA- + +7 + +DC+ + +8 + +DC- - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + - + W1:e--X2:w - - - - - + + + + + diff --git a/examples/ex10_wv_gvpr.gvpr b/examples/ex10_wv_gvpr.gvpr new file mode 100644 index 000000000..7bfced78e --- /dev/null +++ b/examples/ex10_wv_gvpr.gvpr @@ -0,0 +1,64 @@ +/******************************************************************* + + see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 + input must include pos values (must be output from one of the engines w/ -Tdot)# + Thanks to steveroush and FeRDNYC + +*******************************************************************/ +BEG_G{ + double x1,y1,x2,y2,x3,y3,x4,y4; + string ptSize, tok[int], pt[]; + int cnt, circ, i; + node_t aNode; + + circ=0; + +/*************************************** + $G.bb=""; + $G.nodesep=""; + $G.ranksep=""; + $G.splines="true"; +****************************************/ +} + +// This removes the label text but keeps the position +E[noLabel] { + $.label=""; // remove pesky label + // $.lp=""; // remove peskier label pos +} + +E[straight] { + cnt=tokens($.pos,tok," "); + $.oldpos=$.pos; + x1 = xOf(tok[0]); + y1 = yOf(tok[0]); + x4 = xOf(tok[cnt-1]); + y4 = yOf(tok[cnt-1]); + x2 = x1 + (x4-x1)/3.; + y2 = y1 + (y4-y1)/3.; + x3 = x1 + 2.*(x4-x1)/3.; + y3 = y1 + 2.*(y4-y1)/3.; + pos=sprintf("%.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f", x1,y1, x2,y2, x3,y3, x4,y4); + $.label=""; // remove pesky label + $.lp=""; // remove peskier label pos + + if (hasAttr($, "addPTS") && $.addPTS!="" && $.colorPTS!=""){ + // now we place point nodes at the edge ends + pt[1] = tok[0]; + pt[2] = tok[cnt-1]; + ptSize=$.addPTS; + for (pt[i]) { + if (i==2 && pt[1]==pt[2]) + continue; + aNode=node($G, "__CIRCLE__" + (string)++circ); + aNode.pos=pt[i]; + aNode.shape="point"; + aNode.width=ptSize; + aNode.height=ptSize; + aNode.style="filled"; + aNode.fillcolor=$.colorPTS; + aNode.color=$.colorPTS; + } + } + +} \ No newline at end of file diff --git a/examples/ex11.gv b/examples/ex11.gv index 24d405858..fcee36b37 100644 --- a/examples/ex11.gv +++ b/examples/ex11.gv @@ -148,19 +148,7 @@ graph {
- -
- - - - - - - - - -
- + @@ -170,19 +158,7 @@ graph { - - - - - - - - - - - -
- + @@ -192,19 +168,7 @@ graph { - - - - - - - - - - - -
- + @@ -214,19 +178,7 @@ graph { - - - - - - - - - - - -
- +   @@ -244,6 +196,10 @@ graph { W1:w3:e -- AUTOGENERATED_F_3:w edge [color="#000000:#895956:#000000"] W1:w4:e -- AUTOGENERATED_F_4:w + W1:w1:e -- W1:w1:w [color="#000000:#000000:#000000" straight=straight] + W1:w2:e -- W1:w2:w [color="#000000:#FFFFFF:#000000" straight=straight] + W1:w3:e -- W1:w3:w [color="#000000:#0066FF:#000000" straight=straight] + W1:w4:e -- W1:w4:w [color="#000000:#895956:#000000" straight=straight] edge [color="#000000" dir=forward style=dashed] AUTOGENERATED_F_1:p1r:e -- X1:p1l:w edge [color="#000000" dir=forward style=dashed] diff --git a/examples/ex11.html b/examples/ex11.html index d300b6460..0cf591de5 100644 --- a/examples/ex11.html +++ b/examples/ex11.html @@ -30,194 +30,210 @@

Diagram

- - - - + + + AUTOGENERATED_F_1 - - - -Ferrule - -GY - - + + + +Ferrule + +GY + + - + X1 - - - -X1 - -Screw connector - -male - -4-pin - -GN - - - -1 - -A - -2 - -B - -3 - -C - -4 - -D + + + +X1 + +Screw connector + +male + +4-pin + +GN + + + +1 + +A + +2 + +B + +3 + +C + +4 + +D - + AUTOGENERATED_F_1:e--X1:w - - + + - + AUTOGENERATED_F_2 - - - -Ferrule - -GY - - + + + +Ferrule + +GY + + - + AUTOGENERATED_F_2:e--X1:w - - + + - + AUTOGENERATED_F_3 - - - -Ferrule - -GY - - + + + +Ferrule + +GY + + - + AUTOGENERATED_F_3:e--X1:w - - + + - + AUTOGENERATED_F_4 - - - -Ferrule - -GY - - + + + +Ferrule + +GY + + - + AUTOGENERATED_F_4:e--X1:w - - + + W1 - - - -W1 - -4x - -BK - - -  - - -1:BK - - - - - - - -2:WH - - - - - - - -3:BU - - - - - - - -4:BN - - - - - -  + + + +W1 + +4x + +BK + + +  + + +1:BK + + + + +2:WH + + + + +3:BU + + + + +4:BN + + +  - + W1:e--AUTOGENERATED_F_1:w - - - + + + - + W1:e--AUTOGENERATED_F_2:w - - - + + + - + W1:e--AUTOGENERATED_F_3:w - - - + + + - + W1:e--AUTOGENERATED_F_4:w - - - + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + diff --git a/examples/ex11.png b/examples/ex11.png index da001c80d..a42bc3b70 100644 Binary files a/examples/ex11.png and b/examples/ex11.png differ diff --git a/examples/ex11.svg b/examples/ex11.svg index 578c676bf..0038aa8ba 100644 --- a/examples/ex11.svg +++ b/examples/ex11.svg @@ -1,194 +1,210 @@ - - - - + + + AUTOGENERATED_F_1 - - - -Ferrule - -GY - - + + + +Ferrule + +GY + + - + X1 - - - -X1 - -Screw connector - -male - -4-pin - -GN - - - -1 - -A - -2 - -B - -3 - -C - -4 - -D + + + +X1 + +Screw connector + +male + +4-pin + +GN + + + +1 + +A + +2 + +B + +3 + +C + +4 + +D - + AUTOGENERATED_F_1:e--X1:w - - + + - + AUTOGENERATED_F_2 - - - -Ferrule - -GY - - + + + +Ferrule + +GY + + - + AUTOGENERATED_F_2:e--X1:w - - + + - + AUTOGENERATED_F_3 - - - -Ferrule - -GY - - + + + +Ferrule + +GY + + - + AUTOGENERATED_F_3:e--X1:w - - + + - + AUTOGENERATED_F_4 - - - -Ferrule - -GY - - + + + +Ferrule + +GY + + - + AUTOGENERATED_F_4:e--X1:w - - + + W1 - - - -W1 - -4x - -BK - - -  - - -1:BK - - - - - - - -2:WH - - - - - - - -3:BU - - - - - - - -4:BN - - - - - -  + + + +W1 + +4x + +BK + + +  + + +1:BK + + + + +2:WH + + + + +3:BU + + + + +4:BN + + +  - + W1:e--AUTOGENERATED_F_1:w - - - + + + - + W1:e--AUTOGENERATED_F_2:w - - - + + + - + W1:e--AUTOGENERATED_F_3:w - - - + + + - + W1:e--AUTOGENERATED_F_4:w - - - + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + diff --git a/examples/ex11_wv_gvpr.gvpr b/examples/ex11_wv_gvpr.gvpr new file mode 100644 index 000000000..7bfced78e --- /dev/null +++ b/examples/ex11_wv_gvpr.gvpr @@ -0,0 +1,64 @@ +/******************************************************************* + + see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 + input must include pos values (must be output from one of the engines w/ -Tdot)# + Thanks to steveroush and FeRDNYC + +*******************************************************************/ +BEG_G{ + double x1,y1,x2,y2,x3,y3,x4,y4; + string ptSize, tok[int], pt[]; + int cnt, circ, i; + node_t aNode; + + circ=0; + +/*************************************** + $G.bb=""; + $G.nodesep=""; + $G.ranksep=""; + $G.splines="true"; +****************************************/ +} + +// This removes the label text but keeps the position +E[noLabel] { + $.label=""; // remove pesky label + // $.lp=""; // remove peskier label pos +} + +E[straight] { + cnt=tokens($.pos,tok," "); + $.oldpos=$.pos; + x1 = xOf(tok[0]); + y1 = yOf(tok[0]); + x4 = xOf(tok[cnt-1]); + y4 = yOf(tok[cnt-1]); + x2 = x1 + (x4-x1)/3.; + y2 = y1 + (y4-y1)/3.; + x3 = x1 + 2.*(x4-x1)/3.; + y3 = y1 + 2.*(y4-y1)/3.; + pos=sprintf("%.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f", x1,y1, x2,y2, x3,y3, x4,y4); + $.label=""; // remove pesky label + $.lp=""; // remove peskier label pos + + if (hasAttr($, "addPTS") && $.addPTS!="" && $.colorPTS!=""){ + // now we place point nodes at the edge ends + pt[1] = tok[0]; + pt[2] = tok[cnt-1]; + ptSize=$.addPTS; + for (pt[i]) { + if (i==2 && pt[1]==pt[2]) + continue; + aNode=node($G, "__CIRCLE__" + (string)++circ); + aNode.pos=pt[i]; + aNode.shape="point"; + aNode.width=ptSize; + aNode.height=ptSize; + aNode.style="filled"; + aNode.fillcolor=$.colorPTS; + aNode.color=$.colorPTS; + } + } + +} \ No newline at end of file diff --git a/examples/ex12.gv b/examples/ex12.gv index 82bc1491d..a5079708d 100644 --- a/examples/ex12.gv +++ b/examples/ex12.gv @@ -144,19 +144,7 @@ graph { X1:1
- -
- - - - - - - - - -
- + @@ -167,19 +155,7 @@ graph { X1:2 - - - - - - - - - - - -
- + @@ -190,19 +166,7 @@ graph { X1:3 - - - - - - - - - - - -
- + @@ -213,19 +177,7 @@ graph { X1:4 - - - - - - - - - - - -
- +   @@ -243,6 +195,10 @@ graph { W1:w3:e -- X1:p3l:w edge [color="#000000:#00AA00:#000000"] W1:w4:e -- X1:p4l:w + W1:w1:e -- W1:w1:w [color="#000000:#FF0000:#000000" straight=straight] + W1:w2:e -- W1:w2:w [color="#000000:#000000:#000000" straight=straight] + W1:w3:e -- W1:w3:w [color="#000000:#0066FF:#000000" straight=straight] + W1:w4:e -- W1:w4:w [color="#000000:#00AA00:#000000" straight=straight] W2 [label=< @@ -279,19 +235,7 @@ graph { - + @@ -302,19 +246,7 @@ graph { - + @@ -325,19 +257,7 @@ graph { - + @@ -348,19 +268,7 @@ graph { - + @@ -378,6 +286,10 @@ graph { X2:p3r:e -- W2:w3:w edge [color="#000000:#00AA00:#000000"] X2:p4r:e -- W2:w4:w + W2:w1:e -- W2:w1:w [color="#000000:#FF0000:#000000" straight=straight] + W2:w2:e -- W2:w2:w [color="#000000:#000000:#000000" straight=straight] + W2:w3:e -- W2:w3:w [color="#000000:#0066FF:#000000" straight=straight] + W2:w4:e -- W2:w4:w [color="#000000:#00AA00:#000000" straight=straight] edge [color="#000000" dir=forward style=dashed] X1:e -- X2:w } diff --git a/examples/ex12.html b/examples/ex12.html index 5d6685cf2..02cb025e6 100644 --- a/examples/ex12.html +++ b/examples/ex12.html @@ -30,222 +30,254 @@

Diagram

- - - - + + + X1 - - - -X1 - -Dupont 2.54mm - -male - -5-pin - -BK - - - -1 - -2 - -3 - -4 - -5 + + + +X1 + +Dupont 2.54mm + +male + +5-pin + +BK + + + +1 + +2 + +3 + +4 + +5 X2 - - - -X2 - -Dupont 2.54mm - -female - -5-pin - -BK - - - -1 - -2 - -3 - -4 - -5 + + + +X2 + +Dupont 2.54mm + +female + +5-pin + +BK + + + +1 + +2 + +3 + +4 + +5 - + X1:e--X2:w - - + + - + W2 - - - -W2 - -4x - -0.2 m -  - X2:1 - -RD - - - - - - X2:2 - -BK - - - - - - X2:3 - -BU - - - - - - X2:4 - -GN - - - - - -  + + + +W2 + +4x + +0.2 m +  + X2:1 + +RD + + + X2:2 + +BK + + + X2:3 + +BU + + + X2:4 + +GN + + +  - + X2:e--W2:w - - - + + + - + X2:e--W2:w - - - + + + - + X2:e--W2:w - - - + + + - + X2:e--W2:w - - - + + + + + + +W2:e--W2:w + + + + + + +W2:e--W2:w + + + + + + +W2:e--W2:w + + + + + + +W2:e--W2:w + + + - + W1 - - - -W1 - -4x - -0.2 m -  - - -RD - -X1:1 - - - - - -BK - -X1:2 - - - - - -BU - -X1:3 - - - - - -GN - -X1:4 - - - -  + + + +W1 + +4x + +0.2 m +  + + +RD + +X1:1 + + +BK + +X1:2 + + +BU + +X1:3 + + +GN + +X1:4 +  - + W1:e--X1:w - - - + + + - + W1:e--X1:w - - - + + + - + W1:e--X1:w - - - + + + - + W1:e--X1:w - - - + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + diff --git a/examples/ex12.png b/examples/ex12.png index f4a69837f..c7fedacee 100644 Binary files a/examples/ex12.png and b/examples/ex12.png differ diff --git a/examples/ex12.svg b/examples/ex12.svg index f2c59a1b8..17acded6d 100644 --- a/examples/ex12.svg +++ b/examples/ex12.svg @@ -1,222 +1,254 @@ - - - - + + + X1 - - - -X1 - -Dupont 2.54mm - -male - -5-pin - -BK - - - -1 - -2 - -3 - -4 - -5 + + + +X1 + +Dupont 2.54mm + +male + +5-pin + +BK + + + +1 + +2 + +3 + +4 + +5 X2 - - - -X2 - -Dupont 2.54mm - -female - -5-pin - -BK - - - -1 - -2 - -3 - -4 - -5 + + + +X2 + +Dupont 2.54mm + +female + +5-pin + +BK + + + +1 + +2 + +3 + +4 + +5 - + X1:e--X2:w - - + + - + W2 - - - -W2 - -4x - -0.2 m -  - X2:1 - -RD - - - - - - X2:2 - -BK - - - - - - X2:3 - -BU - - - - - - X2:4 - -GN - - - - - -  + + + +W2 + +4x + +0.2 m +  + X2:1 + +RD + + + X2:2 + +BK + + + X2:3 + +BU + + + X2:4 + +GN + + +  - + X2:e--W2:w - - - + + + - + X2:e--W2:w - - - + + + - + X2:e--W2:w - - - + + + - + X2:e--W2:w - - - + + + + + + +W2:e--W2:w + + + + + + +W2:e--W2:w + + + + + + +W2:e--W2:w + + + + + + +W2:e--W2:w + + + - + W1 - - - -W1 - -4x - -0.2 m -  - - -RD - -X1:1 - - - - - -BK - -X1:2 - - - - - -BU - -X1:3 - - - - - -GN - -X1:4 - - - -  + + + +W1 + +4x + +0.2 m +  + + +RD + +X1:1 + + +BK + +X1:2 + + +BU + +X1:3 + + +GN + +X1:4 +  - + W1:e--X1:w - - - + + + - + W1:e--X1:w - - - + + + - + W1:e--X1:w - - - + + + - + W1:e--X1:w - - - + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + diff --git a/examples/ex12_wv_gvpr.gvpr b/examples/ex12_wv_gvpr.gvpr new file mode 100644 index 000000000..7bfced78e --- /dev/null +++ b/examples/ex12_wv_gvpr.gvpr @@ -0,0 +1,64 @@ +/******************************************************************* + + see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 + input must include pos values (must be output from one of the engines w/ -Tdot)# + Thanks to steveroush and FeRDNYC + +*******************************************************************/ +BEG_G{ + double x1,y1,x2,y2,x3,y3,x4,y4; + string ptSize, tok[int], pt[]; + int cnt, circ, i; + node_t aNode; + + circ=0; + +/*************************************** + $G.bb=""; + $G.nodesep=""; + $G.ranksep=""; + $G.splines="true"; +****************************************/ +} + +// This removes the label text but keeps the position +E[noLabel] { + $.label=""; // remove pesky label + // $.lp=""; // remove peskier label pos +} + +E[straight] { + cnt=tokens($.pos,tok," "); + $.oldpos=$.pos; + x1 = xOf(tok[0]); + y1 = yOf(tok[0]); + x4 = xOf(tok[cnt-1]); + y4 = yOf(tok[cnt-1]); + x2 = x1 + (x4-x1)/3.; + y2 = y1 + (y4-y1)/3.; + x3 = x1 + 2.*(x4-x1)/3.; + y3 = y1 + 2.*(y4-y1)/3.; + pos=sprintf("%.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f", x1,y1, x2,y2, x3,y3, x4,y4); + $.label=""; // remove pesky label + $.lp=""; // remove peskier label pos + + if (hasAttr($, "addPTS") && $.addPTS!="" && $.colorPTS!=""){ + // now we place point nodes at the edge ends + pt[1] = tok[0]; + pt[2] = tok[cnt-1]; + ptSize=$.addPTS; + for (pt[i]) { + if (i==2 && pt[1]==pt[2]) + continue; + aNode=node($G, "__CIRCLE__" + (string)++circ); + aNode.pos=pt[i]; + aNode.shape="point"; + aNode.width=ptSize; + aNode.height=ptSize; + aNode.style="filled"; + aNode.fillcolor=$.colorPTS; + aNode.color=$.colorPTS; + } + } + +} \ No newline at end of file diff --git a/examples/ex13.gv b/examples/ex13.gv index ccc85bf88..137812be9 100644 --- a/examples/ex13.gv +++ b/examples/ex13.gv @@ -222,19 +222,7 @@ graph { F1
- + @@ -244,19 +232,7 @@ graph { - + @@ -266,19 +242,7 @@ graph { - + @@ -288,19 +252,7 @@ graph { - + @@ -322,6 +274,10 @@ graph { edge [color="#000000:#FFFF00:#000000"] X1:p4r:e -- C1:w4:w C1:w4:e -- F4:w + C1:w1:e -- C1:w1:w [color="#000000:#FFFFFF:#000000" straight=straight] + C1:w2:e -- C1:w2:w [color="#000000:#895956:#000000" straight=straight] + C1:w3:e -- C1:w3:w [color="#000000:#00AA00:#000000" straight=straight] + C1:w4:e -- C1:w4:w [color="#000000:#FFFF00:#000000" straight=straight] C2 [label=<
- - - - - - - - - - -
-
X2:2
- - - - - - - - - - -
-
X2:3
- - - - - - - - - - -
-
X2:4
- - - - - - - - - - -
-
 
- - - - - - - - - - -
-
X1:2:BF2
- - - - - - - - - - -
-
X1:3:CF3
- - - - - - - - - - -
-
X1:4:DF4
- - - - - - - - - - -
-
 
@@ -356,19 +312,7 @@ graph { - + @@ -378,19 +322,7 @@ graph { - + @@ -400,19 +332,7 @@ graph { - + @@ -422,19 +342,7 @@ graph { - + @@ -456,6 +364,10 @@ graph { edge [color="#000000:#FFFF00:#000000"] F4:e -- C2:w4:w C2:w4:e -- X2:p4l:w + C2:w1:e -- C2:w1:w [color="#000000:#FFFFFF:#000000" straight=straight] + C2:w2:e -- C2:w2:w [color="#000000:#895956:#000000" straight=straight] + C2:w3:e -- C2:w3:w [color="#000000:#00AA00:#000000" straight=straight] + C2:w4:e -- C2:w4:w [color="#000000:#FFFF00:#000000" straight=straight] C3 [label=<
X2:1:A
- - - - - - - - - - -
-
F2X2:2:B
- - - - - - - - - - -
-
F3X2:3:C
- - - - - - - - - - -
-
F4X2:4:D
- - - - - - - - - - -
-
 
@@ -490,19 +402,7 @@ graph { - + @@ -512,19 +412,7 @@ graph { - + @@ -534,19 +422,7 @@ graph { - + @@ -556,19 +432,7 @@ graph { - + @@ -590,4 +454,8 @@ graph { edge [color="#000000:#FFFF00:#000000"] F4:e -- C3:w4:w C3:w4:e -- X3:p4l:w + C3:w1:e -- C3:w1:w [color="#000000:#FFFFFF:#000000" straight=straight] + C3:w2:e -- C3:w2:w [color="#000000:#895956:#000000" straight=straight] + C3:w3:e -- C3:w3:w [color="#000000:#00AA00:#000000" straight=straight] + C3:w4:e -- C3:w4:w [color="#000000:#FFFF00:#000000" straight=straight] } diff --git a/examples/ex13.html b/examples/ex13.html index 18d4bb3a5..524244452 100644 --- a/examples/ex13.html +++ b/examples/ex13.html @@ -30,422 +30,470 @@

Diagram

- - - - + + + X1 - - - -X1 - -4-pin - -A - -1 - -B - -2 - -C - -3 - -D - -4 + + + +X1 + +4-pin + +A + +1 + +B + +2 + +C + +3 + +D + +4 - + C1 - - - -C1 - -4x -  - X1:1:A - -1:WH - -F1 - - - - X1:2:B - -2:BN - -F2 - - - - X1:3:C - -3:GN - -F3 - - - - X1:4:D - -4:YE - -F4 - - - -  + + + +C1 + +4x +  + X1:1:A + +1:WH + +F1 + X1:2:B + +2:BN + +F2 + X1:3:C + +3:GN + +F3 + X1:4:D + +4:YE + +F4 +  X1:e--C1:w - - - + + + - + X1:e--C1:w - - - + + + - + X1:e--C1:w - - - + + + - + X1:e--C1:w - - - + + + + + + +C1:e--C1:w + + + + + + +C1:e--C1:w + + + + + + +C1:e--C1:w + + + + + + +C1:e--C1:w + + + - + F1 - - - -ferrule + + + +ferrule + + + +C1:e--F1:w + + + + + + +F2 + + + +ferrule + + + +C1:e--F2:w + + + + + + +F3 + + + +ferrule + + + +C1:e--F3:w + + + + + + +F4 + + + +ferrule + + + +C1:e--F4:w + + + - + C2 - - - -C2 - -4x -  - F1 - -1:WH - -X2:1:A - - - - F2 - -2:BN - -X2:2:B - - - - F3 - -3:GN - -X2:3:C - - - - F4 - -4:YE - -X2:4:D - - - -  + + + +C2 + +4x +  + F1 + +1:WH + +X2:1:A + F2 + +2:BN + +X2:2:B + F3 + +3:GN + +X2:3:C + F4 + +4:YE + +X2:4:D +  - + F1:e--C2:w - - - + + + - + C3 - - - -C3 - -4x -  - F1 - -1:WH - -X3:1:A - - - - F2 - -2:BN - -X3:2:B - - - - F3 - -3:GN - -X3:3:C - - - - F4 - -4:YE - -X3:4:D - - - -  + + + +C3 + +4x +  + F1 + +1:WH + +X3:1:A + F2 + +2:BN + +X3:2:B + F3 + +3:GN + +X3:3:C + F4 + +4:YE + +X3:4:D +  - + F1:e--C3:w - - - - - - -F2 - - - -ferrule + + + - + F2:e--C2:w - - - + + + - + F2:e--C3:w - - - - - - -F3 - - - -ferrule + + + - + F3:e--C2:w - - - + + + - + F3:e--C3:w - - - - - - -F4 - - - -ferrule + + + - + F4:e--C2:w - - - + + + - + F4:e--C3:w - - - - - - -X2 - - - -X2 - -4-pin - -1 - -A - -2 - -B - -3 - -C - -4 - -D + + + - - -X3 - - - -X3 - -4-pin - -1 - -A - -2 - -B - -3 - -C - -4 - -D + + +C2:e--C2:w + + + - - -C1:e--F1:w - - - + + +C2:e--C2:w + + + - - -C1:e--F2:w - - - + + +C2:e--C2:w + + + - - -C1:e--F3:w - - - + + +C2:e--C2:w + + + - - -C1:e--F4:w - - - + + +X2 + + + +X2 + +4-pin + +1 + +A + +2 + +B + +3 + +C + +4 + +D - + C2:e--X2:w - - - + + + - + C2:e--X2:w - - - + + + - + C2:e--X2:w - - - + + + - + C2:e--X2:w - - - + + + + + + +C3:e--C3:w + + + + + + +C3:e--C3:w + + + + + + +C3:e--C3:w + + + + + + +C3:e--C3:w + + + + + + +X3 + + + +X3 + +4-pin + +1 + +A + +2 + +B + +3 + +C + +4 + +D - + C3:e--X3:w - - - + + + - + C3:e--X3:w - - - + + + - + C3:e--X3:w - - - + + + - + C3:e--X3:w - - - + + + diff --git a/examples/ex13.png b/examples/ex13.png index 967689d1a..61a4782f1 100644 Binary files a/examples/ex13.png and b/examples/ex13.png differ diff --git a/examples/ex13.svg b/examples/ex13.svg index ce7294bc6..222d6e37a 100644 --- a/examples/ex13.svg +++ b/examples/ex13.svg @@ -1,422 +1,470 @@ - - - - + + + X1 - - - -X1 - -4-pin - -A - -1 - -B - -2 - -C - -3 - -D - -4 + + + +X1 + +4-pin + +A + +1 + +B + +2 + +C + +3 + +D + +4 - + C1 - - - -C1 - -4x -  - X1:1:A - -1:WH - -F1 - - - - X1:2:B - -2:BN - -F2 - - - - X1:3:C - -3:GN - -F3 - - - - X1:4:D - -4:YE - -F4 - - - -  + + + +C1 + +4x +  + X1:1:A + +1:WH + +F1 + X1:2:B + +2:BN + +F2 + X1:3:C + +3:GN + +F3 + X1:4:D + +4:YE + +F4 +  X1:e--C1:w - - - + + + - + X1:e--C1:w - - - + + + - + X1:e--C1:w - - - + + + - + X1:e--C1:w - - - + + + + + + +C1:e--C1:w + + + + + + +C1:e--C1:w + + + + + + +C1:e--C1:w + + + + + + +C1:e--C1:w + + + - + F1 - - - -ferrule + + + +ferrule + + + +C1:e--F1:w + + + + + + +F2 + + + +ferrule + + + +C1:e--F2:w + + + + + + +F3 + + + +ferrule + + + +C1:e--F3:w + + + + + + +F4 + + + +ferrule + + + +C1:e--F4:w + + + - + C2 - - - -C2 - -4x -  - F1 - -1:WH - -X2:1:A - - - - F2 - -2:BN - -X2:2:B - - - - F3 - -3:GN - -X2:3:C - - - - F4 - -4:YE - -X2:4:D - - - -  + + + +C2 + +4x +  + F1 + +1:WH + +X2:1:A + F2 + +2:BN + +X2:2:B + F3 + +3:GN + +X2:3:C + F4 + +4:YE + +X2:4:D +  - + F1:e--C2:w - - - + + + - + C3 - - - -C3 - -4x -  - F1 - -1:WH - -X3:1:A - - - - F2 - -2:BN - -X3:2:B - - - - F3 - -3:GN - -X3:3:C - - - - F4 - -4:YE - -X3:4:D - - - -  + + + +C3 + +4x +  + F1 + +1:WH + +X3:1:A + F2 + +2:BN + +X3:2:B + F3 + +3:GN + +X3:3:C + F4 + +4:YE + +X3:4:D +  - + F1:e--C3:w - - - - - - -F2 - - - -ferrule + + + - + F2:e--C2:w - - - + + + - + F2:e--C3:w - - - - - - -F3 - - - -ferrule + + + - + F3:e--C2:w - - - + + + - + F3:e--C3:w - - - - - - -F4 - - - -ferrule + + + - + F4:e--C2:w - - - + + + - + F4:e--C3:w - - - - - - -X2 - - - -X2 - -4-pin - -1 - -A - -2 - -B - -3 - -C - -4 - -D + + + - - -X3 - - - -X3 - -4-pin - -1 - -A - -2 - -B - -3 - -C - -4 - -D + + +C2:e--C2:w + + + - - -C1:e--F1:w - - - + + +C2:e--C2:w + + + - - -C1:e--F2:w - - - + + +C2:e--C2:w + + + - - -C1:e--F3:w - - - + + +C2:e--C2:w + + + - - -C1:e--F4:w - - - + + +X2 + + + +X2 + +4-pin + +1 + +A + +2 + +B + +3 + +C + +4 + +D - + C2:e--X2:w - - - + + + - + C2:e--X2:w - - - + + + - + C2:e--X2:w - - - + + + - + C2:e--X2:w - - - + + + + + + +C3:e--C3:w + + + + + + +C3:e--C3:w + + + + + + +C3:e--C3:w + + + + + + +C3:e--C3:w + + + + + + +X3 + + + +X3 + +4-pin + +1 + +A + +2 + +B + +3 + +C + +4 + +D - + C3:e--X3:w - - - + + + - + C3:e--X3:w - - - + + + - + C3:e--X3:w - - - + + + - + C3:e--X3:w - - - + + + diff --git a/examples/ex13_wv_gvpr.gvpr b/examples/ex13_wv_gvpr.gvpr new file mode 100644 index 000000000..7bfced78e --- /dev/null +++ b/examples/ex13_wv_gvpr.gvpr @@ -0,0 +1,64 @@ +/******************************************************************* + + see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 + input must include pos values (must be output from one of the engines w/ -Tdot)# + Thanks to steveroush and FeRDNYC + +*******************************************************************/ +BEG_G{ + double x1,y1,x2,y2,x3,y3,x4,y4; + string ptSize, tok[int], pt[]; + int cnt, circ, i; + node_t aNode; + + circ=0; + +/*************************************** + $G.bb=""; + $G.nodesep=""; + $G.ranksep=""; + $G.splines="true"; +****************************************/ +} + +// This removes the label text but keeps the position +E[noLabel] { + $.label=""; // remove pesky label + // $.lp=""; // remove peskier label pos +} + +E[straight] { + cnt=tokens($.pos,tok," "); + $.oldpos=$.pos; + x1 = xOf(tok[0]); + y1 = yOf(tok[0]); + x4 = xOf(tok[cnt-1]); + y4 = yOf(tok[cnt-1]); + x2 = x1 + (x4-x1)/3.; + y2 = y1 + (y4-y1)/3.; + x3 = x1 + 2.*(x4-x1)/3.; + y3 = y1 + 2.*(y4-y1)/3.; + pos=sprintf("%.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f", x1,y1, x2,y2, x3,y3, x4,y4); + $.label=""; // remove pesky label + $.lp=""; // remove peskier label pos + + if (hasAttr($, "addPTS") && $.addPTS!="" && $.colorPTS!=""){ + // now we place point nodes at the edge ends + pt[1] = tok[0]; + pt[2] = tok[cnt-1]; + ptSize=$.addPTS; + for (pt[i]) { + if (i==2 && pt[1]==pt[2]) + continue; + aNode=node($G, "__CIRCLE__" + (string)++circ); + aNode.pos=pt[i]; + aNode.shape="point"; + aNode.width=ptSize; + aNode.height=ptSize; + aNode.style="filled"; + aNode.fillcolor=$.colorPTS; + aNode.color=$.colorPTS; + } + } + +} \ No newline at end of file diff --git a/examples/ex14.gv b/examples/ex14.gv index 17b351648..3028c817c 100644 --- a/examples/ex14.gv +++ b/examples/ex14.gv @@ -404,19 +404,7 @@ graph {
- + @@ -426,19 +414,7 @@ graph { - + @@ -448,19 +424,7 @@ graph { - + @@ -470,19 +434,7 @@ graph { - + @@ -504,6 +456,10 @@ graph { edge [color="#000000:#FFFF00:#000000"] X1:p1r:e -- W1:w4:w W1:w4:e -- AUTOGENERATED_S_3:w + W1:w1:e -- W1:w1:w [color="#000000:#FFFFFF:#000000" straight=straight] + W1:w2:e -- W1:w2:w [color="#000000:#895956:#000000" straight=straight] + W1:w3:e -- W1:w3:w [color="#000000:#00AA00:#000000" straight=straight] + W1:w4:e -- W1:w4:w [color="#000000:#FFFF00:#000000" straight=straight] W2 [label=<
X3:1:A
- - - - - - - - - - -
-
F2X3:2:B
- - - - - - - - - - -
-
F3X3:3:C
- - - - - - - - - - -
-
F4X3:4:D
- - - - - - - - - - -
-
 
- - - - - - - - - - -
-
X1:3:C
- - - - - - - - - - -
-
X1:2:BS1
- - - - - - - - - - -
-
X1:1:A
- - - - - - - - - - -
-
 
@@ -539,19 +495,7 @@ graph { - + @@ -561,19 +505,7 @@ graph { - + @@ -583,19 +515,7 @@ graph { - + @@ -605,19 +525,7 @@ graph { - + @@ -639,6 +547,10 @@ graph { edge [color="#000000:#FFFF00:#000000"] AUTOGENERATED_S_3:e -- W2:w4:w W2:w4:e -- AUTOGENERATED_S_7:w + W2:w1:e -- W2:w1:w [color="#000000:#FFFFFF:#000000" straight=straight] + W2:w2:e -- W2:w2:w [color="#000000:#895956:#000000" straight=straight] + W2:w3:e -- W2:w3:w [color="#000000:#00AA00:#000000" straight=straight] + W2:w4:e -- W2:w4:w [color="#000000:#FFFF00:#000000" straight=straight] W21 [label=<
- - - - - - - - - - -
-
- - - - - - - - - - -
-
S1
- - - - - - - - - - -
-
- - - - - - - - - - -
-
 
@@ -674,19 +586,7 @@ graph { - + @@ -696,19 +596,7 @@ graph { - + @@ -718,19 +606,7 @@ graph { - + @@ -740,19 +616,7 @@ graph { - + @@ -774,6 +638,10 @@ graph { edge [color="#000000:#FFFF00:#000000"] AUTOGENERATED_S_7:e -- W21:w4:w W21:w4:e -- X2:p4l:w + W21:w1:e -- W21:w1:w [color="#000000:#FFFFFF:#000000" straight=straight] + W21:w2:e -- W21:w2:w [color="#000000:#895956:#000000" straight=straight] + W21:w3:e -- W21:w3:w [color="#000000:#00AA00:#000000" straight=straight] + W21:w4:e -- W21:w4:w [color="#000000:#FFFF00:#000000" straight=straight] W3 [label=<
X2:1:A
- - - - - - - - - - -
-
X2:2:B
- - - - - - - - - - -
-
X2:3:C
- - - - - - - - - - -
-
X2:4:D
- - - - - - - - - - -
-
 
@@ -809,19 +677,7 @@ graph { - + @@ -831,19 +687,7 @@ graph { - + @@ -853,19 +697,7 @@ graph { - + @@ -875,19 +707,7 @@ graph { - + @@ -909,6 +729,10 @@ graph { edge [color="#000000:#FFFF00:#000000"] X3:p4r:e -- W3:w4:w W3:w4:e -- AUTOGENERATED_F_4:w + W3:w1:e -- W3:w1:w [color="#000000:#FFFFFF:#000000" straight=straight] + W3:w2:e -- W3:w2:w [color="#000000:#895956:#000000" straight=straight] + W3:w3:e -- W3:w3:w [color="#000000:#00AA00:#000000" straight=straight] + W3:w4:e -- W3:w4:w [color="#000000:#FFFF00:#000000" straight=straight] AUTOGENERATED_WIRE_1 [label=<
- - - - - - - - - - -
-
X3:2:B
- - - - - - - - - - -
-
X3:3:C
- - - - - - - - - - -
-
X3:4:D
- - - - - - - - - - -
-
 
@@ -935,19 +759,7 @@ graph { - + @@ -960,6 +772,7 @@ graph { edge [color="#000000:#000000:#000000"] S1:e -- AUTOGENERATED_WIRE_1:w1:w AUTOGENERATED_WIRE_1:w1:e -- X2:p4l:w + AUTOGENERATED_WIRE_1:w1:e -- AUTOGENERATED_WIRE_1:w1:w [color="#000000:#000000:#000000" straight=straight] edge [color="#000000" dir=both style=dashed] X2:e -- X3:w edge [color="#000000" dir=forward style=dashed] diff --git a/examples/ex14.html b/examples/ex14.html index 7b686fbb9..0bc708e9a 100644 --- a/examples/ex14.html +++ b/examples/ex14.html @@ -30,751 +30,819 @@

Diagram

- - - - + + + X1 - - - -X1 - -JST SM - -male - -4-pin - -A - -1 - -B - -2 - -C - -3 - -D - -4 + + + +X1 + +JST SM + +male + +4-pin + +A + +1 + +B + +2 + +C + +3 + +D + +4 - + W1 - - - -W1 - -4x - -0.1 m -  - X1:4:D - -1:WH - - - - - - X1:3:C - -2:BN - - - - - - X1:2:B - -3:GN - -S1 - - - - X1:1:A - -4:YE - - - - - -  + + + +W1 + +4x + +0.1 m +  + X1:4:D + +1:WH + + + X1:3:C + +2:BN + + + X1:2:B + +3:GN + +S1 + X1:1:A + +4:YE + + +  X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + - + AUTOGENERATED_S_1 - - - -Splice - -CU - - + + + +Splice + +CU + + - - -W2 - - - -W2 - -4x - -0.1 m -  - - -1:WH - - - - - - - -2:BN - - - - - - S1 - -3:GN - - - - - - - -4:YE - - - - - -  - - + -AUTOGENERATED_S_1:e--W2:w - - - +W1:e--AUTOGENERATED_S_1:w + + + - + AUTOGENERATED_S_2 - - - -Splice - -CU - - + + + +Splice + +CU + + - - -AUTOGENERATED_S_2:e--W2:w - - - + + +W1:e--AUTOGENERATED_S_2:w + + + - + S1 - - - -Splice - -CU - - + + + +Splice + +CU + + - + + +W1:e--S1:w + + + + + + +AUTOGENERATED_S_3 + + + +Splice + +CU + + + + + +W1:e--AUTOGENERATED_S_3:w + + + + + + +W2 + + + +W2 + +4x + +0.1 m +  + + +1:WH + + + + +2:BN + + + S1 + +3:GN + + + + +4:YE + + +  + + +AUTOGENERATED_S_1:e--W2:w + + + + + + +AUTOGENERATED_S_2:e--W2:w + + + + + + S1:e--W2:w - - - + + + - + AUTOGENERATED_WIRE_1 - - - -1x - -0.1 m -  - S1 - -1:BK - -X2:4:D - - - -  + + + +1x + +0.1 m +  + S1 + +1:BK + +X2:4:D +  - + S1:e--AUTOGENERATED_WIRE_1:w - - - - - - -AUTOGENERATED_S_3 - - - -Splice - -CU - - + + + - + AUTOGENERATED_S_3:e--W2:w - - - + + + - - -AUTOGENERATED_S_4 - - - -Splice - -CU - - + + +W2:e--W2:w + + + - - -W21 - - - -W21 - -4x - -0.1 m -  - - -1:WH - -X2:1:A - - - - - -2:BN - -X2:2:B - - - - - -3:GN - -X2:3:C - - - - - -4:YE - -X2:4:D - - - -  + + +W2:e--W2:w + + + - + + +W2:e--W2:w + + + + + -AUTOGENERATED_S_4:e--W21:w - - - +W2:e--W2:w + + + + + + +AUTOGENERATED_S_4 + + + +Splice + +CU + + + + + +W2:e--AUTOGENERATED_S_4:w + + + - + AUTOGENERATED_S_5 - - - -Splice - -CU - - + + + +Splice + +CU + + - + -AUTOGENERATED_S_5:e--W21:w - - - +W2:e--AUTOGENERATED_S_5:w + + + - + AUTOGENERATED_S_6 - - - -Splice - -CU - - + + + +Splice + +CU + + - - -AUTOGENERATED_S_6:e--W21:w - - - + + +W2:e--AUTOGENERATED_S_6:w + + + - + AUTOGENERATED_S_7 - - - -Splice - -CU - - + + + +Splice + +CU + + + + + +W2:e--AUTOGENERATED_S_7:w + + + + + + +W21 + + + +W21 + +4x + +0.1 m +  + + +1:WH + +X2:1:A + + +2:BN + +X2:2:B + + +3:GN + +X2:3:C + + +4:YE + +X2:4:D +  + + + +AUTOGENERATED_S_4:e--W21:w + + + + + + +AUTOGENERATED_S_5:e--W21:w + + + + + + +AUTOGENERATED_S_6:e--W21:w + + + - + AUTOGENERATED_S_7:e--W21:w - - - + + + + + + +AUTOGENERATED_WIRE_1:e--AUTOGENERATED_WIRE_1:w + + + - + X2 - - - -X2 - -JST SM - -female - -4-pin - -1 - -A - -2 - -B - -3 - -C - -4 - -D + + + +X2 + +JST SM + +female + +4-pin + +1 + +A + +2 + +B + +3 + +C + +4 + +D + + + +AUTOGENERATED_WIRE_1:e--X2:w + + + - + X3 - - - -X3 - -JST SM - -male - -4-pin - -A - -1 - -B - -2 - -C - -3 - -D - -4 + + + +X3 + +JST SM + +male + +4-pin + +A + +1 + +B + +2 + +C + +3 + +D + +4 - + X2:e--X3:w - - - + + + + + + +W21:e--X2:w + + + + + + +W21:e--X2:w + + + + + + +W21:e--X2:w + + + + + + +W21:e--X2:w + + + + + + +W21:e--W21:w + + + + + + +W21:e--W21:w + + + + + + +W21:e--W21:w + + + + + + +W21:e--W21:w + + + - + W3 - - - -W3 - -4x - -0.1 m -  - X3:1:A - -1:WH - - - - - - X3:2:B - -2:BN - - - - - - X3:3:C - -3:GN - - - - - - X3:4:D - -4:YE - - - - - -  + + + +W3 + +4x + +0.1 m +  + X3:1:A + +1:WH + + + X3:2:B + +2:BN + + + X3:3:C + +3:GN + + + X3:4:D + +4:YE + + +  - + X3:e--W3:w - - - + + + - + X3:e--W3:w - - - + + + - + X3:e--W3:w - - - + + + - + X3:e--W3:w - - - + + + + + + +W3:e--W3:w + + + + + + +W3:e--W3:w + + + + + + +W3:e--W3:w + + + + + + +W3:e--W3:w + + + - + AUTOGENERATED_F_1 - - - -Ferrule - -GY - - + + + +Ferrule + +GY + + - - -X4 - - - -X4 - -Screw terminal connector - -4-pin - -GN - - - -1 - -W - -2 - -X - -3 - -Y - -4 - -Z - - - -AUTOGENERATED_F_1:e--X4:w - - + + +W3:e--AUTOGENERATED_F_1:w + + + - + AUTOGENERATED_F_2 - - - -Ferrule - -GY - - + + + +Ferrule + +GY + + - - -AUTOGENERATED_F_2:e--X4:w - - + + +W3:e--AUTOGENERATED_F_2:w + + + - + AUTOGENERATED_F_3 - - - -Ferrule - -GY - - + + + +Ferrule + +GY + + - - -AUTOGENERATED_F_3:e--X4:w - - + + +W3:e--AUTOGENERATED_F_3:w + + + - + AUTOGENERATED_F_4 - - - -Ferrule - -GY - - - - - -AUTOGENERATED_F_4:e--X4:w - - - - - -W1:e--AUTOGENERATED_S_1:w - - - - - - -W1:e--AUTOGENERATED_S_2:w - - - - - - -W1:e--S1:w - - - - - - -W1:e--AUTOGENERATED_S_3:w - - - - - - -W2:e--AUTOGENERATED_S_4:w - - - - - - -W2:e--AUTOGENERATED_S_5:w - - - + + + +Ferrule + +GY + + - - -W2:e--AUTOGENERATED_S_6:w - - - - - - -W2:e--AUTOGENERATED_S_7:w - - - - - - -W21:e--X2:w - - - - - - -W21:e--X2:w - - - - - - -W21:e--X2:w - - - - - - -W21:e--X2:w - - - + + +W3:e--AUTOGENERATED_F_4:w + + + - - -W3:e--AUTOGENERATED_F_1:w - - - + + +X4 + + + +X4 + +Screw terminal connector + +4-pin + +GN + + + +1 + +W + +2 + +X + +3 + +Y + +4 + +Z - - -W3:e--AUTOGENERATED_F_2:w - - - + + +AUTOGENERATED_F_1:e--X4:w + + - - -W3:e--AUTOGENERATED_F_3:w - - - + + +AUTOGENERATED_F_2:e--X4:w + + - - -W3:e--AUTOGENERATED_F_4:w - - - + + +AUTOGENERATED_F_3:e--X4:w + + - - -AUTOGENERATED_WIRE_1:e--X2:w - - - + + +AUTOGENERATED_F_4:e--X4:w + + diff --git a/examples/ex14.png b/examples/ex14.png index d50b3f6cc..08155fd32 100644 Binary files a/examples/ex14.png and b/examples/ex14.png differ diff --git a/examples/ex14.svg b/examples/ex14.svg index c97d90061..6fc465543 100644 --- a/examples/ex14.svg +++ b/examples/ex14.svg @@ -1,751 +1,819 @@ - - - - + + + X1 - - - -X1 - -JST SM - -male - -4-pin - -A - -1 - -B - -2 - -C - -3 - -D - -4 + + + +X1 + +JST SM + +male + +4-pin + +A + +1 + +B + +2 + +C + +3 + +D + +4 - + W1 - - - -W1 - -4x - -0.1 m -  - X1:4:D - -1:WH - - - - - - X1:3:C - -2:BN - - - - - - X1:2:B - -3:GN - -S1 - - - - X1:1:A - -4:YE - - - - - -  + + + +W1 + +4x + +0.1 m +  + X1:4:D + +1:WH + + + X1:3:C + +2:BN + + + X1:2:B + +3:GN + +S1 + X1:1:A + +4:YE + + +  X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + - + AUTOGENERATED_S_1 - - - -Splice - -CU - - + + + +Splice + +CU + + - - -W2 - - - -W2 - -4x - -0.1 m -  - - -1:WH - - - - - - - -2:BN - - - - - - S1 - -3:GN - - - - - - - -4:YE - - - - - -  - - + -AUTOGENERATED_S_1:e--W2:w - - - +W1:e--AUTOGENERATED_S_1:w + + + - + AUTOGENERATED_S_2 - - - -Splice - -CU - - + + + +Splice + +CU + + - - -AUTOGENERATED_S_2:e--W2:w - - - + + +W1:e--AUTOGENERATED_S_2:w + + + - + S1 - - - -Splice - -CU - - + + + +Splice + +CU + + - + + +W1:e--S1:w + + + + + + +AUTOGENERATED_S_3 + + + +Splice + +CU + + + + + +W1:e--AUTOGENERATED_S_3:w + + + + + + +W2 + + + +W2 + +4x + +0.1 m +  + + +1:WH + + + + +2:BN + + + S1 + +3:GN + + + + +4:YE + + +  + + +AUTOGENERATED_S_1:e--W2:w + + + + + + +AUTOGENERATED_S_2:e--W2:w + + + + + + S1:e--W2:w - - - + + + - + AUTOGENERATED_WIRE_1 - - - -1x - -0.1 m -  - S1 - -1:BK - -X2:4:D - - - -  + + + +1x + +0.1 m +  + S1 + +1:BK + +X2:4:D +  - + S1:e--AUTOGENERATED_WIRE_1:w - - - - - - -AUTOGENERATED_S_3 - - - -Splice - -CU - - + + + - + AUTOGENERATED_S_3:e--W2:w - - - + + + - - -AUTOGENERATED_S_4 - - - -Splice - -CU - - + + +W2:e--W2:w + + + - - -W21 - - - -W21 - -4x - -0.1 m -  - - -1:WH - -X2:1:A - - - - - -2:BN - -X2:2:B - - - - - -3:GN - -X2:3:C - - - - - -4:YE - -X2:4:D - - - -  + + +W2:e--W2:w + + + - + + +W2:e--W2:w + + + + + -AUTOGENERATED_S_4:e--W21:w - - - +W2:e--W2:w + + + + + + +AUTOGENERATED_S_4 + + + +Splice + +CU + + + + + +W2:e--AUTOGENERATED_S_4:w + + + - + AUTOGENERATED_S_5 - - - -Splice - -CU - - + + + +Splice + +CU + + - + -AUTOGENERATED_S_5:e--W21:w - - - +W2:e--AUTOGENERATED_S_5:w + + + - + AUTOGENERATED_S_6 - - - -Splice - -CU - - + + + +Splice + +CU + + - - -AUTOGENERATED_S_6:e--W21:w - - - + + +W2:e--AUTOGENERATED_S_6:w + + + - + AUTOGENERATED_S_7 - - - -Splice - -CU - - + + + +Splice + +CU + + + + + +W2:e--AUTOGENERATED_S_7:w + + + + + + +W21 + + + +W21 + +4x + +0.1 m +  + + +1:WH + +X2:1:A + + +2:BN + +X2:2:B + + +3:GN + +X2:3:C + + +4:YE + +X2:4:D +  + + + +AUTOGENERATED_S_4:e--W21:w + + + + + + +AUTOGENERATED_S_5:e--W21:w + + + + + + +AUTOGENERATED_S_6:e--W21:w + + + - + AUTOGENERATED_S_7:e--W21:w - - - + + + + + + +AUTOGENERATED_WIRE_1:e--AUTOGENERATED_WIRE_1:w + + + - + X2 - - - -X2 - -JST SM - -female - -4-pin - -1 - -A - -2 - -B - -3 - -C - -4 - -D + + + +X2 + +JST SM + +female + +4-pin + +1 + +A + +2 + +B + +3 + +C + +4 + +D + + + +AUTOGENERATED_WIRE_1:e--X2:w + + + - + X3 - - - -X3 - -JST SM - -male - -4-pin - -A - -1 - -B - -2 - -C - -3 - -D - -4 + + + +X3 + +JST SM + +male + +4-pin + +A + +1 + +B + +2 + +C + +3 + +D + +4 - + X2:e--X3:w - - - + + + + + + +W21:e--X2:w + + + + + + +W21:e--X2:w + + + + + + +W21:e--X2:w + + + + + + +W21:e--X2:w + + + + + + +W21:e--W21:w + + + + + + +W21:e--W21:w + + + + + + +W21:e--W21:w + + + + + + +W21:e--W21:w + + + - + W3 - - - -W3 - -4x - -0.1 m -  - X3:1:A - -1:WH - - - - - - X3:2:B - -2:BN - - - - - - X3:3:C - -3:GN - - - - - - X3:4:D - -4:YE - - - - - -  + + + +W3 + +4x + +0.1 m +  + X3:1:A + +1:WH + + + X3:2:B + +2:BN + + + X3:3:C + +3:GN + + + X3:4:D + +4:YE + + +  - + X3:e--W3:w - - - + + + - + X3:e--W3:w - - - + + + - + X3:e--W3:w - - - + + + - + X3:e--W3:w - - - + + + + + + +W3:e--W3:w + + + + + + +W3:e--W3:w + + + + + + +W3:e--W3:w + + + + + + +W3:e--W3:w + + + - + AUTOGENERATED_F_1 - - - -Ferrule - -GY - - + + + +Ferrule + +GY + + - - -X4 - - - -X4 - -Screw terminal connector - -4-pin - -GN - - - -1 - -W - -2 - -X - -3 - -Y - -4 - -Z - - - -AUTOGENERATED_F_1:e--X4:w - - + + +W3:e--AUTOGENERATED_F_1:w + + + - + AUTOGENERATED_F_2 - - - -Ferrule - -GY - - + + + +Ferrule + +GY + + - - -AUTOGENERATED_F_2:e--X4:w - - + + +W3:e--AUTOGENERATED_F_2:w + + + - + AUTOGENERATED_F_3 - - - -Ferrule - -GY - - + + + +Ferrule + +GY + + - - -AUTOGENERATED_F_3:e--X4:w - - + + +W3:e--AUTOGENERATED_F_3:w + + + - + AUTOGENERATED_F_4 - - - -Ferrule - -GY - - - - - -AUTOGENERATED_F_4:e--X4:w - - - - - -W1:e--AUTOGENERATED_S_1:w - - - - - - -W1:e--AUTOGENERATED_S_2:w - - - - - - -W1:e--S1:w - - - - - - -W1:e--AUTOGENERATED_S_3:w - - - - - - -W2:e--AUTOGENERATED_S_4:w - - - - - - -W2:e--AUTOGENERATED_S_5:w - - - + + + +Ferrule + +GY + + - - -W2:e--AUTOGENERATED_S_6:w - - - - - - -W2:e--AUTOGENERATED_S_7:w - - - - - - -W21:e--X2:w - - - - - - -W21:e--X2:w - - - - - - -W21:e--X2:w - - - - - - -W21:e--X2:w - - - + + +W3:e--AUTOGENERATED_F_4:w + + + - - -W3:e--AUTOGENERATED_F_1:w - - - + + +X4 + + + +X4 + +Screw terminal connector + +4-pin + +GN + + + +1 + +W + +2 + +X + +3 + +Y + +4 + +Z - - -W3:e--AUTOGENERATED_F_2:w - - - + + +AUTOGENERATED_F_1:e--X4:w + + - - -W3:e--AUTOGENERATED_F_3:w - - - + + +AUTOGENERATED_F_2:e--X4:w + + - - -W3:e--AUTOGENERATED_F_4:w - - - + + +AUTOGENERATED_F_3:e--X4:w + + - - -AUTOGENERATED_WIRE_1:e--X2:w - - - + + +AUTOGENERATED_F_4:e--X4:w + + diff --git a/examples/ex14_wv_gvpr.gvpr b/examples/ex14_wv_gvpr.gvpr new file mode 100644 index 000000000..7bfced78e --- /dev/null +++ b/examples/ex14_wv_gvpr.gvpr @@ -0,0 +1,64 @@ +/******************************************************************* + + see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 + input must include pos values (must be output from one of the engines w/ -Tdot)# + Thanks to steveroush and FeRDNYC + +*******************************************************************/ +BEG_G{ + double x1,y1,x2,y2,x3,y3,x4,y4; + string ptSize, tok[int], pt[]; + int cnt, circ, i; + node_t aNode; + + circ=0; + +/*************************************** + $G.bb=""; + $G.nodesep=""; + $G.ranksep=""; + $G.splines="true"; +****************************************/ +} + +// This removes the label text but keeps the position +E[noLabel] { + $.label=""; // remove pesky label + // $.lp=""; // remove peskier label pos +} + +E[straight] { + cnt=tokens($.pos,tok," "); + $.oldpos=$.pos; + x1 = xOf(tok[0]); + y1 = yOf(tok[0]); + x4 = xOf(tok[cnt-1]); + y4 = yOf(tok[cnt-1]); + x2 = x1 + (x4-x1)/3.; + y2 = y1 + (y4-y1)/3.; + x3 = x1 + 2.*(x4-x1)/3.; + y3 = y1 + 2.*(y4-y1)/3.; + pos=sprintf("%.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f", x1,y1, x2,y2, x3,y3, x4,y4); + $.label=""; // remove pesky label + $.lp=""; // remove peskier label pos + + if (hasAttr($, "addPTS") && $.addPTS!="" && $.colorPTS!=""){ + // now we place point nodes at the edge ends + pt[1] = tok[0]; + pt[2] = tok[cnt-1]; + ptSize=$.addPTS; + for (pt[i]) { + if (i==2 && pt[1]==pt[2]) + continue; + aNode=node($G, "__CIRCLE__" + (string)++circ); + aNode.pos=pt[i]; + aNode.shape="point"; + aNode.width=ptSize; + aNode.height=ptSize; + aNode.style="filled"; + aNode.fillcolor=$.colorPTS; + aNode.color=$.colorPTS; + } + } + +} \ No newline at end of file diff --git a/examples/ex15.bom.tsv b/examples/ex15.bom.tsv new file mode 100644 index 000000000..53017cb43 --- /dev/null +++ b/examples/ex15.bom.tsv @@ -0,0 +1,5 @@ +# Qty Unit Description Designators Manufacturer MPN +1 2 Connector, Molex KK 254, female, 7 pins X1, X2 +2 1 m Cable, Serial, 4 x 0.25 mm² shielded W1 +3 42 mm shortPartA X1 WireViz 42XCD42A5 +4 1 shortPartB X1 WireViz 42XCD42A5 diff --git a/examples/ex15.gv b/examples/ex15.gv new file mode 100644 index 000000000..b1d7df4c5 --- /dev/null +++ b/examples/ex15.gv @@ -0,0 +1,297 @@ +graph { +// Graph generated by WireViz 0.5-dev+refactor +// https://github.com/wireviz/WireViz + graph [bgcolor="#FFFFFF" fontname=arial nodesep=0.33 rankdir=LR ranksep=2] + node [fillcolor="#FFFFFF" fontname=arial height=0 margin=0 shape=none style=filled width=0] + edge [fontname=arial style=bold] + X1 [label=< +
X2:4:D
- - - - - - - - - - -
-
 
+ + + + + + + + + + + + +
+ + + + +
X1
+
+ + + + + + +
Molex KK 254female7-pin
+
+ + + + + + + + + + [, ] + + + + + [, ] + + + + + [, ] + + + + + [, ] + + + + + [, ] + + + + + [, ] + + + + + [, ] + + +
SH1SH2
GND1
VCC2
RX3
TX4
GND5
VCC6
GND7
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
42mmshortPartA
WireViz: 42XCD42A5
1xshortPartB
WireViz: 42XCD42A5
+
+> shape=box style=filled] + edge [color="#000000"] + X1:p1j:c -- X1:p5j:c [addPTS=.18 color="#FFFFFF:#FF66CC:#FFFFFF" colorPTS="#FF66CC:#FFFFFF" headclip=false straight=straight tailclip=false] + X1:p5j:c -- X1:p7j:c [addPTS=.18 color="#FFFFFF:#FF66CC:#FFFFFF" colorPTS="#FF66CC:#FFFFFF" headclip=false straight=straight tailclip=false] + X1:p2j:c -- X1:p6j:c [addPTS=.18 color="#FFFFFF:#FF0000:#FFFFFF" colorPTS="#FF0000:#FFFFFF" headclip=false straight=straight tailclip=false] + X2 [label=< + + + + + + + + + + +
+ + + + +
X2
+
+ + + + + + +
Molex KK 254female7-pin
+
+ + + + + + + + + + + [, ] + + + + + [, ] + + + + + [, ] + + + + + [, ] + + + + + [, ] + + + + + [, ] + + + + + [, ] + +
SH1SH2
1GND
2VCC
3RX
4TX
5GND
6VCC
7GND
+
+> shape=box style=filled] + edge [color="#000000"] + X2:p1j:c -- X2:p5j:c [addPTS=.18 color="#FFFFFF:#000000:#FFFFFF" colorPTS="#000000:#FFFFFF" headclip=false straight=straight tailclip=false] + X2:p5j:c -- X2:p7j:c [addPTS=.18 color="#FFFFFF:#000000:#FFFFFF" colorPTS="#000000:#FFFFFF" headclip=false straight=straight tailclip=false] + X2:p2j:c -- X2:p6j:c [addPTS=.18 color="#FFFFFF:#000000:#FFFFFF" colorPTS="#000000:#FFFFFF" headclip=false straight=straight tailclip=false] + W1 [label=< + + + + + + + + + + +
+ + + + +
W1
+
+ + + + + + + + +
Serial4x0.25 mm² (24 AWG)+ S0.2 m
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
X1:1:GND 1:BUWH X2:1:GND
X1:2:VCC 2:WHBU X2:2:VCC
X1:3:RX 3:OGWH X2:4:TX
X1:4:TX 4:WHOG X2:3:RX
 
X1:1:GND Shield
 
+
+> shape=box style=filled] + edge [color="#000000:#0066FF:#FFFFFF:#0066FF:#000000"] + X1:p1r:e -- W1:w1:w + W1:w1:e -- X2:p1l:w + edge [color="#000000:#FFFFFF:#0066FF:#FFFFFF:#000000"] + X1:p2r:e -- W1:w2:w + W1:w2:e -- X2:p2l:w + edge [color="#000000:#FF8000:#FFFFFF:#FF8000:#000000"] + X1:p3r:e -- W1:w3:w + W1:w3:e -- X2:p4l:w + edge [color="#000000:#FFFFFF:#FF8000:#FFFFFF:#000000"] + X1:p4r:e -- W1:w4:w + W1:w4:e -- X2:p3l:w + edge [color="#000000"] + X1:p1r:e -- W1:w5:w + W1:w1:e -- W1:w1:w [color="#000000:#0066FF:#FFFFFF:#0066FF:#000000" straight=straight] + W1:w2:e -- W1:w2:w [color="#000000:#FFFFFF:#0066FF:#FFFFFF:#000000" straight=straight] + W1:w3:e -- W1:w3:w [color="#000000:#FF8000:#FFFFFF:#FF8000:#000000" straight=straight] + W1:w4:e -- W1:w4:w [color="#000000:#FFFFFF:#FF8000:#FFFFFF:#000000" straight=straight] + W1:w5:e -- W1:w5:w [color="#000000" straight=straight] +} diff --git a/examples/ex15.html b/examples/ex15.html new file mode 100644 index 000000000..c652c245f --- /dev/null +++ b/examples/ex15.html @@ -0,0 +1,501 @@ + + + + + ex15 + + +

ex15

+

Diagram

+ +
+ +
+ +
+ + + + + + + + +X1 + + + +X1 + +Molex KK 254 + +female + +7-pin + + +SH1 + +SH2 + + +GND + + + +1 + +VCC + + + +2 + +RX + + + +3 + +TX + + + +4 + +GND + + + +5 + +VCC + + + +6 + +GND + + + +7 +42 +mm +shortPartA +WireViz: 42XCD42A5 +1 +x +shortPartB +WireViz: 42XCD42A5 + + + + +X1:c--X1:c + + + + + + +X1:c--X1:c + + + + + + +X1:c--X1:c + + + + + + +W1 + + + +W1 + +Serial + +4x + +0.25 mm² (24 AWG) + ++ S + +0.2 m +  + X1:1:GND + +1:BUWH + +X2:1:GND + X1:2:VCC + +2:WHBU + +X2:2:VCC + X1:3:RX + +3:OGWH + +X2:4:TX + X1:4:TX + +4:WHOG + +X2:3:RX +  + X1:1:GND + +Shield + + +  + + + +X1:e--W1:w + + + + + + + + +X1:e--W1:w + + + + + + + + +X1:e--W1:w + + + + + + + + +X1:e--W1:w + + + + + + + + +X1:e--W1:w + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + +X2 + + + +X2 + +Molex KK 254 + +female + +7-pin + + + +SH1 + +SH2 + +1 + +GND + + + +2 + +VCC + + + +3 + +RX + + + +4 + +TX + + + +5 + +GND + + + +6 + +VCC + + + +7 + +GND + + + + + +W1:e--X2:w + + + + + + + + +W1:e--X2:w + + + + + + + + +W1:e--X2:w + + + + + + + + +W1:e--X2:w + + + + + + + + +X2:c--X2:c + + + + + + +X2:c--X2:c + + + + + + +X2:c--X2:c + + + + + + +__CIRCLE__1 + + + + +__CIRCLE__2 + + + + +__CIRCLE__3 + + + + +__CIRCLE__4 + + + + +__CIRCLE__5 + + + + +__CIRCLE__6 + + + + +__CIRCLE__7 + + + + +__CIRCLE__8 + + + + +__CIRCLE__9 + + + + +__CIRCLE__10 + + + + +__CIRCLE__11 + + + + +__CIRCLE__12 + + + + + +
+ +
+ +
+ +

Bill of Materials

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#QtyUnitDescriptionDesignatorsManufacturerMPN
12Connector, Molex KK 254, female, 7 pinsX1, X2
21mCable, Serial, 4 x 0.25 mm² shieldedW1
342mmshortPartAX1WireViz42XCD42A5
41shortPartBX1WireViz42XCD42A5
+ +
+ + diff --git a/examples/ex15.png b/examples/ex15.png new file mode 100644 index 000000000..d60f1975a Binary files /dev/null and b/examples/ex15.png differ diff --git a/examples/ex15.svg b/examples/ex15.svg new file mode 100644 index 000000000..21ba1e06d --- /dev/null +++ b/examples/ex15.svg @@ -0,0 +1,411 @@ + + + + + + + + + +X1 + + + +X1 + +Molex KK 254 + +female + +7-pin + + +SH1 + +SH2 + + +GND + + + +1 + +VCC + + + +2 + +RX + + + +3 + +TX + + + +4 + +GND + + + +5 + +VCC + + + +6 + +GND + + + +7 +42 +mm +shortPartA +WireViz: 42XCD42A5 +1 +x +shortPartB +WireViz: 42XCD42A5 + + + + +X1:c--X1:c + + + + + + +X1:c--X1:c + + + + + + +X1:c--X1:c + + + + + + +W1 + + + +W1 + +Serial + +4x + +0.25 mm² (24 AWG) + ++ S + +0.2 m +  + X1:1:GND + +1:BUWH + +X2:1:GND + X1:2:VCC + +2:WHBU + +X2:2:VCC + X1:3:RX + +3:OGWH + +X2:4:TX + X1:4:TX + +4:WHOG + +X2:3:RX +  + X1:1:GND + +Shield + + +  + + + +X1:e--W1:w + + + + + + + + +X1:e--W1:w + + + + + + + + +X1:e--W1:w + + + + + + + + +X1:e--W1:w + + + + + + + + +X1:e--W1:w + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + + + + + +W1:e--W1:w + + + + +X2 + + + +X2 + +Molex KK 254 + +female + +7-pin + + + +SH1 + +SH2 + +1 + +GND + + + +2 + +VCC + + + +3 + +RX + + + +4 + +TX + + + +5 + +GND + + + +6 + +VCC + + + +7 + +GND + + + + + +W1:e--X2:w + + + + + + + + +W1:e--X2:w + + + + + + + + +W1:e--X2:w + + + + + + + + +W1:e--X2:w + + + + + + + + +X2:c--X2:c + + + + + + +X2:c--X2:c + + + + + + +X2:c--X2:c + + + + + + +__CIRCLE__1 + + + + +__CIRCLE__2 + + + + +__CIRCLE__3 + + + + +__CIRCLE__4 + + + + +__CIRCLE__5 + + + + +__CIRCLE__6 + + + + +__CIRCLE__7 + + + + +__CIRCLE__8 + + + + +__CIRCLE__9 + + + + +__CIRCLE__10 + + + + +__CIRCLE__11 + + + + +__CIRCLE__12 + + + + diff --git a/examples/ex15.yml b/examples/ex15.yml new file mode 100644 index 000000000..0e90e2eb7 --- /dev/null +++ b/examples/ex15.yml @@ -0,0 +1,46 @@ +connectors: # This is based on ex1 and adds some Shorts to the connectors + X1: # An example of Shorts with more information + type: Molex KK 254 + subtype: female + pinlabels: [GND, VCC, RX, TX, GND, VCC, GND] + shorts: # A List(Dict) of shorts is created + SH1: [1, 5, 7] # First is the designator than a list of pins to be shorted + SH2: [2, 6] + additional_components: # Some Additional Components to describe the short in more detail + - references: SH1 + color: PK # The color of the short, can also be multicolor + manufacturer: WireViz + mpn: 42XCD42A5 + type: shortPartA + amount: 42 mm # The length or some other quantity + - references: SH2 + color: RD + manufacturer: WireViz + mpn: 42XCD42A5 + type: shortPartB + X2: # An example of a simple short definition + type: Molex KK 254 + subtype: female + pinlabels: [GND, VCC, RX, TX, GND, VCC, GND] + shorts: # The definition is the same as above but there is no additional_components for more information + SH1: [1, 5, 7] + SH2: [2, 6] + +cables: + W1: + color_code: TEL + wirecount: 4 + gauge: 0.25 mm2 + show_equiv: true + length: 0.2 + shield: true + type: Serial + +connections: + - + - X1: [1-4] + - W1: [1-4] + - X2: [1,2,4,3] + - + - X1: 1 + - W1: s \ No newline at end of file diff --git a/examples/ex15_wv_gvpr.gvpr b/examples/ex15_wv_gvpr.gvpr new file mode 100644 index 000000000..7bfced78e --- /dev/null +++ b/examples/ex15_wv_gvpr.gvpr @@ -0,0 +1,64 @@ +/******************************************************************* + + see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 + input must include pos values (must be output from one of the engines w/ -Tdot)# + Thanks to steveroush and FeRDNYC + +*******************************************************************/ +BEG_G{ + double x1,y1,x2,y2,x3,y3,x4,y4; + string ptSize, tok[int], pt[]; + int cnt, circ, i; + node_t aNode; + + circ=0; + +/*************************************** + $G.bb=""; + $G.nodesep=""; + $G.ranksep=""; + $G.splines="true"; +****************************************/ +} + +// This removes the label text but keeps the position +E[noLabel] { + $.label=""; // remove pesky label + // $.lp=""; // remove peskier label pos +} + +E[straight] { + cnt=tokens($.pos,tok," "); + $.oldpos=$.pos; + x1 = xOf(tok[0]); + y1 = yOf(tok[0]); + x4 = xOf(tok[cnt-1]); + y4 = yOf(tok[cnt-1]); + x2 = x1 + (x4-x1)/3.; + y2 = y1 + (y4-y1)/3.; + x3 = x1 + 2.*(x4-x1)/3.; + y3 = y1 + 2.*(y4-y1)/3.; + pos=sprintf("%.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f", x1,y1, x2,y2, x3,y3, x4,y4); + $.label=""; // remove pesky label + $.lp=""; // remove peskier label pos + + if (hasAttr($, "addPTS") && $.addPTS!="" && $.colorPTS!=""){ + // now we place point nodes at the edge ends + pt[1] = tok[0]; + pt[2] = tok[cnt-1]; + ptSize=$.addPTS; + for (pt[i]) { + if (i==2 && pt[1]==pt[2]) + continue; + aNode=node($G, "__CIRCLE__" + (string)++circ); + aNode.pos=pt[i]; + aNode.shape="point"; + aNode.width=ptSize; + aNode.height=ptSize; + aNode.style="filled"; + aNode.fillcolor=$.colorPTS; + aNode.color=$.colorPTS; + } + } + +} \ No newline at end of file diff --git a/examples/ex16.bom.tsv b/examples/ex16.bom.tsv new file mode 100644 index 000000000..54f73d05a --- /dev/null +++ b/examples/ex16.bom.tsv @@ -0,0 +1,6 @@ +# Qty Unit Description Designators Manufacturer MPN +1 2 Connector, Molex KK 254, female, 7 pins X1, X2 +2 1 m Cable, Serial, 4 x 0.25 mm² shielded W1 +3 42 mm loopPartA X1 WireViz 42XCD42A5 +4 74 mm loopPartB X1 WireViz 42XCD42A5 +5 21 mm loopPartC X2 WireViz 42XCD42A5 diff --git a/examples/ex16.gv b/examples/ex16.gv new file mode 100644 index 000000000..49f886d96 --- /dev/null +++ b/examples/ex16.gv @@ -0,0 +1,289 @@ +graph { +// Graph generated by WireViz 0.5-dev+refactor +// https://github.com/wireviz/WireViz + graph [bgcolor="#FFFFFF" fontname=arial nodesep=0.33 rankdir=LR ranksep=2] + node [fillcolor="#FFFFFF" fontname=arial height=0 margin=0 shape=none style=filled width=0] + edge [fontname=arial style=bold] + X1 [label=< + + + + + + + + + + + + + +
+ + + + +
X1
+
+ + + + + + +
Molex KK 254female7-pin
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
GND1
VCC2
RX3
TX4
GND5
VCC6
GND7
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
42mmloopPartA
WireViz: 42XCD42A5
74mmloopPartB
WireViz: 42XCD42A5
+
+> shape=box style=filled] + edge [color="#000000"] + X1:p1r:e -- X1:p5r:e [label=" " color="#FF66CC" noLabel=noLabel] + X1:p5r:e -- X1:p7r:e [label=" " color="#FF66CC" noLabel=noLabel] + X1:p2r:e -- X1:p6r:e [label=" " color="#FF0000:#0066FF:#FF8000:#A0DFFF" noLabel=noLabel] + X2 [label=< + + + + + + + + + + + + + +
+ + + + +
X2
+
+ + + + + + +
Molex KK 254female7-pin
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
1GND
2VCC
3RX
4TX
5GND
6VCC
7GND
+
+ + + + + + + + + + + + + +
21mmloopPartC
WireViz: 42XCD42A5
+
+> shape=box style=filled] + edge [color="#000000"] + X2:p1l:w -- X2:p5l:w [label=" " color="#FF66CC" noLabel=noLabel] + X2:p5l:w -- X2:p7l:w [label=" " color="#FF66CC" noLabel=noLabel] + X2:p2l:w -- X2:p6l:w [label=" " color="#FF66CC" noLabel=noLabel] + W1 [label=< + + + + + + + + + + +
+ + + + +
W1
+
+ + + + + + + + +
Serial4x0.25 mm² (24 AWG)+ S0.2 m
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
X1:1:GND 1:BN X2:1:GND
X1:2:VCC 2:RD X2:2:VCC
X1:3:RX 3:OG X2:4:TX
X1:4:TX 4:YE X2:3:RX
 
X1:1:GND Shield
 
+
+> shape=box style=filled] + edge [color="#000000:#895956:#000000"] + X1:p1r:e -- W1:w1:w + W1:w1:e -- X2:p1l:w + edge [color="#000000:#FF0000:#000000"] + X1:p2r:e -- W1:w2:w + W1:w2:e -- X2:p2l:w + edge [color="#000000:#FF8000:#000000"] + X1:p3r:e -- W1:w3:w + W1:w3:e -- X2:p4l:w + edge [color="#000000:#FFFF00:#000000"] + X1:p4r:e -- W1:w4:w + W1:w4:e -- X2:p3l:w + edge [color="#000000"] + X1:p1r:e -- W1:w5:w + W1:w1:e -- W1:w1:w [color="#000000:#895956:#000000" straight=straight] + W1:w2:e -- W1:w2:w [color="#000000:#FF0000:#000000" straight=straight] + W1:w3:e -- W1:w3:w [color="#000000:#FF8000:#000000" straight=straight] + W1:w4:e -- W1:w4:w [color="#000000:#FFFF00:#000000" straight=straight] + W1:w5:e -- W1:w5:w [color="#000000" straight=straight] +} diff --git a/examples/ex16.html b/examples/ex16.html new file mode 100644 index 000000000..5d219a8c9 --- /dev/null +++ b/examples/ex16.html @@ -0,0 +1,382 @@ + + + + + ex16 + + +

ex16

+

Diagram

+ +
+ +
+ +
+ + + + + + + + +X1 + + + +X1 + +Molex KK 254 + +female + +7-pin + +GND + +1 + +VCC + +2 + +RX + +3 + +TX + +4 + +GND + +5 + +VCC + +6 + +GND + +7 +42 +mm +loopPartA +WireViz: 42XCD42A5 +74 +mm +loopPartB +WireViz: 42XCD42A5 + + + + +X1:e--X1:e + + + + +X1:e--X1:e + + + + +X1:e--X1:e + + + + + + + +W1 + + + +W1 + +Serial + +4x + +0.25 mm² (24 AWG) + ++ S + +0.2 m +  + X1:1:GND + +1:BN + +X2:1:GND + X1:2:VCC + +2:RD + +X2:2:VCC + X1:3:RX + +3:OG + +X2:4:TX + X1:4:TX + +4:YE + +X2:3:RX +  + X1:1:GND + +Shield + + +  + + + +X1:e--W1:w + + + + + + +X1:e--W1:w + + + + + + +X1:e--W1:w + + + + + + +X1:e--W1:w + + + + + + +X1:e--W1:w + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + +X2 + + + +X2 + +Molex KK 254 + +female + +7-pin + +1 + +GND + +2 + +VCC + +3 + +RX + +4 + +TX + +5 + +GND + +6 + +VCC + +7 + +GND +21 +mm +loopPartC +WireViz: 42XCD42A5 + + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + + + + +X2:w--X2:w + + + + +X2:w--X2:w + + + + +X2:w--X2:w + + + + + +
+ +
+ +
+ +

Bill of Materials

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#QtyUnitDescriptionDesignatorsManufacturerMPN
12Connector, Molex KK 254, female, 7 pinsX1, X2
21mCable, Serial, 4 x 0.25 mm² shieldedW1
342mmloopPartAX1WireViz42XCD42A5
474mmloopPartBX1WireViz42XCD42A5
521mmloopPartCX2WireViz42XCD42A5
+ +
+ + diff --git a/examples/ex16.png b/examples/ex16.png new file mode 100644 index 000000000..480ba395d Binary files /dev/null and b/examples/ex16.png differ diff --git a/examples/ex16.svg b/examples/ex16.svg new file mode 100644 index 000000000..3cced100f --- /dev/null +++ b/examples/ex16.svg @@ -0,0 +1,283 @@ + + + + + + + + + +X1 + + + +X1 + +Molex KK 254 + +female + +7-pin + +GND + +1 + +VCC + +2 + +RX + +3 + +TX + +4 + +GND + +5 + +VCC + +6 + +GND + +7 +42 +mm +loopPartA +WireViz: 42XCD42A5 +74 +mm +loopPartB +WireViz: 42XCD42A5 + + + + +X1:e--X1:e + + + + +X1:e--X1:e + + + + +X1:e--X1:e + + + + + + + +W1 + + + +W1 + +Serial + +4x + +0.25 mm² (24 AWG) + ++ S + +0.2 m +  + X1:1:GND + +1:BN + +X2:1:GND + X1:2:VCC + +2:RD + +X2:2:VCC + X1:3:RX + +3:OG + +X2:4:TX + X1:4:TX + +4:YE + +X2:3:RX +  + X1:1:GND + +Shield + + +  + + + +X1:e--W1:w + + + + + + +X1:e--W1:w + + + + + + +X1:e--W1:w + + + + + + +X1:e--W1:w + + + + + + +X1:e--W1:w + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + +X2 + + + +X2 + +Molex KK 254 + +female + +7-pin + +1 + +GND + +2 + +VCC + +3 + +RX + +4 + +TX + +5 + +GND + +6 + +VCC + +7 + +GND +21 +mm +loopPartC +WireViz: 42XCD42A5 + + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + + + + +X2:w--X2:w + + + + +X2:w--X2:w + + + + +X2:w--X2:w + + + + diff --git a/examples/ex16.yml b/examples/ex16.yml new file mode 100644 index 000000000..88ee7053b --- /dev/null +++ b/examples/ex16.yml @@ -0,0 +1,58 @@ +options: + mini_bom_mode: false # disable mini_bom to show difference to ex15 + +connectors: # This is based on ex1 and adds some Loops to the connectors + X1: + type: Molex KK 254 + subtype: female + pinlabels: [GND, VCC, RX, TX, GND, VCC, GND] + loops: # A List(Dict) of loops is created + LO1: [1, 5, 7] # First is the designator than a list of pins to be shorted + LO2: [2, 6] + additional_components: # Some Additional Components to describe the short in more detail + - references: LO1 + color: PK # The color of the short, can also be multicolor + manufacturer: WireViz + mpn: 42XCD42A5 + type: loopPartA + amount: 42 mm # The length or some other quantity + - references: LO2 + color: RDBUOGLB # multicolor example + manufacturer: WireViz + mpn: 42XCD42A5 + type: loopPartB + amount: 74 mm + + X2: + type: Molex KK 254 + subtype: female + pinlabels: [GND, VCC, RX, TX, GND, VCC, GND] + loops: + LO1: [1, 5, 7] + LO2: [2, 6] + additional_components: + - references: [LO1, LO2] # example to show how one additional_components can reference more than one short or loop + color: PK + manufacturer: WireViz + mpn: 42XCD42A5 + type: loopPartC + amount: 21 mm + +cables: + W1: + color_code: IEC + wirecount: 4 + gauge: 0.25 mm2 + show_equiv: true + length: 0.2 + shield: true + type: Serial + +connections: + - + - X1: [1-4] + - W1: [1-4] + - X2: [1,2,4,3] + - + - X1: 1 + - W1: s \ No newline at end of file diff --git a/examples/ex16_wv_gvpr.gvpr b/examples/ex16_wv_gvpr.gvpr new file mode 100644 index 000000000..7bfced78e --- /dev/null +++ b/examples/ex16_wv_gvpr.gvpr @@ -0,0 +1,64 @@ +/******************************************************************* + + see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 + input must include pos values (must be output from one of the engines w/ -Tdot)# + Thanks to steveroush and FeRDNYC + +*******************************************************************/ +BEG_G{ + double x1,y1,x2,y2,x3,y3,x4,y4; + string ptSize, tok[int], pt[]; + int cnt, circ, i; + node_t aNode; + + circ=0; + +/*************************************** + $G.bb=""; + $G.nodesep=""; + $G.ranksep=""; + $G.splines="true"; +****************************************/ +} + +// This removes the label text but keeps the position +E[noLabel] { + $.label=""; // remove pesky label + // $.lp=""; // remove peskier label pos +} + +E[straight] { + cnt=tokens($.pos,tok," "); + $.oldpos=$.pos; + x1 = xOf(tok[0]); + y1 = yOf(tok[0]); + x4 = xOf(tok[cnt-1]); + y4 = yOf(tok[cnt-1]); + x2 = x1 + (x4-x1)/3.; + y2 = y1 + (y4-y1)/3.; + x3 = x1 + 2.*(x4-x1)/3.; + y3 = y1 + 2.*(y4-y1)/3.; + pos=sprintf("%.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f", x1,y1, x2,y2, x3,y3, x4,y4); + $.label=""; // remove pesky label + $.lp=""; // remove peskier label pos + + if (hasAttr($, "addPTS") && $.addPTS!="" && $.colorPTS!=""){ + // now we place point nodes at the edge ends + pt[1] = tok[0]; + pt[2] = tok[cnt-1]; + ptSize=$.addPTS; + for (pt[i]) { + if (i==2 && pt[1]==pt[2]) + continue; + aNode=node($G, "__CIRCLE__" + (string)++circ); + aNode.pos=pt[i]; + aNode.shape="point"; + aNode.width=ptSize; + aNode.height=ptSize; + aNode.style="filled"; + aNode.fillcolor=$.colorPTS; + aNode.color=$.colorPTS; + } + } + +} \ No newline at end of file diff --git a/examples/readme.md b/examples/readme.md index cd2c8442e..739eac65b 100644 --- a/examples/readme.md +++ b/examples/readme.md @@ -84,27 +84,15 @@ [Source](ex14.yml) - [Bill of Materials](ex14.tsv) -## Example 11 -![](ex11.png) - -[Source](ex11.yml) - [Bill of Materials](ex11.bom.tsv) - - -## Example 12 -![](ex12.png) +## Example 15 +![](ex15.png) -[Source](ex12.yml) - [Bill of Materials](ex12.bom.tsv) +[Source](ex15.yml) - [Bill of Materials](ex15.tsv) -## Example 13 -![](ex13.png) - -[Source](ex13.yml) - [Bill of Materials](ex13.bom.tsv) - - -## Example 14 -![](ex14.png) +## Example 16 +![](ex16.png) -[Source](ex14.yml) - [Bill of Materials](ex14.bom.tsv) +[Source](ex16.yml) - [Bill of Materials](ex16.tsv) diff --git a/src/wireviz/wv_dataclasses.py b/src/wireviz/wv_dataclasses.py index ff7fa4b77..1009ade9c 100644 --- a/src/wireviz/wv_dataclasses.py +++ b/src/wireviz/wv_dataclasses.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- from collections import namedtuple -from dataclasses import dataclass, field +from dataclasses import dataclass, field, asdict from enum import Enum from itertools import zip_longest from typing import Any, Dict, List, Optional, Tuple, Union @@ -263,10 +263,14 @@ class AdditionalComponent(GraphicalComponent): explicit_qty: bool = True amount_computed: Optional[NumberAndUnit] = None note: str = None + color: Optional[MultiColor] = None + references: Optional[List[str]] = field(default_factory=list) def __post_init__(self): super().__post_init__() + self.color = MultiColor(self.color) + if isinstance(self.qty_multiplier, float) or isinstance( self.qty_multiplier, int ): @@ -307,7 +311,10 @@ class TopLevelGraphicalComponent(GraphicalComponent): # abstract class class Connector(TopLevelGraphicalComponent): # connector-specific properties style: Optional[str] = None - loops: List[List[Pin]] = field(default_factory=list) + # TODO: Move shorts and loops to PinClass + loops: Union[Dict[str, List[int]], List[List[int]]] = field(default_factory=dict) + shorts: Union[Dict[str, List[int]], List[List[int]]] = field(default_factory=dict) + shorts_hide_lable: bool = False # pin information in particular pincount: Optional[int] = None pins: List[Pin] = field(default_factory=list) # legacy @@ -412,20 +419,58 @@ def __post_init__(self) -> None: # hide pincount for simple (1 pin) connectors by default self.show_pincount = self.style != "simple" - for loop in self.loops: - # TODO: allow using pin labels in addition to pin numbers, - # just like when defining regular connections - # TODO: include properties of wire used to create the loop - if len(loop) != 2: - raise Exception("Loops must be between exactly two pins!") - for pin in loop: + # Convert short List to Short Dict + if type(self.shorts) == list: + self.shorts_hide_lable = True + shDict = dict() + for shIndex in range(0, len(self.shorts)): + key = "AutoSH" + str(shIndex) + shDict[key] = self.shorts[shIndex] + self.shorts = shDict + + # Convert loop List to loop Dict + if type(self.loops) == list: + loDict = dict() + for loIndex in range(0, len(self.loops)): + key = "AutoLO" + str(loIndex) + loDict[key] = self.loops[loIndex] + self.loops = loDict + + # TODO: allow using pin labels in addition to pin numbers, + # just like when defining regular connections + # TODO: include properties of wire used to create the loop + for loopName in self.loops: + for pin in self.loops[loopName]: + if pin not in self.pins: + raise Exception( + f'Unknown loop pin "{pin}" for connector "{self.designator}"!' + ) + # Make sure loop connected pins are not hidden. + self.activate_pin(pin, None) + for short in self.shorts: + for pin in self.shorts[short]: if pin not in self.pins: raise Exception( - f'Unknown loop pin "{pin}" for connector "{self.name}"!' + f'Unknown loop pin "{pin}" for connector "{self.designator}"!' ) # Make sure loop connected pins are not hidden. - # side=None, determine side to show loops during rendering - self.activate_pin(pin, side=None, is_connection=True) + self.activate_pin(pin, None) + + # TODO: Remove the outcommented code here if it is no longer needed as reference + # for loop in self.loops: + # # TODO: allow using pin labels in addition to pin numbers, + # # just like when defining regular connections + # # TODO: include properties of wire used to create the loop + # if len(loop) != 2: + # raise Exception("Loops must be between exactly two pins!") + # for pin in loop: + # if pin not in self.pins: + # raise Exception( + # f'Unknown loop pin "{pin}" for connector "{self.name}"!' + # ) + # # Make sure loop connected pins are not hidden. + # # side=None, determine side to show loops during rendering + # self.activate_pin(pin, side=None, is_connection=True) for i, item in enumerate(self.additional_components): if isinstance(item, dict): diff --git a/src/wireviz/wv_graphviz.py b/src/wireviz/wv_graphviz.py index 60d89ed1f..29ab52013 100644 --- a/src/wireviz/wv_graphviz.py +++ b/src/wireviz/wv_graphviz.py @@ -22,7 +22,7 @@ WireClass, ) from wireviz.wv_html import Img, Table, Td, Tr -from wireviz.wv_utils import html_line_breaks, remove_links +from wireviz.wv_utils import html_line_breaks, remove_links, getAddCompFromRef def gv_node_component(component: Component) -> Table: @@ -259,8 +259,28 @@ def nested_table_dict(d: dict) -> Table: return Table(rows, border=0, cellborder=1, cellpadding=3, cellspacing=0) + +def gv_shorts_info_row(component) -> Tr: + shorts_info = [] + if component.ports_left: + shorts_info.append(Td(f"")) + if component.pinlabels: + shorts_info.append(Td(f"")) + + for short in component.shorts: + shorts_info.append(Td(f"{short}")) + + if component.ports_right: + shorts_info.append(Td(f"")) + return Tr(shorts_info) + + def gv_pin_table(component) -> Table: pin_rows = [] + + if len(component.shorts) > 0 and not component.shorts_hide_lable: + pin_rows.append(gv_shorts_info_row(component)) + for pin in component.pin_objects.values(): if component.should_show_pin(pin.id): pin_rows.append(gv_pin_row(pin, component)) @@ -271,6 +291,16 @@ def gv_pin_table(component) -> Table: return tbl +def gv_short_row_part(pin, connector) -> List: + short_row = [] # Td("ADA"), Td("DAD") + for short, shPins in connector.shorts.items(): + if pin.index + 1 in shPins: + short_row.append(Td("", port=f"p{pin.index+1}j")) + else: + short_row.append(Td("")) + return short_row if len(short_row) > 0 else None + + def gv_pin_row(pin, connector) -> Tr: # ports in GraphViz are 1-indexed for more natural maping to pin/wire numbers has_pincolors = any([_pin.color for _pin in connector.pin_objects.values()]) @@ -279,6 +309,7 @@ def gv_pin_row(pin, connector) -> Tr: Td(pin.label, delete_if_empty=True), Td(str(pin.color) if pin.color else "", sides="TBL") if has_pincolors else None, Td(color_minitable(pin.color), sides="TBR") if has_pincolors else None, + gv_short_row_part(pin, connector), Td(pin.id, port=f"p{pin.index+1}r") if connector.ports_right else None, ] return Tr(cells) @@ -294,13 +325,36 @@ def gv_connector_loops(connector: Connector) -> List: loop_dir = "e" else: raise Exception("No side for loops") - for loop in connector.loops: - head = f"{connector.designator}:p{loop[0]}{loop_side}:{loop_dir}" - tail = f"{connector.designator}:p{loop[1]}{loop_side}:{loop_dir}" - loop_edges.append((head, tail)) + + for loop, loPins in connector.loops.items(): + comp = getAddCompFromRef(loop, connector) + loColor = "#000000" + if comp != None and comp.color != None: + loColor = comp.color.html + + for i in range(1, len(loPins)): + head = f"{connector.designator}:p{loPins[i - 1]}{loop_side}:{loop_dir}" + tail = f"{connector.designator}:p{loPins[i]}{loop_side}:{loop_dir}" + loop_edges.append((head, tail, loColor)) return loop_edges +def gv_connector_shorts(connector: Connector) -> List: + short_edges = [] + + for short, shPins in connector.shorts.items(): + comp = getAddCompFromRef(short, connector) + shColor = "#FFFFFF:#000000:#FFFFFF" + if comp != None and comp.color != None: + shColor = f"#FFFFFF:{comp.color.html}:#FFFFFF" + + for i in range(1, len(shPins)): + head = f"{connector.designator}:p{shPins[i - 1]}j:c" + tail = f"{connector.designator}:p{shPins[i]}j:c" + short_edges.append((head, tail, shColor)) + return short_edges + + def gv_conductor_table(cable) -> Table: rows = [] rows.append(Tr(Td(" "))) # spacer row on top @@ -363,37 +417,25 @@ def gv_conductor_table(cable) -> Table: def gv_wire_cell(wire: Union[WireClass, ShieldClass], colspan: int) -> Td: - if wire.color: - color_list = ["#000000"] + wire.color.html_padded_list + ["#000000"] - else: - color_list = ["#000000"] - - wire_inner_rows = [] - for j, bgcolor in enumerate(color_list[::-1]): - wire_inner_cell_attribs = { - "bgcolor": bgcolor if bgcolor != "" else "#000000", - "border": 0, - "cellpadding": 0, - "colspan": colspan, - "height": 2, - } - wire_inner_rows.append(Tr(Td("", **wire_inner_cell_attribs))) - wire_inner_table = Table(wire_inner_rows, border=0, cellborder=0, cellspacing=0) wire_outer_cell_attribs = { "border": 0, "cellspacing": 0, "cellpadding": 0, "colspan": colspan, - "height": 2 * len(color_list), + "height": 6, "port": f"w{wire.index+1}", } # ports in GraphViz are 1-indexed for more natural maping to pin/wire numbers - wire_outer_cell = Td(wire_inner_table, **wire_outer_cell_attribs) + wire_outer_cell = Td(None, **wire_outer_cell_attribs) return wire_outer_cell + dot.attr("edge", headclip="true", tailclip="true", style="bold") # TODO: ? + + -def gv_edge_wire(harness, cable, connection) -> Tuple[str, str, str, str, str]: + # color, l1, l2, r1, r2 +def gv_edge_wire(harness, cable, connection) -> Tuple[str, str, str, str, str]: if connection.via.color: # check if it's an actual wire and not a shield color = f"#000000:{connection.via.color.html_padded}:#000000" @@ -425,6 +467,24 @@ def gv_edge_wire(harness, cable, connection) -> Tuple[str, str, str, str, str]: return color, code_left_1, code_left_2, code_right_1, code_right_2 + # color, we, ww, +def gv_edge_wire_inside(cable) -> List[Tuple[str, str, str]]: + wires = [] + # print(cable.wire_objects) + for wire in cable.wire_objects.values(): + color = "#000000" + if wire.color: + # check if it's an actual wire and not a shield + color = f"#000000:{wire.color.html_padded}:#000000" + else: # it's a shield connection + color = "#000000" + + we = f"{wire.parent}:w{wire.index+1}:e" + ww = f"{wire.parent}:w{wire.index+1}:w" + + wires.append([color, we, ww]) + return wires + def parse_arrow_str(inp: str) -> ArrowDirection: if inp[0] == "<" and inp[-1] == ">": diff --git a/src/wireviz/wv_gvpr.gvpr b/src/wireviz/wv_gvpr.gvpr new file mode 100644 index 000000000..7bfced78e --- /dev/null +++ b/src/wireviz/wv_gvpr.gvpr @@ -0,0 +1,64 @@ +/******************************************************************* + + see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 + input must include pos values (must be output from one of the engines w/ -Tdot)# + Thanks to steveroush and FeRDNYC + +*******************************************************************/ +BEG_G{ + double x1,y1,x2,y2,x3,y3,x4,y4; + string ptSize, tok[int], pt[]; + int cnt, circ, i; + node_t aNode; + + circ=0; + +/*************************************** + $G.bb=""; + $G.nodesep=""; + $G.ranksep=""; + $G.splines="true"; +****************************************/ +} + +// This removes the label text but keeps the position +E[noLabel] { + $.label=""; // remove pesky label + // $.lp=""; // remove peskier label pos +} + +E[straight] { + cnt=tokens($.pos,tok," "); + $.oldpos=$.pos; + x1 = xOf(tok[0]); + y1 = yOf(tok[0]); + x4 = xOf(tok[cnt-1]); + y4 = yOf(tok[cnt-1]); + x2 = x1 + (x4-x1)/3.; + y2 = y1 + (y4-y1)/3.; + x3 = x1 + 2.*(x4-x1)/3.; + y3 = y1 + 2.*(y4-y1)/3.; + pos=sprintf("%.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f", x1,y1, x2,y2, x3,y3, x4,y4); + $.label=""; // remove pesky label + $.lp=""; // remove peskier label pos + + if (hasAttr($, "addPTS") && $.addPTS!="" && $.colorPTS!=""){ + // now we place point nodes at the edge ends + pt[1] = tok[0]; + pt[2] = tok[cnt-1]; + ptSize=$.addPTS; + for (pt[i]) { + if (i==2 && pt[1]==pt[2]) + continue; + aNode=node($G, "__CIRCLE__" + (string)++circ); + aNode.pos=pt[i]; + aNode.shape="point"; + aNode.width=ptSize; + aNode.height=ptSize; + aNode.style="filled"; + aNode.fillcolor=$.colorPTS; + aNode.color=$.colorPTS; + } + } + +} \ No newline at end of file diff --git a/src/wireviz/wv_harness.py b/src/wireviz/wv_harness.py index 95e920e32..209d5730f 100644 --- a/src/wireviz/wv_harness.py +++ b/src/wireviz/wv_harness.py @@ -1,9 +1,12 @@ # -*- coding: utf-8 -*- +import os +import shutil from collections import defaultdict -from dataclasses import dataclass, field +from dataclasses import dataclass, field, asdict from pathlib import Path from typing import List, Union +#from distutils.spawn import find_executable from graphviz import Graph @@ -24,13 +27,16 @@ Side, TopLevelGraphicalComponent, Tweak, + Image, ) from wireviz.wv_graphviz import ( apply_dot_tweaks, calculate_node_bgcolor, gv_connector_loops, + gv_connector_shorts, gv_edge_mate, gv_edge_wire, + gv_edge_wire_inside, gv_node_component, parse_arrow_str, set_dot_basics, @@ -40,8 +46,7 @@ embed_svg_images_file, generate_html_output, ) -from wireviz.wv_utils import OLD_CONNECTOR_ATTR, bom2tsv, check_old, file_write_text - +from wireviz.wv_utils import OLD_CONNECTOR_ATTR, bom2tsv, check_old, file_write_text, getAddCompFromRef @dataclass class Harness: @@ -322,9 +327,20 @@ def create_graph(self) -> Graph: if len(connector.loops) > 0: dot.attr("edge", color="#000000") loops = gv_connector_loops(connector) - for head, tail in loops: - dot.edge(head, tail, label=" ") - # ^ workaround to avoid oversized loops + for head, tail, color in loops: + dot.edge(head, tail, color = color, label = " ", noLabel="noLabel") + + # generate edges for connector shorts + if len(connector.shorts) > 0: + dot.attr("edge", color="#000000") + shorts = gv_connector_shorts(connector) + for head, tail, color in shorts: + dot.edge(head, tail, + color=color, + straight="straight", + addPTS=".18", # Size of the point at the end of the straight line/edge, it also enables the drawing of it + colorPTS=color.replace("#FFFFFF:", ""), + headclip="false", tailclip="false") # determine if there are double- or triple-colored wires in the harness; # if so, pad single-color wires to make all wires of equal thickness @@ -360,6 +376,9 @@ def create_graph(self) -> Graph: if not (r1, r2) == (None, None): dot.edge(r1, r2) + for color, we, ww in gv_edge_wire_inside(cable): + if not (we, ww) == (None, None): + dot.edge(we, ww, color=color, straight="straight") for mate in self.mates: color, dir, code_from, code_to = gv_edge_mate(mate) @@ -394,6 +413,22 @@ def png(self): def svg(self): # TODO?: Verify xml encoding="utf-8" in SVG? graph = self.graph return embed_svg_images(graph.pipe(format="svg").decode("utf-8"), Path.cwd()) + + def graphRender(self, type, filename, graph): + # Chack if the needed commands are existing + if shutil.which("dot") and shutil.which("gvpr") and shutil.which("neato"): + # Set enviorments variable to path of this file + os.environ['GVPRPATH'] = str(Path(__file__).parent) + # Export the gv output to a temporay file + graph.save(filename=f"{filename}_tmp.gv") + # Run the vomand and generait the output + os.system(f"dot {filename}_tmp.gv | gvpr -q -cf wv_gvpr.gvpr | neato -n2 -T{type} -o {filename}.{type}") + # Remove the temporary file + os.remove(f"{filename}_tmp.gv") + else: + print('The "dot", "gvpr" and "neato" comand where not found on the system, use old methode of generaiton, this may lead to not wanted output.') + graph.render(filename=filename) # old rendering methode, befor jumper implementations + def output( self, @@ -412,13 +447,17 @@ def output( _filename = f"{filename}.tmp" if f == "svg" else filename # TODO: prevent rendering SVG twice when both SVG and HTML are specified graph.format = f - graph.render(filename=_filename, view=view, cleanup=cleanup) + self.graphRender(f, _filename, graph) # embed images into SVG output if "svg" in fmt or "html" in fmt: embed_svg_images_file(f"{filename}.tmp.svg") # GraphViz output if "gv" in fmt: graph.save(filename=f"{filename}.gv") + # Print the needed comand for generaitong an output + filename_str = str(filename) + shutil.copyfile(str(Path(__file__).parent).replace('\\', '/') + "/wv_gvpr.gvpr", filename_str + "_wv_gvpr.gvpr") + print(f"Use: dot {filename_str}.gv | gvpr -q -cf {filename_str}_wv_gvpr.gvpr | neato -n2 -T -o {filename_str}.") # BOM output bomlist = bom_list(self.bom) # bomlist = [[]] diff --git a/src/wireviz/wv_utils.py b/src/wireviz/wv_utils.py index 1d364e346..abf906d4d 100644 --- a/src/wireviz/wv_utils.py +++ b/src/wireviz/wv_utils.py @@ -241,3 +241,10 @@ def check_old(node: str, old_attr: dict, args: dict) -> None: for attr, descr in old_attr.items(): if attr in args: raise ValueError(f"'{attr}' in {node}: '{attr}' {descr}") + +# Returns a Additional Component from with the given +def getAddCompFromRef(reference, part): + #print(part.additional_components) + for comp in part.additional_components: + if reference in comp.references: + return comp; \ No newline at end of file diff --git a/tests/bom/bomqty_wv_gvpr.gvpr b/tests/bom/bomqty_wv_gvpr.gvpr new file mode 100644 index 000000000..7bfced78e --- /dev/null +++ b/tests/bom/bomqty_wv_gvpr.gvpr @@ -0,0 +1,64 @@ +/******************************************************************* + + see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 + input must include pos values (must be output from one of the engines w/ -Tdot)# + Thanks to steveroush and FeRDNYC + +*******************************************************************/ +BEG_G{ + double x1,y1,x2,y2,x3,y3,x4,y4; + string ptSize, tok[int], pt[]; + int cnt, circ, i; + node_t aNode; + + circ=0; + +/*************************************** + $G.bb=""; + $G.nodesep=""; + $G.ranksep=""; + $G.splines="true"; +****************************************/ +} + +// This removes the label text but keeps the position +E[noLabel] { + $.label=""; // remove pesky label + // $.lp=""; // remove peskier label pos +} + +E[straight] { + cnt=tokens($.pos,tok," "); + $.oldpos=$.pos; + x1 = xOf(tok[0]); + y1 = yOf(tok[0]); + x4 = xOf(tok[cnt-1]); + y4 = yOf(tok[cnt-1]); + x2 = x1 + (x4-x1)/3.; + y2 = y1 + (y4-y1)/3.; + x3 = x1 + 2.*(x4-x1)/3.; + y3 = y1 + 2.*(y4-y1)/3.; + pos=sprintf("%.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f", x1,y1, x2,y2, x3,y3, x4,y4); + $.label=""; // remove pesky label + $.lp=""; // remove peskier label pos + + if (hasAttr($, "addPTS") && $.addPTS!="" && $.colorPTS!=""){ + // now we place point nodes at the edge ends + pt[1] = tok[0]; + pt[2] = tok[cnt-1]; + ptSize=$.addPTS; + for (pt[i]) { + if (i==2 && pt[1]==pt[2]) + continue; + aNode=node($G, "__CIRCLE__" + (string)++circ); + aNode.pos=pt[i]; + aNode.shape="point"; + aNode.width=ptSize; + aNode.height=ptSize; + aNode.style="filled"; + aNode.fillcolor=$.colorPTS; + aNode.color=$.colorPTS; + } + } + +} \ No newline at end of file diff --git a/tests/rendering/00_minimal_wv_gvpr.gvpr b/tests/rendering/00_minimal_wv_gvpr.gvpr new file mode 100644 index 000000000..7bfced78e --- /dev/null +++ b/tests/rendering/00_minimal_wv_gvpr.gvpr @@ -0,0 +1,64 @@ +/******************************************************************* + + see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 + input must include pos values (must be output from one of the engines w/ -Tdot)# + Thanks to steveroush and FeRDNYC + +*******************************************************************/ +BEG_G{ + double x1,y1,x2,y2,x3,y3,x4,y4; + string ptSize, tok[int], pt[]; + int cnt, circ, i; + node_t aNode; + + circ=0; + +/*************************************** + $G.bb=""; + $G.nodesep=""; + $G.ranksep=""; + $G.splines="true"; +****************************************/ +} + +// This removes the label text but keeps the position +E[noLabel] { + $.label=""; // remove pesky label + // $.lp=""; // remove peskier label pos +} + +E[straight] { + cnt=tokens($.pos,tok," "); + $.oldpos=$.pos; + x1 = xOf(tok[0]); + y1 = yOf(tok[0]); + x4 = xOf(tok[cnt-1]); + y4 = yOf(tok[cnt-1]); + x2 = x1 + (x4-x1)/3.; + y2 = y1 + (y4-y1)/3.; + x3 = x1 + 2.*(x4-x1)/3.; + y3 = y1 + 2.*(y4-y1)/3.; + pos=sprintf("%.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f", x1,y1, x2,y2, x3,y3, x4,y4); + $.label=""; // remove pesky label + $.lp=""; // remove peskier label pos + + if (hasAttr($, "addPTS") && $.addPTS!="" && $.colorPTS!=""){ + // now we place point nodes at the edge ends + pt[1] = tok[0]; + pt[2] = tok[cnt-1]; + ptSize=$.addPTS; + for (pt[i]) { + if (i==2 && pt[1]==pt[2]) + continue; + aNode=node($G, "__CIRCLE__" + (string)++circ); + aNode.pos=pt[i]; + aNode.shape="point"; + aNode.width=ptSize; + aNode.height=ptSize; + aNode.style="filled"; + aNode.fillcolor=$.colorPTS; + aNode.color=$.colorPTS; + } + } + +} \ No newline at end of file diff --git a/tests/rendering/01_color_single_wv_gvpr.gvpr b/tests/rendering/01_color_single_wv_gvpr.gvpr new file mode 100644 index 000000000..7bfced78e --- /dev/null +++ b/tests/rendering/01_color_single_wv_gvpr.gvpr @@ -0,0 +1,64 @@ +/******************************************************************* + + see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 + input must include pos values (must be output from one of the engines w/ -Tdot)# + Thanks to steveroush and FeRDNYC + +*******************************************************************/ +BEG_G{ + double x1,y1,x2,y2,x3,y3,x4,y4; + string ptSize, tok[int], pt[]; + int cnt, circ, i; + node_t aNode; + + circ=0; + +/*************************************** + $G.bb=""; + $G.nodesep=""; + $G.ranksep=""; + $G.splines="true"; +****************************************/ +} + +// This removes the label text but keeps the position +E[noLabel] { + $.label=""; // remove pesky label + // $.lp=""; // remove peskier label pos +} + +E[straight] { + cnt=tokens($.pos,tok," "); + $.oldpos=$.pos; + x1 = xOf(tok[0]); + y1 = yOf(tok[0]); + x4 = xOf(tok[cnt-1]); + y4 = yOf(tok[cnt-1]); + x2 = x1 + (x4-x1)/3.; + y2 = y1 + (y4-y1)/3.; + x3 = x1 + 2.*(x4-x1)/3.; + y3 = y1 + 2.*(y4-y1)/3.; + pos=sprintf("%.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f", x1,y1, x2,y2, x3,y3, x4,y4); + $.label=""; // remove pesky label + $.lp=""; // remove peskier label pos + + if (hasAttr($, "addPTS") && $.addPTS!="" && $.colorPTS!=""){ + // now we place point nodes at the edge ends + pt[1] = tok[0]; + pt[2] = tok[cnt-1]; + ptSize=$.addPTS; + for (pt[i]) { + if (i==2 && pt[1]==pt[2]) + continue; + aNode=node($G, "__CIRCLE__" + (string)++circ); + aNode.pos=pt[i]; + aNode.shape="point"; + aNode.width=ptSize; + aNode.height=ptSize; + aNode.style="filled"; + aNode.fillcolor=$.colorPTS; + aNode.color=$.colorPTS; + } + } + +} \ No newline at end of file diff --git a/tests/rendering/02_color_multi_wv_gvpr.gvpr b/tests/rendering/02_color_multi_wv_gvpr.gvpr new file mode 100644 index 000000000..7bfced78e --- /dev/null +++ b/tests/rendering/02_color_multi_wv_gvpr.gvpr @@ -0,0 +1,64 @@ +/******************************************************************* + + see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 + input must include pos values (must be output from one of the engines w/ -Tdot)# + Thanks to steveroush and FeRDNYC + +*******************************************************************/ +BEG_G{ + double x1,y1,x2,y2,x3,y3,x4,y4; + string ptSize, tok[int], pt[]; + int cnt, circ, i; + node_t aNode; + + circ=0; + +/*************************************** + $G.bb=""; + $G.nodesep=""; + $G.ranksep=""; + $G.splines="true"; +****************************************/ +} + +// This removes the label text but keeps the position +E[noLabel] { + $.label=""; // remove pesky label + // $.lp=""; // remove peskier label pos +} + +E[straight] { + cnt=tokens($.pos,tok," "); + $.oldpos=$.pos; + x1 = xOf(tok[0]); + y1 = yOf(tok[0]); + x4 = xOf(tok[cnt-1]); + y4 = yOf(tok[cnt-1]); + x2 = x1 + (x4-x1)/3.; + y2 = y1 + (y4-y1)/3.; + x3 = x1 + 2.*(x4-x1)/3.; + y3 = y1 + 2.*(y4-y1)/3.; + pos=sprintf("%.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f", x1,y1, x2,y2, x3,y3, x4,y4); + $.label=""; // remove pesky label + $.lp=""; // remove peskier label pos + + if (hasAttr($, "addPTS") && $.addPTS!="" && $.colorPTS!=""){ + // now we place point nodes at the edge ends + pt[1] = tok[0]; + pt[2] = tok[cnt-1]; + ptSize=$.addPTS; + for (pt[i]) { + if (i==2 && pt[1]==pt[2]) + continue; + aNode=node($G, "__CIRCLE__" + (string)++circ); + aNode.pos=pt[i]; + aNode.shape="point"; + aNode.width=ptSize; + aNode.height=ptSize; + aNode.style="filled"; + aNode.fillcolor=$.colorPTS; + aNode.color=$.colorPTS; + } + } + +} \ No newline at end of file diff --git a/tests/rendering/03_bgcolors_wv_gvpr.gvpr b/tests/rendering/03_bgcolors_wv_gvpr.gvpr new file mode 100644 index 000000000..7bfced78e --- /dev/null +++ b/tests/rendering/03_bgcolors_wv_gvpr.gvpr @@ -0,0 +1,64 @@ +/******************************************************************* + + see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 + input must include pos values (must be output from one of the engines w/ -Tdot)# + Thanks to steveroush and FeRDNYC + +*******************************************************************/ +BEG_G{ + double x1,y1,x2,y2,x3,y3,x4,y4; + string ptSize, tok[int], pt[]; + int cnt, circ, i; + node_t aNode; + + circ=0; + +/*************************************** + $G.bb=""; + $G.nodesep=""; + $G.ranksep=""; + $G.splines="true"; +****************************************/ +} + +// This removes the label text but keeps the position +E[noLabel] { + $.label=""; // remove pesky label + // $.lp=""; // remove peskier label pos +} + +E[straight] { + cnt=tokens($.pos,tok," "); + $.oldpos=$.pos; + x1 = xOf(tok[0]); + y1 = yOf(tok[0]); + x4 = xOf(tok[cnt-1]); + y4 = yOf(tok[cnt-1]); + x2 = x1 + (x4-x1)/3.; + y2 = y1 + (y4-y1)/3.; + x3 = x1 + 2.*(x4-x1)/3.; + y3 = y1 + 2.*(y4-y1)/3.; + pos=sprintf("%.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f", x1,y1, x2,y2, x3,y3, x4,y4); + $.label=""; // remove pesky label + $.lp=""; // remove peskier label pos + + if (hasAttr($, "addPTS") && $.addPTS!="" && $.colorPTS!=""){ + // now we place point nodes at the edge ends + pt[1] = tok[0]; + pt[2] = tok[cnt-1]; + ptSize=$.addPTS; + for (pt[i]) { + if (i==2 && pt[1]==pt[2]) + continue; + aNode=node($G, "__CIRCLE__" + (string)++circ); + aNode.pos=pt[i]; + aNode.shape="point"; + aNode.width=ptSize; + aNode.height=ptSize; + aNode.style="filled"; + aNode.fillcolor=$.colorPTS; + aNode.color=$.colorPTS; + } + } + +} \ No newline at end of file diff --git a/tutorial/tutorial01.gv b/tutorial/tutorial01.gv index 2503f3b48..4505f760e 100644 --- a/tutorial/tutorial01.gv +++ b/tutorial/tutorial01.gv @@ -127,13 +127,7 @@ graph { X2:1 - - - - - -
- + X1:2 @@ -143,13 +137,7 @@ graph { X2:2 - - - - - -
- + X1:3 @@ -159,13 +147,7 @@ graph { X2:3 - - - - - -
- + X1:4 @@ -175,13 +157,7 @@ graph { X2:4 - - - - - -
- +   @@ -203,4 +179,8 @@ graph { edge [color="#000000"] X1:p4r:e -- W1:w4:w W1:w4:e -- X2:p4l:w + W1:w1:e -- W1:w1:w [color="#000000" straight=straight] + W1:w2:e -- W1:w2:w [color="#000000" straight=straight] + W1:w3:e -- W1:w3:w [color="#000000" straight=straight] + W1:w4:e -- W1:w4:w [color="#000000" straight=straight] } diff --git a/tutorial/tutorial01.html b/tutorial/tutorial01.html index 271fd05f3..3d5e0a9e8 100644 --- a/tutorial/tutorial01.html +++ b/tutorial/tutorial01.html @@ -30,126 +30,142 @@

Diagram

- - - - + + + X1 - - - -X1 - -4-pin - -1 - -2 - -3 - -4 + + + +X1 + +4-pin + +1 + +2 + +3 + +4 - + W1 - - - -W1 - -4x - -1 m -  - X1:1 - -1 - -X2:1 - - X1:2 - -2 - -X2:2 - - X1:3 - -3 - -X2:3 - - X1:4 - -4 - -X2:4 - -  + + + +W1 + +4x + +1 m +  + X1:1 + +1 + +X2:1 + X1:2 + +2 + +X2:2 + X1:3 + +3 + +X2:3 + X1:4 + +4 + +X2:4 +  X1:e--W1:w - + - + X1:e--W1:w - + - + X1:e--W1:w - + - + X1:e--W1:w - + + + + +W1:e--W1:w + + + + +W1:e--W1:w + + + + +W1:e--W1:w + + + + +W1:e--W1:w + - + X2 - - - -X2 - -4-pin - -1 - -2 - -3 - -4 + + + +X2 + +4-pin + +1 + +2 + +3 + +4 - + W1:e--X2:w - + - + W1:e--X2:w - + - + W1:e--X2:w - + - + W1:e--X2:w - + diff --git a/tutorial/tutorial01.png b/tutorial/tutorial01.png index e93b3dec3..b858f164f 100644 Binary files a/tutorial/tutorial01.png and b/tutorial/tutorial01.png differ diff --git a/tutorial/tutorial01.svg b/tutorial/tutorial01.svg index 1c871c13e..b3633a95b 100644 --- a/tutorial/tutorial01.svg +++ b/tutorial/tutorial01.svg @@ -1,126 +1,142 @@ - - - - + + + X1 - - - -X1 - -4-pin - -1 - -2 - -3 - -4 + + + +X1 + +4-pin + +1 + +2 + +3 + +4 - + W1 - - - -W1 - -4x - -1 m -  - X1:1 - -1 - -X2:1 - - X1:2 - -2 - -X2:2 - - X1:3 - -3 - -X2:3 - - X1:4 - -4 - -X2:4 - -  + + + +W1 + +4x + +1 m +  + X1:1 + +1 + +X2:1 + X1:2 + +2 + +X2:2 + X1:3 + +3 + +X2:3 + X1:4 + +4 + +X2:4 +  X1:e--W1:w - + - + X1:e--W1:w - + - + X1:e--W1:w - + - + X1:e--W1:w - + + + + +W1:e--W1:w + + + + +W1:e--W1:w + + + + +W1:e--W1:w + + + + +W1:e--W1:w + - + X2 - - - -X2 - -4-pin - -1 - -2 - -3 - -4 + + + +X2 + +4-pin + +1 + +2 + +3 + +4 - + W1:e--X2:w - + - + W1:e--X2:w - + - + W1:e--X2:w - + - + W1:e--X2:w - + diff --git a/tutorial/tutorial01_wv_gvpr.gvpr b/tutorial/tutorial01_wv_gvpr.gvpr new file mode 100644 index 000000000..7bfced78e --- /dev/null +++ b/tutorial/tutorial01_wv_gvpr.gvpr @@ -0,0 +1,64 @@ +/******************************************************************* + + see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 + input must include pos values (must be output from one of the engines w/ -Tdot)# + Thanks to steveroush and FeRDNYC + +*******************************************************************/ +BEG_G{ + double x1,y1,x2,y2,x3,y3,x4,y4; + string ptSize, tok[int], pt[]; + int cnt, circ, i; + node_t aNode; + + circ=0; + +/*************************************** + $G.bb=""; + $G.nodesep=""; + $G.ranksep=""; + $G.splines="true"; +****************************************/ +} + +// This removes the label text but keeps the position +E[noLabel] { + $.label=""; // remove pesky label + // $.lp=""; // remove peskier label pos +} + +E[straight] { + cnt=tokens($.pos,tok," "); + $.oldpos=$.pos; + x1 = xOf(tok[0]); + y1 = yOf(tok[0]); + x4 = xOf(tok[cnt-1]); + y4 = yOf(tok[cnt-1]); + x2 = x1 + (x4-x1)/3.; + y2 = y1 + (y4-y1)/3.; + x3 = x1 + 2.*(x4-x1)/3.; + y3 = y1 + 2.*(y4-y1)/3.; + pos=sprintf("%.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f", x1,y1, x2,y2, x3,y3, x4,y4); + $.label=""; // remove pesky label + $.lp=""; // remove peskier label pos + + if (hasAttr($, "addPTS") && $.addPTS!="" && $.colorPTS!=""){ + // now we place point nodes at the edge ends + pt[1] = tok[0]; + pt[2] = tok[cnt-1]; + ptSize=$.addPTS; + for (pt[i]) { + if (i==2 && pt[1]==pt[2]) + continue; + aNode=node($G, "__CIRCLE__" + (string)++circ); + aNode.pos=pt[i]; + aNode.shape="point"; + aNode.width=ptSize; + aNode.height=ptSize; + aNode.style="filled"; + aNode.fillcolor=$.colorPTS; + aNode.color=$.colorPTS; + } + } + +} \ No newline at end of file diff --git a/tutorial/tutorial02.gv b/tutorial/tutorial02.gv index 227eaae31..5e80f292e 100644 --- a/tutorial/tutorial02.gv +++ b/tutorial/tutorial02.gv @@ -132,19 +132,7 @@ graph { X2:1
- -
- - - - - - - - - -
- + X1:2 @@ -154,19 +142,7 @@ graph { X2:2 - - - - - - - - - - - -
- + X1:3 @@ -176,19 +152,7 @@ graph { X2:4 - - - - - - - - - - - -
- + X1:4 @@ -198,19 +162,7 @@ graph { X2:3 - - - - - - - - - - - -
- +   @@ -232,4 +184,8 @@ graph { edge [color="#000000:#FFFF00:#000000"] X1:p4r:e -- W1:w4:w W1:w4:e -- X2:p3l:w + W1:w1:e -- W1:w1:w [color="#000000:#FFFFFF:#000000" straight=straight] + W1:w2:e -- W1:w2:w [color="#000000:#895956:#000000" straight=straight] + W1:w3:e -- W1:w3:w [color="#000000:#00AA00:#000000" straight=straight] + W1:w4:e -- W1:w4:w [color="#000000:#FFFF00:#000000" straight=straight] } diff --git a/tutorial/tutorial02.html b/tutorial/tutorial02.html index e43e2f20a..ee740f63f 100644 --- a/tutorial/tutorial02.html +++ b/tutorial/tutorial02.html @@ -30,160 +30,176 @@

Diagram

- - - - + + + X1 - - - -X1 - -Molex KK 254 - -female - -4-pin - -1 - -2 - -3 - -4 + + + +X1 + +Molex KK 254 + +female + +4-pin + +1 + +2 + +3 + +4 - + W1 - - - -W1 - -4x - -0.25 mm² (24 AWG) - -1 m -  - X1:1 - -1:WH - -X2:1 - - - - X1:2 - -2:BN - -X2:2 - - - - X1:3 - -3:GN - -X2:4 - - - - X1:4 - -4:YE - -X2:3 - - - -  + + + +W1 + +4x + +0.25 mm² (24 AWG) + +1 m +  + X1:1 + +1:WH + +X2:1 + X1:2 + +2:BN + +X2:2 + X1:3 + +3:GN + +X2:4 + X1:4 + +4:YE + +X2:3 +  X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + - + X2 - - - -X2 - -Molex KK 254 - -female - -4-pin - -1 - -2 - -3 - -4 + + + +X2 + +Molex KK 254 + +female + +4-pin + +1 + +2 + +3 + +4 - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + diff --git a/tutorial/tutorial02.png b/tutorial/tutorial02.png index ba6902c98..78d7268a3 100644 Binary files a/tutorial/tutorial02.png and b/tutorial/tutorial02.png differ diff --git a/tutorial/tutorial02.svg b/tutorial/tutorial02.svg index 786d59933..94c54b9e7 100644 --- a/tutorial/tutorial02.svg +++ b/tutorial/tutorial02.svg @@ -1,160 +1,176 @@ - - - - + + + X1 - - - -X1 - -Molex KK 254 - -female - -4-pin - -1 - -2 - -3 - -4 + + + +X1 + +Molex KK 254 + +female + +4-pin + +1 + +2 + +3 + +4 - + W1 - - - -W1 - -4x - -0.25 mm² (24 AWG) - -1 m -  - X1:1 - -1:WH - -X2:1 - - - - X1:2 - -2:BN - -X2:2 - - - - X1:3 - -3:GN - -X2:4 - - - - X1:4 - -4:YE - -X2:3 - - - -  + + + +W1 + +4x + +0.25 mm² (24 AWG) + +1 m +  + X1:1 + +1:WH + +X2:1 + X1:2 + +2:BN + +X2:2 + X1:3 + +3:GN + +X2:4 + X1:4 + +4:YE + +X2:3 +  X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + - + X2 - - - -X2 - -Molex KK 254 - -female - -4-pin - -1 - -2 - -3 - -4 + + + +X2 + +Molex KK 254 + +female + +4-pin + +1 + +2 + +3 + +4 - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + diff --git a/tutorial/tutorial02_wv_gvpr.gvpr b/tutorial/tutorial02_wv_gvpr.gvpr new file mode 100644 index 000000000..7bfced78e --- /dev/null +++ b/tutorial/tutorial02_wv_gvpr.gvpr @@ -0,0 +1,64 @@ +/******************************************************************* + + see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 + input must include pos values (must be output from one of the engines w/ -Tdot)# + Thanks to steveroush and FeRDNYC + +*******************************************************************/ +BEG_G{ + double x1,y1,x2,y2,x3,y3,x4,y4; + string ptSize, tok[int], pt[]; + int cnt, circ, i; + node_t aNode; + + circ=0; + +/*************************************** + $G.bb=""; + $G.nodesep=""; + $G.ranksep=""; + $G.splines="true"; +****************************************/ +} + +// This removes the label text but keeps the position +E[noLabel] { + $.label=""; // remove pesky label + // $.lp=""; // remove peskier label pos +} + +E[straight] { + cnt=tokens($.pos,tok," "); + $.oldpos=$.pos; + x1 = xOf(tok[0]); + y1 = yOf(tok[0]); + x4 = xOf(tok[cnt-1]); + y4 = yOf(tok[cnt-1]); + x2 = x1 + (x4-x1)/3.; + y2 = y1 + (y4-y1)/3.; + x3 = x1 + 2.*(x4-x1)/3.; + y3 = y1 + 2.*(y4-y1)/3.; + pos=sprintf("%.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f", x1,y1, x2,y2, x3,y3, x4,y4); + $.label=""; // remove pesky label + $.lp=""; // remove peskier label pos + + if (hasAttr($, "addPTS") && $.addPTS!="" && $.colorPTS!=""){ + // now we place point nodes at the edge ends + pt[1] = tok[0]; + pt[2] = tok[cnt-1]; + ptSize=$.addPTS; + for (pt[i]) { + if (i==2 && pt[1]==pt[2]) + continue; + aNode=node($G, "__CIRCLE__" + (string)++circ); + aNode.pos=pt[i]; + aNode.shape="point"; + aNode.width=ptSize; + aNode.height=ptSize; + aNode.style="filled"; + aNode.fillcolor=$.colorPTS; + aNode.color=$.colorPTS; + } + } + +} \ No newline at end of file diff --git a/tutorial/tutorial03.gv b/tutorial/tutorial03.gv index 91fa7d62a..562dcb3a5 100644 --- a/tutorial/tutorial03.gv +++ b/tutorial/tutorial03.gv @@ -133,19 +133,7 @@ graph { X2:1:GND
- -
- - - - - - - - - -
- + X1:2:VCC @@ -155,19 +143,7 @@ graph { X2:2:VCC - - - - - - - - - - - -
- + X1:3:RX @@ -177,19 +153,7 @@ graph { X2:4:TX - - - - - - - - - - - -
- + X1:4:TX @@ -199,19 +163,7 @@ graph { X2:3:RX - - - - - - - - - - - -
- +   @@ -224,13 +176,7 @@ graph { - - - - - -
- +   @@ -254,4 +200,9 @@ graph { W1:w4:e -- X2:p3l:w edge [color="#000000"] X1:p1r:e -- W1:w5:w + W1:w1:e -- W1:w1:w [color="#000000:#FFFFFF:#000000" straight=straight] + W1:w2:e -- W1:w2:w [color="#000000:#895956:#000000" straight=straight] + W1:w3:e -- W1:w3:w [color="#000000:#00AA00:#000000" straight=straight] + W1:w4:e -- W1:w4:w [color="#000000:#FFFF00:#000000" straight=straight] + W1:w5:e -- W1:w5:w [color="#000000" straight=straight] } diff --git a/tutorial/tutorial03.html b/tutorial/tutorial03.html index b76440ff0..28addd0c8 100644 --- a/tutorial/tutorial03.html +++ b/tutorial/tutorial03.html @@ -30,190 +30,210 @@

Diagram

- - - - + + + X1 - - - -X1 - -Molex KK 254 - -female - -4-pin - -GND - -1 - -VCC - -2 - -RX - -3 - -TX - -4 + + + +X1 + +Molex KK 254 + +female + +4-pin + +GND + +1 + +VCC + +2 + +RX + +3 + +TX + +4 - + W1 - - - -W1 - -4x - -0.25 mm² (24 AWG) - -+ S - -1 m -  - X1:1:GND - -1:WH - -X2:1:GND - - - - X1:2:VCC - -2:BN - -X2:2:VCC - - - - X1:3:RX - -3:GN - -X2:4:TX - - - - X1:4:TX - -4:YE - -X2:3:RX - - - -  - X1:1:GND - -Shield - - - -  + + + +W1 + +4x + +0.25 mm² (24 AWG) + ++ S + +1 m +  + X1:1:GND + +1:WH + +X2:1:GND + X1:2:VCC + +2:BN + +X2:2:VCC + X1:3:RX + +3:GN + +X2:4:TX + X1:4:TX + +4:YE + +X2:3:RX +  + X1:1:GND + +Shield + + +  X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + - + X2 - - - -X2 - -Molex KK 254 - -female - -4-pin - -1 - -GND - -2 - -VCC - -3 - -RX - -4 - -TX + + + +X2 + +Molex KK 254 + +female + +4-pin + +1 + +GND + +2 + +VCC + +3 + +RX + +4 + +TX - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + diff --git a/tutorial/tutorial03.png b/tutorial/tutorial03.png index 9bca81725..131c7437a 100644 Binary files a/tutorial/tutorial03.png and b/tutorial/tutorial03.png differ diff --git a/tutorial/tutorial03.svg b/tutorial/tutorial03.svg index aef9b8537..06b505806 100644 --- a/tutorial/tutorial03.svg +++ b/tutorial/tutorial03.svg @@ -1,190 +1,210 @@ - - - - + + + X1 - - - -X1 - -Molex KK 254 - -female - -4-pin - -GND - -1 - -VCC - -2 - -RX - -3 - -TX - -4 + + + +X1 + +Molex KK 254 + +female + +4-pin + +GND + +1 + +VCC + +2 + +RX + +3 + +TX + +4 - + W1 - - - -W1 - -4x - -0.25 mm² (24 AWG) - -+ S - -1 m -  - X1:1:GND - -1:WH - -X2:1:GND - - - - X1:2:VCC - -2:BN - -X2:2:VCC - - - - X1:3:RX - -3:GN - -X2:4:TX - - - - X1:4:TX - -4:YE - -X2:3:RX - - - -  - X1:1:GND - -Shield - - - -  + + + +W1 + +4x + +0.25 mm² (24 AWG) + ++ S + +1 m +  + X1:1:GND + +1:WH + +X2:1:GND + X1:2:VCC + +2:BN + +X2:2:VCC + X1:3:RX + +3:GN + +X2:4:TX + X1:4:TX + +4:YE + +X2:3:RX +  + X1:1:GND + +Shield + + +  X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + - + X2 - - - -X2 - -Molex KK 254 - -female - -4-pin - -1 - -GND - -2 - -VCC - -3 - -RX - -4 - -TX + + + +X2 + +Molex KK 254 + +female + +4-pin + +1 + +GND + +2 + +VCC + +3 + +RX + +4 + +TX - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + diff --git a/tutorial/tutorial03_wv_gvpr.gvpr b/tutorial/tutorial03_wv_gvpr.gvpr new file mode 100644 index 000000000..7bfced78e --- /dev/null +++ b/tutorial/tutorial03_wv_gvpr.gvpr @@ -0,0 +1,64 @@ +/******************************************************************* + + see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 + input must include pos values (must be output from one of the engines w/ -Tdot)# + Thanks to steveroush and FeRDNYC + +*******************************************************************/ +BEG_G{ + double x1,y1,x2,y2,x3,y3,x4,y4; + string ptSize, tok[int], pt[]; + int cnt, circ, i; + node_t aNode; + + circ=0; + +/*************************************** + $G.bb=""; + $G.nodesep=""; + $G.ranksep=""; + $G.splines="true"; +****************************************/ +} + +// This removes the label text but keeps the position +E[noLabel] { + $.label=""; // remove pesky label + // $.lp=""; // remove peskier label pos +} + +E[straight] { + cnt=tokens($.pos,tok," "); + $.oldpos=$.pos; + x1 = xOf(tok[0]); + y1 = yOf(tok[0]); + x4 = xOf(tok[cnt-1]); + y4 = yOf(tok[cnt-1]); + x2 = x1 + (x4-x1)/3.; + y2 = y1 + (y4-y1)/3.; + x3 = x1 + 2.*(x4-x1)/3.; + y3 = y1 + 2.*(y4-y1)/3.; + pos=sprintf("%.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f", x1,y1, x2,y2, x3,y3, x4,y4); + $.label=""; // remove pesky label + $.lp=""; // remove peskier label pos + + if (hasAttr($, "addPTS") && $.addPTS!="" && $.colorPTS!=""){ + // now we place point nodes at the edge ends + pt[1] = tok[0]; + pt[2] = tok[cnt-1]; + ptSize=$.addPTS; + for (pt[i]) { + if (i==2 && pt[1]==pt[2]) + continue; + aNode=node($G, "__CIRCLE__" + (string)++circ); + aNode.pos=pt[i]; + aNode.shape="point"; + aNode.width=ptSize; + aNode.height=ptSize; + aNode.style="filled"; + aNode.fillcolor=$.colorPTS; + aNode.color=$.colorPTS; + } + } + +} \ No newline at end of file diff --git a/tutorial/tutorial04.gv b/tutorial/tutorial04.gv index f506f2b26..eb153352c 100644 --- a/tutorial/tutorial04.gv +++ b/tutorial/tutorial04.gv @@ -209,19 +209,7 @@ graph { X2:1:GND
- -
- - - - - - - - - -
- + X1:2:VCC @@ -231,19 +219,7 @@ graph { X2:2:VCC - - - - - - - - - - - -
- + X1:3:SCL @@ -253,19 +229,7 @@ graph { X2:3:SCL - - - - - - - - - - - -
- + X1:4:SDA @@ -275,19 +239,7 @@ graph { X2:4:SDA - - - - - - - - - - - -
- +   @@ -318,6 +270,10 @@ graph { edge [color="#000000:#FFFF00:#000000"] X1:p4r:e -- W1:w4:w W1:w4:e -- X2:p4l:w + W1:w1:e -- W1:w1:w [color="#000000:#895956:#000000" straight=straight] + W1:w2:e -- W1:w2:w [color="#000000:#FF0000:#000000" straight=straight] + W1:w3:e -- W1:w3:w [color="#000000:#FF8000:#000000" straight=straight] + W1:w4:e -- W1:w4:w [color="#000000:#FFFF00:#000000" straight=straight] W2 [label=< @@ -354,19 +310,7 @@ graph { - + @@ -376,19 +320,7 @@ graph { - + @@ -398,19 +330,7 @@ graph { - + @@ -420,19 +340,7 @@ graph { - + @@ -463,4 +371,8 @@ graph { edge [color="#000000:#FFFF00:#000000"] X2:p4r:e -- W2:w4:w W2:w4:e -- X3:p4l:w + W2:w1:e -- W2:w1:w [color="#000000:#895956:#000000" straight=straight] + W2:w2:e -- W2:w2:w [color="#000000:#FF0000:#000000" straight=straight] + W2:w3:e -- W2:w3:w [color="#000000:#FF8000:#000000" straight=straight] + W2:w4:e -- W2:w4:w [color="#000000:#FFFF00:#000000" straight=straight] } diff --git a/tutorial/tutorial04.html b/tutorial/tutorial04.html index 41c4c8cda..9a74a262a 100644 --- a/tutorial/tutorial04.html +++ b/tutorial/tutorial04.html @@ -30,328 +30,360 @@

Diagram

- - - - + + + X1 - - - -X1 - -Molex KK 254 - -male - -4-pin - -GND - -1 - -VCC - -2 - -SCL - -3 - -SDA - -4 - -to microcontroller + + + +X1 + +Molex KK 254 + +male + +4-pin + +GND + +1 + +VCC + +2 + +SCL + +3 + +SDA + +4 + +to microcontroller - + W1 - - - -W1 - -4x - -24 AWG - -0.3 m -  - X1:1:GND - -1:BN - -X2:1:GND - - - - X1:2:VCC - -2:RD - -X2:2:VCC - - - - X1:3:SCL - -3:OG - -X2:3:SCL - - - - X1:4:SDA - -4:YE - -X2:4:SDA - - - -  - -This cable is a bit longer + + + +W1 + +4x + +24 AWG + +0.3 m +  + X1:1:GND + +1:BN + +X2:1:GND + X1:2:VCC + +2:RD + +X2:2:VCC + X1:3:SCL + +3:OG + +X2:3:SCL + X1:4:SDA + +4:YE + +X2:4:SDA +  + +This cable is a bit longer X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + - + X2 - - - -X2 - -Molex KK 254 - -female - -4-pin - -1 - -GND - -1 - -2 - -VCC - -2 - -3 - -SCL - -3 - -4 - -SDA - -4 - -to accelerometer + + + +X2 + +Molex KK 254 + +female + +4-pin + +1 + +GND + +1 + +2 + +VCC + +2 + +3 + +SCL + +3 + +4 + +SDA + +4 + +to accelerometer + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + - + W2 - - - -W2 - -4x - -24 AWG - -0.1 m -  - X2:1:GND - -1:BN - -X3:1:GND - - - - X2:2:VCC - -2:RD - -X3:2:VCC - - - - X2:3:SCL - -3:OG - -X3:3:SCL - - - - X2:4:SDA - -4:YE - -X3:4:SDA - - - -  - -This cable is a bit shorter + + + +W2 + +4x + +24 AWG + +0.1 m +  + X2:1:GND + +1:BN + +X3:1:GND + X2:2:VCC + +2:RD + +X3:2:VCC + X2:3:SCL + +3:OG + +X3:3:SCL + X2:4:SDA + +4:YE + +X3:4:SDA +  + +This cable is a bit shorter - + X2:e--W2:w - - - + + + - + X2:e--W2:w - - - + + + - + X2:e--W2:w - - - + + + - + X2:e--W2:w - - - + + + - - -X3 - - - -X3 - -Molex KK 254 - -female - -4-pin - -1 - -GND - -2 - -VCC - -3 - -SCL - -4 - -SDA - -to temperature sensor + + +W2:e--W2:w + + + - - -W1:e--X2:w - - - + + +W2:e--W2:w + + + - - -W1:e--X2:w - - - + + +W2:e--W2:w + + + - - -W1:e--X2:w - - - + + +W2:e--W2:w + + + - - -W1:e--X2:w - - - + + +X3 + + + +X3 + +Molex KK 254 + +female + +4-pin + +1 + +GND + +2 + +VCC + +3 + +SCL + +4 + +SDA + +to temperature sensor - + W2:e--X3:w - - - + + + - + W2:e--X3:w - - - + + + - + W2:e--X3:w - - - + + + - + W2:e--X3:w - - - + + + diff --git a/tutorial/tutorial04.png b/tutorial/tutorial04.png index 125074bae..55e64bf55 100644 Binary files a/tutorial/tutorial04.png and b/tutorial/tutorial04.png differ diff --git a/tutorial/tutorial04.svg b/tutorial/tutorial04.svg index bb56c9deb..1a9884f40 100644 --- a/tutorial/tutorial04.svg +++ b/tutorial/tutorial04.svg @@ -1,328 +1,360 @@ - - - - + + + X1 - - - -X1 - -Molex KK 254 - -male - -4-pin - -GND - -1 - -VCC - -2 - -SCL - -3 - -SDA - -4 - -to microcontroller + + + +X1 + +Molex KK 254 + +male + +4-pin + +GND + +1 + +VCC + +2 + +SCL + +3 + +SDA + +4 + +to microcontroller - + W1 - - - -W1 - -4x - -24 AWG - -0.3 m -  - X1:1:GND - -1:BN - -X2:1:GND - - - - X1:2:VCC - -2:RD - -X2:2:VCC - - - - X1:3:SCL - -3:OG - -X2:3:SCL - - - - X1:4:SDA - -4:YE - -X2:4:SDA - - - -  - -This cable is a bit longer + + + +W1 + +4x + +24 AWG + +0.3 m +  + X1:1:GND + +1:BN + +X2:1:GND + X1:2:VCC + +2:RD + +X2:2:VCC + X1:3:SCL + +3:OG + +X2:3:SCL + X1:4:SDA + +4:YE + +X2:4:SDA +  + +This cable is a bit longer X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + - + X2 - - - -X2 - -Molex KK 254 - -female - -4-pin - -1 - -GND - -1 - -2 - -VCC - -2 - -3 - -SCL - -3 - -4 - -SDA - -4 - -to accelerometer + + + +X2 + +Molex KK 254 + +female + +4-pin + +1 + +GND + +1 + +2 + +VCC + +2 + +3 + +SCL + +3 + +4 + +SDA + +4 + +to accelerometer + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + - + W2 - - - -W2 - -4x - -24 AWG - -0.1 m -  - X2:1:GND - -1:BN - -X3:1:GND - - - - X2:2:VCC - -2:RD - -X3:2:VCC - - - - X2:3:SCL - -3:OG - -X3:3:SCL - - - - X2:4:SDA - -4:YE - -X3:4:SDA - - - -  - -This cable is a bit shorter + + + +W2 + +4x + +24 AWG + +0.1 m +  + X2:1:GND + +1:BN + +X3:1:GND + X2:2:VCC + +2:RD + +X3:2:VCC + X2:3:SCL + +3:OG + +X3:3:SCL + X2:4:SDA + +4:YE + +X3:4:SDA +  + +This cable is a bit shorter - + X2:e--W2:w - - - + + + - + X2:e--W2:w - - - + + + - + X2:e--W2:w - - - + + + - + X2:e--W2:w - - - + + + - - -X3 - - - -X3 - -Molex KK 254 - -female - -4-pin - -1 - -GND - -2 - -VCC - -3 - -SCL - -4 - -SDA - -to temperature sensor + + +W2:e--W2:w + + + - - -W1:e--X2:w - - - + + +W2:e--W2:w + + + - - -W1:e--X2:w - - - + + +W2:e--W2:w + + + - - -W1:e--X2:w - - - + + +W2:e--W2:w + + + - - -W1:e--X2:w - - - + + +X3 + + + +X3 + +Molex KK 254 + +female + +4-pin + +1 + +GND + +2 + +VCC + +3 + +SCL + +4 + +SDA + +to temperature sensor - + W2:e--X3:w - - - + + + - + W2:e--X3:w - - - + + + - + W2:e--X3:w - - - + + + - + W2:e--X3:w - - - + + + diff --git a/tutorial/tutorial04_wv_gvpr.gvpr b/tutorial/tutorial04_wv_gvpr.gvpr new file mode 100644 index 000000000..7bfced78e --- /dev/null +++ b/tutorial/tutorial04_wv_gvpr.gvpr @@ -0,0 +1,64 @@ +/******************************************************************* + + see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 + input must include pos values (must be output from one of the engines w/ -Tdot)# + Thanks to steveroush and FeRDNYC + +*******************************************************************/ +BEG_G{ + double x1,y1,x2,y2,x3,y3,x4,y4; + string ptSize, tok[int], pt[]; + int cnt, circ, i; + node_t aNode; + + circ=0; + +/*************************************** + $G.bb=""; + $G.nodesep=""; + $G.ranksep=""; + $G.splines="true"; +****************************************/ +} + +// This removes the label text but keeps the position +E[noLabel] { + $.label=""; // remove pesky label + // $.lp=""; // remove peskier label pos +} + +E[straight] { + cnt=tokens($.pos,tok," "); + $.oldpos=$.pos; + x1 = xOf(tok[0]); + y1 = yOf(tok[0]); + x4 = xOf(tok[cnt-1]); + y4 = yOf(tok[cnt-1]); + x2 = x1 + (x4-x1)/3.; + y2 = y1 + (y4-y1)/3.; + x3 = x1 + 2.*(x4-x1)/3.; + y3 = y1 + 2.*(y4-y1)/3.; + pos=sprintf("%.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f", x1,y1, x2,y2, x3,y3, x4,y4); + $.label=""; // remove pesky label + $.lp=""; // remove peskier label pos + + if (hasAttr($, "addPTS") && $.addPTS!="" && $.colorPTS!=""){ + // now we place point nodes at the edge ends + pt[1] = tok[0]; + pt[2] = tok[cnt-1]; + ptSize=$.addPTS; + for (pt[i]) { + if (i==2 && pt[1]==pt[2]) + continue; + aNode=node($G, "__CIRCLE__" + (string)++circ); + aNode.pos=pt[i]; + aNode.shape="point"; + aNode.width=ptSize; + aNode.height=ptSize; + aNode.style="filled"; + aNode.fillcolor=$.colorPTS; + aNode.color=$.colorPTS; + } + } + +} \ No newline at end of file diff --git a/tutorial/tutorial05.gv b/tutorial/tutorial05.gv index 2aab2d162..754f718cf 100644 --- a/tutorial/tutorial05.gv +++ b/tutorial/tutorial05.gv @@ -151,19 +151,7 @@ graph { X1:1:+12V
- + @@ -174,19 +162,7 @@ graph { - + @@ -197,19 +173,7 @@ graph { - + @@ -220,19 +184,7 @@ graph { - + @@ -254,4 +206,8 @@ graph { edge [color="#000000:#FF0000:#000000"] AUTOGENERATED_F1_4:e -- W1:w4:w W1:w4:e -- X1:p4l:w + W1:w1:e -- W1:w1:w [color="#000000:#FFFF00:#000000" straight=straight] + W1:w2:e -- W1:w2:w [color="#000000:#000000:#000000" straight=straight] + W1:w3:e -- W1:w3:w [color="#000000:#000000:#000000" straight=straight] + W1:w4:e -- W1:w4:w [color="#000000:#FF0000:#000000" straight=straight] } diff --git a/tutorial/tutorial05.html b/tutorial/tutorial05.html index 80c7f2ac5..de9944961 100644 --- a/tutorial/tutorial05.html +++ b/tutorial/tutorial05.html @@ -30,202 +30,218 @@

Diagram

- - - - + + + AUTOGENERATED_F1_1 - - - -Crimp ferrule - -0.5 mm² - -OG - - + + + +Crimp ferrule + +0.5 mm² + +OG + + - + W1 - - - -W1 - -4x - -0.5 mm² - -0.3 m -  - - -YE - -X1:1:+12V - - - - - -BK - -X1:2:GND - - - - - -BK - -X1:3:GND - - - - - -RD - -X1:4:+5V - - - -  + + + +W1 + +4x + +0.5 mm² + +0.3 m +  + + +YE + +X1:1:+12V + + +BK + +X1:2:GND + + +BK + +X1:3:GND + + +RD + +X1:4:+5V +  AUTOGENERATED_F1_1:e--W1:w - - - + + + - - -AUTOGENERATED_F1_2 - - - -Crimp ferrule - -0.5 mm² - -OG - - + + +W1:e--W1:w + + + - + -AUTOGENERATED_F1_2:e--W1:w - - - +W1:e--W1:w + + + - - -AUTOGENERATED_F1_3 - - - -Crimp ferrule - -0.5 mm² - -OG - - + + +W1:e--W1:w + + + - + -AUTOGENERATED_F1_3:e--W1:w - - - - - - -AUTOGENERATED_F1_4 - - - -Crimp ferrule - -0.5 mm² - -OG - - - - - -AUTOGENERATED_F1_4:e--W1:w - - - +W1:e--W1:w + + + - + X1 - - - -X1 - -Molex 8981 - -female - -4-pin - -1 - -+12V - -2 - -GND - -3 - -GND - -4 - -+5V + + + +X1 + +Molex 8981 + +female + +4-pin + +1 + ++12V + +2 + +GND + +3 + +GND + +4 + ++5V - + W1:e--X1:w - - - + + + - + W1:e--X1:w - - - + + + - + W1:e--X1:w - - - + + + - + W1:e--X1:w - - - + + + + + + +AUTOGENERATED_F1_2 + + + +Crimp ferrule + +0.5 mm² + +OG + + + + + +AUTOGENERATED_F1_2:e--W1:w + + + + + + +AUTOGENERATED_F1_3 + + + +Crimp ferrule + +0.5 mm² + +OG + + + + + +AUTOGENERATED_F1_3:e--W1:w + + + + + + +AUTOGENERATED_F1_4 + + + +Crimp ferrule + +0.5 mm² + +OG + + + + + +AUTOGENERATED_F1_4:e--W1:w + + + diff --git a/tutorial/tutorial05.png b/tutorial/tutorial05.png index d8a8eeb11..d0c6e81a5 100644 Binary files a/tutorial/tutorial05.png and b/tutorial/tutorial05.png differ diff --git a/tutorial/tutorial05.svg b/tutorial/tutorial05.svg index 8995d4904..5d02c4a02 100644 --- a/tutorial/tutorial05.svg +++ b/tutorial/tutorial05.svg @@ -1,202 +1,218 @@ - - - - + + + AUTOGENERATED_F1_1 - - - -Crimp ferrule - -0.5 mm² - -OG - - + + + +Crimp ferrule + +0.5 mm² + +OG + + - + W1 - - - -W1 - -4x - -0.5 mm² - -0.3 m -  - - -YE - -X1:1:+12V - - - - - -BK - -X1:2:GND - - - - - -BK - -X1:3:GND - - - - - -RD - -X1:4:+5V - - - -  + + + +W1 + +4x + +0.5 mm² + +0.3 m +  + + +YE + +X1:1:+12V + + +BK + +X1:2:GND + + +BK + +X1:3:GND + + +RD + +X1:4:+5V +  AUTOGENERATED_F1_1:e--W1:w - - - + + + - - -AUTOGENERATED_F1_2 - - - -Crimp ferrule - -0.5 mm² - -OG - - + + +W1:e--W1:w + + + - + -AUTOGENERATED_F1_2:e--W1:w - - - +W1:e--W1:w + + + - - -AUTOGENERATED_F1_3 - - - -Crimp ferrule - -0.5 mm² - -OG - - + + +W1:e--W1:w + + + - + -AUTOGENERATED_F1_3:e--W1:w - - - - - - -AUTOGENERATED_F1_4 - - - -Crimp ferrule - -0.5 mm² - -OG - - - - - -AUTOGENERATED_F1_4:e--W1:w - - - +W1:e--W1:w + + + - + X1 - - - -X1 - -Molex 8981 - -female - -4-pin - -1 - -+12V - -2 - -GND - -3 - -GND - -4 - -+5V + + + +X1 + +Molex 8981 + +female + +4-pin + +1 + ++12V + +2 + +GND + +3 + +GND + +4 + ++5V - + W1:e--X1:w - - - + + + - + W1:e--X1:w - - - + + + - + W1:e--X1:w - - - + + + - + W1:e--X1:w - - - + + + + + + +AUTOGENERATED_F1_2 + + + +Crimp ferrule + +0.5 mm² + +OG + + + + + +AUTOGENERATED_F1_2:e--W1:w + + + + + + +AUTOGENERATED_F1_3 + + + +Crimp ferrule + +0.5 mm² + +OG + + + + + +AUTOGENERATED_F1_3:e--W1:w + + + + + + +AUTOGENERATED_F1_4 + + + +Crimp ferrule + +0.5 mm² + +OG + + + + + +AUTOGENERATED_F1_4:e--W1:w + + + diff --git a/tutorial/tutorial05_wv_gvpr.gvpr b/tutorial/tutorial05_wv_gvpr.gvpr new file mode 100644 index 000000000..7bfced78e --- /dev/null +++ b/tutorial/tutorial05_wv_gvpr.gvpr @@ -0,0 +1,64 @@ +/******************************************************************* + + see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 + input must include pos values (must be output from one of the engines w/ -Tdot)# + Thanks to steveroush and FeRDNYC + +*******************************************************************/ +BEG_G{ + double x1,y1,x2,y2,x3,y3,x4,y4; + string ptSize, tok[int], pt[]; + int cnt, circ, i; + node_t aNode; + + circ=0; + +/*************************************** + $G.bb=""; + $G.nodesep=""; + $G.ranksep=""; + $G.splines="true"; +****************************************/ +} + +// This removes the label text but keeps the position +E[noLabel] { + $.label=""; // remove pesky label + // $.lp=""; // remove peskier label pos +} + +E[straight] { + cnt=tokens($.pos,tok," "); + $.oldpos=$.pos; + x1 = xOf(tok[0]); + y1 = yOf(tok[0]); + x4 = xOf(tok[cnt-1]); + y4 = yOf(tok[cnt-1]); + x2 = x1 + (x4-x1)/3.; + y2 = y1 + (y4-y1)/3.; + x3 = x1 + 2.*(x4-x1)/3.; + y3 = y1 + 2.*(y4-y1)/3.; + pos=sprintf("%.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f", x1,y1, x2,y2, x3,y3, x4,y4); + $.label=""; // remove pesky label + $.lp=""; // remove peskier label pos + + if (hasAttr($, "addPTS") && $.addPTS!="" && $.colorPTS!=""){ + // now we place point nodes at the edge ends + pt[1] = tok[0]; + pt[2] = tok[cnt-1]; + ptSize=$.addPTS; + for (pt[i]) { + if (i==2 && pt[1]==pt[2]) + continue; + aNode=node($G, "__CIRCLE__" + (string)++circ); + aNode.pos=pt[i]; + aNode.shape="point"; + aNode.width=ptSize; + aNode.height=ptSize; + aNode.style="filled"; + aNode.fillcolor=$.colorPTS; + aNode.color=$.colorPTS; + } + } + +} \ No newline at end of file diff --git a/tutorial/tutorial06.gv b/tutorial/tutorial06.gv index 31bd8f591..c9daeb71f 100644 --- a/tutorial/tutorial06.gv +++ b/tutorial/tutorial06.gv @@ -135,19 +135,7 @@ graph { X1:1:+12V
- + @@ -158,19 +146,7 @@ graph { - + @@ -181,19 +157,7 @@ graph { - + @@ -204,19 +168,7 @@ graph { - + @@ -238,4 +190,8 @@ graph { edge [color="#000000:#FF0000:#000000"] AUTOGENERATED_F_05_2:e -- W1:w4:w W1:w4:e -- X1:p4l:w + W1:w1:e -- W1:w1:w [color="#000000:#FFFF00:#000000" straight=straight] + W1:w2:e -- W1:w2:w [color="#000000:#000000:#000000" straight=straight] + W1:w3:e -- W1:w3:w [color="#000000:#000000:#000000" straight=straight] + W1:w4:e -- W1:w4:w [color="#000000:#FF0000:#000000" straight=straight] } diff --git a/tutorial/tutorial06.html b/tutorial/tutorial06.html index cb52865e1..0a1ea19d3 100644 --- a/tutorial/tutorial06.html +++ b/tutorial/tutorial06.html @@ -30,188 +30,204 @@

Diagram

- - - - + + + AUTOGENERATED_F_05_1 - - - -Crimp ferrule - -0.5 mm² - -OG - - + + + +Crimp ferrule + +0.5 mm² + +OG + + - + W1 - - - -W1 - -4x - -0.5 mm² - -0.3 m -  - - -YE - -X1:1:+12V - - - - F1 - -BK - -X1:2:GND - - - - F1 - -BK - -X1:3:GND - - - - - -RD - -X1:4:+5V - - - -  + + + +W1 + +4x + +0.5 mm² + +0.3 m +  + + +YE + +X1:1:+12V + F1 + +BK + +X1:2:GND + F1 + +BK + +X1:3:GND + + +RD + +X1:4:+5V +  AUTOGENERATED_F_05_1:e--W1:w - - - + + + - - -F1 - - - -Crimp ferrule - -1.0 mm² - -YE - - + + +W1:e--W1:w + + + - + -F1:e--W1:w - - - - - - -F1:e--W1:w - - - +W1:e--W1:w + + + - - -AUTOGENERATED_F_05_2 - - - -Crimp ferrule - -0.5 mm² - -OG - - + + +W1:e--W1:w + + + - - -AUTOGENERATED_F_05_2:e--W1:w - - - + + +W1:e--W1:w + + + - + X1 - - - -X1 - -Molex 8981 - -female - -4-pin - -1 - -+12V - -2 - -GND - -3 - -GND - -4 - -+5V + + + +X1 + +Molex 8981 + +female + +4-pin + +1 + ++12V + +2 + +GND + +3 + +GND + +4 + ++5V - + W1:e--X1:w - - - + + + - + W1:e--X1:w - - - + + + - + W1:e--X1:w - - - + + + - + W1:e--X1:w - - - + + + + + + +F1 + + + +Crimp ferrule + +1.0 mm² + +YE + + + + + +F1:e--W1:w + + + + + + +F1:e--W1:w + + + + + + +AUTOGENERATED_F_05_2 + + + +Crimp ferrule + +0.5 mm² + +OG + + + + + +AUTOGENERATED_F_05_2:e--W1:w + + + diff --git a/tutorial/tutorial06.png b/tutorial/tutorial06.png index 55711813a..fbc8c089c 100644 Binary files a/tutorial/tutorial06.png and b/tutorial/tutorial06.png differ diff --git a/tutorial/tutorial06.svg b/tutorial/tutorial06.svg index 6800d7f0f..5bf6e09cb 100644 --- a/tutorial/tutorial06.svg +++ b/tutorial/tutorial06.svg @@ -1,188 +1,204 @@ - - - - + + + AUTOGENERATED_F_05_1 - - - -Crimp ferrule - -0.5 mm² - -OG - - + + + +Crimp ferrule + +0.5 mm² + +OG + + - + W1 - - - -W1 - -4x - -0.5 mm² - -0.3 m -  - - -YE - -X1:1:+12V - - - - F1 - -BK - -X1:2:GND - - - - F1 - -BK - -X1:3:GND - - - - - -RD - -X1:4:+5V - - - -  + + + +W1 + +4x + +0.5 mm² + +0.3 m +  + + +YE + +X1:1:+12V + F1 + +BK + +X1:2:GND + F1 + +BK + +X1:3:GND + + +RD + +X1:4:+5V +  AUTOGENERATED_F_05_1:e--W1:w - - - + + + - - -F1 - - - -Crimp ferrule - -1.0 mm² - -YE - - + + +W1:e--W1:w + + + - + -F1:e--W1:w - - - - - - -F1:e--W1:w - - - +W1:e--W1:w + + + - - -AUTOGENERATED_F_05_2 - - - -Crimp ferrule - -0.5 mm² - -OG - - + + +W1:e--W1:w + + + - - -AUTOGENERATED_F_05_2:e--W1:w - - - + + +W1:e--W1:w + + + - + X1 - - - -X1 - -Molex 8981 - -female - -4-pin - -1 - -+12V - -2 - -GND - -3 - -GND - -4 - -+5V + + + +X1 + +Molex 8981 + +female + +4-pin + +1 + ++12V + +2 + +GND + +3 + +GND + +4 + ++5V - + W1:e--X1:w - - - + + + - + W1:e--X1:w - - - + + + - + W1:e--X1:w - - - + + + - + W1:e--X1:w - - - + + + + + + +F1 + + + +Crimp ferrule + +1.0 mm² + +YE + + + + + +F1:e--W1:w + + + + + + +F1:e--W1:w + + + + + + +AUTOGENERATED_F_05_2 + + + +Crimp ferrule + +0.5 mm² + +OG + + + + + +AUTOGENERATED_F_05_2:e--W1:w + + + diff --git a/tutorial/tutorial06_wv_gvpr.gvpr b/tutorial/tutorial06_wv_gvpr.gvpr new file mode 100644 index 000000000..7bfced78e --- /dev/null +++ b/tutorial/tutorial06_wv_gvpr.gvpr @@ -0,0 +1,64 @@ +/******************************************************************* + + see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 + input must include pos values (must be output from one of the engines w/ -Tdot)# + Thanks to steveroush and FeRDNYC + +*******************************************************************/ +BEG_G{ + double x1,y1,x2,y2,x3,y3,x4,y4; + string ptSize, tok[int], pt[]; + int cnt, circ, i; + node_t aNode; + + circ=0; + +/*************************************** + $G.bb=""; + $G.nodesep=""; + $G.ranksep=""; + $G.splines="true"; +****************************************/ +} + +// This removes the label text but keeps the position +E[noLabel] { + $.label=""; // remove pesky label + // $.lp=""; // remove peskier label pos +} + +E[straight] { + cnt=tokens($.pos,tok," "); + $.oldpos=$.pos; + x1 = xOf(tok[0]); + y1 = yOf(tok[0]); + x4 = xOf(tok[cnt-1]); + y4 = yOf(tok[cnt-1]); + x2 = x1 + (x4-x1)/3.; + y2 = y1 + (y4-y1)/3.; + x3 = x1 + 2.*(x4-x1)/3.; + y3 = y1 + 2.*(y4-y1)/3.; + pos=sprintf("%.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f", x1,y1, x2,y2, x3,y3, x4,y4); + $.label=""; // remove pesky label + $.lp=""; // remove peskier label pos + + if (hasAttr($, "addPTS") && $.addPTS!="" && $.colorPTS!=""){ + // now we place point nodes at the edge ends + pt[1] = tok[0]; + pt[2] = tok[cnt-1]; + ptSize=$.addPTS; + for (pt[i]) { + if (i==2 && pt[1]==pt[2]) + continue; + aNode=node($G, "__CIRCLE__" + (string)++circ); + aNode.pos=pt[i]; + aNode.shape="point"; + aNode.width=ptSize; + aNode.height=ptSize; + aNode.style="filled"; + aNode.fillcolor=$.colorPTS; + aNode.color=$.colorPTS; + } + } + +} \ No newline at end of file diff --git a/tutorial/tutorial07.gv b/tutorial/tutorial07.gv index 84c378290..9a3cbbd93 100644 --- a/tutorial/tutorial07.gv +++ b/tutorial/tutorial07.gv @@ -317,19 +317,7 @@ graph { X2:1:GND
- + @@ -340,19 +328,7 @@ graph { - + @@ -363,19 +339,7 @@ graph { - + @@ -386,19 +350,7 @@ graph { - + @@ -420,6 +372,10 @@ graph { edge [color="#000000:#8000FF:#000000"] X1:p4r:e -- W1:w4:w W1:w4:e -- X2:p4l:w + W1:w1:e -- W1:w1:w [color="#000000:#00FFFF:#000000" straight=straight] + W1:w2:e -- W1:w2:w [color="#000000:#FF66CC:#000000" straight=straight] + W1:w3:e -- W1:w3:w [color="#000000:#FFFF00:#000000" straight=straight] + W1:w4:e -- W1:w4:w [color="#000000:#8000FF:#000000" straight=straight] W2 [label=<
X3:1:GND
- - - - - - - - - - -
-
X2:2:VCCX3:2:VCC
- - - - - - - - - - -
-
X2:3:SCLX3:3:SCL
- - - - - - - - - - -
-
X2:4:SDAX3:4:SDA
- - - - - - - - - - -
-
 
- - - - - - - - - - -
-
X1:2:GND
- - - - - - - - - - -
-
X1:3:GND
- - - - - - - - - - -
-
X1:4:+5V
- - - - - - - - - - -
-
 
- - - - - - - - - - -
-
F1X1:2:GND
- - - - - - - - - - -
-
F1X1:3:GND
- - - - - - - - - - -
-
X1:4:+5V
- - - - - - - - - - -
-
 
- - - - - - - - - - -
-
X1:2:VCCX2:2:VCC
- - - - - - - - - - -
-
X1:3:SCLX2:3:SCL
- - - - - - - - - - -
-
X1:4:SDAX2:4:SDA
- - - - - - - - - - -
-
 
@@ -457,19 +413,7 @@ graph { - + @@ -480,19 +424,7 @@ graph { - + @@ -503,19 +435,7 @@ graph { - + @@ -526,19 +446,7 @@ graph { - + @@ -560,6 +468,10 @@ graph { edge [color="#000000:#8000FF:#000000"] X3:p4r:e -- W2:w4:w W2:w4:e -- X2:p4l:w + W2:w1:e -- W2:w1:w [color="#000000:#00FFFF:#000000" straight=straight] + W2:w2:e -- W2:w2:w [color="#000000:#FF66CC:#000000" straight=straight] + W2:w3:e -- W2:w3:w [color="#000000:#FFFF00:#000000" straight=straight] + W2:w4:e -- W2:w4:w [color="#000000:#8000FF:#000000" straight=straight] W3 [label=<
X2:1:GND
- - - - - - - - - - -
-
X3:2:VCCX2:2:VCC
- - - - - - - - - - -
-
X3:3:SCLX2:3:SCL
- - - - - - - - - - -
-
X3:4:SDAX2:4:SDA
- - - - - - - - - - -
-
 
@@ -597,19 +509,7 @@ graph { - + @@ -620,19 +520,7 @@ graph { - + @@ -643,19 +531,7 @@ graph { - + @@ -666,19 +542,7 @@ graph { - + @@ -700,6 +564,10 @@ graph { edge [color="#000000:#8000FF:#000000"] X3:p4r:e -- W3:w4:w W3:w4:e -- X4:p4l:w + W3:w1:e -- W3:w1:w [color="#000000:#00FFFF:#000000" straight=straight] + W3:w2:e -- W3:w2:w [color="#000000:#FF66CC:#000000" straight=straight] + W3:w3:e -- W3:w3:w [color="#000000:#FFFF00:#000000" straight=straight] + W3:w4:e -- W3:w4:w [color="#000000:#8000FF:#000000" straight=straight] W4 [label=<
X4:1:GND
- - - - - - - - - - -
-
X3:2:VCCX4:2:VCC
- - - - - - - - - - -
-
X3:3:SCLX4:3:SCL
- - - - - - - - - - -
-
X3:4:SDAX4:4:SDA
- - - - - - - - - - -
-
 
@@ -737,19 +605,7 @@ graph { - + @@ -760,19 +616,7 @@ graph { - + @@ -783,19 +627,7 @@ graph { - + @@ -806,19 +638,7 @@ graph { - + @@ -840,6 +660,10 @@ graph { edge [color="#000000:#8000FF:#000000"] X5:p4r:e -- W4:w4:w W4:w4:e -- X4:p4l:w + W4:w1:e -- W4:w1:w [color="#000000:#00FFFF:#000000" straight=straight] + W4:w2:e -- W4:w2:w [color="#000000:#FF66CC:#000000" straight=straight] + W4:w3:e -- W4:w3:w [color="#000000:#FFFF00:#000000" straight=straight] + W4:w4:e -- W4:w4:w [color="#000000:#8000FF:#000000" straight=straight] W5 [label=<
X4:1:GND
- - - - - - - - - - -
-
X5:2:VCCX4:2:VCC
- - - - - - - - - - -
-
X5:3:SCLX4:3:SCL
- - - - - - - - - - -
-
X5:4:SDAX4:4:SDA
- - - - - - - - - - -
-
 
@@ -877,19 +701,7 @@ graph { - + @@ -900,19 +712,7 @@ graph { - + @@ -923,19 +723,7 @@ graph { - + @@ -946,19 +734,7 @@ graph { - + @@ -980,4 +756,8 @@ graph { edge [color="#000000:#8000FF:#000000"] X5:p4r:e -- W5:w4:w W5:w4:e -- X6:p4l:w + W5:w1:e -- W5:w1:w [color="#000000:#00FFFF:#000000" straight=straight] + W5:w2:e -- W5:w2:w [color="#000000:#FF66CC:#000000" straight=straight] + W5:w3:e -- W5:w3:w [color="#000000:#FFFF00:#000000" straight=straight] + W5:w4:e -- W5:w4:w [color="#000000:#8000FF:#000000" straight=straight] } diff --git a/tutorial/tutorial07.html b/tutorial/tutorial07.html index 91b02e317..4acf4fa80 100644 --- a/tutorial/tutorial07.html +++ b/tutorial/tutorial07.html @@ -30,712 +30,792 @@

Diagram

- - - - + + + X1 - - - -X1 - -Molex KK 254 - -female - -4-pin - -GND - -1 - -VCC - -2 - -SCL - -3 - -SDA - -4 + + + +X1 + +Molex KK 254 + +female + +4-pin + +GND + +1 + +VCC + +2 + +SCL + +3 + +SDA + +4 - + W1 - - - -W1 - -4x - -0.25 mm² - -0.2 m -  - X1:1:GND - -TQ - -X2:1:GND - - - - X1:2:VCC - -PK - -X2:2:VCC - - - - X1:3:SCL - -YE - -X2:3:SCL - - - - X1:4:SDA - -VT - -X2:4:SDA - - - -  + + + +W1 + +4x + +0.25 mm² + +0.2 m +  + X1:1:GND + +TQ + +X2:1:GND + X1:2:VCC + +PK + +X2:2:VCC + X1:3:SCL + +YE + +X2:3:SCL + X1:4:SDA + +VT + +X2:4:SDA +  X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + - + X2 - - - -X2 - -Molex KK 254 - -female - -4-pin - -1 - -GND - -2 - -VCC - -3 - -SCL - -4 - -SDA + + + +X2 + +Molex KK 254 + +female + +4-pin + +1 + +GND + +2 + +VCC + +3 + +SCL + +4 + +SDA + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + - + X3 - - - -X3 - -Molex KK 254 - -female - -4-pin - -GND - -1 - -VCC - -2 - -SCL - -3 - -SDA - -4 + + + +X3 + +Molex KK 254 + +female + +4-pin + +GND + +1 + +VCC + +2 + +SCL + +3 + +SDA + +4 - + W2 - - - -W2 - -4x - -0.25 mm² - -0.2 m -  - X3:1:GND - -TQ - -X2:1:GND - - - - X3:2:VCC - -PK - -X2:2:VCC - - - - X3:3:SCL - -YE - -X2:3:SCL - - - - X3:4:SDA - -VT - -X2:4:SDA - - - -  + + + +W2 + +4x + +0.25 mm² + +0.2 m +  + X3:1:GND + +TQ + +X2:1:GND + X3:2:VCC + +PK + +X2:2:VCC + X3:3:SCL + +YE + +X2:3:SCL + X3:4:SDA + +VT + +X2:4:SDA +  - + X3:e--W2:w - - - + + + - + X3:e--W2:w - - - + + + - + X3:e--W2:w - - - + + + - + X3:e--W2:w - - - + + + - + W3 - - - -W3 - -4x - -0.25 mm² - -0.2 m -  - X3:1:GND - -TQ - -X4:1:GND - - - - X3:2:VCC - -PK - -X4:2:VCC - - - - X3:3:SCL - -YE - -X4:3:SCL - - - - X3:4:SDA - -VT - -X4:4:SDA - - - -  + + + +W3 + +4x + +0.25 mm² + +0.2 m +  + X3:1:GND + +TQ + +X4:1:GND + X3:2:VCC + +PK + +X4:2:VCC + X3:3:SCL + +YE + +X4:3:SCL + X3:4:SDA + +VT + +X4:4:SDA +  X3:e--W3:w - - - + + + - + X3:e--W3:w - - - + + + - + X3:e--W3:w - - - + + + - + X3:e--W3:w - - - + + + + + + +W2:e--X2:w + + + + + + +W2:e--X2:w + + + + + + +W2:e--X2:w + + + + + + +W2:e--X2:w + + + + + + +W2:e--W2:w + + + + + + +W2:e--W2:w + + + + + + +W2:e--W2:w + + + + + + +W2:e--W2:w + + + + + + +W3:e--W3:w + + + + + + +W3:e--W3:w + + + + + + +W3:e--W3:w + + + + + + +W3:e--W3:w + + + - + X4 - - - -X4 - -Molex KK 254 - -female - -4-pin - -1 - -GND - -2 - -VCC - -3 - -SCL - -4 - -SDA + + + +X4 + +Molex KK 254 + +female + +4-pin + +1 + +GND + +2 + +VCC + +3 + +SCL + +4 + +SDA + + + +W3:e--X4:w + + + + + + +W3:e--X4:w + + + + + + +W3:e--X4:w + + + + + + +W3:e--X4:w + + + - + X5 - - - -X5 - -Molex KK 254 - -female - -4-pin - -GND - -1 - -VCC - -2 - -SCL - -3 - -SDA - -4 + + + +X5 + +Molex KK 254 + +female + +4-pin + +GND + +1 + +VCC + +2 + +SCL + +3 + +SDA + +4 - + W4 - - - -W4 - -4x - -0.25 mm² - -0.2 m -  - X5:1:GND - -TQ - -X4:1:GND - - - - X5:2:VCC - -PK - -X4:2:VCC - - - - X5:3:SCL - -YE - -X4:3:SCL - - - - X5:4:SDA - -VT - -X4:4:SDA - - - -  + + + +W4 + +4x + +0.25 mm² + +0.2 m +  + X5:1:GND + +TQ + +X4:1:GND + X5:2:VCC + +PK + +X4:2:VCC + X5:3:SCL + +YE + +X4:3:SCL + X5:4:SDA + +VT + +X4:4:SDA +  - + X5:e--W4:w - - - + + + - + X5:e--W4:w - - - + + + - + X5:e--W4:w - - - + + + - + X5:e--W4:w - - - + + + - + W5 - - - -W5 - -4x - -0.25 mm² - -0.2 m -  - X5:1:GND - -TQ - -X6:1:GND - - - - X5:2:VCC - -PK - -X6:2:VCC - - - - X5:3:SCL - -YE - -X6:3:SCL - - - - X5:4:SDA - -VT - -X6:4:SDA - - - -  + + + +W5 + +4x + +0.25 mm² + +0.2 m +  + X5:1:GND + +TQ + +X6:1:GND + X5:2:VCC + +PK + +X6:2:VCC + X5:3:SCL + +YE + +X6:3:SCL + X5:4:SDA + +VT + +X6:4:SDA +  - + X5:e--W5:w - - - + + + - + X5:e--W5:w - - - + + + - + X5:e--W5:w - - - + + + - + X5:e--W5:w - - - - - - -X6 - - - -X6 - -Molex KK 254 - -female - -4-pin - -1 - -GND - -2 - -VCC - -3 - -SCL - -4 - -SDA - - - -W1:e--X2:w - - - - - - -W1:e--X2:w - - - - - - -W1:e--X2:w - - - - - - -W1:e--X2:w - - - - - - -W2:e--X2:w - - - - - - -W2:e--X2:w - - - - - - -W2:e--X2:w - - - - - - -W2:e--X2:w - - - - - - -W3:e--X4:w - - - - - - -W3:e--X4:w - - - - - - -W3:e--X4:w - - - - - - -W3:e--X4:w - - - + + + - + W4:e--X4:w - - - + + + - + W4:e--X4:w - - - + + + - + W4:e--X4:w - - - + + + - + W4:e--X4:w - - - + + + + + + +W4:e--W4:w + + + + + + +W4:e--W4:w + + + + + + +W4:e--W4:w + + + + + + +W4:e--W4:w + + + + + + +W5:e--W5:w + + + + + + +W5:e--W5:w + + + + + + +W5:e--W5:w + + + + + + +W5:e--W5:w + + + + + + +X6 + + + +X6 + +Molex KK 254 + +female + +4-pin + +1 + +GND + +2 + +VCC + +3 + +SCL + +4 + +SDA - + W5:e--X6:w - - - + + + - + W5:e--X6:w - - - + + + - + W5:e--X6:w - - - + + + - + W5:e--X6:w - - - + + + diff --git a/tutorial/tutorial07.png b/tutorial/tutorial07.png index 171353ae6..f16f1c4f1 100644 Binary files a/tutorial/tutorial07.png and b/tutorial/tutorial07.png differ diff --git a/tutorial/tutorial07.svg b/tutorial/tutorial07.svg index ecbf9e0ed..69138a8bc 100644 --- a/tutorial/tutorial07.svg +++ b/tutorial/tutorial07.svg @@ -1,712 +1,792 @@ - - - - + + + X1 - - - -X1 - -Molex KK 254 - -female - -4-pin - -GND - -1 - -VCC - -2 - -SCL - -3 - -SDA - -4 + + + +X1 + +Molex KK 254 + +female + +4-pin + +GND + +1 + +VCC + +2 + +SCL + +3 + +SDA + +4 - + W1 - - - -W1 - -4x - -0.25 mm² - -0.2 m -  - X1:1:GND - -TQ - -X2:1:GND - - - - X1:2:VCC - -PK - -X2:2:VCC - - - - X1:3:SCL - -YE - -X2:3:SCL - - - - X1:4:SDA - -VT - -X2:4:SDA - - - -  + + + +W1 + +4x + +0.25 mm² + +0.2 m +  + X1:1:GND + +TQ + +X2:1:GND + X1:2:VCC + +PK + +X2:2:VCC + X1:3:SCL + +YE + +X2:3:SCL + X1:4:SDA + +VT + +X2:4:SDA +  X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + - + X2 - - - -X2 - -Molex KK 254 - -female - -4-pin - -1 - -GND - -2 - -VCC - -3 - -SCL - -4 - -SDA + + + +X2 + +Molex KK 254 + +female + +4-pin + +1 + +GND + +2 + +VCC + +3 + +SCL + +4 + +SDA + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + + + + +W1:e--X2:w + + + - + X3 - - - -X3 - -Molex KK 254 - -female - -4-pin - -GND - -1 - -VCC - -2 - -SCL - -3 - -SDA - -4 + + + +X3 + +Molex KK 254 + +female + +4-pin + +GND + +1 + +VCC + +2 + +SCL + +3 + +SDA + +4 - + W2 - - - -W2 - -4x - -0.25 mm² - -0.2 m -  - X3:1:GND - -TQ - -X2:1:GND - - - - X3:2:VCC - -PK - -X2:2:VCC - - - - X3:3:SCL - -YE - -X2:3:SCL - - - - X3:4:SDA - -VT - -X2:4:SDA - - - -  + + + +W2 + +4x + +0.25 mm² + +0.2 m +  + X3:1:GND + +TQ + +X2:1:GND + X3:2:VCC + +PK + +X2:2:VCC + X3:3:SCL + +YE + +X2:3:SCL + X3:4:SDA + +VT + +X2:4:SDA +  - + X3:e--W2:w - - - + + + - + X3:e--W2:w - - - + + + - + X3:e--W2:w - - - + + + - + X3:e--W2:w - - - + + + - + W3 - - - -W3 - -4x - -0.25 mm² - -0.2 m -  - X3:1:GND - -TQ - -X4:1:GND - - - - X3:2:VCC - -PK - -X4:2:VCC - - - - X3:3:SCL - -YE - -X4:3:SCL - - - - X3:4:SDA - -VT - -X4:4:SDA - - - -  + + + +W3 + +4x + +0.25 mm² + +0.2 m +  + X3:1:GND + +TQ + +X4:1:GND + X3:2:VCC + +PK + +X4:2:VCC + X3:3:SCL + +YE + +X4:3:SCL + X3:4:SDA + +VT + +X4:4:SDA +  X3:e--W3:w - - - + + + - + X3:e--W3:w - - - + + + - + X3:e--W3:w - - - + + + - + X3:e--W3:w - - - + + + + + + +W2:e--X2:w + + + + + + +W2:e--X2:w + + + + + + +W2:e--X2:w + + + + + + +W2:e--X2:w + + + + + + +W2:e--W2:w + + + + + + +W2:e--W2:w + + + + + + +W2:e--W2:w + + + + + + +W2:e--W2:w + + + + + + +W3:e--W3:w + + + + + + +W3:e--W3:w + + + + + + +W3:e--W3:w + + + + + + +W3:e--W3:w + + + - + X4 - - - -X4 - -Molex KK 254 - -female - -4-pin - -1 - -GND - -2 - -VCC - -3 - -SCL - -4 - -SDA + + + +X4 + +Molex KK 254 + +female + +4-pin + +1 + +GND + +2 + +VCC + +3 + +SCL + +4 + +SDA + + + +W3:e--X4:w + + + + + + +W3:e--X4:w + + + + + + +W3:e--X4:w + + + + + + +W3:e--X4:w + + + - + X5 - - - -X5 - -Molex KK 254 - -female - -4-pin - -GND - -1 - -VCC - -2 - -SCL - -3 - -SDA - -4 + + + +X5 + +Molex KK 254 + +female + +4-pin + +GND + +1 + +VCC + +2 + +SCL + +3 + +SDA + +4 - + W4 - - - -W4 - -4x - -0.25 mm² - -0.2 m -  - X5:1:GND - -TQ - -X4:1:GND - - - - X5:2:VCC - -PK - -X4:2:VCC - - - - X5:3:SCL - -YE - -X4:3:SCL - - - - X5:4:SDA - -VT - -X4:4:SDA - - - -  + + + +W4 + +4x + +0.25 mm² + +0.2 m +  + X5:1:GND + +TQ + +X4:1:GND + X5:2:VCC + +PK + +X4:2:VCC + X5:3:SCL + +YE + +X4:3:SCL + X5:4:SDA + +VT + +X4:4:SDA +  - + X5:e--W4:w - - - + + + - + X5:e--W4:w - - - + + + - + X5:e--W4:w - - - + + + - + X5:e--W4:w - - - + + + - + W5 - - - -W5 - -4x - -0.25 mm² - -0.2 m -  - X5:1:GND - -TQ - -X6:1:GND - - - - X5:2:VCC - -PK - -X6:2:VCC - - - - X5:3:SCL - -YE - -X6:3:SCL - - - - X5:4:SDA - -VT - -X6:4:SDA - - - -  + + + +W5 + +4x + +0.25 mm² + +0.2 m +  + X5:1:GND + +TQ + +X6:1:GND + X5:2:VCC + +PK + +X6:2:VCC + X5:3:SCL + +YE + +X6:3:SCL + X5:4:SDA + +VT + +X6:4:SDA +  - + X5:e--W5:w - - - + + + - + X5:e--W5:w - - - + + + - + X5:e--W5:w - - - + + + - + X5:e--W5:w - - - - - - -X6 - - - -X6 - -Molex KK 254 - -female - -4-pin - -1 - -GND - -2 - -VCC - -3 - -SCL - -4 - -SDA - - - -W1:e--X2:w - - - - - - -W1:e--X2:w - - - - - - -W1:e--X2:w - - - - - - -W1:e--X2:w - - - - - - -W2:e--X2:w - - - - - - -W2:e--X2:w - - - - - - -W2:e--X2:w - - - - - - -W2:e--X2:w - - - - - - -W3:e--X4:w - - - - - - -W3:e--X4:w - - - - - - -W3:e--X4:w - - - - - - -W3:e--X4:w - - - + + + - + W4:e--X4:w - - - + + + - + W4:e--X4:w - - - + + + - + W4:e--X4:w - - - + + + - + W4:e--X4:w - - - + + + + + + +W4:e--W4:w + + + + + + +W4:e--W4:w + + + + + + +W4:e--W4:w + + + + + + +W4:e--W4:w + + + + + + +W5:e--W5:w + + + + + + +W5:e--W5:w + + + + + + +W5:e--W5:w + + + + + + +W5:e--W5:w + + + + + + +X6 + + + +X6 + +Molex KK 254 + +female + +4-pin + +1 + +GND + +2 + +VCC + +3 + +SCL + +4 + +SDA - + W5:e--X6:w - - - + + + - + W5:e--X6:w - - - + + + - + W5:e--X6:w - - - + + + - + W5:e--X6:w - - - + + + diff --git a/tutorial/tutorial07_wv_gvpr.gvpr b/tutorial/tutorial07_wv_gvpr.gvpr new file mode 100644 index 000000000..7bfced78e --- /dev/null +++ b/tutorial/tutorial07_wv_gvpr.gvpr @@ -0,0 +1,64 @@ +/******************************************************************* + + see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 + input must include pos values (must be output from one of the engines w/ -Tdot)# + Thanks to steveroush and FeRDNYC + +*******************************************************************/ +BEG_G{ + double x1,y1,x2,y2,x3,y3,x4,y4; + string ptSize, tok[int], pt[]; + int cnt, circ, i; + node_t aNode; + + circ=0; + +/*************************************** + $G.bb=""; + $G.nodesep=""; + $G.ranksep=""; + $G.splines="true"; +****************************************/ +} + +// This removes the label text but keeps the position +E[noLabel] { + $.label=""; // remove pesky label + // $.lp=""; // remove peskier label pos +} + +E[straight] { + cnt=tokens($.pos,tok," "); + $.oldpos=$.pos; + x1 = xOf(tok[0]); + y1 = yOf(tok[0]); + x4 = xOf(tok[cnt-1]); + y4 = yOf(tok[cnt-1]); + x2 = x1 + (x4-x1)/3.; + y2 = y1 + (y4-y1)/3.; + x3 = x1 + 2.*(x4-x1)/3.; + y3 = y1 + 2.*(y4-y1)/3.; + pos=sprintf("%.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f", x1,y1, x2,y2, x3,y3, x4,y4); + $.label=""; // remove pesky label + $.lp=""; // remove peskier label pos + + if (hasAttr($, "addPTS") && $.addPTS!="" && $.colorPTS!=""){ + // now we place point nodes at the edge ends + pt[1] = tok[0]; + pt[2] = tok[cnt-1]; + ptSize=$.addPTS; + for (pt[i]) { + if (i==2 && pt[1]==pt[2]) + continue; + aNode=node($G, "__CIRCLE__" + (string)++circ); + aNode.pos=pt[i]; + aNode.shape="point"; + aNode.width=ptSize; + aNode.height=ptSize; + aNode.style="filled"; + aNode.fillcolor=$.colorPTS; + aNode.color=$.colorPTS; + } + } + +} \ No newline at end of file diff --git a/tutorial/tutorial08.gv b/tutorial/tutorial08.gv index dcbabb19e..64c729461 100644 --- a/tutorial/tutorial08.gv +++ b/tutorial/tutorial08.gv @@ -310,19 +310,7 @@ graph { X2:1
- + @@ -332,19 +320,7 @@ graph { - + @@ -354,19 +330,7 @@ graph { - + @@ -376,19 +340,7 @@ graph { - + @@ -410,6 +362,10 @@ graph { edge [color="#000000:#FFFF00:#000000"] X1:p4r:e -- W1:w4:w W1:w4:e -- X2:p4l:w + W1:w1:e -- W1:w1:w [color="#000000:#895956:#000000" straight=straight] + W1:w2:e -- W1:w2:w [color="#000000:#FF0000:#000000" straight=straight] + W1:w3:e -- W1:w3:w [color="#000000:#FF8000:#000000" straight=straight] + W1:w4:e -- W1:w4:w [color="#000000:#FFFF00:#000000" straight=straight] W2 [label=<
X6:1:GND
- - - - - - - - - - -
-
X5:2:VCCX6:2:VCC
- - - - - - - - - - -
-
X5:3:SCLX6:3:SCL
- - - - - - - - - - -
-
X5:4:SDAX6:4:SDA
- - - - - - - - - - -
-
 
- - - - - - - - - - -
-
X1:2X2:2
- - - - - - - - - - -
-
X1:3X2:3
- - - - - - - - - - -
-
X1:4X2:4
- - - - - - - - - - -
-
 
@@ -447,19 +403,7 @@ graph { - + - + - + - +
X3:1
- - - - - - - - - - -
-
@@ -481,19 +425,7 @@ graph { X3:2
- - - - - - - - - - -
-
@@ -515,19 +447,7 @@ graph { X3:3
- - - - - - - - - - -
-
@@ -549,19 +469,7 @@ graph { X3:4
- - - - - - - - - - -
-
@@ -612,4 +520,8 @@ graph { edge [color="#000000:#FF0000:#000000"] X1:p4r:e -- W2:w4:w W2:w4:e -- X3:p4l:w + W2:w1:e -- W2:w1:w [color="#000000:#FFFF00:#000000" straight=straight] + W2:w2:e -- W2:w2:w [color="#000000:#000000:#000000" straight=straight] + W2:w3:e -- W2:w3:w [color="#000000:#000000:#000000" straight=straight] + W2:w4:e -- W2:w4:w [color="#000000:#FF0000:#000000" straight=straight] } diff --git a/tutorial/tutorial08.html b/tutorial/tutorial08.html index 8c95896b5..c86264c1d 100644 --- a/tutorial/tutorial08.html +++ b/tutorial/tutorial08.html @@ -30,350 +30,382 @@

Diagram

- - - - + + + X1 - - - -X1 - -Molex: 22013047 - -Digimouse: 1234 - -Molex KK 254 - -female - -4-pin - -1 - -2 - -3 - -4 -4 -x -Crimp, Molex KK 254, 22-30 AWG -Molex: 08500030 -1 -x -Test -P/N: ABC, Molex: 45454, Mousikey: 9999 - + + + +X1 + +Molex: 22013047 + +Digimouse: 1234 + +Molex KK 254 + +female + +4-pin + +1 + +2 + +3 + +4 +4 +x +Crimp, Molex KK 254, 22-30 AWG +Molex: 08500030 +1 +x +Test +P/N: ABC, Molex: 45454, Mousikey: 9999 + - + W1 - - - -W1 - -P/N: CAB1 - -CablesCo: ABC123 - -Cables R Us: 999-888-777 - -4x - -0.25 mm² - -1 m -  - X1:1 - -1:BN - -X2:1 - - - - X1:2 - -2:RD - -X2:2 - - - - X1:3 - -3:OG - -X2:3 - - - - X1:4 - -4:YE - -X2:4 - - - -  + + + +W1 + +P/N: CAB1 + +CablesCo: ABC123 + +Cables R Us: 999-888-777 + +4x + +0.25 mm² + +1 m +  + X1:1 + +1:BN + +X2:1 + X1:2 + +2:RD + +X2:2 + X1:3 + +3:OG + +X2:3 + X1:4 + +4:YE + +X2:4 +  X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + W2 - - - -W2 - -4x - -0.25 mm² - -1 m -  - X1:1 - -YE - -X3:1 - - - -P/N: WIRE1 -WiresCo: W1-YE -WireShack: 1001 - X1:2 - -BK - -X3:2 - - - -P/N: WIRE2 -WiresCo: W1-BK -WireShack: 1002 - X1:3 - -BK - -X3:3 - - - -P/N: WIRE2 -WiresCo: W1-BK -WireShack: 1002 - X1:4 - -RD - -X3:4 - - - -P/N: WIRE3 -WiresCo: W1-RD -WireShack: 1009 -  -1 -m -Sleeve, Braided nylon, black, 3mm -P/N: SLV-1 - + + + +W2 + +4x + +0.25 mm² + +1 m +  + X1:1 + +YE + +X3:1 +P/N: WIRE1 +WiresCo: W1-YE +WireShack: 1001 + X1:2 + +BK + +X3:2 +P/N: WIRE2 +WiresCo: W1-BK +WireShack: 1002 + X1:3 + +BK + +X3:3 +P/N: WIRE2 +WiresCo: W1-BK +WireShack: 1002 + X1:4 + +RD + +X3:4 +P/N: WIRE3 +WiresCo: W1-RD +WireShack: 1009 +  +1 +m +Sleeve, Braided nylon, black, 3mm +P/N: SLV-1 + - + X1:e--W2:w - - - + + + - + X1:e--W2:w - - - + + + - + X1:e--W2:w - - - + + + - + X1:e--W2:w - - - + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + - + X2 - - - -X2 - -P/N: CON4 - -Molex: 22013047 - -Digimouse: 1234 - -Molex KK 254 - -female - -4-pin - -1 - -2 - -3 - -4 -4 -x -Crimp, Molex KK 254, 22-30 AWG -Molex: 08500030 -1 -x -Test -P/N: ABC, Molex: 45454, Mousikey: 9999 - - - - -X3 - - - -X3 - -Molex: 22013047 - -Digimouse: 1234 - -Molex KK 254 - -female - -4-pin - -1 - -2 - -3 - -4 -4 -x -Crimp, Molex KK 254, 22-30 AWG -Molex: 08500030 -1 -x -Test -P/N: ABC, Molex: 45454, Mousikey: 9999 - + + + +X2 + +P/N: CON4 + +Molex: 22013047 + +Digimouse: 1234 + +Molex KK 254 + +female + +4-pin + +1 + +2 + +3 + +4 +4 +x +Crimp, Molex KK 254, 22-30 AWG +Molex: 08500030 +1 +x +Test +P/N: ABC, Molex: 45454, Mousikey: 9999 + - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + + + + +W2:e--W2:w + + + + + + +W2:e--W2:w + + + + + + +W2:e--W2:w + + + + + + +W2:e--W2:w + + + + + + +X3 + + + +X3 + +Molex: 22013047 + +Digimouse: 1234 + +Molex KK 254 + +female + +4-pin + +1 + +2 + +3 + +4 +4 +x +Crimp, Molex KK 254, 22-30 AWG +Molex: 08500030 +1 +x +Test +P/N: ABC, Molex: 45454, Mousikey: 9999 + - + W2:e--X3:w - - - + + + - + W2:e--X3:w - - - + + + - + W2:e--X3:w - - - + + + - + W2:e--X3:w - - - + + + diff --git a/tutorial/tutorial08.png b/tutorial/tutorial08.png index e1fb7bd8d..cc9aa77fb 100644 Binary files a/tutorial/tutorial08.png and b/tutorial/tutorial08.png differ diff --git a/tutorial/tutorial08.svg b/tutorial/tutorial08.svg index dcfa29aa4..67cc7bab5 100644 --- a/tutorial/tutorial08.svg +++ b/tutorial/tutorial08.svg @@ -1,350 +1,382 @@ - - - - + + + X1 - - - -X1 - -Molex: 22013047 - -Digimouse: 1234 - -Molex KK 254 - -female - -4-pin - -1 - -2 - -3 - -4 -4 -x -Crimp, Molex KK 254, 22-30 AWG -Molex: 08500030 -1 -x -Test -P/N: ABC, Molex: 45454, Mousikey: 9999 - + + + +X1 + +Molex: 22013047 + +Digimouse: 1234 + +Molex KK 254 + +female + +4-pin + +1 + +2 + +3 + +4 +4 +x +Crimp, Molex KK 254, 22-30 AWG +Molex: 08500030 +1 +x +Test +P/N: ABC, Molex: 45454, Mousikey: 9999 + - + W1 - - - -W1 - -P/N: CAB1 - -CablesCo: ABC123 - -Cables R Us: 999-888-777 - -4x - -0.25 mm² - -1 m -  - X1:1 - -1:BN - -X2:1 - - - - X1:2 - -2:RD - -X2:2 - - - - X1:3 - -3:OG - -X2:3 - - - - X1:4 - -4:YE - -X2:4 - - - -  + + + +W1 + +P/N: CAB1 + +CablesCo: ABC123 + +Cables R Us: 999-888-777 + +4x + +0.25 mm² + +1 m +  + X1:1 + +1:BN + +X2:1 + X1:2 + +2:RD + +X2:2 + X1:3 + +3:OG + +X2:3 + X1:4 + +4:YE + +X2:4 +  X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + X1:e--W1:w - - - + + + - + W2 - - - -W2 - -4x - -0.25 mm² - -1 m -  - X1:1 - -YE - -X3:1 - - - -P/N: WIRE1 -WiresCo: W1-YE -WireShack: 1001 - X1:2 - -BK - -X3:2 - - - -P/N: WIRE2 -WiresCo: W1-BK -WireShack: 1002 - X1:3 - -BK - -X3:3 - - - -P/N: WIRE2 -WiresCo: W1-BK -WireShack: 1002 - X1:4 - -RD - -X3:4 - - - -P/N: WIRE3 -WiresCo: W1-RD -WireShack: 1009 -  -1 -m -Sleeve, Braided nylon, black, 3mm -P/N: SLV-1 - + + + +W2 + +4x + +0.25 mm² + +1 m +  + X1:1 + +YE + +X3:1 +P/N: WIRE1 +WiresCo: W1-YE +WireShack: 1001 + X1:2 + +BK + +X3:2 +P/N: WIRE2 +WiresCo: W1-BK +WireShack: 1002 + X1:3 + +BK + +X3:3 +P/N: WIRE2 +WiresCo: W1-BK +WireShack: 1002 + X1:4 + +RD + +X3:4 +P/N: WIRE3 +WiresCo: W1-RD +WireShack: 1009 +  +1 +m +Sleeve, Braided nylon, black, 3mm +P/N: SLV-1 + - + X1:e--W2:w - - - + + + - + X1:e--W2:w - - - + + + - + X1:e--W2:w - - - + + + - + X1:e--W2:w - - - + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + + + + +W1:e--W1:w + + + - + X2 - - - -X2 - -P/N: CON4 - -Molex: 22013047 - -Digimouse: 1234 - -Molex KK 254 - -female - -4-pin - -1 - -2 - -3 - -4 -4 -x -Crimp, Molex KK 254, 22-30 AWG -Molex: 08500030 -1 -x -Test -P/N: ABC, Molex: 45454, Mousikey: 9999 - - - - -X3 - - - -X3 - -Molex: 22013047 - -Digimouse: 1234 - -Molex KK 254 - -female - -4-pin - -1 - -2 - -3 - -4 -4 -x -Crimp, Molex KK 254, 22-30 AWG -Molex: 08500030 -1 -x -Test -P/N: ABC, Molex: 45454, Mousikey: 9999 - + + + +X2 + +P/N: CON4 + +Molex: 22013047 + +Digimouse: 1234 + +Molex KK 254 + +female + +4-pin + +1 + +2 + +3 + +4 +4 +x +Crimp, Molex KK 254, 22-30 AWG +Molex: 08500030 +1 +x +Test +P/N: ABC, Molex: 45454, Mousikey: 9999 + - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + - + W1:e--X2:w - - - + + + + + + +W2:e--W2:w + + + + + + +W2:e--W2:w + + + + + + +W2:e--W2:w + + + + + + +W2:e--W2:w + + + + + + +X3 + + + +X3 + +Molex: 22013047 + +Digimouse: 1234 + +Molex KK 254 + +female + +4-pin + +1 + +2 + +3 + +4 +4 +x +Crimp, Molex KK 254, 22-30 AWG +Molex: 08500030 +1 +x +Test +P/N: ABC, Molex: 45454, Mousikey: 9999 + - + W2:e--X3:w - - - + + + - + W2:e--X3:w - - - + + + - + W2:e--X3:w - - - + + + - + W2:e--X3:w - - - + + + diff --git a/tutorial/tutorial08_wv_gvpr.gvpr b/tutorial/tutorial08_wv_gvpr.gvpr new file mode 100644 index 000000000..7bfced78e --- /dev/null +++ b/tutorial/tutorial08_wv_gvpr.gvpr @@ -0,0 +1,64 @@ +/******************************************************************* + + see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 + input must include pos values (must be output from one of the engines w/ -Tdot)# + Thanks to steveroush and FeRDNYC + +*******************************************************************/ +BEG_G{ + double x1,y1,x2,y2,x3,y3,x4,y4; + string ptSize, tok[int], pt[]; + int cnt, circ, i; + node_t aNode; + + circ=0; + +/*************************************** + $G.bb=""; + $G.nodesep=""; + $G.ranksep=""; + $G.splines="true"; +****************************************/ +} + +// This removes the label text but keeps the position +E[noLabel] { + $.label=""; // remove pesky label + // $.lp=""; // remove peskier label pos +} + +E[straight] { + cnt=tokens($.pos,tok," "); + $.oldpos=$.pos; + x1 = xOf(tok[0]); + y1 = yOf(tok[0]); + x4 = xOf(tok[cnt-1]); + y4 = yOf(tok[cnt-1]); + x2 = x1 + (x4-x1)/3.; + y2 = y1 + (y4-y1)/3.; + x3 = x1 + 2.*(x4-x1)/3.; + y3 = y1 + 2.*(y4-y1)/3.; + pos=sprintf("%.3f,%.3f %.3f,%.3f %.3f,%.3f %.3f,%.3f", x1,y1, x2,y2, x3,y3, x4,y4); + $.label=""; // remove pesky label + $.lp=""; // remove peskier label pos + + if (hasAttr($, "addPTS") && $.addPTS!="" && $.colorPTS!=""){ + // now we place point nodes at the edge ends + pt[1] = tok[0]; + pt[2] = tok[cnt-1]; + ptSize=$.addPTS; + for (pt[i]) { + if (i==2 && pt[1]==pt[2]) + continue; + aNode=node($G, "__CIRCLE__" + (string)++circ); + aNode.pos=pt[i]; + aNode.shape="point"; + aNode.width=ptSize; + aNode.height=ptSize; + aNode.style="filled"; + aNode.fillcolor=$.colorPTS; + aNode.color=$.colorPTS; + } + } + +} \ No newline at end of file