Search code examples
graphviz

Why this code does not work in viz-js site?


This code

digraph R {

   node [shape=record];

   { rank = same; rA; sA; tA; }
   { rank = same; uB; vB; wB; }

   rA -> sA;
   sA -> vB;
   uB -> vB;
   wB -> tA;
}

does not work in http://viz-js.com/ but it works fine in http://www.webgraphviz.com/

Why? How to fix in order to work in both sites?


Solution

  • Intriguing problem.

    With the version 2.38 (dot - graphviz version 2.38.0 (20140413.2041)) I get the right image (as shown with http://www.webgraphviz.com/):

    enter image description here

    With version 2.40 (dot - graphviz version 2.40.1 (20161225.0304)) I get the error messages:

    Warning: flat edge between adjacent nodes one of which has a record shape - replace records with HTML-like labels
      Edge rA -> sA
    Error: lost rA sA edge
    Error: lost uB vB edge
    
    

    and the picture looks like:

    enter image description here

    So problem most likely is the version of dot used by the 2 interpreters. There is a newer version of dot available (2.42.2 see https://gitlab.com/graphviz/graphviz), but very unlikely that this will be integrated in viz-js.com as for viz.js repository (https://github.com/mdaines/viz.js) there is, unfortunately, written: This repository has been archived by the owner. It is now read-only.