rsyntaxtree 1.2.4 → 1.2.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (156) hide show
  1. checksums.yaml +4 -4
  2. data/.tags +1 -0
  3. data/Rakefile +1 -79
  4. data/devel/generate_examples.rb +91 -0
  5. data/docs/_examples/000.md +1 -0
  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 +1 -0
  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 +8 -6
  43. data/docs/_examples/038.md +1 -0
  44. data/docs/_examples/039.md +1 -0
  45. data/docs/_examples/040.md +1 -0
  46. data/docs/_examples/041.md +1 -0
  47. data/docs/_examples/042.md +22 -0
  48. data/docs/_examples/043.md +40 -0
  49. data/docs/_examples/044.md +16 -0
  50. data/docs/_examples/045.md +48 -0
  51. data/docs/assets/img/000.png +0 -0
  52. data/docs/assets/img/001.png +0 -0
  53. data/docs/assets/img/002.png +0 -0
  54. data/docs/assets/img/003.png +0 -0
  55. data/docs/assets/img/004.png +0 -0
  56. data/docs/assets/img/005.png +0 -0
  57. data/docs/assets/img/006.png +0 -0
  58. data/docs/assets/img/007.png +0 -0
  59. data/docs/assets/img/008.png +0 -0
  60. data/docs/assets/img/009.png +0 -0
  61. data/docs/assets/img/010.png +0 -0
  62. data/docs/assets/img/011.png +0 -0
  63. data/docs/assets/img/012.png +0 -0
  64. data/docs/assets/img/013.png +0 -0
  65. data/docs/assets/img/014.png +0 -0
  66. data/docs/assets/img/014_.png +0 -0
  67. data/docs/assets/img/015.png +0 -0
  68. data/docs/assets/img/016.png +0 -0
  69. data/docs/assets/img/017.png +0 -0
  70. data/docs/assets/img/018.png +0 -0
  71. data/docs/assets/img/019.png +0 -0
  72. data/docs/assets/img/020.png +0 -0
  73. data/docs/assets/img/021.png +0 -0
  74. data/docs/assets/img/022.png +0 -0
  75. data/docs/assets/img/023.png +0 -0
  76. data/docs/assets/img/024.png +0 -0
  77. data/docs/assets/img/025.png +0 -0
  78. data/docs/assets/img/026.png +0 -0
  79. data/docs/assets/img/027.png +0 -0
  80. data/docs/assets/img/028.png +0 -0
  81. data/docs/assets/img/029.png +0 -0
  82. data/docs/assets/img/030.png +0 -0
  83. data/docs/assets/img/031.png +0 -0
  84. data/docs/assets/img/032.png +0 -0
  85. data/docs/assets/img/033.png +0 -0
  86. data/docs/assets/img/034.png +0 -0
  87. data/docs/assets/img/035.png +0 -0
  88. data/docs/assets/img/036.png +0 -0
  89. data/docs/assets/img/037.png +0 -0
  90. data/docs/assets/img/038.png +0 -0
  91. data/docs/assets/img/039.png +0 -0
  92. data/docs/assets/img/040.png +0 -0
  93. data/docs/assets/img/041.png +0 -0
  94. data/docs/assets/img/042.png +0 -0
  95. data/docs/assets/img/043.png +0 -0
  96. data/docs/assets/img/044.png +0 -0
  97. data/docs/assets/img/045.png +0 -0
  98. data/docs/assets/svg/000.svg +29 -29
  99. data/docs/assets/svg/001.svg +14 -14
  100. data/docs/assets/svg/002.svg +32 -32
  101. data/docs/assets/svg/003.svg +24 -24
  102. data/docs/assets/svg/004.svg +35 -35
  103. data/docs/assets/svg/005.svg +15 -15
  104. data/docs/assets/svg/006.svg +20 -20
  105. data/docs/assets/svg/007.svg +26 -26
  106. data/docs/assets/svg/008.svg +30 -30
  107. data/docs/assets/svg/009.svg +29 -29
  108. data/docs/assets/svg/010.svg +47 -47
  109. data/docs/assets/svg/011.svg +24 -24
  110. data/docs/assets/svg/012.svg +29 -29
  111. data/docs/assets/svg/013.svg +92 -92
  112. data/docs/assets/svg/014.svg +65 -65
  113. data/docs/assets/svg/015.svg +28 -28
  114. data/docs/assets/svg/016.svg +249 -249
  115. data/docs/assets/svg/017.svg +30 -30
  116. data/docs/assets/svg/018.svg +32 -32
  117. data/docs/assets/svg/019.svg +91 -91
  118. data/docs/assets/svg/020.svg +57 -57
  119. data/docs/assets/svg/021.svg +37 -37
  120. data/docs/assets/svg/022.svg +63 -63
  121. data/docs/assets/svg/023.svg +37 -37
  122. data/docs/assets/svg/024.svg +18 -18
  123. data/docs/assets/svg/025.svg +86 -86
  124. data/docs/assets/svg/026.svg +14 -14
  125. data/docs/assets/svg/027.svg +44 -44
  126. data/docs/assets/svg/028.svg +16 -16
  127. data/docs/assets/svg/029.svg +61 -61
  128. data/docs/assets/svg/030.svg +29 -29
  129. data/docs/assets/svg/031.svg +10 -10
  130. data/docs/assets/svg/032.svg +33 -33
  131. data/docs/assets/svg/033.svg +32 -32
  132. data/docs/assets/svg/034.svg +34 -34
  133. data/docs/assets/svg/035.svg +31 -31
  134. data/docs/assets/svg/036.svg +11 -11
  135. data/docs/assets/svg/037.svg +26 -45
  136. data/docs/assets/svg/038.svg +33 -33
  137. data/docs/assets/svg/039.svg +2 -2
  138. data/docs/assets/svg/040.svg +59 -59
  139. data/docs/assets/svg/041.svg +43 -43
  140. data/docs/assets/svg/042.svg +42 -0
  141. data/docs/assets/svg/043.svg +304 -0
  142. data/docs/assets/svg/044.svg +32 -0
  143. data/docs/assets/svg/045.svg +107 -0
  144. data/docs/documentation.md +2 -3
  145. data/docs/documentation_ja.md +4 -4
  146. data/fonts/NotoEmoji-Bold.ttf +0 -0
  147. data/fonts/NotoEmoji-Regular.ttf +0 -0
  148. data/fonts/OpenMoji-black-glyf.ttf +0 -0
  149. data/lib/rsyntaxtree/element.rb +7 -8
  150. data/lib/rsyntaxtree/svg_graph.rb +13 -12
  151. data/lib/rsyntaxtree/version.rb +1 -1
  152. data/lib/rsyntaxtree.rb +5 -5
  153. data/test/example_verify_test.rb +2 -0
  154. metadata +20 -5
  155. data/fonts/OpenMoji-Black.ttf +0 -0
  156. data/fonts/OpenMoji-Color.ttf +0 -0
