Graphviz wrapper lazarus / 39-Graphics ---------------------------------------------------------------------- iLya2IK · 2022-01-29 09:15 Hello! Sorry if this question has already been asked, but I didn't find anything suitable on the forum. Tell me please if there is a pascal header for Graphvis library. ---------------------------------------------------------------------- iLya2IK · 2022-02-14 14:25 Out of desperation, I had to write my own wrapper  . Who is interested, I invite you to the project page. Here is a code example of how to use the wrapper Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i (* Create and draw finite state machine example     *)(* *) program simpletest; uses Classes, OGLGraphvizWrapper; var  // wrapper  Cntx : TGVContext;  Gv  : IGVCntxGraph;  Nv : Array [0..8] of IGVNode;  Ev : IGVEdge;  Av : TGVAttrId;  NI, EI : IGVIterator;  FS : TFileStream;begin  if TGVContext.GVLibsLoad then // initalize gvc and cgraph libs  begin    Cntx := TGVContext.Create;    try      Gv := Cntx.NewGraph('finite_state_machine', [gvoDirected]);      try        Gv.GraphAttr('rankdir', 'LR');        Gv.GraphAttr('size', '8, 5');      Gv.NodeAttr('shape', 'doublecircle');        Nv[0] := Gv.Node('0');        Nv[3] := Gv.Node('3');        Nv[4] := Gv.Node('4');        Nv[8] := Gv.Node('8');        Gv.NodeAttr('shape', 'circle');        Nv[2] := Gv.Node('2');        Nv[1] := Gv.Node('1');        Nv[6] := Gv.Node('6');        Nv[5] := Gv.Node('5');        Nv[7] := Gv.Node('7');         Av := Gv.EdgeAttr('label', '');        Ev := Gv.Edge(Gv.FindNode('0'), Gv.FindNode('2'));        Ev.SetExAttr(Av, 'SS(B)');        Gv.Edge(Nv[0], Nv[1]).SetExAttr(Av, 'SS(S)');        Gv.Edge(Nv[1], Nv[3]).SetExAttr(Av, 'S($end)');        Gv.Edge(Nv[2], Nv[6]).SetExAttr(Av, 'SS(b)');        Gv.Edge(Nv[2], Nv[5]).SetExAttr(Av, 'SS(a)');        Gv.Edge(Nv[2], Nv[4]).SetExAttr(Av, 'S(A)');        Gv.Edge(Nv[5], Nv[7]).SetExAttr(Av, 'S(b)');        Gv.Edge(Nv[5], Nv[5]).SetExAttr(Av, 'S(a)');        Gv.Edge(Nv[6], Nv[6]).SetExAttr(Av, 'S(b)');        Gv.Edge(Nv[6], Nv[5]).SetExAttr(Av, 'S(a)');        Gv.Edge(Nv[7], Nv[8]).SetExAttr(Av, 'S(b)');        Gv.Edge(Nv[7], Nv[5]).SetExAttr(Av, 'S(a)');        Gv.Edge(Nv[8], Nv[6]).SetExAttr(Av, 'S(b)');        Gv.Edge(Nv[8], Nv[5]).SetExAttr(Av, 'S(a)');         // place the graph in a contextual layout to initialize         // drawing interfaces using a specific engine (dot)        Gv.Layout(Cntx, 'dot');                  // iterating through all nodes and edges of the graph        NI := Gv.GetNodeIterator;        while NI.HasNext do        begin          Nv[0] := NI.Next as IGVNode;          WriteLn('Node ', Nv[0].Name);        EI := Gv.GetEdgeIterator(Nv[0]);          while EI.HasNext do        begin            Ev := EI.Next as IGVEdge;            WriteLn('  Edge ', Ev.GetExAttr(Av).AsString);          end;        end;       // draw the graph in an SVG file        Gv.RenderFilename('svg', 'out3.svg');                        // example of drawing the graph into a stream        FS := TFileStream.Create('out4.bmp', fmCreate or fmOpenWrite);        try          Gv.RenderStream('bmp', FS);        finally          FS.Free;        end;       finally        Gv.Close;    end;    finally      Cntx.Free;    end;     TGVContext.GVLibsUnLoad;  end else begin    WriteLn('Cant initialize Graphviz');  end;  Readln;end. ---------------------------------------------------------------------- avra · 2022-02-15 01:13 Thanks! I will have a need for this in the future...