rsyntaxtree 1.2.3 → 1.2.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (139) hide show
  1. checksums.yaml +4 -4
  2. data/.tags +364 -127
  3. data/Rakefile +3 -0
  4. data/bin/rsyntaxtree +2 -0
  5. data/docs/_examples/000.md +2 -1
  6. data/docs/_examples/001.md +1 -0
  7. data/docs/_examples/002.md +1 -0
  8. data/docs/_examples/003.md +1 -0
  9. data/docs/_examples/004.md +1 -0
  10. data/docs/_examples/005.md +1 -0
  11. data/docs/_examples/006.md +1 -0
  12. data/docs/_examples/007.md +1 -0
  13. data/docs/_examples/008.md +1 -0
  14. data/docs/_examples/009.md +1 -0
  15. data/docs/_examples/010.md +1 -0
  16. data/docs/_examples/011.md +1 -0
  17. data/docs/_examples/012.md +1 -0
  18. data/docs/_examples/013.md +1 -0
  19. data/docs/_examples/014.md +1 -0
  20. data/docs/_examples/015.md +1 -0
  21. data/docs/_examples/016.md +1 -0
  22. data/docs/_examples/017.md +1 -0
  23. data/docs/_examples/018.md +1 -0
  24. data/docs/_examples/019.md +1 -0
  25. data/docs/_examples/020.md +7 -6
  26. data/docs/_examples/021.md +1 -0
  27. data/docs/_examples/022.md +1 -0
  28. data/docs/_examples/023.md +1 -0
  29. data/docs/_examples/024.md +1 -0
  30. data/docs/_examples/025.md +1 -0
  31. data/docs/_examples/026.md +1 -0
  32. data/docs/_examples/027.md +1 -0
  33. data/docs/_examples/028.md +1 -0
  34. data/docs/_examples/029.md +1 -0
  35. data/docs/_examples/030.md +1 -0
  36. data/docs/_examples/031.md +1 -0
  37. data/docs/_examples/032.md +1 -0
  38. data/docs/_examples/033.md +1 -0
  39. data/docs/_examples/034.md +1 -0
  40. data/docs/_examples/035.md +1 -0
  41. data/docs/_examples/036.md +1 -0
  42. data/docs/_examples/037.md +1 -0
  43. data/docs/_examples/038.md +2 -1
  44. data/docs/_examples/039.md +2 -0
  45. data/docs/_examples/040.md +62 -0
  46. data/docs/_examples/041.md +34 -0
  47. data/docs/assets/img/000.png +0 -0
  48. data/docs/assets/img/001.png +0 -0
  49. data/docs/assets/img/002.png +0 -0
  50. data/docs/assets/img/003.png +0 -0
  51. data/docs/assets/img/004.png +0 -0
  52. data/docs/assets/img/005.png +0 -0
  53. data/docs/assets/img/006.png +0 -0
  54. data/docs/assets/img/007.png +0 -0
  55. data/docs/assets/img/008.png +0 -0
  56. data/docs/assets/img/009.png +0 -0
  57. data/docs/assets/img/010.png +0 -0
  58. data/docs/assets/img/011.png +0 -0
  59. data/docs/assets/img/012.png +0 -0
  60. data/docs/assets/img/013.png +0 -0
  61. data/docs/assets/img/014.png +0 -0
  62. data/docs/assets/img/015.png +0 -0
  63. data/docs/assets/img/016.png +0 -0
  64. data/docs/assets/img/017.png +0 -0
  65. data/docs/assets/img/018.png +0 -0
  66. data/docs/assets/img/019.png +0 -0
  67. data/docs/assets/img/020.png +0 -0
  68. data/docs/assets/img/021.png +0 -0
  69. data/docs/assets/img/022.png +0 -0
  70. data/docs/assets/img/023.png +0 -0
  71. data/docs/assets/img/024.png +0 -0
  72. data/docs/assets/img/025.png +0 -0
  73. data/docs/assets/img/026.png +0 -0
  74. data/docs/assets/img/027.png +0 -0
  75. data/docs/assets/img/028.png +0 -0
  76. data/docs/assets/img/029.png +0 -0
  77. data/docs/assets/img/030.png +0 -0
  78. data/docs/assets/img/031.png +0 -0
  79. data/docs/assets/img/032.png +0 -0
  80. data/docs/assets/img/033.png +0 -0
  81. data/docs/assets/img/034.png +0 -0
  82. data/docs/assets/img/035.png +0 -0
  83. data/docs/assets/img/036.png +0 -0
  84. data/docs/assets/img/037.png +0 -0
  85. data/docs/assets/img/038.png +0 -0
  86. data/docs/assets/img/040.png +0 -0
  87. data/docs/assets/img/041.png +0 -0
  88. data/docs/assets/svg/000.svg +43 -43
  89. data/docs/assets/svg/001.svg +14 -14
  90. data/docs/assets/svg/002.svg +19 -19
  91. data/docs/assets/svg/003.svg +16 -16
  92. data/docs/assets/svg/004.svg +18 -18
  93. data/docs/assets/svg/005.svg +11 -11
  94. data/docs/assets/svg/006.svg +13 -13
  95. data/docs/assets/svg/007.svg +15 -15
  96. data/docs/assets/svg/008.svg +19 -19
  97. data/docs/assets/svg/009.svg +17 -17
  98. data/docs/assets/svg/010.svg +32 -32
  99. data/docs/assets/svg/011.svg +15 -15
  100. data/docs/assets/svg/012.svg +16 -16
  101. data/docs/assets/svg/013.svg +140 -140
  102. data/docs/assets/svg/014.svg +102 -109
  103. data/docs/assets/svg/015.svg +21 -21
  104. data/docs/assets/svg/016.svg +144 -144
  105. data/docs/assets/svg/017.svg +22 -22
  106. data/docs/assets/svg/018.svg +25 -25
  107. data/docs/assets/svg/019.svg +202 -232
  108. data/docs/assets/svg/020.svg +37 -35
  109. data/docs/assets/svg/021.svg +20 -20
  110. data/docs/assets/svg/022.svg +39 -39
  111. data/docs/assets/svg/023.svg +31 -31
  112. data/docs/assets/svg/024.svg +11 -11
  113. data/docs/assets/svg/025.svg +144 -144
  114. data/docs/assets/svg/026.svg +9 -9
  115. data/docs/assets/svg/027.svg +19 -19
  116. data/docs/assets/svg/028.svg +15 -15
  117. data/docs/assets/svg/029.svg +88 -98
  118. data/docs/assets/svg/030.svg +47 -53
  119. data/docs/assets/svg/031.svg +9 -9
  120. data/docs/assets/svg/032.svg +60 -66
  121. data/docs/assets/svg/033.svg +29 -29
  122. data/docs/assets/svg/034.svg +58 -67
  123. data/docs/assets/svg/035.svg +48 -53
  124. data/docs/assets/svg/036.svg +26 -29
  125. data/docs/assets/svg/037.svg +24 -25
  126. data/docs/assets/svg/038.svg +51 -57
  127. data/docs/assets/svg/039.svg +8 -8
  128. data/docs/assets/svg/040.svg +120 -0
  129. data/docs/assets/svg/041.svg +93 -0
  130. data/docs/documentation.md +7 -3
  131. data/docs/documentation_ja.md +7 -3
  132. data/docs/examples.html +2 -0
  133. data/lib/rsyntaxtree/base_graph.rb +7 -6
  134. data/lib/rsyntaxtree/element.rb +2 -0
  135. data/lib/rsyntaxtree/svg_graph.rb +51 -48
  136. data/lib/rsyntaxtree/version.rb +1 -1
  137. data/lib/rsyntaxtree.rb +5 -0
  138. data/test/example_verify_test.rb +1 -0
  139. metadata +9 -3