@@ -0,0 +1,107 @@
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="2578.2" height="3949.4" viewBox="-20, -20, 2598.2, 3969.4" 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="#CC79A7"/>
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="#CC79A7"/>
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="#CC79A7"/>
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="#CC79A7"/>
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="#0072B2" 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="#009E73" stroke-width="4"></line>
25
+ </pattern>
26
+ </defs>
27
+ <rect x="-20" y="-20" width="2598.2" height="3969.4" stroke="none" fill="white" />"
28
+ <text white-space='pre' alignment-baseline='text-top' style='fill: #0072B2; font-size: 64px;' x='620.93125' y='132.0'><tspan x='620.93125' y='132.0' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">Nominal</tspan>
29
+ </text>
30
+ <text white-space='pre' alignment-baseline='text-top' style='fill: #009E73; font-size: 64px;' x='33.60000000000002' y='477.4'><tspan x='44.10000000000002' y='477.4' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">Grounding</tspan>
31
+ <tspan x='33.60000000000002' y='565.4' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">Predication</tspan>
32
+ </text>
33
+ <text white-space='pre' alignment-baseline='text-top' style='fill: #0072B2; font-size: 64px;' x='1133.7624999999998' y='477.4'><tspan x='1133.7624999999998' y='477.4' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">Quantified</tspan>
34
+ <tspan x='1167.2624999999998' y='565.4' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">Instance</tspan>
35
+ </text>
36
+ <text white-space='pre' alignment-baseline='text-top' style='fill: #009E73; font-size: 64px;' x='517.9999999999999' y='987.8'><tspan x='541.9999999999999' y='987.8' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">Absolute</tspan>
37
+ <tspan x='517.9999999999999' y='1075.8' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">Quantifier</tspan>
38
+ </text>
39
+ <text white-space='pre' alignment-baseline='text-top' style='fill: #0072B2; font-size: 64px;' x='1711.525' y='987.8'><tspan x='1711.525' y='987.8' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">Higher-Order</tspan>
40
+ <tspan x='1732.525' y='1075.8' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">Instantiated</tspan>
41
+ <tspan x='1842.525' y='1163.8' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">Type</tspan>
42
+ </text>
43
+ <text white-space='pre' alignment-baseline='text-top' style='fill: #0072B2; font-size: 64px;' x='1221.85' y='1630.1999999999998'><tspan x='1221.85' y='1630.1999999999998' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">Higher-Order</tspan>
44
+ <tspan x='1242.85' y='1718.1999999999998' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">Instantiated</tspan>
45
+ <tspan x='1352.85' y='1806.1999999999998' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">Type</tspan>
46
+ </text>
47
+ <text white-space='pre' alignment-baseline='text-top' style='fill: #009E73; font-size: 64px;' x='968.3999999999999' y='2272.6'><tspan x='968.3999999999999' y='2272.6' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">Modifier</tspan>
48
+ </text>
49
+ <text white-space='pre' alignment-baseline='text-top' style='fill: #0072B2; font-size: 64px;' x='1569.2999999999997' y='2272.6'><tspan x='1570.2999999999997' y='2272.6' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">Head<tspan style='fill:none;'>■</tspan>Noun</tspan>
50
+ <tspan x='1674.2999999999997' y='2448.6' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">Basic</tspan>
51
+ <tspan x='1569.2999999999997' y='2536.6' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">Instantiated</tspan>
52
+ <tspan x='1679.2999999999997' y='2624.6' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">Type</tspan>
53
+ </text>
54
+ <text white-space='pre' alignment-baseline='text-top' style='fill: #009E73; font-size: 64px;' x='1366.7999999999997' y='3179.0'><tspan x='1366.7999999999997' y='3179.0' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">Basic<tspan style='fill:none;'>■</tspan>Type<tspan style='fill:none;'>■</tspan>Specification</tspan>
55
+ <tspan x='1498.2999999999997' y='3355.0' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">Underived<tspan style='fill:none;'>■</tspan>Stem</tspan>
56
+ <tspan x='1565.2999999999997' y='3443.0' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">Plural<tspan style='fill:none;'>■</tspan>Stem</tspan>
57
+ <tspan x='1537.7999999999997' y='3531.0' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">Derived<tspan style='fill:none;'>■</tspan>Stem</tspan>
58
+ <tspan x='1491.7999999999997' y='3619.0' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">Compound<tspan style='fill:none;'>■</tspan>Stem</tspan>
59
+ </text>
60
+ <text white-space='pre' alignment-baseline='text-top' style='fill: #009E73; font-size: 64px;' x='2274.2' y='1630.1999999999998'><tspan x='2274.2' y='1630.1999999999998' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">Modifier</tspan>
61
+ </text>
62
+ <line style='stroke:black; stroke-width:5; stroke-linecap:round;' x1='208.60000000000002' y1='367.4' x2='752.43125' y2='187.0' />
63
+ <line style='stroke:black; stroke-width:5; stroke-linecap:round;' x1='1296.2624999999998' y1='367.4' x2='752.43125' y2='187.0' />
64
+ <line style='stroke:black; stroke-width:5; stroke-linecap:round;' x1='675.9999999999999' y1='877.8' x2='1296.2624999999998' y2='620.4' />
65
+ <line style='stroke:black; stroke-width:5; stroke-linecap:round;' x1='1916.525' y1='877.8' x2='1296.2624999999998' y2='620.4' />
66
+ <line style='stroke:black; stroke-width:5; stroke-linecap:round;' x1='1426.85' y1='1520.1999999999998' x2='1916.525' y2='1218.8' />
67
+ <line style='stroke:black; stroke-width:5; stroke-linecap:round;' x1='2406.2' y1='1520.1999999999998' x2='1916.525' y2='1218.8' />
68
+ <line style='stroke:black; stroke-width:5; stroke-linecap:round;' x1='1100.3999999999999' y1='2162.6' x2='1426.85' y2='1861.1999999999998' />
69
+ <line style='stroke:black; stroke-width:5; stroke-linecap:round;' x1='1753.2999999999997' y1='2162.6' x2='1426.85' y2='1861.1999999999998' />
70
+ <line style='stroke:black; stroke-width:5; stroke-linecap:round;' x1='1753.2999999999997' y1='3069.0' x2='1753.2999999999997' y2='2679.6' />
71
+ <polygon style='stroke:#0072B2; stroke-width:5; fill:none; stroke-linejoin:round;'
72
+ points='604.13125,33.0 900.73125,33.0 900.73125,176.0 604.13125,176.0' />
73
+
74
+ <polygon style='stroke:#009E73; stroke-width:5; fill:none; stroke-linejoin:round;'
75
+ points='16.800000000000022,378.4 400.40000000000003,378.4 400.40000000000003,609.4 16.800000000000022,609.4' />
76
+
77
+ <polygon style='stroke:#0072B2; stroke-width:5; fill:none; stroke-linejoin:round;'
78
+ points='1116.9624999999999,378.4 1475.5625,378.4 1475.5625,609.4 1116.9624999999999,609.4' />
79
+
80
+ <polygon style='stroke:#009E73; stroke-width:5; fill:none; stroke-linejoin:round;'
81
+ points='501.1999999999999,888.8 850.8,888.8 850.8,1119.8 501.1999999999999,1119.8' />
82
+
83
+ <polygon style='stroke:#0072B2; stroke-width:8; fill:none; stroke-linejoin:round;'
84
+ points='1694.7250000000001,888.8 2138.3250000000003,888.8 2138.3250000000003,1207.8 1694.7250000000001,1207.8' />
85
+
86
+ <polygon style='stroke:#0072B2; stroke-width:8; fill:none; stroke-linejoin:round;'
87
+ points='1205.05,1531.1999999999998 1648.65,1531.1999999999998 1648.65,1850.1999999999998 1205.05,1850.1999999999998' />
88
+
89
+ <polygon style='stroke:#009E73; stroke-width:5; fill:none; stroke-linejoin:round;'
90
+ points='951.5999999999999,2173.6 1249.1999999999998,2173.6 1249.1999999999998,2316.6 951.5999999999999,2316.6' />
91
+
92
+ <line style="stroke:#0072B2; stroke-width:5; " x1="1569.2999999999997" y1="2338.6" x2="1937.2999999999997" y2="2338.6"></line>
93
+ <polygon style='stroke:#0072B2; stroke-width:8; fill:none; stroke-linejoin:round;'
94
+ points='1552.4999999999998,2173.6 1954.1,2173.6 1954.1,2668.6 1552.4999999999998,2668.6' />
95
+
96
+ <line style="stroke:#009E73; stroke-width:5; " x1="1366.7999999999997" y1="3245.0" x2="2139.7999999999997" y2="3245.0"></line>
97
+ <polygon style='stroke:#009E73; stroke-width:5; fill:none; stroke-linejoin:round;'
98
+ points='1349.9999999999998,3080.0 2156.6,3080.0 2156.6,3663.0 1349.9999999999998,3663.0' />
99
+
100
+ <polygon style='stroke:#009E73; stroke-width:8; fill:none; stroke-linejoin:round;'
101
+ points='2257.3999999999996,1531.1999999999998 2554.9999999999995,1531.1999999999998 2554.9999999999995,1674.1999999999998 2257.3999999999996,1674.1999999999998' />
102
+
103
+ <path d='M417.20000000000005,493.9 L758.68125,493.9 L1100.1625, 493.9' style='fill: none; stroke: #CC79A7; stroke-width:5; stroke-linecap:round;' marker-mid='url(#arrowBackward)' />
104
+ <path d='M867.5999999999999,1004.3 L1272.7625,1004.3 L1677.9250000000002, 1004.3' style='fill: none; stroke: #CC79A7; stroke-width:5; stroke-linecap:round;' marker-mid='url(#arrowBackward)' />
105
+ <path d='M1665.4499999999998,1602.6999999999998 L1953.0249999999999,1602.6999999999998 L2240.6, 1602.6999999999998' style='fill: none; stroke: #CC79A7; stroke-width:5; stroke-linecap:round;' marker-mid='url(#arrowForward)' />
106
+ <path d='M1265.9999999999998,2245.1 L1400.85,2245.1 L1535.6999999999998, 2245.1' style='fill: none; stroke: #CC79A7; stroke-width:5; stroke-linecap:round;' marker-mid='url(#arrowBackward)' />
107
+ <path d='M1753.2999999999997,3069.0 L1753.2999999999997,2874.3 L1753.2999999999997, 2679.6' style='fill: none; stroke: #CC79A7; stroke-width:5; stroke-linecap:round;' marker-mid='url(#arrowBackward)' /></svg>
@@ -137,8 +137,7 @@ You can draw any number of paths of three different types:
137
137
  - Directional (rendered as solid line `----▶`)
