[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-0-en-105":3,"doc-seo-655887-105":59,"doc-detail-655887-en":130},{"code":4,"msg":5,"data":6},0,"success",[7,13,18,23,28,33,38,43,48,51,55],{"id":8,"doc_module":4,"doc_module_name":9,"category_name":10,"show_sort_weight":11,"slug":12},1,"Document","Story & Novel",90,"story-novel",{"id":14,"doc_module":4,"doc_module_name":9,"category_name":15,"show_sort_weight":16,"slug":17},2,"Literature",80,"literature",{"id":19,"doc_module":4,"doc_module_name":9,"category_name":20,"show_sort_weight":21,"slug":22},4,"Exam",70,"exam",{"id":24,"doc_module":4,"doc_module_name":9,"category_name":25,"show_sort_weight":26,"slug":27},5,"Comic",60,"comic",{"id":29,"doc_module":4,"doc_module_name":9,"category_name":30,"show_sort_weight":31,"slug":32},6,"Technology",50,"technology",{"id":34,"doc_module":4,"doc_module_name":9,"category_name":35,"show_sort_weight":36,"slug":37},7,"Healthcare",40,"healthcare",{"id":39,"doc_module":4,"doc_module_name":9,"category_name":40,"show_sort_weight":41,"slug":42},8,"Research & Report",30,"research-report",{"id":44,"doc_module":4,"doc_module_name":9,"category_name":45,"show_sort_weight":46,"slug":47},9,"Religion & Spirituality",20,"religion-spirituality",{"id":46,"doc_module":4,"doc_module_name":9,"category_name":49,"show_sort_weight":46,"slug":50},"World Cup","world-cup",{"id":52,"doc_module":4,"doc_module_name":9,"category_name":53,"show_sort_weight":52,"slug":54},10,"Lifestyle","lifestyle",{"id":56,"doc_module":4,"doc_module_name":9,"category_name":57,"show_sort_weight":24,"slug":58},19,"General","general",{"code":4,"msg":60,"data":61},"ok",{"site_id":62,"language":63,"slug":64,"title":65,"keywords":66,"description":67,"schema_data":68,"social_meta":123,"head_meta":125,"extra_data":127,"updated_unix":129},105,"en","drawing-graphs-with-dot","Drawing Graphs with dot","","dot draws directed graphs as hierarchies, providing multiple ways to run: command line tool, web visualization service, or compatible graphical interface. Its layout system combines tuned node placement and edge spline routing, supports edge labels, and enables record-like shapes using ports for data-structure drawing. It also offers cluster layouts and an underlying file language designed for stream-oriented graph tools and modules.",{"@graph":69,"@context":122},[70,84,105],{"@type":71,"itemListElement":72},"BreadcrumbList",[73,77,79,82],{"item":74,"name":75,"@type":76,"position":8},"https://docshare.wps.com","Home","ListItem",{"item":78,"name":9,"@type":76,"position":14},"https://docshare.wps.com/document/",{"item":80,"name":30,"@type":76,"position":81},"https://docshare.wps.com/document/technology/",3,{"item":83,"name":65,"@type":76,"position":19},"https://docshare.wps.com/document/drawing-graphs-with-dot/655887/",{"url":83,"name":65,"@type":85,"image":86,"author":91,"headline":65,"publisher":94,"fileFormat":97,"inLanguage":63,"description":67,"dateModified":98,"datePublished":99,"encodingFormat":97,"isAccessibleForFree":100,"interactionStatistic":101},"DigitalDocument",{"url":87,"@type":88,"width":89,"height":90},"https://docshare.wps.com/thumbnails/drawing-graphs-with-dot/655887.png","ImageObject",300,407,{"name":92,"@type":93},"Rainbow Cat","Person",{"url":74,"name":95,"@type":96},"DocShare","Organization","application/pdf","2026-11-02","2026-10-25",true,{"@type":102,"interactionType":103,"userInteractionCount":81},"InteractionCounter",{"@type":104},"ViewAction",{"@type":106,"mainEntity":107},"FAQPage",[108,114,118],{"name":109,"@type":110,"acceptedAnswer":111},"How does dot convert a graph into a hierarchical drawing?","Question",{"text":112,"@type":113},"dot breaks cycles by reversing certain cyclic edges, assigns nodes to discrete ranks, orders nodes within ranks to reduce crossings, then sets X coordinates and routes edge splines.","Answer",{"name":115,"@type":110,"acceptedAnswer":116},"What input format does dot use?",{"text":117,"@type":113},"dot accepts input in the DOT language, which describes objects such as graphs, nodes, and edges, including directed graphs via digraph.",{"name":119,"@type":110,"acceptedAnswer":120},"How can node and edge appearance be controlled in the DOT input?",{"text":121,"@type":113},"Use attributes as name-value pairs on nodes, edges, or subgraphs; examples include size, shape, edge weight, line style (e.g., dotted), labels, and colors.","https://schema.org",{"og:url":83,"og:type":124,"og:title":65,"og:site_name":95,"og:description":67},"article",{"robots":126,"canonical":83},"index,follow",{"doc_id":128,"site_id":62},655887,1793052153,{"code":4,"msg":5,"data":131},{"doc_id":128,"user_id":132,"nickname":92,"user_avatar":133,"doc_module":4,"category_id":29,"category_name":30,"doc_title":65,"doc_description":67,"doc_content":134,"file_id":135,"file_url":136,"file_type":137,"file_size":138,"view_count":81,"is_deleted":4,"is_public":8,"is_downloadable":8,"audit_status":8,"page_count":36,"language":139,"language_code":63,"site_id":62,"html_lang":63,"table_of_contents":140,"faqs":141,"seo_title":142,"seo_description":67,"update_tm":143,"read_time":144},962090769181,"https://ap-avatar.wpscdn.com/davatar_6f874abed73319feea01a86fa6f0fab8","Drawing graphs with dot  \nEmden R. Gansner and Eleftherios Koutsoﬁos and Stephen North  \nJanuary 5, 2015  \nAbstract  \ndot draws directed graphs as hierarchies. It runs as a command line program, web visualization service, or with a compatible graphical interface. Its features include well-tuned layout algorithms for placing nodes and edge splines, edge labels, “record” shapes with “ports” for drawing data structures; cluster layouts; and an underlying ﬁle language for stream-oriented graph tools. Below is a reduced module dependency graph of an SML-NJ compiler that took 0.23 seconds of user time on a 3 GHz Intel Xeon.  \n1  \n1 Basic Graph Drawing  \ndot draws directed graphs. It reads attributed graph text ﬁles and writes drawings, either as graph ﬁles or in a graphics format such as GIF, PNG, SVG, PDF, or PostScript.  \ndot draws graphs in four main phases. Knowing this helps you to understand what kind of layouts dot makes and how you can control them. The layout procedure used by dot relies on the graph being acyclic. Thus, the ﬁrst step is to break any cycles which occur in the input graph by reversing the internal direction of certain cyclic edges. The next step assigns nodes to discrete ranks or levels. In atop-to-bottom drawing, ranks determine Y coordinates. Edges that span more than one rank are broken into chains of “virtual” nodes and unit-length edges. The third step orders nodes within ranks to avoid crossings. The fourth step sets X coordinates of nodes to keep edges short, and the ﬁnal step routes edge splines. This is the same general approach as most hierarchical graph drawing programs, based on the work of Warﬁeld [War77], Carpano [Car80] and Sugiyama [STT81] . We refer the reader to [GKNV93] for a thorough explanation of dot's algorithms.  \ndot accepts input in the DOT language (cf. Appendix D) . This language describes three main kinds of objects: graphs, nodes, and edges. The main (outermost) graph can be directed (digraph) or undirected graph. Because dot makes layouts of directed graphs, all the following examples use digraph. (A separate layout utility, neato, draws undirected graphs [Nor92].) Within a main graph, asubgraph deﬁnes a subset of nodes and edges.  \nFigure 1 is an example graph in the DOT language. Line 1 gives the graph name and type. The lines that follow create nodes, edges, or subgraphs, and set attributes. Names of all these objects may be C identiﬁers, numbers, or quoted C strings. Quotes protect punctuation and white space.  \nA node is created when its name ﬁrst appears in the ﬁle. An edge is created when nodes are joined by the edge operator-> . In the example, line 2 makes edges from main toparse, and from parse to execute. Running dot on this ﬁle (call it graph1 .gv)  \n$ dot-Tps graph1 .gv-o graph1 .ps  \nyields the drawing of Figure 2 . The command line option-Tps selects PostScript (EPSF) output. graph1 .ps may be printed, displayed by a PostScript viewer, or embedded in another document.  \nIt is often useful to adjust the representation or placement of nodes and edges in the layout. This is done by setting attributes of nodes, edges, or subgraphs in the input ﬁle. Attributes are name-value pairs of character strings. Figures 3 and 4 illustrate some layout attributes. In the listing of Figure 3, line 2 sets the graph's  \ndot User's Manual, January 5, 2015 3  \n1: digraph G {  \n2: main-> parse-> execute;  \n3: main-> init;  \n4: main-> cleanup;  \n5: execute-> make_string;  \n6: execute-> printf  \n7: init-> make_string;  \n8: main-> printf;  \n9: execute-> compare;  \n10: }  \nFigure 1: Small graph  \nFigure 2: Drawing of small graph  \ndot User's Manual, January 5, 2015 4  \nsize to 4,4 (in inches) . This attribute controls the size of the drawing; if the drawing is too large, it is scaled uniformly as necessary to ﬁt.  \nNode or edge attributes are set off in square brackets. In line 3, the node main is assigned shape box. The edge in line 4 is straightened by increasing its weight (the default ","cbCaiqk1JUN7kWv0","https://ap.wps.com/l/cbCaiqk1JUN7kWv0","pdf",283995,"English","# Basic Graph Drawing\n## Node Shapes\n## Drawing Attributes","[{\"question\":\"How does dot convert a graph into a hierarchical drawing?\",\"answer\":\"dot breaks cycles by reversing certain cyclic edges, assigns nodes to discrete ranks, orders nodes within ranks to reduce crossings, then sets X coordinates and routes edge splines.\"},{\"question\":\"What input format does dot use?\",\"answer\":\"dot accepts input in the DOT language, which describes objects such as graphs, nodes, and edges, including directed graphs via digraph.\"},{\"question\":\"How can node and edge appearance be controlled in the DOT input?\",\"answer\":\"Use attributes as name-value pairs on nodes, edges, or subgraphs; examples include size, shape, edge weight, line style (e.g., dotted), labels, and colors.\"}]","Drawing Graphs with dot | PDF",1792964564,101]