rsyntaxtree 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -1
- data/.tags +72 -0
- data/docs/_examples/030.md +2 -2
- data/docs/_examples/032.md +6 -5
- data/docs/_examples/034.md +1 -1
- data/docs/_examples/035.md +34 -0
- data/docs/assets/img/001.png +0 -0
- data/docs/assets/img/002.png +0 -0
- data/docs/assets/img/003.png +0 -0
- data/docs/assets/img/004.png +0 -0
- data/docs/assets/img/005.png +0 -0
- data/docs/assets/img/006.png +0 -0
- data/docs/assets/img/007.png +0 -0
- data/docs/assets/img/008.png +0 -0
- data/docs/assets/img/009.png +0 -0
- data/docs/assets/img/010.png +0 -0
- data/docs/assets/img/011.png +0 -0
- data/docs/assets/img/012.png +0 -0
- data/docs/assets/img/013.png +0 -0
- data/docs/assets/img/014.png +0 -0
- data/docs/assets/img/015.png +0 -0
- data/docs/assets/img/016.png +0 -0
- data/docs/assets/img/017.png +0 -0
- data/docs/assets/img/018.png +0 -0
- data/docs/assets/img/020.png +0 -0
- data/docs/assets/img/021.png +0 -0
- data/docs/assets/img/023.png +0 -0
- data/docs/assets/img/024.png +0 -0
- data/docs/assets/img/025.png +0 -0
- data/docs/assets/img/026.png +0 -0
- data/docs/assets/img/027.png +0 -0
- data/docs/assets/img/028.png +0 -0
- data/docs/assets/img/029.png +0 -0
- data/docs/assets/img/030.png +0 -0
- data/docs/assets/img/032.png +0 -0
- data/docs/assets/img/033.png +0 -0
- data/docs/assets/img/034.png +0 -0
- data/docs/assets/img/035.png +0 -0
- data/docs/assets/svg/000.svg +8 -2
- data/docs/assets/svg/001.svg +8 -2
- data/docs/assets/svg/002.svg +8 -2
- data/docs/assets/svg/003.svg +8 -2
- data/docs/assets/svg/004.svg +8 -2
- data/docs/assets/svg/005.svg +8 -2
- data/docs/assets/svg/006.svg +8 -2
- data/docs/assets/svg/007.svg +8 -2
- data/docs/assets/svg/008.svg +8 -2
- data/docs/assets/svg/009.svg +8 -2
- data/docs/assets/svg/010.svg +17 -11
- data/docs/assets/svg/011.svg +8 -2
- data/docs/assets/svg/012.svg +8 -2
- data/docs/assets/svg/013.svg +8 -2
- data/docs/assets/svg/014.svg +8 -2
- data/docs/assets/svg/015.svg +8 -2
- data/docs/assets/svg/016.svg +8 -2
- data/docs/assets/svg/017.svg +8 -2
- data/docs/assets/svg/018.svg +8 -2
- data/docs/assets/svg/019.svg +8 -2
- data/docs/assets/svg/020.svg +8 -2
- data/docs/assets/svg/021.svg +8 -2
- data/docs/assets/svg/022.svg +8 -2
- data/docs/assets/svg/023.svg +8 -2
- data/docs/assets/svg/024.svg +8 -2
- data/docs/assets/svg/025.svg +8 -2
- data/docs/assets/svg/026.svg +8 -2
- data/docs/assets/svg/027.svg +8 -2
- data/docs/assets/svg/028.svg +8 -2
- data/docs/assets/svg/029.svg +14 -8
- data/docs/assets/svg/030.svg +10 -4
- data/docs/assets/svg/031.svg +8 -2
- data/docs/assets/svg/032.svg +67 -48
- data/docs/assets/svg/033.svg +17 -11
- data/docs/assets/svg/034.svg +8 -2
- data/docs/assets/svg/035.svg +80 -0
- data/docs/documentation.md +2 -2
- data/docs/documentation_ja.md +4 -0
- data/lib/rsyntaxtree/base_graph.rb +3 -6
- data/lib/rsyntaxtree/element.rb +0 -8
- data/lib/rsyntaxtree/svg_graph.rb +43 -40
- data/lib/rsyntaxtree/version.rb +1 -1
- metadata +6 -3
data/docs/assets/svg/031.svg
CHANGED
@@ -5,8 +5,14 @@
|
|
5
5
|
<marker id="arrow" markerUnits="strokeWidth" markerWidth="11.520000000000001" markerHeight="11.520000000000001" viewBox="0 0 11.520000000000001 11.520000000000001" refX="5.760000000000001" refY="0">
|
6
6
|
<polyline fill="none" stroke="black" stroke-width="1" points="0,11.520000000000001,5.760000000000001,0,11.520000000000001,11.520000000000001" />
|
7
7
|
</marker>
|
8
|
-
<marker id="
|
9
|
-
<path d="M 0 0 L 10 5 L 0 10 z"
|
8
|
+
<marker id="arrowForward" viewBox="0 0 10 10" refX="5" refY="5" markerWidth="11.520000000000001" markerHeight="11.520000000000001" orient="auto-start-reverse">
|
9
|
+
<path d="M 0 0 L 10 5 L 0 10 z" fill="black"/>
|
10
|
+
</marker>
|
11
|
+
<marker id="arrowBackward" viewBox="0 0 10 10" refX="5" refY="5" markerWidth="11.520000000000001" markerHeight="11.520000000000001" orient="auto">
|
12
|
+
<path d="M 0 0 L 10 5 L 0 10 z" fill="black"/>
|
13
|
+
</marker>
|
14
|
+
<marker id="arrowBothways" viewBox="0 0 30 10" refX="15" refY="5" markerWidth="28.8" 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"/>
|
10
16
|
</marker>
|
11
17
|
<pattern id="hatchBlack" x="10" y="10" width="10" height="10" patternUnits="userSpaceOnUse" patternTransform="rotate(45)">
|
12
18
|
<line x1="0" y="0" x2="0" y2="10" stroke="black" stroke-width="4"></line>
|
data/docs/assets/svg/032.svg
CHANGED
@@ -1,73 +1,92 @@
|
|
1
1
|
<?xml version="1.0" standalone="no"?>
|
2
2
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
3
|
-
<svg width="
|
3
|
+
<svg width="846.3999999999999" height="1544.8" viewBox="-20, -20, 866.3999999999999, 1564.8" version="1.1" xmlns="http://www.w3.org/2000/svg">
|
4
4
|
<defs>
|
5
5
|
<marker id="arrow" markerUnits="strokeWidth" markerWidth="11.520000000000001" markerHeight="11.520000000000001" viewBox="0 0 11.520000000000001 11.520000000000001" refX="5.760000000000001" refY="0">
|
6
|
-
<polyline fill="none" stroke="
|
6
|
+
<polyline fill="none" stroke="purple" stroke-width="1" points="0,11.520000000000001,5.760000000000001,0,11.520000000000001,11.520000000000001" />
|
7
7
|
</marker>
|
8
|
-
<marker id="
|
9
|
-
<path d="M 0 0 L 10 5 L 0 10 z"
|
8
|
+
<marker id="arrowForward" viewBox="0 0 10 10" refX="5" refY="5" markerWidth="11.520000000000001" markerHeight="11.520000000000001" orient="auto-start-reverse">
|
9
|
+
<path d="M 0 0 L 10 5 L 0 10 z" fill="red"/>
|
10
|
+
</marker>
|
11
|
+
<marker id="arrowBackward" viewBox="0 0 10 10" refX="5" refY="5" markerWidth="11.520000000000001" markerHeight="11.520000000000001" orient="auto">
|
12
|
+
<path d="M 0 0 L 10 5 L 0 10 z" fill="red"/>
|
13
|
+
</marker>
|
14
|
+
<marker id="arrowBothways" viewBox="0 0 30 10" refX="15" refY="5" markerWidth="28.8" 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="red"/>
|
10
16
|
</marker>
|
11
17
|
<pattern id="hatchBlack" x="10" y="10" width="10" height="10" patternUnits="userSpaceOnUse" patternTransform="rotate(45)">
|
12
18
|
<line x1="0" y="0" x2="0" y2="10" stroke="black" stroke-width="4"></line>
|
13
19
|
</pattern>
|
14
20
|
<pattern id="hatchForNode" x="10" y="10" width="10" height="10" patternUnits="userSpaceOnUse" patternTransform="rotate(45)">
|
15
|
-
<line x1="0" y="0" x2="0" y2="10" stroke="
|
21
|
+
<line x1="0" y="0" x2="0" y2="10" stroke="blue" stroke-width="4"></line>
|
16
22
|
</pattern>
|
17
23
|
<pattern id="hatchForLeaf" x="10" y="10" width="10" height="10" patternUnits="userSpaceOnUse" patternTransform="rotate(45)">
|
18
|
-
<line x1="0" y="0" x2="0" y2="10" stroke="
|
24
|
+
<line x1="0" y="0" x2="0" y2="10" stroke="green" stroke-width="4"></line>
|
19
25
|
</pattern>
|
20
26
|
</defs>
|
21
|
-
<rect x="-20" y="-20" width="
|
22
|
-
<text white-space='pre' alignment-baseline='text-top' style='fill:
|
23
|
-
<tspan x='
|
27
|
+
<rect x="-20" y="-20" width="866.3999999999999" height="1564.8" stroke="none" fill="white" />"
|
28
|
+
<text white-space='pre' alignment-baseline='text-top' style='fill: blue; font-size: 64px;' x='363.59999999999997' y='132.0'><tspan x='363.59999999999997' y='132.0' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">ABC</tspan>
|
29
|
+
<tspan x='363.59999999999997' y='308.0' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">abc</tspan>
|
24
30
|
</text>
|
25
|
-
<text white-space='pre' alignment-baseline='text-top' style='fill:
|
31
|
+
<text white-space='pre' alignment-baseline='text-top' style='fill: green; font-size: 64px;' x='28.80000000000001' y='730.4'><tspan x='28.80000000000001' y='730.4' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">DEF</tspan>
|
26
32
|
</text>
|
27
|
-
<text white-space='pre' alignment-baseline='text-top' style='fill:
|
33
|
+
<text white-space='pre' alignment-baseline='text-top' style='fill: green; font-size: 64px;' x='252.0' y='730.4'><tspan x='252.0' y='730.4' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">GHI</tspan>
|
28
34
|
<tspan x='252.0' y='906.4' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">ghi</tspan>
|
29
35
|
</text>
|
30
|
-
<text white-space='pre' alignment-baseline='text-top' style='fill:
|
36
|
+
<text white-space='pre' alignment-baseline='text-top' style='fill: blue; font-size: 64px;' x='475.19999999999993' y='730.4'><tspan x='475.19999999999993' y='730.4' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">JKL</tspan>
|
37
|
+
</text>
|
38
|
+
<text white-space='pre' alignment-baseline='text-top' style='fill: blue; font-size: 64px;' x='475.19999999999993' y='1073.6'><tspan x='475.19999999999993' y='1073.6' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">MNO</tspan>
|
31
39
|
</text>
|
32
|
-
<text white-space='pre' alignment-baseline='text-top' style='fill:
|
40
|
+
<text white-space='pre' alignment-baseline='text-top' style='fill: green; font-size: 64px;' x='475.19999999999993' y='1240.8'><tspan x='475.19999999999993' y='1240.8' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">XYZ</tspan>
|
33
41
|
</text>
|
34
|
-
<text white-space='pre' alignment-baseline='text-top' style='fill:
|
42
|
+
<text white-space='pre' alignment-baseline='text-top' style='fill: green; font-size: 64px;' x='698.3999999999999' y='730.4'><tspan x='698.3999999999999' y='730.4' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">PQR</tspan>
|
35
43
|
</text>
|
36
44
|
<polyline style='stroke:black; stroke-width:2; fill:none;'
|
37
|
-
points='82.80000000000001 620.4 82.80000000000001 491.7
|
45
|
+
points='82.80000000000001 620.4 82.80000000000001 491.7 417.59999999999997 491.7 417.59999999999997 363.0' />
|
46
|
+
<polyline style='stroke:black; stroke-width:2; fill:none;'
|
47
|
+
points='306.0 620.4 306.0 491.7 417.59999999999997 491.7 417.59999999999997 363.0' />
|
38
48
|
<polyline style='stroke:black; stroke-width:2; fill:none;'
|
39
|
-
points='
|
49
|
+
points='529.1999999999999 620.4 529.1999999999999 491.7 417.59999999999997 491.7 417.59999999999997 363.0' />
|
40
50
|
<polyline style='stroke:black; stroke-width:2; fill:none;'
|
41
|
-
points='
|
51
|
+
points='752.3999999999999 620.4 752.3999999999999 491.7 417.59999999999997 491.7 417.59999999999997 363.0' />
|
42
52
|
<polyline style='stroke:black; stroke-width:2; fill:none;'
|
43
|
-
points='529.
|
44
|
-
<line style="stroke:
|
45
|
-
<line x1='
|
46
|
-
<line x1='
|
47
|
-
<line x1='
|
48
|
-
<line x1='
|
49
|
-
<line style="stroke:
|
50
|
-
<line x1='237.6' y1='631.4' x2='374.4' y2='631.4' style='fill: none; stroke:
|
51
|
-
<line x1='237.6' y1='631.4' x2='237.6' y2='950.4' style='fill: none; stroke:
|
52
|
-
<line x1='374.4' y1='631.4' x2='374.4' y2='950.4' style='fill: none; stroke:
|
53
|
-
<line x1='237.6' y1='950.4' x2='374.4' y2='950.4' style='fill: none; stroke:
|
54
|
-
<line x1='460.
|
55
|
-
<line x1='460.
|
56
|
-
<line x1='597.
|
57
|
-
<line x1='460.
|
58
|
-
<line x1='460.
|
59
|
-
<line x1='460.
|
60
|
-
<line x1='597.
|
61
|
-
<line x1='460.
|
62
|
-
<line x1='
|
63
|
-
<line x1='
|
64
|
-
<line x1='
|
65
|
-
<line x1='
|
66
|
-
<line x1='
|
67
|
-
<line x1='
|
68
|
-
<line x1='
|
69
|
-
<line x1='
|
70
|
-
<line x1='
|
71
|
-
<line x1='
|
72
|
-
<line x1='
|
73
|
-
<line x1='306.0' y1='
|
53
|
+
points='529.1999999999999 963.5999999999999 529.1999999999999 874.5 529.1999999999999 874.5 529.1999999999999 785.4' />
|
54
|
+
<line style="stroke:blue; stroke-width:2; " x1="363.59999999999997" y1="198.0" x2="471.59999999999997" y2="198.0"></line>
|
55
|
+
<line x1='349.2' y1='33.0' x2='486.0' y2='33.0' style='fill: none; stroke: blue; stroke-width:2' />
|
56
|
+
<line x1='349.2' y1='33.0' x2='349.2' y2='352.0' style='fill: none; stroke: blue; stroke-width:2' />
|
57
|
+
<line x1='486.0' y1='33.0' x2='486.0' y2='352.0' style='fill: none; stroke: blue; stroke-width:2' />
|
58
|
+
<line x1='349.2' y1='352.0' x2='486.0' y2='352.0' style='fill: none; stroke: blue; stroke-width:2' />
|
59
|
+
<line style="stroke:green; stroke-width:2; " x1="252.0" y1="796.4" x2="360.0" y2="796.4"></line>
|
60
|
+
<line x1='237.6' y1='631.4' x2='374.4' y2='631.4' style='fill: none; stroke: green; stroke-width:2' />
|
61
|
+
<line x1='237.6' y1='631.4' x2='237.6' y2='950.4' style='fill: none; stroke: green; stroke-width:2' />
|
62
|
+
<line x1='374.4' y1='631.4' x2='374.4' y2='950.4' style='fill: none; stroke: green; stroke-width:2' />
|
63
|
+
<line x1='237.6' y1='950.4' x2='374.4' y2='950.4' style='fill: none; stroke: green; stroke-width:2' />
|
64
|
+
<line x1='460.79999999999995' y1='631.4' x2='597.5999999999999' y2='631.4' style='fill: none; stroke: blue; stroke-width:2' />
|
65
|
+
<line x1='460.79999999999995' y1='631.4' x2='460.79999999999995' y2='774.4' style='fill: none; stroke: blue; stroke-width:2' />
|
66
|
+
<line x1='597.5999999999999' y1='631.4' x2='597.5999999999999' y2='774.4' style='fill: none; stroke: blue; stroke-width:2' />
|
67
|
+
<line x1='460.79999999999995' y1='774.4' x2='597.5999999999999' y2='774.4' style='fill: none; stroke: blue; stroke-width:2' />
|
68
|
+
<line x1='460.79999999999995' y1='974.5999999999999' x2='597.5999999999999' y2='974.5999999999999' style='fill: none; stroke: blue; stroke-width:2' />
|
69
|
+
<line x1='460.79999999999995' y1='974.5999999999999' x2='460.79999999999995' y2='1117.6' style='fill: none; stroke: blue; stroke-width:2' />
|
70
|
+
<line x1='597.5999999999999' y1='974.5999999999999' x2='597.5999999999999' y2='1117.6' style='fill: none; stroke: blue; stroke-width:2' />
|
71
|
+
<line x1='460.79999999999995' y1='1117.6' x2='597.5999999999999' y2='1117.6' style='fill: none; stroke: blue; stroke-width:2' />
|
72
|
+
<line x1='460.79999999999995' y1='1141.8' x2='597.5999999999999' y2='1141.8' style='fill: none; stroke: green; stroke-width:2' />
|
73
|
+
<line x1='460.79999999999995' y1='1141.8' x2='460.79999999999995' y2='1284.8' style='fill: none; stroke: green; stroke-width:2' />
|
74
|
+
<line x1='597.5999999999999' y1='1141.8' x2='597.5999999999999' y2='1284.8' style='fill: none; stroke: green; stroke-width:2' />
|
75
|
+
<line x1='460.79999999999995' y1='1284.8' x2='597.5999999999999' y2='1284.8' style='fill: none; stroke: green; stroke-width:2' />
|
76
|
+
<line x1='683.9999999999999' y1='631.4' x2='820.8' y2='631.4' style='fill: none; stroke: green; stroke-width:2' />
|
77
|
+
<line x1='683.9999999999999' y1='631.4' x2='683.9999999999999' y2='774.4' style='fill: none; stroke: green; stroke-width:2' />
|
78
|
+
<line x1='820.8' y1='631.4' x2='820.8' y2='774.4' style='fill: none; stroke: green; stroke-width:2' />
|
79
|
+
<line x1='683.9999999999999' y1='774.4' x2='820.8' y2='774.4' style='fill: none; stroke: green; stroke-width:2' />
|
80
|
+
<line x1='82.80000000000001' y1='784.6' x2='82.80000000000001' y2='1372.8' style='fill: none; stroke: purple; stroke-width:2' />
|
81
|
+
<line x1='82.80000000000001' y1='784.6' x2='82.80000000000001' y2='1372.8' style='fill: none; stroke: purple; stroke-width:2' />
|
82
|
+
<line x1='82.80000000000001' y1='1372.8' x2='306.0' y2='1372.8' style='fill: none; stroke: purple; stroke-width:2' />
|
83
|
+
<line x1='306.0' y1='1372.8' x2='306.0' y2='960.6' style='fill: none; stroke: purple; stroke-width:2' marker-end='url(#arrow)' />
|
84
|
+
<line x1='270.0' y1='960.6' x2='270.0' y2='1504.8' style='fill: none; stroke: purple; stroke-width:2' stroke-dasharray='8 8' />
|
85
|
+
<line x1='270.0' y1='1504.8' x2='529.1999999999999' y2='1504.8' style='fill: none; stroke: purple; stroke-width:2' stroke-dasharray='8 8' />
|
86
|
+
<line x1='529.1999999999999' y1='1504.8' x2='529.1999999999999' y2='1295.0' style='fill: none; stroke: purple; stroke-width:2' stroke-dasharray='8 8' />
|
87
|
+
<line x1='417.59999999999997' y1='362.2' x2='82.80000000000001' y2='620.4' style='fill: none; stroke: red; stroke-width:2' />
|
88
|
+
<path d='M417.59999999999997,362.2 L361.79999999999995,491.29999999999995 L306.0, 620.4' style='fill: none; stroke: red; stroke-width:2' marker-mid='url(#arrowBothways)' />
|
89
|
+
<path d='M165.60000000000002,702.5 L194.39999999999998,746.5 L223.19999999999996, 790.5' style='fill: none; stroke: red; stroke-width:2' marker-mid='url(#arrowForward)' />
|
90
|
+
<path d='M306.0,960.6 L417.59999999999997,1045.7 L529.1999999999999, 1130.8' style='fill: none; stroke: red; stroke-width:2' marker-mid='url(#arrowBothways)' />
|
91
|
+
<path d='M611.9999999999999,702.5 L640.8,702.5 L669.5999999999999, 702.5' style='fill: none; stroke: red; stroke-width:2' marker-mid='url(#arrowBothways)' />
|
92
|
+
<path d='M529.1999999999999,784.6 L529.1999999999999,874.0999999999999 L529.1999999999999, 963.5999999999999' style='fill: none; stroke: red; stroke-width:2' marker-mid='url(#arrowBothways)' /></svg>
|
data/docs/assets/svg/033.svg
CHANGED
@@ -5,8 +5,14 @@
|
|
5
5
|
<marker id="arrow" markerUnits="strokeWidth" markerWidth="11.520000000000001" markerHeight="11.520000000000001" viewBox="0 0 11.520000000000001 11.520000000000001" refX="5.760000000000001" refY="0">
|
6
6
|
<polyline fill="none" stroke="black" stroke-width="1" points="0,11.520000000000001,5.760000000000001,0,11.520000000000001,11.520000000000001" />
|
7
7
|
</marker>
|
8
|
-
<marker id="
|
9
|
-
<path d="M 0 0 L 10 5 L 0 10 z"
|
8
|
+
<marker id="arrowForward" viewBox="0 0 10 10" refX="5" refY="5" markerWidth="11.520000000000001" markerHeight="11.520000000000001" orient="auto-start-reverse">
|
9
|
+
<path d="M 0 0 L 10 5 L 0 10 z" fill="black"/>
|
10
|
+
</marker>
|
11
|
+
<marker id="arrowBackward" viewBox="0 0 10 10" refX="5" refY="5" markerWidth="11.520000000000001" markerHeight="11.520000000000001" orient="auto">
|
12
|
+
<path d="M 0 0 L 10 5 L 0 10 z" fill="black"/>
|
13
|
+
</marker>
|
14
|
+
<marker id="arrowBothways" viewBox="0 0 30 10" refX="15" refY="5" markerWidth="28.8" 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"/>
|
10
16
|
</marker>
|
11
17
|
<pattern id="hatchBlack" x="10" y="10" width="10" height="10" patternUnits="userSpaceOnUse" patternTransform="rotate(45)">
|
12
18
|
<line x1="0" y="0" x2="0" y2="10" stroke="black" stroke-width="4"></line>
|
@@ -61,14 +67,14 @@
|
|
61
67
|
<line x1='460.80000000000007' y1='1273.8' x2='460.80000000000007' y2='1416.8' style='fill: none; stroke: black; stroke-width:2' />
|
62
68
|
<line x1='597.6000000000001' y1='1273.8' x2='597.6000000000001' y2='1416.8' style='fill: none; stroke: black; stroke-width:2' />
|
63
69
|
<line x1='460.80000000000007' y1='1416.8' x2='597.6000000000001' y2='1416.8' style='fill: none; stroke: black; stroke-width:2' />
|
64
|
-
<line x1='306.0' y1='
|
65
|
-
<line x1='306.0' y1='
|
70
|
+
<line x1='306.0' y1='960.6' x2='306.0' y2='1504.8' style='fill: none; stroke: black; stroke-width:2' />
|
71
|
+
<line x1='306.0' y1='960.6' x2='306.0' y2='1504.8' style='fill: none; stroke: black; stroke-width:2' />
|
66
72
|
<line x1='306.0' y1='1504.8' x2='82.80000000000001' y2='1504.8' style='fill: none; stroke: black; stroke-width:2' />
|
67
|
-
<line x1='82.80000000000001' y1='1504.8' x2='82.80000000000001' y2='
|
68
|
-
<line x1='270.0' y1='
|
73
|
+
<line x1='82.80000000000001' y1='1504.8' x2='82.80000000000001' y2='784.6' style='fill: none; stroke: black; stroke-width:2' marker-end='url(#arrow)' />
|
74
|
+
<line x1='270.0' y1='960.6' x2='270.0' y2='1636.8' style='fill: none; stroke: black; stroke-width:2' stroke-dasharray='8 8' />
|
69
75
|
<line x1='270.0' y1='1636.8' x2='529.2' y2='1636.8' style='fill: none; stroke: black; stroke-width:2' stroke-dasharray='8 8' />
|
70
|
-
<line x1='529.2' y1='1636.8' x2='529.2' y2='1427.
|
71
|
-
<line x1='306.0' y1='
|
72
|
-
<line x1='306.0' y1='
|
73
|
-
<line x1='165.60000000000002' y1='702.
|
74
|
-
<line x1='306.0' y1='
|
76
|
+
<line x1='529.2' y1='1636.8' x2='529.2' y2='1427.0' style='fill: none; stroke: black; stroke-width:2' stroke-dasharray='8 8' />
|
77
|
+
<line x1='306.0' y1='362.2' x2='529.2' y2='919.6' style='fill: none; stroke: black; stroke-width:2' />
|
78
|
+
<line x1='306.0' y1='362.2' x2='82.80000000000001' y2='620.4' style='fill: none; stroke: black; stroke-width:2' />
|
79
|
+
<line x1='165.60000000000002' y1='702.5' x2='223.2' y2='790.5' style='fill: none; stroke: black; stroke-width:2' />
|
80
|
+
<line x1='306.0' y1='960.6' x2='529.2' y2='1262.8' style='fill: none; stroke: black; stroke-width:2' /></svg>
|
data/docs/assets/svg/034.svg
CHANGED
@@ -5,8 +5,14 @@
|
|
5
5
|
<marker id="arrow" markerUnits="strokeWidth" markerWidth="13.440000000000001" markerHeight="13.440000000000001" viewBox="0 0 13.440000000000001 13.440000000000001" refX="6.720000000000001" refY="0">
|
6
6
|
<polyline fill="none" stroke="black" stroke-width="1" points="0,13.440000000000001,6.720000000000001,0,13.440000000000001,13.440000000000001" />
|
7
7
|
</marker>
|
8
|
-
<marker id="
|
9
|
-
<path d="M 0 0 L 10 5 L 0 10 z"
|
8
|
+
<marker id="arrowForward" viewBox="0 0 10 10" refX="5" refY="5" markerWidth="13.440000000000001" markerHeight="13.440000000000001" orient="auto-start-reverse">
|
9
|
+
<path d="M 0 0 L 10 5 L 0 10 z" fill="black"/>
|
10
|
+
</marker>
|
11
|
+
<marker id="arrowBackward" viewBox="0 0 10 10" refX="5" refY="5" markerWidth="13.440000000000001" markerHeight="13.440000000000001" orient="auto">
|
12
|
+
<path d="M 0 0 L 10 5 L 0 10 z" fill="black"/>
|
13
|
+
</marker>
|
14
|
+
<marker id="arrowBothways" viewBox="0 0 30 10" refX="15" refY="5" markerWidth="33.6" 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"/>
|
10
16
|
</marker>
|
11
17
|
<pattern id="hatchBlack" x="10" y="10" width="10" height="10" patternUnits="userSpaceOnUse" patternTransform="rotate(45)">
|
12
18
|
<line x1="0" y="0" x2="0" y2="10" stroke="black" stroke-width="4"></line>
|
@@ -0,0 +1,80 @@
|
|
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="3630.4" height="1958.4" viewBox="-20, -20, 3650.4, 1978.4" version="1.1" xmlns="http://www.w3.org/2000/svg">
|
4
|
+
<defs>
|
5
|
+
<marker id="arrow" markerUnits="strokeWidth" markerWidth="13.440000000000001" markerHeight="13.440000000000001" viewBox="0 0 13.440000000000001 13.440000000000001" refX="6.720000000000001" refY="0">
|
6
|
+
<polyline fill="none" stroke="black" stroke-width="1" points="0,13.440000000000001,6.720000000000001,0,13.440000000000001,13.440000000000001" />
|
7
|
+
</marker>
|
8
|
+
<marker id="arrowForward" viewBox="0 0 10 10" refX="5" refY="5" markerWidth="13.440000000000001" markerHeight="13.440000000000001" orient="auto-start-reverse">
|
9
|
+
<path d="M 0 0 L 10 5 L 0 10 z" fill="black"/>
|
10
|
+
</marker>
|
11
|
+
<marker id="arrowBackward" viewBox="0 0 10 10" refX="5" refY="5" markerWidth="13.440000000000001" markerHeight="13.440000000000001" orient="auto">
|
12
|
+
<path d="M 0 0 L 10 5 L 0 10 z" fill="black"/>
|
13
|
+
</marker>
|
14
|
+
<marker id="arrowBothways" viewBox="0 0 30 10" refX="15" refY="5" markerWidth="33.6" 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="3650.4" height="1978.4" stroke="none" fill="white" />"
|
28
|
+
<text white-space='pre' alignment-baseline='text-top' style='fill: black; font-size: 64px;' x='1265.0' y='132.0'><tspan x='1627.5' y='132.0' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">Caused-Motion</tspan>
|
29
|
+
<tspan x='1265.0' y='308.0' style="font-style: italic; " text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">Pat<tspan style='fill:none;'>■</tspan>sneezed<tspan style='fill:none;'>■</tspan>the<tspan style='fill:none;'>■</tspan>napkin<tspan style='fill:none;'>■</tspan>off<tspan style='fill:none;'>■</tspan>the<tspan style='fill:none;'>■</tspan>table</tspan>
|
30
|
+
</text>
|
31
|
+
<text white-space='pre' alignment-baseline='text-top' style='fill: black; font-size: 64px;' x='154.0999999999999' y='730.4'><tspan x='426.5999999999999' y='730.4' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">Resultative</tspan>
|
32
|
+
<tspan x='154.0999999999999' y='906.4' style="font-style: italic; " text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">She<tspan style='fill:none;'>■</tspan>kissed<tspan style='fill:none;'>■</tspan>him<tspan style='fill:none;'>■</tspan>unconsicous</tspan>
|
33
|
+
</text>
|
34
|
+
<text white-space='pre' alignment-baseline='text-top' style='fill: black; font-size: 64px;' x='577.0999999999999' y='1328.8'><tspan x='577.0999999999999' y='1328.8' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif"><tspan style='fill:none;'>■</tspan></tspan>
|
35
|
+
</text>
|
36
|
+
<text white-space='pre' alignment-baseline='text-top' style='fill: black; font-size: 64px;' x='33.59999999999991' y='1628.0'><tspan x='229.0999999999999' y='1628.0' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">Intransitive<tspan style='fill:none;'>■</tspan>Resultative</tspan>
|
37
|
+
<tspan x='33.59999999999991' y='1804.0' style="font-style: italic; " text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">The<tspan style='fill:none;'>■</tspan>jello<tspan style='fill:none;'>■</tspan>went<tspan style='fill:none;'>■</tspan>from<tspan style='fill:none;'>■</tspan>liquid<tspan style='fill:none;'>■</tspan>to<tspan style='fill:none;'>■</tspan>solid</tspan>
|
38
|
+
</text>
|
39
|
+
<text white-space='pre' alignment-baseline='text-top' style='fill: black; font-size: 64px;' x='1836.5' y='730.4'><tspan x='1836.5' y='730.4' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif"><tspan style='fill:none;'>■</tspan></tspan>
|
40
|
+
</text>
|
41
|
+
<text white-space='pre' alignment-baseline='text-top' style='fill: black; font-size: 64px;' x='1549.0' y='1029.6'><tspan x='1549.0' y='1029.6' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">Intransitive<tspan style='fill:none;'>■</tspan>Motion</tspan>
|
42
|
+
<tspan x='1556.0' y='1205.6' style="font-style: italic; " text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">The<tspan style='fill:none;'>■</tspan>boy<tspan style='fill:none;'>■</tspan>ran<tspan style='fill:none;'>■</tspan>home</tspan>
|
43
|
+
</text>
|
44
|
+
<text white-space='pre' alignment-baseline='text-top' style='fill: black; font-size: 64px;' x='2639.4' y='730.4'><tspan x='2983.4' y='730.4' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">Transfer</tspan>
|
45
|
+
<tspan x='2639.4' y='906.4' style="font-style: italic; " text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">Sally<tspan style='fill:none;'>■</tspan>threw<tspan style='fill:none;'>■</tspan>a<tspan style='fill:none;'>■</tspan>football<tspan style='fill:none;'>■</tspan>to<tspan style='fill:none;'>■</tspan>him</tspan>
|
46
|
+
</text>
|
47
|
+
<line style='stroke:black; stroke-width:2;' x1='596.0999999999999' y1='620.4' x2='1855.5' y2='363.0' />
|
48
|
+
<line style='stroke:black; stroke-width:2;' x1='1855.5' y1='620.4' x2='1855.5' y2='363.0' />
|
49
|
+
<line style='stroke:black; stroke-width:2;' x1='3114.9' y1='620.4' x2='1855.5' y2='363.0' />
|
50
|
+
<line style='stroke:black; stroke-width:2;' x1='596.0999999999999' y1='1218.8' x2='596.0999999999999' y2='961.4' />
|
51
|
+
<line style='stroke:black; stroke-width:2;' x1='596.0999999999999' y1='1518.0' x2='596.0999999999999' y2='1383.8' />
|
52
|
+
<line style='stroke:black; stroke-width:2;' x1='1855.5' y1='919.6' x2='1855.5' y2='785.4' />
|
53
|
+
<line style="stroke:black; stroke-width:2; " x1="1265.0" y1="198.0" x2="2446.0" y2="198.0"></line>
|
54
|
+
<line x1='1248.2' y1='33.0' x2='2462.8' y2='33.0' style='fill: none; stroke: black; stroke-width:2' />
|
55
|
+
<line x1='1248.2' y1='33.0' x2='1248.2' y2='352.0' style='fill: none; stroke: black; stroke-width:2' />
|
56
|
+
<line x1='2462.8' y1='33.0' x2='2462.8' y2='352.0' style='fill: none; stroke: black; stroke-width:2' />
|
57
|
+
<line x1='1248.2' y1='352.0' x2='2462.8' y2='352.0' style='fill: none; stroke: black; stroke-width:2' />
|
58
|
+
<line style="stroke:black; stroke-width:2; " x1="154.0999999999999" y1="796.4" x2="1038.1" y2="796.4"></line>
|
59
|
+
<line x1='137.2999999999999' y1='631.4' x2='1054.8999999999999' y2='631.4' style='fill: none; stroke: black; stroke-width:2' />
|
60
|
+
<line x1='137.2999999999999' y1='631.4' x2='137.2999999999999' y2='950.4' style='fill: none; stroke: black; stroke-width:2' />
|
61
|
+
<line x1='1054.8999999999999' y1='631.4' x2='1054.8999999999999' y2='950.4' style='fill: none; stroke: black; stroke-width:2' />
|
62
|
+
<line x1='137.2999999999999' y1='950.4' x2='1054.8999999999999' y2='950.4' style='fill: none; stroke: black; stroke-width:2' />
|
63
|
+
<line style="stroke:black; stroke-width:2; " x1="33.59999999999991" y1="1694.0" x2="1158.6" y2="1694.0"></line>
|
64
|
+
<line x1='16.79999999999991' y1='1529.0' x2='1175.3999999999999' y2='1529.0' style='fill: none; stroke: black; stroke-width:2' />
|
65
|
+
<line x1='16.79999999999991' y1='1529.0' x2='16.79999999999991' y2='1848.0' style='fill: none; stroke: black; stroke-width:2' />
|
66
|
+
<line x1='1175.3999999999999' y1='1529.0' x2='1175.3999999999999' y2='1848.0' style='fill: none; stroke: black; stroke-width:2' />
|
67
|
+
<line x1='16.79999999999991' y1='1848.0' x2='1175.3999999999999' y2='1848.0' style='fill: none; stroke: black; stroke-width:2' />
|
68
|
+
<line style="stroke:black; stroke-width:2; " x1="1549.0" y1="1095.6" x2="2162.0" y2="1095.6"></line>
|
69
|
+
<line x1='1532.2' y1='930.6' x2='2178.8' y2='930.6' style='fill: none; stroke: black; stroke-width:2' />
|
70
|
+
<line x1='1532.2' y1='930.6' x2='1532.2' y2='1249.6' style='fill: none; stroke: black; stroke-width:2' />
|
71
|
+
<line x1='2178.8' y1='930.6' x2='2178.8' y2='1249.6' style='fill: none; stroke: black; stroke-width:2' />
|
72
|
+
<line x1='1532.2' y1='1249.6' x2='2178.8' y2='1249.6' style='fill: none; stroke: black; stroke-width:2' />
|
73
|
+
<line style="stroke:black; stroke-width:2; " x1="2639.4" y1="796.4" x2="3590.4" y2="796.4"></line>
|
74
|
+
<line x1='2622.6' y1='631.4' x2='3607.2' y2='631.4' style='fill: none; stroke: black; stroke-width:2' />
|
75
|
+
<line x1='2622.6' y1='631.4' x2='2622.6' y2='950.4' style='fill: none; stroke: black; stroke-width:2' />
|
76
|
+
<line x1='3607.2' y1='631.4' x2='3607.2' y2='950.4' style='fill: none; stroke: black; stroke-width:2' />
|
77
|
+
<line x1='2622.6' y1='950.4' x2='3607.2' y2='950.4' style='fill: none; stroke: black; stroke-width:2' />
|
78
|
+
<line x1='1855.5' y1='369.4' x2='1855.5' y2='919.6' style='fill: none; stroke: black; stroke-width:2' />
|
79
|
+
<line x1='596.0999999999999' y1='967.8' x2='596.0999999999999' y2='1518.0' style='fill: none; stroke: black; stroke-width:2' />
|
80
|
+
<line x1='596.0999999999999' y1='1518.0' x2='1855.5' y2='1267.0' style='fill: none; stroke: black; stroke-width:2' /></svg>
|
data/docs/documentation.md
CHANGED
@@ -142,8 +142,8 @@ A node can have any number of IDs. The same ID must appear in the text of the *t
|
|
142
142
|
You can also add extra connector between nodes in the same fasion as you draw paths between nodes. Extra connectors are drawn as straigt lines (not as `polyline`s).
|
143
143
|
|
144
144
|
- Non-directional (rendered as solid line `-----`)
|
145
|
-
- Directional (rendered as solid line
|
146
|
-
- Bidirectional (rendered as solid line
|
145
|
+
- Directional (rendered as solid line `--▶--`)
|
146
|
+
- Bidirectional (rendered as solid line `-◀-▶-`)
|
147
147
|
|
148
148
|
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.
|
149
149
|
|
data/docs/documentation_ja.md
CHANGED
@@ -154,6 +154,10 @@ IDにはどのような数字を用いても構いませんが,必ず **2箇
|
|
154
154
|
|
155
155
|
追加のコネクターは数字のIDで指定します,プラスとマイナスを連続させた(`+-`)後にIDを指定してください(例:`+-8`).マイナス記号とID番号の間に `>` 記号を入れると(例:`+->8`),コネクターの終端に矢印が付きます.
|
156
156
|
|
157
|
+
- 方向(矢印)のないコネクター(`-----`)
|
158
|
+
- 方向(矢印)のあるコネクター(`--▶--`)
|
159
|
+
- 両方向の矢印のあるコネクター(`-◀-▶-`)
|
160
|
+
|
157
161
|
IDにはどのような数字を用いても構いませんが,必ず **2箇所** で同じIDを指定することが必要です.同じIDを3箇所以上で指定することはできません.
|
158
162
|
|
159
163
|
<script src="https://cdn.jsdelivr.net/npm/jquery@3.5.0/dist/jquery.min.js"></script>
|
@@ -20,10 +20,12 @@ module RSyntaxTree
|
|
20
20
|
@col_node = "blue"
|
21
21
|
@col_leaf = "green"
|
22
22
|
@col_path = "purple"
|
23
|
+
@col_extra = "red"
|
23
24
|
else
|
24
25
|
@col_node = "black"
|
25
26
|
@col_leaf = "black"
|
26
27
|
@col_path = "black"
|
28
|
+
@col_extra = "black"
|
27
29
|
end
|
28
30
|
|
29
31
|
@col_bg = "none"
|
@@ -79,13 +81,11 @@ module RSyntaxTree
|
|
79
81
|
|
80
82
|
vertical_indent = if !target.triangle &&
|
81
83
|
(@leafstyle == "nothing" || @leafstyle == "none") &&
|
82
|
-
ETYPE_LEAF == target.type &&
|
83
|
-
parent.children.size == 1
|
84
|
+
ETYPE_LEAF == target.type && parent.children.size == 1
|
84
85
|
parent.vertical_indent + parent.content_height
|
85
86
|
else
|
86
87
|
parent.vertical_indent + parent.content_height + @global[:height_connector]
|
87
88
|
end
|
88
|
-
|
89
89
|
target.vertical_indent = vertical_indent
|
90
90
|
end
|
91
91
|
|
@@ -185,8 +185,6 @@ module RSyntaxTree
|
|
185
185
|
triangle_to_parent(parent, child)
|
186
186
|
elsif ETYPE_LEAF != child.type
|
187
187
|
line_to_parent(parent, child)
|
188
|
-
elsif ETYPE_LEAF == child.type
|
189
|
-
child.vertical_indent = parent.vertical_indent + parent.content_height + @global[:height_connector] / 2
|
190
188
|
end
|
191
189
|
end
|
192
190
|
else
|
@@ -239,7 +237,6 @@ module RSyntaxTree
|
|
239
237
|
end
|
240
238
|
|
241
239
|
offset_l = (top.horizontal_indent - get_leftmost) + @global[:h_gap_between_nodes]
|
242
|
-
# offset_r = top.width / 2 - offset_l - @global[:h_gap_between_nodes:
|
243
240
|
|
244
241
|
@element_list.get_elements.each do |e|
|
245
242
|
e.horizontal_indent += offset_l
|
data/lib/rsyntaxtree/element.rb
CHANGED
@@ -77,14 +77,6 @@ module RSyntaxTree
|
|
77
77
|
fontsize = decoration.include?(:subscript) || decoration.include?(:superscript) ? fontsize * SUBSCRIPT_CONST : fontsize
|
78
78
|
style = decoration.include?(:italic) || decoration.include?(:bolditalic) ? :italic : :normal
|
79
79
|
weight = decoration.include?(:bold) || decoration.include?(:bolditalic) ? :bold : :normal
|
80
|
-
|
81
|
-
# e[:cjk] = false
|
82
|
-
# if e[:decoration].include?(:math)
|
83
|
-
# font = @fontset[:math]
|
84
|
-
# elsif text.contains_cjk?
|
85
|
-
# font = @fontset[:cjk]
|
86
|
-
# e[:cjk] = true
|
87
|
-
# elsif decoration.include? :bolditalic
|
88
80
|
font = if decoration.include? :bolditalic
|
89
81
|
@fontset[:bolditalic]
|
90
82
|
elsif decoration.include? :bold
|
@@ -51,7 +51,7 @@ module RSyntaxTree
|
|
51
51
|
|
52
52
|
as = @global[:h_gap_between_nodes] / 4 * 0.8
|
53
53
|
as2 = @global[:h_gap_between_nodes] / 2 * 0.8
|
54
|
-
|
54
|
+
as4 = @global[:h_gap_between_nodes]
|
55
55
|
|
56
56
|
header = <<~HDR
|
57
57
|
<?xml version="1.0" standalone="no"?>
|
@@ -61,8 +61,14 @@ module RSyntaxTree
|
|
61
61
|
<marker id="arrow" markerUnits="strokeWidth" markerWidth="#{as2}" markerHeight="#{as2}" viewBox="0 0 #{as2} #{as2}" refX="#{as}" refY="0">
|
62
62
|
<polyline fill="none" stroke="#{@col_path}" stroke-width="1" points="0,#{as2},#{as},0,#{as2},#{as2}" />
|
63
63
|
</marker>
|
64
|
-
<marker id="
|
65
|
-
<path d="M 0 0 L 10 5 L 0 10 z"
|
64
|
+
<marker id="arrowForward" viewBox="0 0 10 10" refX="5" refY="5" markerWidth="#{as2}" markerHeight="#{as2}" orient="auto-start-reverse">
|
65
|
+
<path d="M 0 0 L 10 5 L 0 10 z" fill="#{@col_extra}"/>
|
66
|
+
</marker>
|
67
|
+
<marker id="arrowBackward" viewBox="0 0 10 10" refX="5" refY="5" markerWidth="#{as2}" markerHeight="#{as2}" orient="auto">
|
68
|
+
<path d="M 0 0 L 10 5 L 0 10 z" fill="#{@col_extra}"/>
|
69
|
+
</marker>
|
70
|
+
<marker id="arrowBothways" viewBox="0 0 30 10" refX="15" refY="5" markerWidth="#{as4}" markerHeight="#{as4}" orient="auto">
|
71
|
+
<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}"/>
|
66
72
|
</marker>
|
67
73
|
<pattern id="hatchBlack" x="10" y="10" width="10" height="10" patternUnits="userSpaceOnUse" patternTransform="rotate(45)">
|
68
74
|
<line x1="0" y="0" x2="0" y2="10" stroke="black" stroke-width="4"></line>
|
@@ -90,7 +96,7 @@ module RSyntaxTree
|
|
90
96
|
end
|
91
97
|
|
92
98
|
def draw_direct_line(s_x, s_y, t_x, t_y, s_arrow = false, t_arrow = false)
|
93
|
-
@extra_lines << generate_connector(s_x, s_y, t_x, t_y, @
|
99
|
+
@extra_lines << generate_connector(s_x, s_y, t_x, t_y, @col_extra, false, s_arrow, t_arrow)
|
94
100
|
end
|
95
101
|
|
96
102
|
def draw_a_path(s_x, s_y, t_x, t_y, target_arrow = :none)
|
@@ -120,10 +126,6 @@ module RSyntaxTree
|
|
120
126
|
@visited_x[t_x] = 1
|
121
127
|
end
|
122
128
|
|
123
|
-
# s_y += @global[:h_gap_between_nodes] / 2
|
124
|
-
# t_y += @global[:h_gap_between_nodes] / 2
|
125
|
-
# new_y += @global[:h_gap_between_nodes] / 2
|
126
|
-
|
127
129
|
dashed = true if target_arrow == :none
|
128
130
|
|
129
131
|
case target_arrow
|
@@ -380,24 +382,14 @@ module RSyntaxTree
|
|
380
382
|
line_pool = {}
|
381
383
|
line_flags = []
|
382
384
|
|
383
|
-
# elist = @element_list.get_elements.reverse
|
384
385
|
elist = @element_list.get_elements
|
385
386
|
|
386
|
-
elist.
|
387
|
+
elist.each do |element|
|
387
388
|
x0 = element.horizontal_indent - @global[:h_gap_between_nodes]
|
388
389
|
x1 = element.horizontal_indent + element.content_width / 2
|
389
390
|
x2 = element.horizontal_indent + element.content_width + @global[:h_gap_between_nodes]
|
390
|
-
y0 =
|
391
|
-
|
392
|
-
else
|
393
|
-
element.vertical_indent + @global[:height_connector_to_text] / 2
|
394
|
-
end
|
395
|
-
y1 = element.vertical_indent + element.content_height
|
396
|
-
if i == elist.size - 1 && /nothing|none/ =~ @leafstyle
|
397
|
-
y1 -= @global[:height_connector_to_text] / 2
|
398
|
-
else
|
399
|
-
y1 += @global[:height_connector_to_text]
|
400
|
-
end
|
391
|
+
y0 = element.vertical_indent + @global[:height_connector_to_text] / 2
|
392
|
+
y1 = element.vertical_indent + element.content_height + @global[:h_gap_between_nodes] * 1.5
|
401
393
|
et = element.path
|
402
394
|
et.each do |tr|
|
403
395
|
if /\A-(>)?(\d+)\z/ =~ tr
|
@@ -458,7 +450,6 @@ module RSyntaxTree
|
|
458
450
|
end
|
459
451
|
|
460
452
|
paths.each do |t|
|
461
|
-
# draw_a_path(t[:x1], t[:y1] - @global[:height_connector_to_text], t[:x2], t[:y2] - @global[:height_connector_to_text], t[:arrow])
|
462
453
|
draw_a_path(t[:x1], t[:y1], t[:x2], t[:y2], t[:arrow])
|
463
454
|
end
|
464
455
|
|
@@ -466,35 +457,47 @@ module RSyntaxTree
|
|
466
457
|
a = v[0]
|
467
458
|
b = v[1]
|
468
459
|
|
469
|
-
if
|
470
|
-
|
471
|
-
|
472
|
-
y_center = y_top + (y_top - y_bottom).abs / 2
|
473
|
-
if a[:x][:center] < b[:x][:center]
|
474
|
-
draw_direct_line(a[:x][:right], y_center, b[:x][:left], y_center, a[:arrow], b[:arrow])
|
475
|
-
else
|
476
|
-
draw_direct_line(b[:x][:right], y_center, a[:x][:left], y_center, b[:arrow], a[:arrow])
|
477
|
-
end
|
478
|
-
next
|
479
|
-
end
|
480
|
-
|
481
|
-
if a[:y][:bottom] < b[:y][:bottom]
|
460
|
+
if a[:y][:top] > b[:y][:bottom]
|
461
|
+
draw_direct_line(a[:x][:center], a[:y][:top], b[:x][:center], b[:y][:bottom], a[:arrow], b[:arrow])
|
462
|
+
elsif b[:y][:top] > a[:y][:bottom]
|
482
463
|
draw_direct_line(a[:x][:center], a[:y][:bottom], b[:x][:center], b[:y][:top], a[:arrow], b[:arrow])
|
464
|
+
elsif a[:x][:center] < b[:x][:center]
|
465
|
+
draw_direct_line(a[:x][:right], a[:y][:center], b[:x][:left], b[:y][:center], a[:arrow], b[:arrow])
|
483
466
|
else
|
484
|
-
draw_direct_line(
|
467
|
+
draw_direct_line(b[:x][:right], b[:y][:center], a[:x][:left], a[:y][:center], b[:arrow], a[:arrow])
|
485
468
|
end
|
486
469
|
end
|
487
470
|
paths.size + line_pool.keys.size
|
488
471
|
end
|
489
472
|
|
490
473
|
def generate_connector(x1, y1, x2, y2, col, dashed = false, s_arrow = false, t_arrow = false, stroke_width = 1)
|
491
|
-
string =
|
492
|
-
|
493
|
-
|
474
|
+
string = if s_arrow && t_arrow
|
475
|
+
"marker-mid='url(#arrowBothways)' "
|
476
|
+
elsif s_arrow
|
477
|
+
"marker-mid='url(#arrowForward)' "
|
478
|
+
elsif t_arrow
|
479
|
+
"marker-mid='url(#arrowBackward)' "
|
480
|
+
else
|
481
|
+
""
|
482
|
+
end
|
494
483
|
dasharray = dashed ? "stroke-dasharray='8 8'" : ""
|
495
484
|
swidth = FONT_SCALING * stroke_width
|
496
485
|
|
497
|
-
|
486
|
+
if s_arrow || t_arrow
|
487
|
+
x_mid = if x2 > x1
|
488
|
+
x1 + (x2 - x1) / 2
|
489
|
+
else
|
490
|
+
x1 - (x1 - x2) / 2
|
491
|
+
end
|
492
|
+
y_mid = if y2 > y1
|
493
|
+
y1 + (y2 - y1) / 2
|
494
|
+
else
|
495
|
+
y1 - (y1 - y2) / 2
|
496
|
+
end
|
497
|
+
"<path d='M#{x1},#{y1} L#{x_mid},#{y_mid} L#{x2}, #{y2}' style='fill: none; stroke: #{col}; stroke-width:#{swidth}' #{dasharray} #{string}/>"
|
498
|
+
else
|
499
|
+
"<line x1='#{x1}' y1='#{y1}' x2='#{x2}' y2='#{y2}' style='fill: none; stroke: #{col}; stroke-width:#{swidth}' #{dasharray} #{string}/>"
|
500
|
+
end
|
498
501
|
end
|
499
502
|
|
500
503
|
def generate_line(x1, y1, x2, y2, col, dashed = false, arrow = false, stroke_width = 1)
|
data/lib/rsyntaxtree/version.rb
CHANGED