138
138
  - Bidirectional (rendered as solid line `◀----▶`)
139
139
 
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.
141
-
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 `<` symbol 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.
142
141
 
143
142
  A node can have any number of IDs. The same ID must appear in the text of the *two* nodes between which the path is rendered. The same ID number cannot appear in more than two places.
144
143
 
@@ -150,7 +149,7 @@ You can also add extra connector between nodes in the same fasion as you draw pa
150
149
  - Directional (rendered as solid line `--▶--`)
151
150
  - Bidirectional (rendered as solid line `-◀-▶-`)
152
151
 
153
- Each additional connectors is distinguished by an ID number. The ID is specified by putting a a number after a sequence of a plus and a minus symbols (e.g. `+-8`) at the end of the node text. If a greater-than sign is placed between the minus sign and the number (e.g. `+->8`), an arrowhead will appear at the end of the connector. Note that it makes no difference whether `+->` or `+-<` is used. The arrow is always directed to the element with one of these ID symbols.
152
+ Each additional connectors is distinguished by an ID number. The ID is specified by putting a a number after a sequence of a plus and a minus symbols (e.g. `+-8`) at the end of the node text. If a greater-than `>` or less-than `<` symbol is placed between the minus sign and the number (e.g. `+->8`), an arrowhead will appear at the end of the connector. Note that it makes no difference whether `+->` or `+-<` is used. The arrow is always directed to the element with one of these ID symbols.
154
153
 
