|
Size: 9296
Comment:
|
Size: 11300
Comment:
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 166: | Line 166: |
---- /!\ '''Edit conflict - other version:''' ---- <img width="100%" /> ---- /!\ '''Edit conflict - your version:''' ---- ---- /!\ '''End of edit conflict''' ---- |
|
| Line 254: | Line 247: |
| action1[shape=box,style=rounded, label="action"] action2[shape=box,style=rounded, label="action"] action3[shape=box,style=rounded, label="action"] |
action1[shape=box,style=rounded, label="action1"] action2[shape=box,style=rounded, label="action2"] action3[shape=box,style=rounded, label="action3"] |
| Line 277: | Line 270: |
| action1[shape=box,style=rounded, label="action"] action2[shape=box,style=rounded, label="action"] action3[shape=box,style=rounded, label="action"] |
action1[shape=box,style=rounded, label="action1"] action2[shape=box,style=rounded, label="action2"] action3[shape=box,style=rounded, label="action3"] |
| Line 291: | Line 284: |
| Line 304: | Line 298: |
| }}} {{{ digraph untitled { rankdir=TD ClassA[shape=rectangle] ClassB[shape=rectangle] { edge[label=" 1.method1() \l 2. method2()"] ClassA->ClassB} { edge[label=" 4.method1() \l 3. method2()"] ClassB->ClassA} } }}} {{{#!GraphViz dot digraph G { // Estilo global dos nós (retângulos) e ligações //rankdir=LR; // Direção da esquerda para a direita (use TB para cima para baixo) node [shape=box, style="rounded,filled", fillcolor="#ffffff", color="#333333", fontname="Arial"]; edge [color="#555555"]; // O prefixo "cluster_" é obrigatório para o Graphviz desenhar a caixa envolvente subgraph cluster_contentor { label = "Ingestion pipeline"; labelloc = "t"; // Posição do título ("t" = topo, "b" = base) fontname = "Arial Bold"; style = "filled"; fillcolor = "#f4f6f9"; color = "#8c9ba5"; margin = 16; // Espaçamento interno A [label="Data sources"]; B [label="Document parser"]; C [label="Chunking engine, text splitters"]; D [label="Embedding model"]; E [label="Index storage, vectorDB/search index"]; // Ligações entre eles A -> B [label=""]; B -> C [label=""]; C -> D C -> E D -> E [label="vector and chunks"]; //A -> C [style=dashed, label="opcional"]; } subgraph cluster_contentor2 { label = "Runtime pipeline"; labelloc = "t"; // Posição do título ("t" = topo, "b" = base) fontname = "Arial Bold"; style = "filled"; fillcolor = "#f4f6f9"; color = "#8c9ba5"; margin = 16; // Espaçamento interno AA [label="User query"]; BB [label="Query processor"]; CC [label="Retriever vector"]; DD [label="Reranker"]; EE [label="Prompt assembler"]; FF [label="LLM generator"]; GG [label="Grounded response"]; // Ligações entre eles AA -> BB AA -> EE BB -> CC CC -> DD DD -> EE EE -> FF FF -> GG } } |
Contents
GraphViz
Graphviz is open source graph visualization software. Graph visualization is a way of representing structural information as diagrams of abstract graphs and networks. It has important applications in networking, bioinformatics, software engineering, database and web design, machine learning, and in visual interfaces for other technical domains.
http://www.tonyballantyne.com/graphs.html
Generate graph in png file
x.dot
digraph SomeGraph {
A -> { B C }
B -> C
} 1 dot x.dot -T png -Ox.png
Slackware64 14.1 install
GraphViz for MoinMoin
http://moinmo.in/GraphVizForMoin
1 # in Ubuntu/Raspbian/Debian box
2 sudo bash
3 apt install graphviz unzip
4 cd /tmp
5 wget "https://moinmo.in/GraphVizForMoin?action=AttachFile&do=get&target=MoinGraphViz-1.0rc4-brn-1.9.x.comp.zip"
6 unzip *MoinGraphViz-1.0rc4-brn-1.9.x.comp.zip
7 cd /tmp/MoinGraphViz-1.0rc4-brn-1.9.x.comp/wiki/data/plugin
8 cp * -r /home/moin/moin-1.9.11/wiki/data/plugin/
9 cd /home/moin/moin-1.9.11/wiki/data/plugin/ && chown moin * -R && chgrp www-data * -R
10 cd /tmp/MoinGraphViz-1.0rc4-brn-1.9.x.comp/umoin
11 cp MoinLegacy /home/moin/moin-1.9.11/MoinMoin/support/
12 cd /home/moin/moin-1.9.11/MoinMoin/support/
13 chown moin * -R
14 chgrp www-data * -R
15 vim /home/moin/moin-1.9.11/wiki/data/plugin/parser/MoinGraphViz/main.py # GRAPHVIZ_TOOLS_DIR = r'/usr/bin'
16 service nginx restart
17 service apache2 restart
Note to configure the path of dot executable:
wiki/data/plugin/parser/MoinGraphViz/main.py:GRAPHVIZ_TOOLS_DIR = r'C:/timwe/tools/Graphviz2.38/bin'
Windows configuration
On file <...>moin-1.9.7\wiki\data\plugin\parser\MoinGraphViz\main.py change in line 254 from close_fds=True to close_ds=False, due to error launched in Windows.
1 def oscmd(cmd):
2 '''instead of simply calling os.system(cmd)
3 capture stderr and raise GraphvizRenderError if exit code != 0
4 '''
5 p = Popen(cmd, stdout=PIPE, stderr=PIPE, shell=True,
6 bufsize=1024, close_fds=False)
7 stdo, stde = p.communicate()
8
9 if p.returncode != 0:
10 raise GraphvizRenderError("%s\n%s" % (stdo, stde))
Test after installation
If all was installed correctly a graph should appear below
Sample 1
UML with GraphViz
UML Sample 1
http://www.ffnn.nl/pages/articles/media/uml-diagrams-using-graphviz-dot.php
UML Sample 2
http://www.lornajane.net/posts/2011/uml-diagrams-with-graphviz
UML Sample 3
http://canvoki.net/coder/resources/DotUmlUseCases.html
http://canvoki.net/coder/DotUseCases/MarUseCases.dot
UML Sample 4
http://fsteeg.wordpress.com/2006/11/16/uml-activity-diagrams-with-graphviz/
digraph untitled {
rankdir=TD
size="4,4"
edge[fontsize="11" arrowhead=open]
start[shape=circle, label="", style=filled]
end[shape=doublecircle, label="", style=filled]
action1[shape=box,style=rounded, label="action1"]
action2[shape=box,style=rounded, label="action2"]
action3[shape=box,style=rounded, label="action3"]
if1[shape=diamond, label="decision"]
if2[shape=diamond, label="decision"]
start -> action1
action1 -> if1[headport=n]
if1 -> action2[label="condition" tailport=w]
if1 -> action3[taillabel="condition" labeldistance=2.5 tailport=e]
action2 -> if2[headport=w]
action3 -> if2[headport=e]
if2 -> end[taillabel="condition"]
}
digraph untitled {
rankdir=TD
ClassA[shape=rectangle]
ClassB[shape=rectangle]
{ edge[label=" 1.method1() \l 2. method2()"] ClassA->ClassB}
{ edge[label=" 4.method1() \l 3. method2()"] ClassB->ClassA}
}
Graphviz in MoinMoin 1.9.8 CentOS CentOS release 6.6 (Final)
1 cd /tmp
2 wget "https://moinmo.in/GraphVizForMoin?action=AttachFile&do=get&target=MoinGraphViz-1.0rc4-brn-1.9.x.comp.zip"
3 unzip "GraphVizForMoin?action=AttachFile&do=get&target=MoinGraphViz-1.0rc4-brn-1.9.x.comp.zip"
4 cd MoinGraphViz-1.0rc4-brn-1.9.x.comp/wiki/data/plugin/
5 cp * -r /root/moin-1.9.8/wiki/data/plugin/
6 cd ../umoin/
7 cp MoinLegacy.py /root/moin-1.9.8/MoinMoin/support/
8 yum install graphviz
9 vim /root/moin-1.9.8/wiki/data/plugin/parser/MoinGraphViz/main.py
10 GRAPHVIZ_TOOLS_DIR = r'/usr/bin'
11 cd /root/moin-1.9.8
12 chown root * -R
13 chgrp root * -R
14 service moinmoin stop
15 service moinmoin start