@@ -0,0 +1,120 @@
1
+ <?xml version="1.0" standalone="no"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
+ <svg width="3020.8" height="2600.8" viewBox="-20, -20, 3040.8, 2620.8" version="1.1" xmlns="http://www.w3.org/2000/svg">
4
+ <defs>
5
+ <marker id="arrow" markerUnits="userSpaceOnUse" viewBox="0 0 10 10" refX="10" refY="5" markerWidth="28.8" markerHeight="28.8" orient="auto">
6
+ <path d="M 0 0 L 10 5 L 0 10" fill="black"/>
7
+ </marker>
8
+ <marker id="arrowBackward" markerUnits="userSpaceOnUse" viewBox="0 0 10 10" refX="5" refY="5" markerWidth="28.8" markerHeight="28.8" orient="auto">
9
+ <path d="M 0 0 L 10 5 L 0 10 z" fill="black"/>
10
+ </marker>
11
+ <marker id="arrowForward" markerUnits="userSpaceOnUse" viewBox="0 0 10 10" refX="5" refY="5" markerWidth="28.8" markerHeight="28.8" orient="auto">
12
+ <path d="M 10 0 L 0 5 L 10 10 z" fill="black"/>
13
+ </marker>
14
+ <marker id="arrowBothways" markerUnits="userSpaceOnUse" viewBox="0 0 30 10" refX="15" refY="5" markerWidth="86.4" markerHeight="28.8" orient="auto">
15
+ <path d="M 0 5 L 10 0 L 10 5 L 20 5 L 20 0 L 30 5 L 20 10 L 20 5 L 10 5 L 10 10 z" fill="black"/>
16
+ </marker>
17
+ <pattern id="hatchBlack" x="10" y="10" width="10" height="10" patternUnits="userSpaceOnUse" patternTransform="rotate(45)">
18
+ <line x1="0" y="0" x2="0" y2="10" stroke="black" stroke-width="4"></line>
19
+ </pattern>
20
+ <pattern id="hatchForNode" x="10" y="10" width="10" height="10" patternUnits="userSpaceOnUse" patternTransform="rotate(45)">
21
+ <line x1="0" y="0" x2="0" y2="10" stroke="black" stroke-width="4"></line>
22
+ </pattern>
23
+ <pattern id="hatchForLeaf" x="10" y="10" width="10" height="10" patternUnits="userSpaceOnUse" patternTransform="rotate(45)">
24
+ <line x1="0" y="0" x2="0" y2="10" stroke="black" stroke-width="4"></line>
25
+ </pattern>
26
+ </defs>
27
+ <rect x="-20" y="-20" width="3040.8" height="2620.8" stroke="none" fill="white" />"
28
+ <text white-space='pre' alignment-baseline='text-top' style='fill: black; font-size: 64px;' x='1200.6000000000004' y='132.0'><tspan x='1560.6000000000004' y='132.0' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">root</tspan>
29
+ <tspan x='1380.6000000000004' y='220.0' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">[cons]<tspan style='fill:none;'>■</tspan>[sonor]</tspan>
30
+ <tspan x='1470.6000000000004' y='308.0' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">stricture</tspan>
31
+ <tspan x='1200.6000000000004' y='396.0' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">[later]<tspan style='fill:none;'>■</tspan>[strid]<tspan style='fill:none;'>■</tspan>[contin]</tspan>
32
+ </text>
33
+ <text white-space='pre' alignment-baseline='text-top' style='fill: black; font-size: 64px;' x='630.0000000000001' y='1047.2'><tspan x='630.0000000000001' y='1047.2' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">cavity</tspan>
34
+ <tspan x='666.0000000000001' y='1135.2' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">Oral</tspan>
35
+ </text>
36
+ <text white-space='pre' alignment-baseline='text-top' style='fill: black; font-size: 64px;' x='28.799999999999955' y='1522.4'><tspan x='28.799999999999955' y='1522.4' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">articulator</tspan>
37
+ <tspan x='118.79999999999995' y='1610.4' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">Labial</tspan>
38
+ </text>
39
+ <text white-space='pre' alignment-baseline='text-top' style='fill: black; font-size: 64px;' x='82.80000000000018' y='1997.6000000000001'><tspan x='82.80000000000018' y='1997.6000000000001' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">terminal</tspan>
40
+ <tspan x='82.80000000000018' y='2085.6000000000004' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">features</tspan>
41
+ <tspan x='100.80000000000018' y='2173.6000000000004' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">[round]</tspan>
42
+ </text>
43
+ <text white-space='pre' alignment-baseline='text-top' style='fill: black; font-size: 64px;' x='540.0000000000002' y='1522.4'><tspan x='540.0000000000002' y='1522.4' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">articulator</tspan>
44
+ <tspan x='612.0000000000002' y='1610.4' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">Coronal</tspan>
45
+ </text>
46
+ <text white-space='pre' alignment-baseline='text-top' style='fill: black; font-size: 64px;' x='576.0000000000002' y='1997.6000000000001'><tspan x='594.0000000000002' y='1997.6000000000001' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">terminal</tspan>
47
+ <tspan x='594.0000000000002' y='2085.6000000000004' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">features</tspan>
48
+ <tspan x='612.0000000000002' y='2173.6000000000004' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">[anter]</tspan>
49
+ <tspan x='576.0000000000002' y='2261.6000000000004' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">[distrib]</tspan>
50
+ </text>
51
+ <text white-space='pre' alignment-baseline='text-top' style='fill: black; font-size: 64px;' x='1051.2000000000003' y='1522.4'><tspan x='1051.2000000000003' y='1522.4' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">articulator</tspan>
52
+ <tspan x='1141.2000000000003' y='1610.4' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">Dorsal</tspan>
53
+ </text>
54
+ <text white-space='pre' alignment-baseline='text-top' style='fill: black; font-size: 64px;' x='1105.2000000000003' y='1997.6000000000001'><tspan x='1105.2000000000003' y='1997.6000000000001' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">terminal</tspan>
55
+ <tspan x='1105.2000000000003' y='2085.6000000000004' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">features</tspan>
56
+ <tspan x='1141.2000000000003' y='2173.6000000000004' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">[back]</tspan>
57
+ <tspan x='1141.2000000000003' y='2261.6000000000004' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">[high]</tspan>
58
+ <tspan x='1159.2000000000003' y='2349.6000000000004' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">[low]</tspan>
59
+ </text>
60
+ <text white-space='pre' alignment-baseline='text-top' style='fill: black; font-size: 64px;' x='1652.4' y='1047.2'><tspan x='1652.4' y='1047.2' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">cavity</tspan>
61
+ <tspan x='1670.4' y='1135.2' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">Nasal</tspan>
62
+ </text>
63
+ <text white-space='pre' alignment-baseline='text-top' style='fill: black; font-size: 64px;' x='1562.4' y='1522.4'><tspan x='1562.4' y='1522.4' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">articulator</tspan>
64
+ <tspan x='1562.4' y='1610.4' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">Soft<tspan style='fill:none;'>■</tspan>Palate</tspan>
65
+ </text>
66
+ <text white-space='pre' alignment-baseline='text-top' style='fill: black; font-size: 64px;' x='1616.4' y='1997.6000000000001'><tspan x='1616.4' y='1997.6000000000001' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">terminal</tspan>
67
+ <tspan x='1616.4' y='2085.6000000000004' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">features</tspan>
68
+ <tspan x='1634.4' y='2173.6000000000004' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">[nasal]</tspan>
69
+ </text>
70
+ <text white-space='pre' alignment-baseline='text-top' style='fill: black; font-size: 64px;' x='2347.2' y='1047.2'><tspan x='2419.2' y='1047.2' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">cavity</tspan>
71
+ <tspan x='2347.2' y='1135.2' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">Pharyngeal</tspan>
72
+ </text>
73
+ <text white-space='pre' alignment-baseline='text-top' style='fill: black; font-size: 64px;' x='2073.6000000000004' y='1522.4'><tspan x='2073.6000000000004' y='1522.4' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">articulator</tspan>
74
+ <tspan x='2145.6000000000004' y='1610.4' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">Radical</tspan>
75
+ </text>
76
+ <text white-space='pre' alignment-baseline='text-top' style='fill: black; font-size: 64px;' x='2127.6000000000004' y='1997.6000000000001'><tspan x='2127.6000000000004' y='1997.6000000000001' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">terminal</tspan>
77
+ <tspan x='2127.6000000000004' y='2085.6000000000004' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">features</tspan>
78
+ <tspan x='2181.6000000000004' y='2173.6000000000004' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">[ATR]</tspan>
79
+ <tspan x='2181.6000000000004' y='2261.6000000000004' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">[RTR]</tspan>
80
+ </text>
81
+ <text white-space='pre' alignment-baseline='text-top' style='fill: black; font-size: 64px;' x='2584.8' y='1522.4'><tspan x='2584.8' y='1522.4' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">articulator</tspan>
82
+ <tspan x='2656.8' y='1610.4' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">Glottal</tspan>
83
+ </text>
84
+ <text white-space='pre' alignment-baseline='text-top' style='fill: black; font-size: 64px;' x='2584.8' y='1997.6000000000001'><tspan x='2638.8' y='1997.6000000000001' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">terminal</tspan>
85
+ <tspan x='2638.8' y='2085.6000000000004' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">features</tspan>
86
+ <tspan x='2584.8' y='2173.6000000000004' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">[spread<tspan style='fill:none;'>■</tspan>gl]</tspan>
87
+ <tspan x='2584.8' y='2261.6000000000004' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">[constr<tspan style='fill:none;'>■</tspan>gl]</tspan>
88
+ <tspan x='2638.8' y='2349.6000000000004' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">[voiced]</tspan>
89
+ </text>
90
+ <polyline style='stroke:black; stroke-width:3; fill:none; stroke-linejoin:round;'
91
+ points='738.0000000000001 937.2 738.0000000000001 694.1 1632.6000000000001 694.1 1632.6000000000001 451.0' />
92
+ <polyline style='stroke:black; stroke-width:3; fill:none; stroke-linejoin:round;'
93
+ points='1760.4 937.2 1760.4 694.1 1632.6000000000001 694.1 1632.6000000000001 451.0' />
94
+ <polyline style='stroke:black; stroke-width:3; fill:none; stroke-linejoin:round;'
95
+ points='2527.2 937.2 2527.2 694.1 1632.6000000000001 694.1 1632.6000000000001 451.0' />
96
+ <polyline style='stroke:black; stroke-width:3; fill:none; stroke-linejoin:round;'
97
+ points='226.79999999999995 1412.4 226.79999999999995 1301.3000000000002 738.0000000000001 1301.3000000000002 738.0000000000001 1190.2' />
98
+ <polyline style='stroke:black; stroke-width:3; fill:none; stroke-linejoin:round;'
99
+ points='738.0000000000002 1412.4 738.0000000000002 1301.3000000000002 738.0000000000001 1301.3000000000002 738.0000000000001 1190.2' />
100
+ <polyline style='stroke:black; stroke-width:3; fill:none; stroke-linejoin:round;'
101
+ points='1249.2000000000003 1412.4 1249.2000000000003 1301.3000000000002 738.0000000000001 1301.3000000000002 738.0000000000001 1190.2' />
102
+ <polyline style='stroke:black; stroke-width:3; fill:none; stroke-linejoin:round;'
103
+ points='226.80000000000018 1887.6000000000001 226.80000000000018 1776.5 226.79999999999995 1776.5 226.79999999999995 1665.4' />
104
+ <polyline style='stroke:black; stroke-width:3; fill:none; stroke-linejoin:round;'
105
+ points='738.0000000000002 1887.6000000000001 738.0000000000002 1776.5 738.0000000000002 1776.5 738.0000000000002 1665.4' />
106
+ <polyline style='stroke:black; stroke-width:3; fill:none; stroke-linejoin:round;'
107
+ points='1249.2000000000003 1887.6000000000001 1249.2000000000003 1776.5 1249.2000000000003 1776.5 1249.2000000000003 1665.4' />
108
+ <polyline style='stroke:black; stroke-width:3; fill:none; stroke-linejoin:round;'
109
+ points='1760.4 1412.4 1760.4 1301.3000000000002 1760.4 1301.3000000000002 1760.4 1190.2' />
110
+ <polyline style='stroke:black; stroke-width:3; fill:none; stroke-linejoin:round;'
111
+ points='1760.4 1887.6000000000001 1760.4 1776.5 1760.4 1776.5 1760.4 1665.4' />
112
+ <polyline style='stroke:black; stroke-width:3; fill:none; stroke-linejoin:round;'
113
+ points='2271.6000000000004 1412.4 2271.6000000000004 1301.3000000000002 2527.2 1301.3000000000002 2527.2 1190.2' />
114
+ <polyline style='stroke:black; stroke-width:3; fill:none; stroke-linejoin:round;'
115
+ points='2782.8 1412.4 2782.8 1301.3000000000002 2527.2 1301.3000000000002 2527.2 1190.2' />
116
+ <polyline style='stroke:black; stroke-width:3; fill:none; stroke-linejoin:round;'
117
+ points='2271.6000000000004 1887.6000000000001 2271.6000000000004 1776.5 2271.6000000000004 1776.5 2271.6000000000004 1665.4' />
118
+ <polyline style='stroke:black; stroke-width:3; fill:none; stroke-linejoin:round;'
119
+ points='2782.8 1887.6000000000001 2782.8 1776.5 2782.8 1776.5 2782.8 1665.4' />
120
+ </svg>
@@ -0,0 +1,93 @@
1
+ <?xml version="1.0" standalone="no"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
+ <svg width="1970.4" height="1558.0" viewBox="-20, -20, 1990.4, 1578.0" version="1.1" xmlns="http://www.w3.org/2000/svg">
4
+ <defs>
5
+ <marker id="arrow" markerUnits="userSpaceOnUse" viewBox="0 0 10 10" refX="10" refY="5" markerWidth="33.6" markerHeight="33.6" orient="auto">
6
+ <path d="M 0 0 L 10 5 L 0 10" fill="black"/>
7
+ </marker>
8
+ <marker id="arrowBackward" markerUnits="userSpaceOnUse" viewBox="0 0 10 10" refX="5" refY="5" markerWidth="33.6" markerHeight="33.6" orient="auto">
9
+ <path d="M 0 0 L 10 5 L 0 10 z" fill="black"/>
10
+ </marker>
11
+ <marker id="arrowForward" markerUnits="userSpaceOnUse" viewBox="0 0 10 10" refX="5" refY="5" markerWidth="33.6" markerHeight="33.6" orient="auto">
12
+ <path d="M 10 0 L 0 5 L 10 10 z" fill="black"/>
13
+ </marker>
14
+ <marker id="arrowBothways" markerUnits="userSpaceOnUse" viewBox="0 0 30 10" refX="15" refY="5" markerWidth="100.80000000000001" markerHeight="33.6" orient="auto">
15
+ <path d="M 0 5 L 10 0 L 10 5 L 20 5 L 20 0 L 30 5 L 20 10 L 20 5 L 10 5 L 10 10 z" fill="black"/>
16
+ </marker>
17
+ <pattern id="hatchBlack" x="10" y="10" width="10" height="10" patternUnits="userSpaceOnUse" patternTransform="rotate(45)">
18
+ <line x1="0" y="0" x2="0" y2="10" stroke="black" stroke-width="4"></line>
19
+ </pattern>
20
+ <pattern id="hatchForNode" x="10" y="10" width="10" height="10" patternUnits="userSpaceOnUse" patternTransform="rotate(45)">
21
+ <line x1="0" y="0" x2="0" y2="10" stroke="black" stroke-width="4"></line>
22
+ </pattern>
23
+ <pattern id="hatchForLeaf" x="10" y="10" width="10" height="10" patternUnits="userSpaceOnUse" patternTransform="rotate(45)">
24
+ <line x1="0" y="0" x2="0" y2="10" stroke="black" stroke-width="4"></line>
25
+ </pattern>
26
+ </defs>
27
+ <rect x="-20" y="-20" width="1990.4" height="1578.0" stroke="none" fill="white" />"
28
+ <text white-space='pre' alignment-baseline='text-top' style='fill: black; font-size: 64px;' x='848.5' y='132.0'><tspan x='848.5' y='132.0' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">Philosophy</tspan>
29
+ </text>
30
+ <text white-space='pre' alignment-baseline='text-top' style='fill: black; font-size: 64px;' x='146.60000000000002' y='453.2'><tspan x='146.60000000000002' y='453.2' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">Psychology</tspan>
31
+ </text>
32
+ <text white-space='pre' alignment-baseline='text-top' style='fill: black; font-size: 64px;' x='298.1' y='796.4'><tspan x='298.1' y='796.4' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif"><tspan style='fill:none;'>■</tspan></tspan>
33
+ </text>
34
+ <text white-space='pre' alignment-baseline='text-top' style='fill: black; font-size: 64px;' x='33.60000000000002' y='1139.6'><tspan x='33.60000000000002' y='1139.6' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">Computer<tspan style='fill:none;'>■</tspan>Science</tspan>
35
+ </text>
36
+ <text white-space='pre' alignment-baseline='text-top' style='fill: black; font-size: 64px;' x='999.5' y='453.2'><tspan x='999.5' y='453.2' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif"><tspan style='fill:none;'>■</tspan></tspan>
37
+ </text>
38
+ <text white-space='pre' alignment-baseline='text-top' style='fill: black; font-size: 64px;' x='999.5' y='796.4'><tspan x='999.5' y='796.4' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif"><tspan style='fill:none;'>■</tspan></tspan>
39
+ </text>
40
+ <text white-space='pre' alignment-baseline='text-top' style='fill: black; font-size: 64px;' x='999.5' y='1139.6'><tspan x='999.5' y='1139.6' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif"><tspan style='fill:none;'>■</tspan></tspan>
41
+ </text>
42
+ <text white-space='pre' alignment-baseline='text-top' style='fill: black; font-size: 64px;' x='813.0' y='1482.8'><tspan x='813.0' y='1482.8' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">Neuroscience</tspan>
43
+ </text>
44
+ <text white-space='pre' alignment-baseline='text-top' style='fill: black; font-size: 64px;' x='1555.9' y='453.2'><tspan x='1555.9' y='453.2' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">Linguistics</tspan>
45
+ </text>
46
+ <text white-space='pre' alignment-baseline='text-top' style='fill: black; font-size: 64px;' x='1700.9' y='796.4'><tspan x='1700.9' y='796.4' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif"><tspan style='fill:none;'>■</tspan></tspan>
47
+ </text>
48
+ <text white-space='pre' alignment-baseline='text-top' style='fill: black; font-size: 64px;' x='1509.4' y='1139.6'><tspan x='1509.4' y='1139.6' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">Anthropology</tspan>
49
+ </text>
50
+ <line style='stroke:none; stroke-width:5; stroke-linecap:round;' x1='317.1' y1='343.2' x2='1018.5' y2='187.0' />
51
+ <line style='stroke:none; stroke-width:5; stroke-linecap:round;' x1='1018.5' y1='343.2' x2='1018.5' y2='187.0' />
52
+ <line style='stroke:none; stroke-width:5; stroke-linecap:round;' x1='1719.9' y1='343.2' x2='1018.5' y2='187.0' />
53
+ <line style='stroke:none; stroke-width:5; stroke-linecap:round;' x1='317.1' y1='686.4' x2='317.1' y2='508.2' />
54
+ <line style='stroke:none; stroke-width:5; stroke-linecap:round;' x1='317.1' y1='1029.6' x2='317.1' y2='851.4' />
55
+ <line style='stroke:none; stroke-width:5; stroke-linecap:round;' x1='1018.5' y1='686.4' x2='1018.5' y2='508.2' />
56
+ <line style='stroke:none; stroke-width:5; stroke-linecap:round;' x1='1018.5' y1='1029.6' x2='1018.5' y2='851.4' />
57
+ <line style='stroke:none; stroke-width:5; stroke-linecap:round;' x1='1018.5' y1='1372.8' x2='1018.5' y2='1194.6' />
58
+ <line style='stroke:none; stroke-width:5; stroke-linecap:round;' x1='1719.9' y1='686.4' x2='1719.9' y2='508.2' />
59
+ <line style='stroke:none; stroke-width:5; stroke-linecap:round;' x1='1719.9' y1='1029.6' x2='1719.9' y2='851.4' />
60
+ <polygon style='stroke:black; stroke-width:5; fill:none; stroke-linejoin:round;'
61
+ points='831.7,33.0 1205.3000000000002,33.0 1205.3000000000002,176.0 831.7,176.0' />
62
+
63
+ <polygon style='stroke:black; stroke-width:5; fill:none; stroke-linejoin:round;'
64
+ points='129.8,354.2 504.40000000000003,354.2 504.40000000000003,497.2 129.8,497.2' />
65
+
66
+ <polygon style='stroke:black; stroke-width:5; fill:none; stroke-linejoin:round;'
67
+ points='16.800000000000022,1040.6 617.4000000000001,1040.6 617.4000000000001,1183.6 16.800000000000022,1183.6' />
68
+
69
+ <polygon style='stroke:black; stroke-width:5; fill:none; stroke-linejoin:round;'
70
+ points='796.2,1383.8 1240.8000000000002,1383.8 1240.8000000000002,1526.8 796.2,1526.8' />
71
+
72
+ <polygon style='stroke:black; stroke-width:5; fill:none; stroke-linejoin:round;'
73
+ points='1539.1000000000001,354.2 1900.7000000000003,354.2 1900.7000000000003,497.2 1539.1000000000001,497.2' />
74
+
75
+ <polygon style='stroke:black; stroke-width:5; fill:none; stroke-linejoin:round;'
76
+ points='1492.6000000000001,1040.6 1947.2000000000003,1040.6 1947.2000000000003,1183.6 1492.6000000000001,1183.6' />
77
+
78
+ <line x1='317.1' y1='343.2' x2='1018.5' y2='187.0' style='fill: none; stroke: black; stroke-width:5; stroke-linecap:round;' />
79
+ <line x1='317.1' y1='1029.6' x2='1018.5' y2='187.0' style='fill: none; stroke: black; stroke-width:5; stroke-linecap:round;' />
80
+ <line x1='1018.5' y1='1372.8' x2='1018.5' y2='187.0' style='fill: none; stroke: black; stroke-width:5; stroke-linecap:round;' />
81
+ <line x1='1719.9' y1='343.2' x2='1018.5' y2='187.0' style='fill: none; stroke: black; stroke-width:5; stroke-linecap:round;' />
82
+ <line x1='1719.9' y1='1029.6' x2='1018.5' y2='187.0' style='fill: none; stroke: black; stroke-width:5; stroke-linecap:round;' />
83
+ <line x1='317.1' y1='1029.6' x2='317.1' y2='508.2' style='fill: none; stroke: black; stroke-width:5; stroke-linecap:round;' />
84
+ <line x1='317.1' y1='1029.6' x2='317.1' y2='508.2' style='fill: none; stroke: black; stroke-width:5; stroke-linecap:round;' />
85
+ <line x1='1018.5' y1='1372.8' x2='317.1' y2='508.2' style='fill: none; stroke: black; stroke-width:5; stroke-linecap:round;' />
86
+ <line x1='521.2' y1='425.7' x2='1522.3000000000002' y2='425.7' style='fill: none; stroke: black; stroke-width:5; stroke-linecap:round;' />
87
+ <line x1='1719.9' y1='1029.6' x2='317.1' y2='508.2' style='fill: none; stroke: black; stroke-width:5; stroke-linecap:round;' />
88
+ <line x1='1018.5' y1='1372.8' x2='317.1' y2='1194.6' style='fill: none; stroke: black; stroke-width:5; stroke-linecap:round;' />
89
+ <line x1='317.1' y1='1029.6' x2='1719.9' y2='508.2' style='fill: none; stroke: black; stroke-width:5; stroke-linecap:round;' />
90
+ <line x1='634.2' y1='1112.1' x2='1475.8000000000002' y2='1112.1' style='fill: none; stroke: black; stroke-width:5; stroke-linecap:round;' />
91
+ <line x1='1018.5' y1='1372.8' x2='1719.9' y2='508.2' style='fill: none; stroke: black; stroke-width:5; stroke-linecap:round;' />
92
+ <line x1='1018.5' y1='1372.8' x2='1719.9' y2='1194.6' style='fill: none; stroke: black; stroke-width:5; stroke-linecap:round;' />
93
+ <line x1='1719.9' y1='1029.6' x2='1719.9' y2='508.2' style='fill: none; stroke: black; stroke-width:5; stroke-linecap:round;' /></svg>
@@ -115,7 +115,11 @@ Here, `---` represents `-` repeated three times or more consecutively.
115
115
 