155
154
  A node can have any number of IDs. The same ID must appear in the text of the *two* nodes between which the additional connector is rendered. The same ID number cannot appear in more than two places.
156
155
 
@@ -144,11 +144,11 @@ SVG形式を用いる場合,期待通りの表示を得るためには,ご
144
144
  下の3種類の形式でノードからノードへのパスを表示することができます.
145
145
 
146
146
  - 方向(矢印)のないパス(`- - -`)
147
- - 方向(矢印)のあるパス(`-----▶`)
148
- - 両方向の矢印のあるパス(`◀----▶`)
147
+ - 方向(矢印)のあるパス(`----▶`)
148
+ - 両方向の矢印のあるパス(`◀---▶`)
149
149
 
150
150
  樹形図の中でパスを表示したいとき,パスの両端を数字のIDで指定します.数字をプラス(`+`)記号と共にノードのテキストの最後で指定してください(例:`+7`).
151
- プラス記号とID番号の間に `>` 記号を入れると(例:`+>7`),パスの終端に矢印が付きます.その際、`+>` と `+<` のどちらを用いるかで結果は変わりません。矢印の先は常にこれらのいずれかを用いたIDが指定された要素に向けられます。
151
+ プラス記号とID番号の間に `>` 記号または `<` 記号を入れると(例:`+>7`),パスの終端に矢印が付きます.その際、`+>` と `+<` のどちらを用いるかで結果は変わりません。矢印の先は常にこれらのいずれかを用いたIDが指定された要素に向けられます。
152
152
 
