tcldot.html 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. <html>
  2. <head>
  3. <title> Tcl Dot API (tcldot)</title>
  4. <link rev=made href="mailto:[email protected]">
  5. </head>
  6. <body>
  7. <h1> Tcl Dot API (tcldot)</h1>
  8. <p>(Tcl Dot also pulls in Gdtclft for writing to a gif image.)
  9. <p><hr>
  10. Create a new graph.
  11. <pre>
  12. <b>dotnew</b> <i>graphtype</i> ?<i>attributeName attributeValue</i>? ?...?
  13. -> <i>graphHandle</i>
  14. <i>graphtype</i>:= (<b>graph</b>|<b>digraph</b>|<b>graphstrict</b>|<b>digraphstrict</b>)
  15. </pre>
  16. Read a graph.
  17. <pre>
  18. <b>dotread</b> <i>fileHandle</i>
  19. -> <i>graphHandle</i>
  20. </pre>
  21. Add a node to a graph
  22. <pre>
  23. <i>graphHandle</i> <b>addnode</b> ?<i>nodeName</i>? ?<i>attributeName attributeValue</i>? ?...?
  24. -> <i>nodeHandle</i>
  25. If the <i>nodeName</i> parameter is omitted the name of the
  26. node defaults to <i>nodeHandle</i>.
  27. </pre>
  28. Add an edge to a graph
  29. <pre>
  30. <i>graphHandle</i> <b>addedge</b> <i>tailnode</i> <i>headnode</i> ?<i>attributeName attributeValue</i>? ?...?
  31. -> <i>edgeHandle</i>
  32. <i>tailnode</i> = (<i>tailnodeHandle</i>|<i>tailnodeName</i>)
  33. <i>headnode</i> = (<i>headnodeHandle</i>|<i>headnodeName</i>)
  34. NodeHandles take precedence, so if nodeName is of the form
  35. "node99" it may conflict. The precedence can be overridden
  36. with code such as:
  37. <i>graphHandle</i> <b>addedge</b> <b>\</b>
  38. <b>[</b><i>graphHandle</i> <b>findnode</b> <i>tailnodeName</i><b>]</b> <b>\</b>
  39. <b>[</b><i>graphHandle</i> <b>findnode</b> <i>headnodeName</i><b>]</b>
  40. </pre>
  41. Add a subgraph to a graph
  42. <pre>
  43. <i>graphHandle</i> <b>addsubgraph</b> ?<i>subgName</i>? ?<i>attributeName attributeValue</i>? ?...?
  44. -> <i>subgHandle</i>
  45. If the <i>subgName</i> parameter is omitted the name of the
  46. node defaults to <i>subgHandle</i>.
  47. Clusters are created by giving a subgraph a name that begins
  48. with "cluster".
  49. </pre>
  50. Add a edge to a node
  51. <pre>
  52. <i>tailnodeHandle</i> <b>addedge</b> <i>headnode</i> ?<i>attributeName attributeValue</i>? ?...?
  53. -> <i>edgeHandle</i>
  54. <i>headnode</i> = (<i>headnodeHandle</i>|<i>headnodeName</i>)
  55. </pre>
  56. Delete a graph/node/edge
  57. <pre>
  58. <i>graphHandle</i> <b>delete</b>
  59. <i>nodeHandle</i> <b>delete</b>
  60. <i>edgeHandle</i> <b>delete</b>
  61. </pre>
  62. Count nodes/edges
  63. <pre>
  64. <i>graphHandle</i> <b>countnodes</b>
  65. -> <i>integer</i>
  66. <i>graphHandle</i> <b>countedges</b>
  67. -> <i>integer</i>
  68. </pre>
  69. List subgraphs/nodes/edges
  70. <pre>
  71. <i>graphHandle</i> <b>listnodes</b>
  72. -> <i>{nodeHandle ... }</i>
  73. <i>nodeHandle</i> <b>listedges</b>
  74. -> <i>{edgeHandle ... }</i>
  75. <i>nodeHandle</i> <b>listoutedges</b>
  76. -> <i>{edgeHandle ... }</i>
  77. <i>nodeHandle</i> <b>listinedges</b>
  78. -> <i>{edgeHandle ... }</i>
  79. <i>edgeHandle</i> <b>listnodes</b>
  80. -> <i>tailnodeHandle</i> <i>headnodeHandle</i>
  81. <i>graphHandle</i> <b>listsubgraphs</b>
  82. -> <i>{graphHandle ... }</i>
  83. </pre>
  84. Find nodes/edges by nodename
  85. <pre>
  86. <i>graphHandle</i> <b>findnode</b> <i>nodename</i>
  87. -> <i>nodeHandle</i>
  88. <i>graphHandle</i> <b>findedge</b> <i>tailnodename</i> <i>headnodename</i>
  89. -> <i>edgeHandle</i>
  90. <i>nodeHandle</i> <b>findedge</b> <i>nodename</i>
  91. -> <i>edgeHandle</i>
  92. </pre>
  93. Show graph/node/edge name
  94. <pre>
  95. <i>graphHandle</i> <b>showname</b>
  96. -> <i>graphname</i>
  97. <i>nodeHandle</i> <b>showname</b>
  98. -> <i>nodename</i>
  99. <i>edgeHandle</i> <b>showname</b>
  100. -> <i>edgename</i>
  101. </pre>
  102. Set default node/edge attributes
  103. <pre>
  104. <i>graphHandle</i> <b>setnodeattributes</b> <i>attributeName attributeValue</i> ?...?
  105. <i>graphHandle</i> <b>setedgeattributes</b> <i>attributeName attributeValue</i> ?...?
  106. </pre>
  107. List node/edge attribute names
  108. <pre>
  109. <i>graphHandle</i> <b>listnodeattributes</b>
  110. -> <i>{attributeName ... }</i>
  111. <i>graphHandle</i> <b>listedgeattributes</b>
  112. -> <i>{attributeName ... }</i>
  113. </pre>
  114. Query default node/edge attributes
  115. <pre>
  116. <i>graphHandle</i> <b>querynodeattributes</b> <i>attributeName</i> ?...?
  117. -> <i>{attributeValue ... }</i>
  118. <i>graphHandle</i> <b>queryedgeattributes</b> <i>attributeName</i> ?...?
  119. -> <i>{attributeValue ... }</i>
  120. </pre>
  121. Set graph/node/edge attributes
  122. <pre>
  123. <i>graphHandle</i> <b>setattributes</b> <I>attributeName attributeValue</i> ?...?
  124. <i>nodeHandle</i> <b>setattributes</b> <i>attributeName attributeValue</i> ?...?
  125. <i>edgeHandle</i> <b>setattributes</b> <i>attributeName attributeValue</i> ?...?
  126. </pre>
  127. List graph/node/edge attribute names
  128. <pre>
  129. <i>graphHandle</i> <b>listattributes</b>
  130. -> <i>{attributeName ... }</i>
  131. <i>nodeHandle</i> <b>listattributes</b>
  132. -> <i>{attributeName ... }</i>
  133. <i>edgeHandle</i> <b>listattributes</b>
  134. -> <i>{attributeName ... }</i>
  135. </pre>
  136. Query graph/node/edge attribute values
  137. <pre>
  138. <i>graphHandle</i> <b>queryattributes</b> <i>attributeName</i> ?<i>attributeName</i>? ?...?
  139. -> <i>{attributeValue ... }</i>
  140. <i>nodeHandle</i> <b>queryattributes</b> <i>attributeName</i> ?<i>attributeName</i>? ?...?
  141. -> <i>{attributeValue ... }</i>
  142. <i>edgeHandle</i> <b>queryattributes</b> <i>attributeName</i> ?<i>attributeName</i>? ?...?
  143. -> <i>{attributeValue ... }</i>
  144. </pre>
  145. Layout nodes
  146. <pre>
  147. <i>graphHandle</i> <b>layoutNodes</b>
  148. <b>NOTE:</b> Not yet implemented. Use:
  149. <i>graphHandle</i> <b>layout</b>
  150. to layout both nodes and edges.
  151. </pre>
  152. Layout edges
  153. <pre>
  154. <i>graphHandle</i> <b>layoutEdges</b> -<i>style</i>
  155. <i>style</i>:= (<b>straight</b>|<b>spline</b>)
  156. <b>NOTE:</b> Not yet implemented. Use:
  157. <i>graphHandle</i> <b>layout</b>
  158. to layout both nodes and edges.
  159. </pre>
  160. Write graph to file
  161. <pre>
  162. <i>graphHandle</i> <b>write</b> <i>filehandle</i> <i>format</i>
  163. <i>format</i>:= (<b>ps</b>|<b>mif</b>|<b>gif</b>|<b>plain</b>|<b>dot</b>)
  164. </pre>
  165. Render graph to existing or new gifImage (see:
  166. <a href=http://guraldi.hgp.med.umich.edu/gdtcl.html>gdTcl</a>)
  167. <pre>
  168. <i>graphHandle</i> <b>rendergd</b> ?<i>gdHandle</i>?
  169. -> <i>gdHandle</i>
  170. </pre>
  171. Render graph to canvas (tkdot only)
  172. <pre>
  173. <i>graphHandle</i> <b>render</b> <i>canvashandle</i>
  174. <b>NOTE:</b> Not yet fully implemented. For now use:
  175. <b>set c</b> <i>canvasHandle</i>
  176. <b>eval [</b><i>graphHandle</i> <b>render]</b>
  177. </pre>
  178. </body>
  179. </html>