116
116
  In `auto` mode, the triangle connector shape is applied when the terminal node contains words separated by whitespace. In `bar` and `none` modes, triangles are drawn for the nodes with `^` at the beginning of the leaf text, lie `[NP ^syntax-trees]`.
117
117
 
118
- If a `#` character is placed at the beginning of a label or leaf text (right after `^` if there is one), the text is enclosed in a pair of square brackets (e.g. `[#NP text]`, `[NP #text]`, `[NP ^#text]`). If `##` is placed at the beginning of the leaf text, a rectangle is drawn instead of brackets.
118
+ If a `#` character is placed at the beginning of a label or leaf text (right after `^` if there is one), the text is enclosed in a pair of square brackets (e.g. `[#NP text]`, `[NP #text]`, `[NP ^#text]`).
119
+
120
+ If `##` is placed at the beginning of the leaf text, a rectangle is drawn instead of brackets.
121
+
122
+ If `###` is placed at the beginning of the leaf text, a rectangle with thicker lines is drawn.
119
123
 
120
124
  ### Escape Special Characters
121
125
 
@@ -130,8 +134,8 @@ The backslash character `\` must be used to print certain characters used in the
130
134
  You can draw any number of paths of three different types:
131
135
 
132
136
  - Non-directional (rendered as dashed line `- - -`)
133
- - Directional (rendered as solid line `----->`)
134
- - Bidirectional (rendered as solid line `<----->`)
137
+ - Directional (rendered as solid line `----▶`)
138
+ - Bidirectional (rendered as solid line `◀----▶`)
135
139
 
136
140
  Each path is distinguished by a unique ID number. The ID is specified by putting a plus sign and a number (e.g. `+7`) at the end of the node text. If a greater-than or less-than sign is placed between the plus sign and the number (e.g. `+>7` or `+<7`), an arrowhead will appear at the end of the path. Note that it makes no difference whether `+>` or `+<` is used. The arrow is always directed to the element with one of these ID symbols.
137
141
 
@@ -123,7 +123,11 @@ SVG形式を用いる場合,期待通りの表示を得るためには,ご
123
123
 
124
124
  ### リーフを囲む括弧と矩形の描画
125
125
 
126
- ラベルまたはリーフとなるテキストの最初に(`^` が存在する場合はその直後に) `#` を付けると,そのテキスト全体を角括弧([ ])で囲みます(例:`[#NP text]`, `[NP #text]`, `[NP ^#text]`). テキストの最初に `##` を付けると,テキスト全体を矩形(ボックス)で囲みます.
126
+ ラベルまたはリーフとなるテキストの最初に(`^` が存在する場合はその直後に) `#` を付けると,そのテキスト全体を角括弧([ ])で囲みます(例:`[#NP text]`, `[NP #text]`, `[NP ^#text]`).
127
+
128
+ テキストの最初に `##` を付けると,テキスト全体を矩形(ボックス)で囲みます.
129
+
130
+ テキストの最初に `###` を付けると,テキスト全体を太い線の矩形(ボックス)で囲みます.
127
131
 