153
153
  IDにはどのような数字を用いても構いませんが,必ず **2箇所** で同じIDを指定することが必要です.同じIDを3箇所以上で指定することはできません.
154
154
 
@@ -156,7 +156,7 @@ IDにはどのような数字を用いても構いませんが,必ず **2箇
156
156
 
157
157
  パスの指定と類似した方式でノードからノードへのコネクターを追加することができます.追加的なコネクターは直線で描画されます(`polyline`にはなりません).追加的なコネクターを描画する際,デフォルトのコネクターを非表示(透明)にしたいときには `Hide default connectors`オプションをオンにすると良いでしょう.
158
158
 
159
- 追加のコネクターは数字のIDで指定します,プラスとマイナスを連続させた(`+-`)後にIDを指定してください(例:`+-8`).マイナス記号とID番号の間に `>` 記号を入れると(例:`+->8`),コネクターの終端に矢印が付きます.その際、`+->` と `+-<` のどちらを用いるかで結果は変わりません。矢印の先は常にこれらのいずれかを用いたIDが指定された要素に向けられます。
159
+ 追加のコネクターは数字のIDで指定します,プラスとマイナスを連続させた(`+-`)後にIDを指定してください(例:`+-8`).マイナス記号とID番号の間に `>` 記号または `<` 記号を入れると(例:`+->8`),コネクターの終端に矢印が付きます.その際、`+->` と `+-<` のどちらを用いるかで結果は変わりません。矢印の先は常にこれらのいずれかを用いたIDが指定された要素に向けられます。
160
160
 
