arrowgen.tcl 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. #!/usr/bin/tclsh
  2. set arrows {
  3. box
  4. crow
  5. curve
  6. diamond
  7. dot
  8. icurve
  9. inv
  10. lbox
  11. lcrow
  12. lcurve
  13. ldiamond
  14. licurve
  15. linv
  16. lnormal
  17. ltee
  18. lvee
  19. none
  20. normal
  21. obox
  22. odiamond
  23. odot
  24. oinv
  25. olbox
  26. oldiamond
  27. olinv
  28. olnormal
  29. onormal
  30. orbox
  31. ordiamond
  32. orinv
  33. ornormal
  34. rbox
  35. rcrow
  36. rcurve
  37. rdiamond
  38. ricurve
  39. rinv
  40. rnormal
  41. rtee
  42. rvee
  43. tee
  44. vee
  45. }
  46. set arrowexamples {
  47. box
  48. crow
  49. curve
  50. diamond
  51. dot
  52. ediamond
  53. empty
  54. halfopen
  55. icurve
  56. inv
  57. invdot
  58. invempty
  59. invodot
  60. lteeoldiamond
  61. none
  62. normal
  63. obox
  64. odiamond
  65. odot
  66. open
  67. tee
  68. }
  69. foreach {arrow} $arrows {
  70. set f [open aa_$arrow.dot w]
  71. puts $f "digraph G \{"
  72. puts $f "graph \[pad=\"0.05\" rankdir=LR\]"
  73. puts $f "a \[label=\"\" shape=point\]"
  74. puts $f "b \[label=\"\" shape=none width=0 height=0\]"
  75. puts $f "a -> b \[arrowhead=$arrow\]"
  76. puts $f "\}"
  77. close $f
  78. exec dot -Tgif aa_$arrow.dot -o aa_$arrow.gif
  79. file delete aa_$arrow.dot
  80. }
  81. foreach {arrow} $arrowexamples {
  82. set f [open a_$arrow.dot w]
  83. puts $f "digraph G \{"
  84. puts $f "graph \[pad=\"0.05\" rankdir=LR\]"
  85. puts $f "a \[label=\"\" shape=point\]"
  86. puts $f "b \[label=\"\"]"
  87. puts $f "a -> b \[arrowhead=$arrow\]"
  88. puts $f "\}"
  89. close $f
  90. exec dot -Tgif a_$arrow.dot -o a_$arrow.gif
  91. file delete a_$arrow.dot
  92. }