128
132
  ### 一部の文字を表示するためのエスケープ
129
133
 
@@ -140,8 +144,8 @@ SVG形式を用いる場合,期待通りの表示を得るためには,ご
140
144
  下の3種類の形式でノードからノードへのパスを表示することができます.
141
145
 
142
146
  - 方向(矢印)のないパス(`- - -`)
143
- - 方向(矢印)のあるパス(`----->`)
144
- - 両方向の矢印のあるパス(`<----->`)
147
+ - 方向(矢印)のあるパス(`-----▶`)
148
+ - 両方向の矢印のあるパス(`◀----▶`)
145
149
 
146
150
  樹形図の中でパスを表示したいとき,パスの両端を数字のIDで指定します.数字をプラス(`+`)記号と共にノードのテキストの最後で指定してください(例:`+7`).
147
151
  プラス記号とID番号の間に `>` 記号を入れると(例:`+>7`),パスの終端に矢印が付きます.その際、`+>` と `+<` のどちらを用いるかで結果は変わりません。矢印の先は常にこれらのいずれかを用いたIDが指定された要素に向けられます。
data/docs/examples.html CHANGED
@@ -36,6 +36,8 @@ layout: default
36
36
  <tbody>
37
37
  <tr><td>Category</td><td>{{ example.category}}</td></tr>