161
161
  - 方向(矢印)のないコネクター(`-----`)
162
162
  - 方向(矢印)のあるコネクター(`--▶--`)
Binary file
Binary file
Binary file
@@ -139,22 +139,21 @@ module RSyntaxTree
139
139
  elements_height << height
140
140
  else
141
141
  one_bvm_given = true
142
- elements_height << height + @global[:box_vertical_margin] / 2
142
+ elements_height << height + @global[:box_vertical_margin]
143
143
  end
144
144
 
145
145
  e[:width] = width
146
146
  row_width += width
147
147
  end
148
148
 
149
- total_height += if @parent.zero? && @children.empty? && @enclosure == :none
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
153
- else
154
- elements_height.max + @global[:height_connector_to_text]
155
- end
149
+ total_height += elements_height.max
156
150
  content_width += row_width
157
151
  end
152
+ total_height += if @parent.zero? && @children.empty? && @enclosure != :none
153
+ @global[:height_connector_to_text] / 4
154
+ else
155
+ @global[:height_connector_to_text]
156
+ end
158
157
  total_width = content_width if total_width < content_width
159
158
  end
160
159
  @content_width = total_width
@@ -41,11 +41,7 @@ module RSyntaxTree
41
41
 
42
42
  def svg_data
43
43
  metrics = parse_list
44
- @height = if @element_list.elements.size == 1
45
- metrics[:height]
46
- else
47
- metrics[:height] + @margin * 2
48
- end
44
+ @height = metrics[:height] + @margin * 2
49
45
  @width = metrics[:width] + @margin * 2
50
46
 
51
47
  x1 = 0 - @margin
@@ -54,10 +50,6 @@ module RSyntaxTree
54
50
  y2 = @height + @margin
55
51
  extra_lines = @extra_lines.join("\n")
56
52
 
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
53
  as2 = @global[:h_gap_between_nodes] * 1.0
62
54
  as4 = as2 * 3
63
55
 
@@ -305,12 +297,12 @@ module RSyntaxTree
305
297
  @extra_lines << bar
306
298
 
307
299
  if e[:decoration].include?(:arrow_to_l)
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"
300
+ l_arrowhead = "<polyline stroke-linejoin='round' stroke-linecap='round' fill='none' stroke='#{col}' stroke-width='#{stroke_width}' points='#{x1 + ar_hwidth},#{y1 + ar_hwidth / 2} #{x1 + stroke_width / 2},#{y1} #{x1 + ar_hwidth},#{y1 - ar_hwidth / 2}' />\n"
309
301
  @extra_lines << l_arrowhead
310
302
  end
311
303
 
312
304
  if e[:decoration].include?(:arrow_to_r)
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"
305
+ r_arrowhead = "<polyline stroke-linejoin='round' stroke-linecap='round' fill='none' stroke='#{col}' stroke-width='#{stroke_width}' points='#{x2 - ar_hwidth},#{y2 - ar_hwidth / 2} #{x2 - stroke_width / 2},#{y2} #{x2 - ar_hwidth},#{y2 + ar_hwidth / 2}' />\n"
314
306
  @extra_lines << r_arrowhead
315
307
  end
316
308
  end
@@ -341,6 +333,7 @@ module RSyntaxTree
341
333
  end
342
334
  @height = text_y if text_y > @height
343
335
  end
336
+
344
337
  bc[:y] = bc[:y] + @global[:height_connector_to_text] * 3 / 4
345
338
  bc[:height] = text_y - bc[:y] + @global[:height_connector_to_text]
346
339
  case element.enclosure
@@ -469,7 +462,15 @@ module RSyntaxTree
469
462
  elsif a[:y][:bottom] < b[:y][:top]
470
463
  generate_connectors(b[:x][:center], b[:y][:top], a[:x][:center], a[:y][:bottom], @col_extra, false, b[:arrow], a[:arrow])
471
464
  elsif a[:x][:center] < b[:x][:center]