38
38
  <tr><td>Connector</td><td>{{ example.connector }}</td></tr>
39
+ <tr><td>Line Width</td><td>{{ example.linewidth }}</td></tr>
40
+ <tr><td>Hide Default Connectors</td><td>{{ example.hide_default_connectors }}</td></tr>
39
41
  <tr><td>Polyline</td><td>{{ example.polyline }}</td></tr>
40
42
  <tr><td>Color</td><td>{{ example.color }}</td></tr>
41
43
  <tr><td>Radical Symmetirization</td><td>{{ example.symmetrization }}</td></tr>
@@ -19,12 +19,12 @@ module RSyntaxTree
19
19
  case params[:color]
20
20
  # Okabe-Ito Color
21
21
  when "modern"
22
- @col_node = "#0072B2" # blue
23
- @col_leaf = "#009E73" # bluishgreen
24
- @col_path = "#CC79A7" # reddishpurple
25
- @col_extra = "#D55E00" # vermillion
22
+ @col_node = "#0072B2" # blue
23
+ @col_leaf = "#009E73" # bluishgreen
24
+ @col_path = "#CC79A7" # reddishpurple
25
+ @col_extra = "#CC79A7" # orange
26
+ @col_emph = "#D55E00" # vermillion
26
27
  # "#000000" black