472
- generate_connectors(a[:x][:right], a[:y][:center], b[:x][:left], b[:y][:center], @col_extra, false, a[:arrow], b[:arrow])
465
+ if a[:y][:top] == b[:y][:top]
466
+ upper_y = a[:y][:center] < b[:y][:center] ? a[:y][:center] : b[:y][:center]
467
+ generate_connectors(a[:x][:right], upper_y, b[:x][:left], upper_y, @col_extra, false, a[:arrow], b[:arrow])
468
+ else
469
+ generate_connectors(a[:x][:right], a[:y][:center], b[:x][:left], b[:y][:center], @col_extra, false, a[:arrow], b[:arrow])
470
+ end
471
+ elsif a[:y][:top] == b[:y][:top]
472
+ upper_y = a[:y][:center] < b[:y][:center] ? a[:y][:center] : b[:y][:center]
473
+ generate_connectors(b[:x][:right], upper_y, a[:x][:left], upper_y, @col_extra, false, b[:arrow], a[:arrow])
473
474
  else
474
475
  generate_connectors(b[:x][:right], b[:y][:center], a[:x][:left], a[:y][:center], @col_extra, false, b[:arrow], a[:arrow])
475
476
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RSyntaxTree
4
- VERSION = "1.2.4"
4
+ VERSION = "1.2.5"
5
5
  end
data/lib/rsyntaxtree.rb CHANGED
@@ -83,7 +83,7 @@ module RSyntaxTree
83
83
  fontset[:bolditalic] = FONT_DIR + "/NotoSansMono_SemiCondensed-Bold.ttf"
84
84
  fontset[:math] = FONT_DIR + "/latinmodern-math.otf"
85
85
  fontset[:cjk] = FONT_DIR + "/NotoSansJP-Regular.otf"
86
- fontset[:emoji] = FONT_DIR + "/OpenMoji-Black.ttf"
86
+ fontset[:emoji] = FONT_DIR + "/OpenMoji-black-glyf"
87
87
  new_params[:fontstyle] = "mono"
88
88
  when "noto-sans", "sans"
89
89
  fontset[:normal] = FONT_DIR + "/NotoSans-Regular.ttf"
@@ -92,7 +92,7 @@ module RSyntaxTree
92
92
  fontset[:bolditalic] = FONT_DIR + "/NotoSans-BoldItalic.ttf"
93
93
  fontset[:math] = FONT_DIR + "/NotoSansMath-Regular.ttf"
94
94
  fontset[:cjk] = FONT_DIR + "/NotoSansJP-Regular.otf"
95
- fontset[:emoji] = FONT_DIR + "/OpenMoji-Black.ttf"
95
+ fontset[:emoji] = FONT_DIR + "/OpenMoji-black-glyf.ttf"
96
96
  new_params[:fontstyle] = "sans"
97
97
  when "noto-serif", "serif"
98
98
  fontset[:normal] = FONT_DIR + "/NotoSerif-Regular.ttf"
@@ -101,7 +101,7 @@ module RSyntaxTree
101
101
  fontset[:bolditalic] = FONT_DIR + "/NotoSerif-BoldItalic.ttf"
102
102
  fontset[:math] = FONT_DIR + "/latinmodern-math.otf"
103
103
  fontset[:cjk] = FONT_DIR + "/NotoSerifJP-Regular.otf"
104
- fontset[:emoji] = FONT_DIR + "/OpenMoji-Black.ttf"
104
+ fontset[:emoji] = FONT_DIR + "/OpenMoji-black-glyf.ttf"
105
105
  new_params[:fontstyle] = "serif"
106
106
  when "cjk zenhei", "cjk"
107
107
  fontset[:normal] = FONT_DIR + "/wqy-zenhei.ttf"
@@ -110,7 +110,7 @@ module RSyntaxTree
110
110
  fontset[:bolditalic] = FONT_DIR + "/NotoSans-BoldItalic.ttf"
111
111
  fontset[:math] = FONT_DIR + "/NotoSansMath-Regular.ttf"
112
112
  fontset[:cjk] = FONT_DIR + "/wqy-zenhei.ttf"
113
- fontset[:emoji] = FONT_DIR + "/OpenMoji-Black.ttf"
113
+ fontset[:emoji] = FONT_DIR + "/OpenMoji-black-glyf.ttf"
114
114
  new_params[:fontstyle] = "cjk"
115
115
  end
116
116
  else
@@ -145,7 +145,7 @@ module RSyntaxTree
145
145
  @global[:height_connector_to_text] = single_x_metrics.height / 2.0
146
146
  @global[:single_line_height] = single_x_metrics.height * 2.0
147
147
  @global[:width_half_x] = single_x_metrics.width / 2.0