27
- # "#E69F00" orange
28
28
  # "#56B4E9" skyblue
29
29
  # "#F0E442" yellow
30
30
  # "#999999" grey
@@ -32,7 +32,8 @@ module RSyntaxTree
32
32
  @col_node = "blue"
33
33
  @col_leaf = "green"
34
34
  @col_path = "purple"
35
- @col_extra = "red"
35
+ @col_extra = "purple"
36
+ @col_emph = "red"
36
37
  else
37
38
  @col_node = "black"
38
39
  @col_leaf = "black"
@@ -148,6 +148,8 @@ module RSyntaxTree
148
148
 
149
149
  total_height += if @parent.zero? && @children.empty? && @enclosure == :none
150
150
  elements_height.max + @global[:height_connector_to_text] * 2
151
+ elsif @parent.zero? && @children.empty?
152
+ elements_height.max + @global[:height_connector_to_text] / 2
151
153
  else
152
154
  elements_height.max + @global[:height_connector_to_text]
153
155
  end
@@ -22,15 +22,16 @@ module RSyntaxTree
22
22
  @extra_lines = []
23
23
  @fontset = params[:fontset]
24
24
  @fontsize = params[:fontsize]
25
+ @linewidth = params[:linewidth]
25
26
  @transparent = params[:transparent]
26
27
  @color = params[:color]
27
28
  @fontstyle = params[:fontstyle]
28
29
  @margin = params[:margin].to_i
29
30
  @polyline = params[:polyline]
30
- @line_styles = "<line style='stroke:#{@col_line}; stroke-width:#{FONT_SCALING};' x1='X1' y1='Y1' x2='X2' y2='Y2' />\n"
31
- @polyline_styles = "<polyline style='stroke:#{@col_line}; stroke-width:#{FONT_SCALING}; fill:none;'
31
+ @line_styles = "<line style='stroke:#{@col_line}; stroke-width:#{@linewidth + LINE_SCALING}; stroke-linecap:round;' x1='X1' y1='Y1' x2='X2' y2='Y2' />\n"
32
+ @polyline_styles = "<polyline style='stroke:#{@col_line}; stroke-width:#{@linewidth + LINE_SCALING}; fill:none; stroke-linejoin:round;'
32
33
  points='CHIX CHIY MIDX1 MIDY1 MIDX2 MIDY2 PARX PARY' />\n"
33
- @polygon_styles = "<polygon style='fill: none; stroke: black; stroke-width:#{FONT_SCALING};' points='X1 Y1 X2 Y2 X3 Y3' />\n"
34
+ @polygon_styles = "<polygon style='fill: none; stroke: black; stroke-width:#{@linewidth + LINE_SCALING}; stroke-linejoin:round;' points='X1 Y1 X2 Y2 X3 Y3' />\n"
34
35
  @text_styles = "<text white-space='pre' alignment-baseline='text-top' style='fill: COLOR; font-size: fontsize' x='X_VALUE' y='Y_VALUE'>CONTENT</text>\n"
35
36
  @tree_data = String.new
36
37
  @visited_x = {}
@@ -53,25 +54,28 @@ module RSyntaxTree
53
54
  y2 = @height + @margin
54
55
  extra_lines = @extra_lines.join("\n")
55
56
 
56
- as = @global[:h_gap_between_nodes] / 4 * 0.8
57
- as2 = @global[:h_gap_between_nodes] / 2 * 0.8
58
- as4 = @global[:h_gap_between_nodes] * 1.2
57
+ # as = @global[:h_gap_between_nodes] / 4 * 0.8
58
+ # as2 = @global[:h_gap_between_nodes] / 2 * 0.8
59
+ # as4 = @global[:h_gap_between_nodes] * 1.2
60
+
61
+ as2 = @global[:h_gap_between_nodes] * 1.0
62
+ as4 = as2 * 3
59
63
 
60
64
  header = <<~HDR
61
65
  <?xml version="1.0" standalone="no"?>
62
66
  <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
63
67
  <svg width="#{@width}" height="#{@height}" viewBox="#{x1}, #{y1}, #{x2}, #{y2}" version="1.1" xmlns="http://www.w3.org/2000/svg">
64
68
  <defs>
65
- <marker id="arrow" markerUnits="strokeWidth" markerWidth="#{as2}" markerHeight="#{as2}" viewBox="0 0 #{as2} #{as2}" refX="#{as}" refY="0">
66
- <polyline fill="none" stroke="#{@col_path}" stroke-width="1" points="0,#{as2},#{as},0,#{as2},#{as2}" />
69
+ <marker id="arrow" markerUnits="userSpaceOnUse" viewBox="0 0 10 10" refX="10" refY="5" markerWidth="#{as2}" markerHeight="#{as2}" orient="auto">
70
+ <path d="M 0 0 L 10 5 L 0 10" fill="#{@col_extra}"/>
67
71
  </marker>
68
- <marker id="arrowBackward" viewBox="0 0 10 10" refX="5" refY="5" markerWidth="#{as2}" markerHeight="#{as2}" orient="auto">
72
+ <marker id="arrowBackward" markerUnits="userSpaceOnUse" viewBox="0 0 10 10" refX="5" refY="5" markerWidth="#{as2}" markerHeight="#{as2}" orient="auto">
69
73
  <path d="M 0 0 L 10 5 L 0 10 z" fill="#{@col_extra}"/>
70
74
  </marker>
71
- <marker id="arrowForward" viewBox="0 0 10 10" refX="5" refY="5" markerWidth="#{as2}" markerHeight="#{as2}" orient="auto">
75
+ <marker id="arrowForward" markerUnits="userSpaceOnUse" viewBox="0 0 10 10" refX="5" refY="5" markerWidth="#{as2}" markerHeight="#{as2}" orient="auto">
72
76
  <path d="M 10 0 L 0 5 L 10 10 z" fill="#{@col_extra}"/>
73
77
  </marker>
74
- <marker id="arrowBothways" viewBox="0 0 30 10" refX="15" refY="5" markerWidth="#{as4}" markerHeight="#{as4}" orient="auto">
78
+ <marker id="arrowBothways" markerUnits="userSpaceOnUse" viewBox="0 0 30 10" refX="15" refY="5" markerWidth="#{as4}" markerHeight="#{as2}" orient="auto">
75
79
  <path d="M 0 5 L 10 0 L 10 5 L 20 5 L 20 0 L 30 5 L 20 10 L 20 5 L 10 5 L 10 10 z" fill="#{@col_extra}"/>
76
80
  </marker>
77
81
  <pattern id="hatchBlack" x="10" y="10" width="10" height="10" patternUnits="userSpaceOnUse" patternTransform="rotate(45)">
@@ -99,10 +103,6 @@ module RSyntaxTree
99
103
  end
100
104
  end
101
105
 
102
- def draw_direct_line(s_x, s_y, t_x, t_y, s_arrow = false, t_arrow = false)
103
- @extra_lines << generate_connector(s_x, s_y, t_x, t_y, @col_extra, false, s_arrow, t_arrow)
104
- end
105
-
106
106
  def draw_a_path(s_x, s_y, t_x, t_y, target_arrow = :none)
107
107
  x_spacing = @global[:h_gap_between_nodes] * 1.25
108
108
  y_spacing = @global[:height_connector] * 0.75
@@ -147,7 +147,6 @@ module RSyntaxTree
147
147
  @extra_lines << generate_line(new_s_x, new_y, new_t_x, new_y, @col_path, dashed)
148
148
  @extra_lines << generate_line(new_t_x, new_y, new_t_x, t_y, @col_path, dashed)
149
149
  end
150
-
151
150
  @height = new_y if new_y > @height
152
151
  end
153
152
 
@@ -187,9 +186,9 @@ module RSyntaxTree
187
186
  y2 = y1
188
187
  case l[:type]
189
188
  when :border
190
- stroke_width = FONT_SCALING
189
+ stroke_width = @linewidth + LINE_SCALING
191
190
  when :bborder
192
- stroke_width = FONT_SCALING * 2
191
+ stroke_width = @linewidth + BLINE_SCALING
193
192
  end
194
193
  @extra_lines << "<line style=\"stroke:#{col}; stroke-width:#{stroke_width}; \" x1=\"#{x1}\" y1=\"#{y1}\" x2=\"#{x2}\" y2=\"#{y2}\"></line>"
195
194
  else
@@ -226,7 +225,7 @@ module RSyntaxTree
226
225
  this_y = text_y
227
226
  end
228
227
 
229
- style += "font-weight: bold; " if e[:decoration].include?(:bold) || e[:decoration].include?(:bolditalic)
228
+ style += "font-weight: bold; fill: #{@col_emph}; " if e[:decoration].include?(:bold) || e[:decoration].include?(:bolditalic)
230
229
  style += "font-style: italic; " if e[:decoration].include?(:italic) || e[:decoration].include?(:bolditalic)
231
230
  style += "\""
232
231
 
@@ -281,9 +280,9 @@ module RSyntaxTree
281
280
  enc = nil
282
281
 
283
282
  stroke_width = if e[:decoration].include?(:bstroke)
284
- FONT_SCALING * 2.5
283
+ @linewidth + BLINE_SCALING
285
284
  else
286
- FONT_SCALING
285
+ @linewidth + LINE_SCALING
287
286
  end
288
287
 
289
288
  if e[:decoration].include?(:box)
@@ -306,12 +305,12 @@ module RSyntaxTree
306
305
  @extra_lines << bar
307
306
 
308
307
  if e[:decoration].include?(:arrow_to_l)
309
- l_arrowhead = "<polyline stroke-linejoin='bevel' fill='none' stroke='#{col}' stroke-width='#{stroke_width}' points='#{x1 + ar_hwidth},#{y1 + ar_hwidth / 2} #{x1},#{y1} #{x1 + ar_hwidth},#{y1 - ar_hwidth / 2}' />\n"
308
+ l_arrowhead = "<polyline stroke-linejoin='round' fill='none' stroke='#{col}' stroke-width='#{stroke_width}' points='#{x1 + ar_hwidth},#{y1 + ar_hwidth / 2} #{x1},#{y1} #{x1 + ar_hwidth},#{y1 - ar_hwidth / 2}' />\n"
310
309
  @extra_lines << l_arrowhead
311
310
  end
312
311
 
313
312
  if e[:decoration].include?(:arrow_to_r)
314
- r_arrowhead = "<polyline stroke-linejoin='bevel' fill='none' stroke='#{col}' stroke-width='#{stroke_width}' points='#{x2 - ar_hwidth},#{y2 - ar_hwidth / 2} #{x2},#{y2} #{x2 - ar_hwidth},#{y2 + ar_hwidth / 2}' />\n"
313
+ r_arrowhead = "<polyline stroke-linejoin='round' fill='none' stroke='#{col}' stroke-width='#{stroke_width}' points='#{x2 - ar_hwidth},#{y2 - ar_hwidth / 2} #{x2},#{y2} #{x2 - ar_hwidth},#{y2 + ar_hwidth / 2}' />\n"
315
314
  @extra_lines << r_arrowhead
316
315
  end
317
316
  end
@@ -346,28 +345,32 @@ module RSyntaxTree
346
345
  bc[:height] = text_y - bc[:y] + @global[:height_connector_to_text]
347
346
  case element.enclosure
348
347
  when :brackets
349
- @extra_lines << generate_line(bc[:x], bc[:y], bc[:x] + @global[:h_gap_between_nodes] / 2, bc[:y], col)
350
- @extra_lines << generate_line(bc[:x], bc[:y], bc[:x], bc[:y] + bc[:height], col)
351
- @extra_lines << generate_line(bc[:x], bc[:y] + bc[:height], bc[:x] + @global[:h_gap_between_nodes] / 2, bc[:y] + bc[:height], col)
352
- @extra_lines << generate_line(bc[:x] + bc[:width], bc[:y], bc[:x] + bc[:width] - @global[:h_gap_between_nodes] / 2, bc[:y], col)
353
- @extra_lines << generate_line(bc[:x] + bc[:width], bc[:y], bc[:x] + bc[:width], bc[:y] + bc[:height], col)
354
- @extra_lines << generate_line(bc[:x] + bc[:width], bc[:y] + bc[:height], bc[:x] + bc[:width] - @global[:h_gap_between_nodes] / 2, bc[:y] + bc[:height], col)
348
+ draw_bracket(bc[:x], bc[:y], bc[:width], bc[:height], col)
355
349
  when :rectangle
356
- @extra_lines << generate_line(bc[:x], bc[:y], bc[:x] + bc[:width], bc[:y], col)
357
- @extra_lines << generate_line(bc[:x], bc[:y], bc[:x], bc[:y] + bc[:height], col)
358
- @extra_lines << generate_line(bc[:x] + bc[:width], bc[:y], bc[:x] + bc[:width], bc[:y] + bc[:height], col)
359
- @extra_lines << generate_line(bc[:x], bc[:y] + bc[:height], bc[:x] + bc[:width], bc[:y] + bc[:height], col)
350
+ draw_rectangle(bc[:x], bc[:y], bc[:width], bc[:height], col)
360
351
  when :brectangle