148
- @global[:height_connector] = single_x_metrics.height * 1.0 * @params[:vheight]
148
+ @global[:height_connector] = single_x_metrics.height * @params[:vheight]
149
149
  @global[:h_gap_between_nodes] = single_x_metrics.width * 0.8
150
150
  @global[:box_vertical_margin] = single_x_metrics.height * 0.8
151
151
  end
@@ -49,6 +49,8 @@ class ExampleParserTest < Minitest::Test
49
49
  opts[:polyline] = value
50
50
  when "hide_default_connectors"
51
51
  opts[:hide_default_connectors] = value
52
+ when "connector_height"
53
+ opts[:vheight] = value
52
54
  when "symmetrization"
53
55
  opts[:symmetrize] = value
54
56
  when "connector"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rsyntaxtree
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.4
4
+ version: 1.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yoichiro Hasebe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-02-04 00:00:00.000000000 Z
11
+ date: 2023-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: optimist
@@ -108,6 +108,7 @@ files:
108
108
  - README.md
109
109
  - Rakefile
110
110
  - bin/rsyntaxtree
111
+ - devel/generate_examples.rb
111
112
  - docs/.gitignore
112
113
  - docs/404.html
113
114
  - docs/Gemfile
@@ -154,6 +155,10 @@ files:
154
155
  - docs/_examples/039.md
155
156
  - docs/_examples/040.md
156
157
  - docs/_examples/041.md
158
+ - docs/_examples/042.md
159
+ - docs/_examples/043.md
160
+ - docs/_examples/044.md
161
+ - docs/_examples/045.md
157
162
  - docs/_includes/box_and_circle_table.html
158
163
  - docs/_includes/escape_char_table.html
159
164
  - docs/_includes/social_media_links.html
@@ -174,6 +179,7 @@ files:
174
179
  - docs/assets/img/012.png
175
180
  - docs/assets/img/013.png
176
181
  - docs/assets/img/014.png
182
+ - docs/assets/img/014_.png
177
183
  - docs/assets/img/015.png
178
184
  - docs/assets/img/016.png
179
185
  - docs/assets/img/017.png
@@ -201,6 +207,10 @@ files:
201
207
  - docs/assets/img/039.png
202
208
  - docs/assets/img/040.png
203
209
  - docs/assets/img/041.png
210
+ - docs/assets/img/042.png
211
+ - docs/assets/img/043.png
212
+ - docs/assets/img/044.png
213
+ - docs/assets/img/045.png
204
214
  - docs/assets/img/elements/circle.png
205
215
  - docs/assets/img/elements/circle_abc.png
206
216
  - docs/assets/img/elements/circle_bold.png
@@ -259,10 +269,16 @@ files:
259
269
  - docs/assets/svg/039.svg
260
270
  - docs/assets/svg/040.svg
261
271
  - docs/assets/svg/041.svg
272
+ - docs/assets/svg/042.svg
273
+ - docs/assets/svg/043.svg
274
+ - docs/assets/svg/044.svg
275
+ - docs/assets/svg/045.svg
262
276
  - docs/documentation.md
263
277
  - docs/documentation_ja.md
264
278
  - docs/examples.html
265
279
  - docs/index.html
280
+ - fonts/NotoEmoji-Bold.ttf
281
+ - fonts/NotoEmoji-Regular.ttf
266
282
  - fonts/NotoSans-Bold.ttf
267
283
  - fonts/NotoSans-BoldItalic.ttf
268
284
  - fonts/NotoSans-Italic.ttf
@@ -278,8 +294,7 @@ files:
278
294
  - fonts/NotoSerif-Regular.ttf
279
295
  - fonts/NotoSerifJP-Bold.otf
280
296
  - fonts/NotoSerifJP-Regular.otf
281
- - fonts/OpenMoji-Black.ttf
282
- - fonts/OpenMoji-Color.ttf
297
+ - fonts/OpenMoji-black-glyf.ttf
283
298
  - fonts/wqy-zenhei.ttf
284
299
  - img/rsyntaxtree-web-screenshot.png
285
300
  - img/rsyntaxtree.png
@@ -316,7 +331,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
316
331
  - !ruby/object:Gem::Version
317
332
  version: '0'
318
333
  requirements: []
319
- rubygems_version: 3.4.2
334
+ rubygems_version: 3.4.1
320
335
  signing_key:
321
336
  specification_version: 4
322
337
  summary: RSyntaxTree is a graphical syntax tree generator written in Ruby
Binary file
Binary file