361
- @extra_lines << generate_line(bc[:x], bc[:y], bc[:x] + bc[:width], bc[:y], col, false, false, 2)
362
- @extra_lines << generate_line(bc[:x], bc[:y], bc[:x], bc[:y] + bc[:height], col, false, false, 2)
363
- @extra_lines << generate_line(bc[:x] + bc[:width], bc[:y], bc[:x] + bc[:width], bc[:y] + bc[:height], col, false, false, 2)
364
- @extra_lines << generate_line(bc[:x], bc[:y] + bc[:height], bc[:x] + bc[:width], bc[:y] + bc[:height], col, false, false, 2)
352
+ draw_rectangle(bc[:x], bc[:y], bc[:width], bc[:height], col, true)
365
353
  end
366
354
 
367
355
  element.content_height = bc[:height]
368
356
  @tree_data += text_data.sub(/CONTENT/, new_text)
369
357
  end
370
358
 
359
+ def draw_rectangle(x1, y1, width, height, col, bline = false)
360
+ swidth = bline ? @linewidth + BLINE_SCALING : @linewidth + LINE_SCALING
361
+ @extra_lines << "<polygon style='stroke:#{col}; stroke-width:#{swidth}; fill:none; stroke-linejoin:round;'
362
+ points='#{x1},#{y1} #{x1 + width},#{y1} #{x1 + width},#{y1 + height} #{x1},#{y1 + height}' />\n"
363
+ end
364
+
365
+ def draw_bracket(x1, y1, width, height, col, bline = false)
366
+ swidth = bline ? @linewidth + BLINE_SCALING : @linewidth + LINE_SCALING
367
+ slwidth = @global[:h_gap_between_nodes] / 2
368
+ @extra_lines << "<polyline style='stroke:#{col}; stroke-width:#{swidth}; fill:none; stroke-linejoin:round;'
369
+ points='#{x1 + slwidth},#{y1} #{x1},#{y1} #{x1},#{y1 + height} #{x1 + slwidth},#{y1 + height}' />\n"
370
+ @extra_lines << "<polyline style='stroke:#{col}; stroke-width:#{swidth}; fill:none; stroke-linejoin:round;'
371
+ points='#{x1 + width - slwidth},#{y1} #{x1 + width},#{y1} #{x1 + width},#{y1 + height} #{x1 + width - slwidth},#{y1 + height}' />\n"
372
+ end
373
+
371
374
  def set_tspan(this_x, this_y, style, decoration, fontstyle, text)
372
375
  text.gsub!(/■+/) do |x|
373
376
  num_spaces = x.size
@@ -462,19 +465,19 @@ module RSyntaxTree
462
465
  b = v[1]
463
466
 
464
467
  if a[:y][:top] > b[:y][:bottom]
465
- draw_direct_line(a[:x][:center], a[:y][:top], b[:x][:center], b[:y][:bottom], a[:arrow], b[:arrow])
468
+ generate_connectors(a[:x][:center], a[:y][:top], b[:x][:center], b[:y][:bottom], @col_extra, false, a[:arrow], b[:arrow])
466
469
  elsif a[:y][:bottom] < b[:y][:top]
467
- draw_direct_line(b[:x][:center], b[:y][:top], a[:x][:center], a[:y][:bottom], b[:arrow], a[:arrow])
470
+ generate_connectors(b[:x][:center], b[:y][:top], a[:x][:center], a[:y][:bottom], @col_extra, false, b[:arrow], a[:arrow])
468
471
  elsif a[:x][:center] < b[:x][:center]
469
- draw_direct_line(a[:x][:right], a[:y][:center], b[:x][:left], b[:y][:center], a[:arrow], b[:arrow])
472
+ generate_connectors(a[:x][:right], a[:y][:center], b[:x][:left], b[:y][:center], @col_extra, false, a[:arrow], b[:arrow])
470
473
  else
471
- draw_direct_line(b[:x][:right], b[:y][:center], a[:x][:left], a[:y][:center], b[:arrow], a[:arrow])
474
+ generate_connectors(b[:x][:right], b[:y][:center], a[:x][:left], a[:y][:center], @col_extra, false, b[:arrow], a[:arrow])
472
475
  end
473
476
  end
474
477
  paths.size + line_pool.keys.size
475
478
  end
476
479
 
477
- def generate_connector(x1, y1, x2, y2, col, dashed = false, s_arrow = false, t_arrow = false, stroke_width = 1)
480
+ def generate_connectors(x1, y1, x2, y2, col, dashed = false, s_arrow = false, t_arrow = false, bline = false)
478
481
  string = if s_arrow && t_arrow
479
482
  "marker-mid='url(#arrowBothways)' "
480
483
  elsif s_arrow
@@ -485,7 +488,7 @@ module RSyntaxTree
485
488
  ""
486
489
  end
487
490
  dasharray = dashed ? "stroke-dasharray='8 8'" : ""
488
- swidth = FONT_SCALING * stroke_width
491
+ swidth = bline ? @linewidth + BLINE_SCALING : @linewidth + LINE_SCALING
489
492
 
490
493
  if s_arrow || t_arrow
491
494
  x_mid = if x2 > x1
@@ -498,22 +501,22 @@ module RSyntaxTree
498
501
  else
499
502
  y1 - (y1 - y2) / 2
500
503
  end
501
- "<path d='M#{x1},#{y1} L#{x_mid},#{y_mid} L#{x2}, #{y2}' style='fill: none; stroke: #{col}; stroke-width:#{swidth}' #{dasharray} #{string}/>"
504
+ @extra_lines << "<path d='M#{x1},#{y1} L#{x_mid},#{y_mid} L#{x2}, #{y2}' style='fill: none; stroke: #{col}; stroke-width:#{swidth}; stroke-linecap:round;' #{dasharray} #{string}/>"
502
505
  else
503
- "<line x1='#{x1}' y1='#{y1}' x2='#{x2}' y2='#{y2}' style='fill: none; stroke: #{col}; stroke-width:#{swidth}' #{dasharray} #{string}/>"
506
+ @extra_lines << "<line x1='#{x1}' y1='#{y1}' x2='#{x2}' y2='#{y2}' style='fill: none; stroke: #{col}; stroke-width:#{swidth}; stroke-linecap:round;' #{dasharray} #{string}/>"
504
507
  end
505
508
  end
506
509
 
507
- def generate_line(x1, y1, x2, y2, col, dashed = false, arrow = false, stroke_width = 1)
510
+ def generate_line(x1, y1, x2, y2, col, dashed = false, arrow = false, bline = false)
508
511
  string = if arrow
509
512
  "marker-end='url(#arrow)' "
510
513
  else
511
514
  ""
512
515
  end
513
516
  dasharray = dashed ? "stroke-dasharray='8 8'" : ""
514
- swidth = FONT_SCALING * stroke_width
517
+ swidth = bline ? @linewidth + BLINE_SCALING : @linewidth + LINE_SCALING
515
518
 
516
- "<line x1='#{x1}' y1='#{y1}' x2='#{x2}' y2='#{y2}' style='fill: none; stroke: #{col}; stroke-width:#{swidth}' #{dasharray} #{string}/>"
519
+ "<line x1='#{x1}' y1='#{y1}' x2='#{x2}' y2='#{y2}' style='fill: none; stroke: #{col}; stroke-width:#{swidth}; stroke-linecap:round;' #{dasharray} #{string}/>"
517
520
  end
518
521
 
519
522
  # Draw a line between child/parent elements
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RSyntaxTree
4
- VERSION = "1.2.3"
4
+ VERSION = "1.2.4"
5
5
  end