rsyntaxtree 1.2.1 → 1.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.tags +12 -0
- data/Rakefile +14 -4
- data/bin/rsyntaxtree +4 -2
- data/docs/_examples/000.md +2 -1
- data/docs/_examples/001.md +2 -1
- data/docs/_examples/002.md +2 -1
- data/docs/_examples/003.md +2 -1
- data/docs/_examples/004.md +2 -1
- data/docs/_examples/005.md +2 -1
- data/docs/_examples/006.md +2 -1
- data/docs/_examples/007.md +2 -1
- data/docs/_examples/008.md +2 -1
- data/docs/_examples/009.md +2 -1
- data/docs/_examples/010.md +2 -1
- data/docs/_examples/011.md +2 -1
- data/docs/_examples/012.md +2 -1
- data/docs/_examples/013.md +2 -1
- data/docs/_examples/014.md +2 -1
- data/docs/_examples/015.md +2 -1
- data/docs/_examples/016.md +2 -1
- data/docs/_examples/017.md +2 -1
- data/docs/_examples/018.md +2 -1
- data/docs/_examples/019.md +2 -1
- data/docs/_examples/020.md +2 -1
- data/docs/_examples/021.md +2 -1
- data/docs/_examples/022.md +2 -1
- data/docs/_examples/023.md +2 -1
- data/docs/_examples/024.md +2 -1
- data/docs/_examples/025.md +2 -1
- data/docs/_examples/026.md +3 -2
- data/docs/_examples/027.md +3 -2
- data/docs/_examples/028.md +2 -1
- data/docs/_examples/029.md +2 -1
- data/docs/_examples/030.md +2 -1
- data/docs/_examples/031.md +2 -1
- data/docs/_examples/032.md +2 -1
- data/docs/_examples/033.md +16 -17
- data/docs/_examples/034.md +2 -1
- data/docs/_examples/035.md +5 -4
- data/docs/_examples/036.md +18 -0
- data/docs/_examples/037.md +18 -0
- data/docs/_examples/038.md +31 -0
- data/docs/_examples/039.md +14 -0
- data/docs/assets/img/000.png +0 -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/022.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/031.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/img/036.png +0 -0
- data/docs/assets/img/037.png +0 -0
- data/docs/assets/img/038.png +0 -0
- data/docs/assets/img/039.png +0 -0
- data/docs/assets/svg/000.svg +44 -44
- data/docs/assets/svg/001.svg +24 -24
- data/docs/assets/svg/002.svg +36 -36
- data/docs/assets/svg/003.svg +28 -28
- data/docs/assets/svg/004.svg +39 -39
- data/docs/assets/svg/005.svg +19 -19
- data/docs/assets/svg/006.svg +24 -24
- data/docs/assets/svg/007.svg +30 -30
- data/docs/assets/svg/008.svg +34 -34
- data/docs/assets/svg/009.svg +33 -33
- data/docs/assets/svg/010.svg +57 -57
- data/docs/assets/svg/011.svg +28 -28
- data/docs/assets/svg/012.svg +33 -33
- data/docs/assets/svg/013.svg +120 -120
- data/docs/assets/svg/014.svg +91 -91
- data/docs/assets/svg/015.svg +38 -38
- data/docs/assets/svg/016.svg +253 -253
- data/docs/assets/svg/017.svg +40 -40
- data/docs/assets/svg/018.svg +42 -42
- data/docs/assets/svg/019.svg +4 -4
- data/docs/assets/svg/020.svg +64 -64
- data/docs/assets/svg/021.svg +41 -41
- data/docs/assets/svg/022.svg +67 -67
- data/docs/assets/svg/023.svg +41 -41
- data/docs/assets/svg/024.svg +22 -22
- data/docs/assets/svg/025.svg +125 -125
- data/docs/assets/svg/026.svg +18 -18
- data/docs/assets/svg/027.svg +48 -48
- data/docs/assets/svg/028.svg +26 -26
- data/docs/assets/svg/029.svg +92 -92
- data/docs/assets/svg/030.svg +18 -18
- data/docs/assets/svg/031.svg +14 -14
- data/docs/assets/svg/032.svg +63 -63
- data/docs/assets/svg/033.svg +60 -59
- data/docs/assets/svg/034.svg +4 -4
- data/docs/assets/svg/035.svg +47 -45
- data/docs/assets/svg/036.svg +50 -0
- data/docs/assets/svg/037.svg +88 -0
- data/docs/assets/svg/038.svg +88 -0
- data/docs/assets/svg/039.svg +30 -0
- data/docs/documentation.md +5 -4
- data/docs/documentation_ja.md +8 -8
- data/docs/examples.html +1 -1
- data/lib/rsyntaxtree/base_graph.rb +26 -8
- data/lib/rsyntaxtree/element.rb +13 -5
- data/lib/rsyntaxtree/markup_parser.rb +1 -1
- data/lib/rsyntaxtree/svg_graph.rb +17 -13
- data/lib/rsyntaxtree/version.rb +1 -1
- data/lib/rsyntaxtree.rb +13 -3
- data/test/example_verify_test.rb +13 -3
- metadata +15 -3
@@ -0,0 +1,50 @@
|
|
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="803.0" height="550.4" viewBox="-20, -20, 823.0, 570.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="#CC79A7" stroke-width="1" points="0,13.440000000000001,6.720000000000001,0,13.440000000000001,13.440000000000001" />
|
7
|
+
</marker>
|
8
|
+
<marker id="arrowBackward" viewBox="0 0 10 10" refX="5" refY="5" markerWidth="13.440000000000001" markerHeight="13.440000000000001" orient="auto">
|
9
|
+
<path d="M 0 0 L 10 5 L 0 10 z" fill="#D55E00"/>
|
10
|
+
</marker>
|
11
|
+
<marker id="arrowForward" viewBox="0 0 10 10" refX="5" refY="5" markerWidth="13.440000000000001" markerHeight="13.440000000000001" orient="auto">
|
12
|
+
<path d="M 10 0 L 0 5 L 10 10 z" fill="#D55E00"/>
|
13
|
+
</marker>
|
14
|
+
<marker id="arrowBothways" viewBox="0 0 30 10" refX="15" refY="5" markerWidth="40.32" markerHeight="40.32" 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="#D55E00"/>
|
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="823.0" height="570.4" stroke="none" fill="white" />"
|
28
|
+
<text white-space='pre' alignment-baseline='text-top' style='fill: #0072B2; font-size: 64px;' x='280.29999999999995' y='132.0'><tspan x='280.29999999999995' y='132.0' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">Schema</tspan>
|
29
|
+
</text>
|
30
|
+
<text white-space='pre' alignment-baseline='text-top' style='fill: #009E73; font-size: 64px;' x='33.60000000000002' y='475.20000000000005'><tspan x='33.60000000000002' y='475.20000000000005' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">Prototype</tspan>
|
31
|
+
</text>
|
32
|
+
<text white-space='pre' alignment-baseline='text-top' style='fill: #009E73; font-size: 64px;' x='467.0' y='475.20000000000005'><tspan x='467.0' y='475.20000000000005' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">Extention</tspan>
|
33
|
+
</text>
|
34
|
+
<line style='stroke:none; stroke-width:2;' x1='182.60000000000002' y1='365.2' x2='398.8' y2='187.0' />
|
35
|
+
<line style='stroke:none; stroke-width:2;' x1='615.0' y1='365.2' x2='398.8' y2='187.0' />
|
36
|
+
<line x1='263.49999999999994' y1='33.0' x2='534.0999999999999' y2='33.0' style='fill: none; stroke: #0072B2; stroke-width:2' />
|
37
|
+
<line x1='263.49999999999994' y1='33.0' x2='263.49999999999994' y2='176.0' style='fill: none; stroke: #0072B2; stroke-width:2' />
|
38
|
+
<line x1='534.0999999999999' y1='33.0' x2='534.0999999999999' y2='176.0' style='fill: none; stroke: #0072B2; stroke-width:2' />
|
39
|
+
<line x1='263.49999999999994' y1='176.0' x2='534.0999999999999' y2='176.0' style='fill: none; stroke: #0072B2; stroke-width:2' />
|
40
|
+
<line x1='16.800000000000022' y1='376.2' x2='348.40000000000003' y2='376.2' style='fill: none; stroke: #009E73; stroke-width:2' />
|
41
|
+
<line x1='16.800000000000022' y1='376.2' x2='16.800000000000022' y2='519.2' style='fill: none; stroke: #009E73; stroke-width:2' />
|
42
|
+
<line x1='348.40000000000003' y1='376.2' x2='348.40000000000003' y2='519.2' style='fill: none; stroke: #009E73; stroke-width:2' />
|
43
|
+
<line x1='16.800000000000022' y1='519.2' x2='348.40000000000003' y2='519.2' style='fill: none; stroke: #009E73; stroke-width:2' />
|
44
|
+
<line x1='450.2' y1='376.2' x2='779.8' y2='376.2' style='fill: none; stroke: #009E73; stroke-width:2' />
|
45
|
+
<line x1='450.2' y1='376.2' x2='450.2' y2='519.2' style='fill: none; stroke: #009E73; stroke-width:2' />
|
46
|
+
<line x1='779.8' y1='376.2' x2='779.8' y2='519.2' style='fill: none; stroke: #009E73; stroke-width:2' />
|
47
|
+
<line x1='450.2' y1='519.2' x2='779.8' y2='519.2' style='fill: none; stroke: #009E73; stroke-width:2' />
|
48
|
+
<path d='M182.60000000000002,365.2 L290.70000000000005,276.1 L398.8, 187.0' style='fill: none; stroke: #D55E00; stroke-width:2' marker-mid='url(#arrowBothways)' />
|
49
|
+
<path d='M615.0,365.2 L506.9,276.1 L398.8, 187.0' style='fill: none; stroke: #D55E00; stroke-width:2' marker-mid='url(#arrowBothways)' />
|
50
|
+
<path d='M365.20000000000005,447.70000000000005 L399.3,447.70000000000005 L433.4, 447.70000000000005' style='fill: none; stroke: #D55E00; stroke-width:2' marker-mid='url(#arrowBackward)' /></svg>
|
@@ -0,0 +1,88 @@
|
|
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="513.6" height="695.2" viewBox="-20, -20, 533.6, 715.2" 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="#CC79A7" stroke-width="1" points="0,13.440000000000001,6.720000000000001,0,13.440000000000001,13.440000000000001" />
|
7
|
+
</marker>
|
8
|
+
<marker id="arrowBackward" viewBox="0 0 10 10" refX="5" refY="5" markerWidth="13.440000000000001" markerHeight="13.440000000000001" orient="auto">
|
9
|
+
<path d="M 0 0 L 10 5 L 0 10 z" fill="#D55E00"/>
|
10
|
+
</marker>
|
11
|
+
<marker id="arrowForward" viewBox="0 0 10 10" refX="5" refY="5" markerWidth="13.440000000000001" markerHeight="13.440000000000001" orient="auto">
|
12
|
+
<path d="M 10 0 L 0 5 L 10 10 z" fill="#D55E00"/>
|
13
|
+
</marker>
|
14
|
+
<marker id="arrowBothways" viewBox="0 0 30 10" refX="15" refY="5" markerWidth="40.32" markerHeight="40.32" 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="#D55E00"/>
|
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="533.6" height="715.2" stroke="none" fill="white" />"
|
28
|
+
<text white-space='pre' alignment-baseline='text-top' style='fill: #009E73; font-size: 64px;' x='33.599999999999994' y='132.0'><tspan x='144.6' y='132.0' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">X</tspan>
|
29
|
+
<tspan x='234.6' y='132.0' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif"> </tspan>
|
30
|
+
<tspan x='323.1' y='132.0' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">x</tspan>
|
31
|
+
<tspan x='234.6' y='220.0' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif"><tspan style='fill:none;'>■</tspan></tspan>
|
32
|
+
<tspan x='57.099999999999994' y='308.0' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">Y</tspan>
|
33
|
+
<tspan x='146.6' y='308.0' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif"> </tspan>
|
34
|
+
<tspan x='235.1' y='308.0' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">y</tspan>
|
35
|
+
<tspan x='322.6' y='308.0' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif"> </tspan>
|
36
|
+
<tspan x='411.6' y='308.0' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">a</tspan>
|
37
|
+
<tspan x='234.6' y='396.0' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif"><tspan style='fill:none;'>■</tspan></tspan>
|
38
|
+
<tspan x='145.1' y='484.0' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">Y</tspan>
|
39
|
+
<tspan x='234.6' y='484.0' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif"> </tspan>
|
40
|
+
<tspan x='323.1' y='484.0' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">y</tspan>
|
41
|
+
</text>
|
42
|
+
<rect style='stroke: #009E73; stroke-width:2;'
|
43
|
+
x='121.6' y='63.599999999999994' rx='44.0' ry='44.0'
|
44
|
+
width='88.0' height='88.0'
|
45
|
+
fill='none' />
|
46
|
+
|
47
|
+
<line style='stroke:#009E73; stroke-width:2;' x1='209.6' y1='107.6' x2='297.6' y2='107.6'></line>
|
48
|
+
|
49
|
+
<rect style='stroke: #009E73; stroke-width:2;'
|
50
|
+
x='297.6' y='63.599999999999994'
|
51
|
+
width='88.0' height='88.0'
|
52
|
+
fill='none' />
|
53
|
+
|
54
|
+
<rect style='stroke: #009E73; stroke-width:2;'
|
55
|
+
x='33.599999999999994' y='239.6' rx='44.0' ry='44.0'
|
56
|
+
width='88.0' height='88.0'
|
57
|
+
fill='none' />
|
58
|
+
|
59
|
+
<line style='stroke:#009E73; stroke-width:2;' x1='121.6' y1='283.6' x2='209.6' y2='283.6'></line>
|
60
|
+
|
61
|
+
<rect style='stroke: #009E73; stroke-width:2;'
|
62
|
+
x='209.6' y='239.6'
|
63
|
+
width='88.0' height='88.0'
|
64
|
+
fill='none' />
|
65
|
+
|
66
|
+
<line style='stroke:#009E73; stroke-width:2;' x1='297.6' y1='283.6' x2='385.6' y2='283.6'></line>
|
67
|
+
|
68
|
+
<rect style='stroke: #009E73; stroke-width:5.0;'
|
69
|
+
x='385.6' y='239.6' rx='44.0' ry='44.0'
|
70
|
+
width='88.0' height='88.0'
|
71
|
+
fill='none' />
|
72
|
+
|
73
|
+
<rect style='stroke: #009E73; stroke-width:2;'
|
74
|
+
x='121.6' y='415.6' rx='44.0' ry='44.0'
|
75
|
+
width='88.0' height='88.0'
|
76
|
+
fill='none' />
|
77
|
+
|
78
|
+
<line style='stroke:#009E73; stroke-width:2;' x1='209.6' y1='459.6' x2='297.6' y2='459.6'></line>
|
79
|
+
|
80
|
+
<rect style='stroke: #009E73; stroke-width:2;'
|
81
|
+
x='297.6' y='415.6'
|
82
|
+
width='88.0' height='88.0'
|
83
|
+
fill='none' />
|
84
|
+
|
85
|
+
<line x1='16.799999999999994' y1='33.0' x2='490.40000000000003' y2='33.0' style='fill: none; stroke: #009E73; stroke-width:4' />
|
86
|
+
<line x1='16.799999999999994' y1='33.0' x2='16.799999999999994' y2='528.0' style='fill: none; stroke: #009E73; stroke-width:4' />
|
87
|
+
<line x1='490.40000000000003' y1='33.0' x2='490.40000000000003' y2='528.0' style='fill: none; stroke: #009E73; stroke-width:4' />
|
88
|
+
<line x1='16.799999999999994' y1='528.0' x2='490.40000000000003' y2='528.0' style='fill: none; stroke: #009E73; stroke-width:4' /></svg>
|
@@ -0,0 +1,88 @@
|
|
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="2135.2000000000007" height="1580.0" viewBox="-20, -20, 2155.2000000000007, 1600.0" version="1.1" xmlns="http://www.w3.org/2000/svg">
|
4
|
+
<defs>
|
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="black" stroke-width="1" points="0,11.520000000000001,5.760000000000001,0,11.520000000000001,11.520000000000001" />
|
7
|
+
</marker>
|
8
|
+
<marker id="arrowBackward" viewBox="0 0 10 10" refX="5" refY="5" markerWidth="11.520000000000001" markerHeight="11.520000000000001" orient="auto">
|
9
|
+
<path d="M 0 0 L 10 5 L 0 10 z" fill="black"/>
|
10
|
+
</marker>
|
11
|
+
<marker id="arrowForward" viewBox="0 0 10 10" refX="5" refY="5" markerWidth="11.520000000000001" markerHeight="11.520000000000001" orient="auto">
|
12
|
+
<path d="M 10 0 L 0 5 L 10 10 z" fill="black"/>
|
13
|
+
</marker>
|
14
|
+
<marker id="arrowBothways" viewBox="0 0 30 10" refX="15" refY="5" markerWidth="34.56" markerHeight="34.56" 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="2155.2000000000007" height="1600.0" stroke="none" fill="white" />"
|
28
|
+
<text white-space='pre' alignment-baseline='text-top' style='fill: black; font-size: 64px;' x='1026.0000000000002' y='132.0'><tspan x='1026.0000000000002' y='132.0' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">hypernym</tspan>
|
29
|
+
</text>
|
30
|
+
<text white-space='pre' alignment-baseline='text-top' style='fill: black; font-size: 64px;' x='244.79999999999995' y='475.20000000000005'><tspan x='244.79999999999995' y='475.20000000000005' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">meronym</tspan>
|
31
|
+
</text>
|
32
|
+
<text white-space='pre' alignment-baseline='text-top' style='fill: black; font-size: 64px;' x='28.799999999999955' y='818.4'><tspan x='28.799999999999955' y='818.4' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">meronymy/part-whole</tspan>
|
33
|
+
</text>
|
34
|
+
<text white-space='pre' alignment-baseline='text-top' style='fill: black; font-size: 64px;' x='244.79999999999995' y='1161.6'><tspan x='244.79999999999995' y='1161.6' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">holonym</tspan>
|
35
|
+
</text>
|
36
|
+
<text white-space='pre' alignment-baseline='text-top' style='fill: black; font-size: 64px;' x='936.0000000000002' y='475.20000000000005'><tspan x='936.0000000000002' y='475.20000000000005' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">superordinate</tspan>
|
37
|
+
</text>
|
38
|
+
<text white-space='pre' alignment-baseline='text-top' style='fill: black; font-size: 64px;' x='1098.0000000000002' y='818.4'><tspan x='1098.0000000000002' y='818.4' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">word</tspan>
|
39
|
+
</text>
|
40
|
+
<text white-space='pre' alignment-baseline='text-top' style='fill: black; font-size: 64px;' x='972.0000000000002' y='1161.6'><tspan x='972.0000000000002' y='1161.6' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">subordinate</tspan>
|
41
|
+
</text>
|
42
|
+
<text white-space='pre' alignment-baseline='text-top' style='fill: black; font-size: 64px;' x='1044.0000000000002' y='1504.8'><tspan x='1044.0000000000002' y='1504.8' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">hyponym</tspan>
|
43
|
+
</text>
|
44
|
+
<text white-space='pre' alignment-baseline='text-top' style='fill: black; font-size: 64px;' x='1951.2000000000003' y='475.20000000000005'><tspan x='1951.2000000000003' y='475.20000000000005' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif"><tspan style='fill:none;'>■</tspan></tspan>
|
45
|
+
</text>
|
46
|
+
<text white-space='pre' alignment-baseline='text-top' style='fill: black; font-size: 64px;' x='1843.2000000000003' y='818.4'><tspan x='1843.2000000000003' y='818.4' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">synonym</tspan>
|
47
|
+
</text>
|
48
|
+
<line style='stroke:none; stroke-width:2;' x1='370.79999999999995' y1='365.2' x2='1170.0000000000002' y2='187.0' />
|
49
|
+
<line style='stroke:none; stroke-width:2;' x1='1170.0000000000002' y1='365.2' x2='1170.0000000000002' y2='187.0' />
|
50
|
+
<line style='stroke:none; stroke-width:2;' x1='1969.2000000000003' y1='365.2' x2='1170.0000000000002' y2='187.0' />
|
51
|
+
<line style='stroke:none; stroke-width:2;' x1='370.79999999999995' y1='708.4' x2='370.79999999999995' y2='530.2' />
|
52
|
+
<line style='stroke:none; stroke-width:2;' x1='370.79999999999995' y1='1051.6' x2='370.79999999999995' y2='873.4' />
|
53
|
+
<line style='stroke:none; stroke-width:2;' x1='1170.0000000000002' y1='708.4' x2='1170.0000000000002' y2='530.2' />
|
54
|
+
<line style='stroke:none; stroke-width:2;' x1='1170.0000000000002' y1='1051.6' x2='1170.0000000000002' y2='873.4' />
|
55
|
+
<line style='stroke:none; stroke-width:2;' x1='1170.0000000000002' y1='1394.8' x2='1170.0000000000002' y2='1216.6' />
|
56
|
+
<line style='stroke:none; stroke-width:2;' x1='1969.2000000000003' y1='708.4' x2='1969.2000000000003' y2='530.2' />
|
57
|
+
<line x1='1011.6000000000003' y1='33.0' x2='1328.4000000000003' y2='33.0' style='fill: none; stroke: black; stroke-width:2' />
|
58
|
+
<line x1='1011.6000000000003' y1='33.0' x2='1011.6000000000003' y2='176.0' style='fill: none; stroke: black; stroke-width:2' />
|
59
|
+
<line x1='1328.4000000000003' y1='33.0' x2='1328.4000000000003' y2='176.0' style='fill: none; stroke: black; stroke-width:2' />
|
60
|
+
<line x1='1011.6000000000003' y1='176.0' x2='1328.4000000000003' y2='176.0' style='fill: none; stroke: black; stroke-width:2' />
|
61
|
+
<line x1='230.39999999999995' y1='376.2' x2='511.19999999999993' y2='376.2' style='fill: none; stroke: black; stroke-width:2' />
|
62
|
+
<line x1='230.39999999999995' y1='376.2' x2='230.39999999999995' y2='519.2' style='fill: none; stroke: black; stroke-width:2' />
|
63
|
+
<line x1='511.19999999999993' y1='376.2' x2='511.19999999999993' y2='519.2' style='fill: none; stroke: black; stroke-width:2' />
|
64
|
+
<line x1='230.39999999999995' y1='519.2' x2='511.19999999999993' y2='519.2' style='fill: none; stroke: black; stroke-width:2' />
|
65
|
+
<line x1='230.39999999999995' y1='1062.6' x2='511.19999999999993' y2='1062.6' style='fill: none; stroke: black; stroke-width:2' />
|
66
|
+
<line x1='230.39999999999995' y1='1062.6' x2='230.39999999999995' y2='1205.6' style='fill: none; stroke: black; stroke-width:2' />
|
67
|
+
<line x1='511.19999999999993' y1='1062.6' x2='511.19999999999993' y2='1205.6' style='fill: none; stroke: black; stroke-width:2' />
|
68
|
+
<line x1='230.39999999999995' y1='1205.6' x2='511.19999999999993' y2='1205.6' style='fill: none; stroke: black; stroke-width:2' />
|
69
|
+
<line x1='1083.6000000000001' y1='719.4' x2='1256.4' y2='719.4' style='fill: none; stroke: black; stroke-width:4' />
|
70
|
+
<line x1='1083.6000000000001' y1='719.4' x2='1083.6000000000001' y2='862.4' style='fill: none; stroke: black; stroke-width:4' />
|
71
|
+
<line x1='1256.4' y1='719.4' x2='1256.4' y2='862.4' style='fill: none; stroke: black; stroke-width:4' />
|
72
|
+
<line x1='1083.6000000000001' y1='862.4' x2='1256.4' y2='862.4' style='fill: none; stroke: black; stroke-width:4' />
|
73
|
+
<line x1='1029.6000000000001' y1='1405.8' x2='1310.4' y2='1405.8' style='fill: none; stroke: black; stroke-width:2' />
|
74
|
+
<line x1='1029.6000000000001' y1='1405.8' x2='1029.6000000000001' y2='1548.8' style='fill: none; stroke: black; stroke-width:2' />
|
75
|
+
<line x1='1310.4' y1='1405.8' x2='1310.4' y2='1548.8' style='fill: none; stroke: black; stroke-width:2' />
|
76
|
+
<line x1='1029.6000000000001' y1='1548.8' x2='1310.4' y2='1548.8' style='fill: none; stroke: black; stroke-width:2' />
|
77
|
+
<line x1='1828.8000000000002' y1='719.4' x2='2109.6000000000004' y2='719.4' style='fill: none; stroke: black; stroke-width:2' />
|
78
|
+
<line x1='1828.8000000000002' y1='719.4' x2='1828.8000000000002' y2='862.4' style='fill: none; stroke: black; stroke-width:2' />
|
79
|
+
<line x1='2109.6000000000004' y1='719.4' x2='2109.6000000000004' y2='862.4' style='fill: none; stroke: black; stroke-width:2' />
|
80
|
+
<line x1='1828.8000000000002' y1='862.4' x2='2109.6000000000004' y2='862.4' style='fill: none; stroke: black; stroke-width:2' />
|
81
|
+
<path d='M1170.0000000000002,365.2 L1170.0000000000002,276.1 L1170.0000000000002, 187.0' style='fill: none; stroke: black; stroke-width:2' marker-mid='url(#arrowBackward)' />
|
82
|
+
<path d='M370.79999999999995,708.4 L370.79999999999995,619.3 L370.79999999999995, 530.2' style='fill: none; stroke: black; stroke-width:2' marker-mid='url(#arrowBackward)' />
|
83
|
+
<path d='M370.79999999999995,1051.6 L370.79999999999995,962.5 L370.79999999999995, 873.4' style='fill: none; stroke: black; stroke-width:2' marker-mid='url(#arrowForward)' />
|
84
|
+
<path d='M741.5999999999999,790.9 L905.4000000000001,790.9 L1069.2000000000003, 790.9' style='fill: none; stroke: black; stroke-width:2' marker-mid='url(#arrowForward)' />
|
85
|
+
<path d='M1170.0000000000002,708.4 L1170.0000000000002,619.3 L1170.0000000000002, 530.2' style='fill: none; stroke: black; stroke-width:2' marker-mid='url(#arrowBackward)' />
|
86
|
+
<path d='M1270.8000000000002,790.9 L1542.6000000000004,790.9 L1814.4000000000003, 790.9' style='fill: none; stroke: black; stroke-width:2' marker-mid='url(#arrowBothways)' />
|
87
|
+
<path d='M1170.0000000000002,1051.6 L1170.0000000000002,962.5 L1170.0000000000002, 873.4' style='fill: none; stroke: black; stroke-width:2' marker-mid='url(#arrowForward)' />
|
88
|
+
<path d='M1170.0000000000002,1394.8 L1170.0000000000002,1305.6999999999998 L1170.0000000000002, 1216.6' style='fill: none; stroke: black; stroke-width:2' marker-mid='url(#arrowForward)' /></svg>
|
@@ -0,0 +1,30 @@
|
|
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="115.6" height="211.2" viewBox="-20, -20, 135.6, 231.2" 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="#CC79A7" stroke-width="1" points="0,13.440000000000001,6.720000000000001,0,13.440000000000001,13.440000000000001" />
|
7
|
+
</marker>
|
8
|
+
<marker id="arrowBackward" viewBox="0 0 10 10" refX="5" refY="5" markerWidth="13.440000000000001" markerHeight="13.440000000000001" orient="auto">
|
9
|
+
<path d="M 0 0 L 10 5 L 0 10 z" fill="#D55E00"/>
|
10
|
+
</marker>
|
11
|
+
<marker id="arrowForward" viewBox="0 0 10 10" refX="5" refY="5" markerWidth="13.440000000000001" markerHeight="13.440000000000001" orient="auto">
|
12
|
+
<path d="M 10 0 L 0 5 L 10 10 z" fill="#D55E00"/>
|
13
|
+
</marker>
|
14
|
+
<marker id="arrowBothways" viewBox="0 0 30 10" refX="15" refY="5" markerWidth="40.32" markerHeight="40.32" 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="#D55E00"/>
|
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="135.6" height="231.2" stroke="none" fill="white" />"
|
28
|
+
<text white-space='pre' alignment-baseline='text-top' style='fill: #009E73; font-size: 64px;' x='33.599999999999994' y='132.0'><tspan x='33.599999999999994' y='132.0' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">X</tspan>
|
29
|
+
</text>
|
30
|
+
</svg>
|
data/docs/documentation.md
CHANGED
@@ -21,7 +21,7 @@ Type your text in the editor area using labeled bracket notation and click the D
|
|
21
21
|
|
22
22
|
Every branch or leaf of the syntax tree must belong to a node. To create a node, place the label text right next to the start bracket. Any number of branches may follow, separated by a whitespace. (Node labels containing whitespaces can be created using the `<>` symbol. For example, `Modal<>Aux` will be rendered as `Modal Aux`).
|
23
23
|
|
24
|
-
There are three different types of `connector` drawn between a terminal node and its leaves (`auto`, `bar` and `none`). `auto` draws a triangle for leaves containing one or more whitespaces (= phrases). If the leaf does not contain any spaces (= single word), a straight bar is drawn instead (unless the leaf contains a `^` symbol at the beginning, which specifies the leaf to be a phrase).
|
24
|
+
There are three different types of `connector` drawn between a terminal node and its leaves (`auto`, `bar` and `none`). `auto` draws a triangle for leaves containing one or more whitespaces (= phrases). If the leaf does not contain any spaces (= single word), a straight bar is drawn instead (unless the leaf contains a `^` symbol at the beginning, which specifies the leaf to be a phrase). The connectors can be made transparent using the `Hide default connectors` option.
|
25
25
|
|
26
26
|
The newline character `\n` can be used within the text of both node lables and leaves.
|
27
27
|
|
@@ -133,19 +133,20 @@ You can draw any number of paths of three different types:
|
|
133
133
|
- Directional (rendered as solid line `----->`)
|
134
134
|
- Bidirectional (rendered as solid line `<----->`)
|
135
135
|
|
136
|
-
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 sign is placed between the plus sign and the number (e.g. `+>7`), an arrowhead will appear at the end of the path.
|
136
|
+
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
|
+
|
137
138
|
|
138
139
|
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.
|
139
140
|
|
140
141
|
### Draw Extra Connectors between Nodes (experimental)
|
141
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
|
+
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). You may enable the `Hide default connectors` option when drawing extra connectors.
|
143
144
|
|
144
145
|
- Non-directional (rendered as solid line `-----`)
|
145
146
|
- Directional (rendered as solid line `--▶--`)
|
146
147
|
- Bidirectional (rendered as solid line `-◀-▶-`)
|
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
|
+
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.
|
149
150
|
|
150
151
|
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.
|
151
152
|
|
data/docs/documentation_ja.md
CHANGED
@@ -19,9 +19,9 @@ layout: default
|
|
19
19
|
|
20
20
|
エディターエリアにラベル付き括弧表記でテキストを入力し,`Draw PNG`または`Draw SVG`ボタンをクリックします.
|
21
21
|
|
22
|
-
樹形図のすべてのブランチ(枝)やリーフ(葉)は,ノード(節点)に属します.ノードを作成するには,ラベルテキストを開始括弧の直後に配置します.ブランチは,空白で区切っていくつでも設定できます.リーフのテキストに1
|
22
|
+
樹形図のすべてのブランチ(枝)やリーフ(葉)は,ノード(節点)に属します.ノードを作成するには,ラベルテキストを開始括弧の直後に配置します.ブランチは,空白で区切っていくつでも設定できます.リーフのテキストに1つ以上の空白が含まれているとき,空白はそのまま表示されます.ノードのラベルに空白を含めたいときには `<>` 記号を使って表します.例えば `Modal<>Aux` とすれば `Modal Aux` と表示されます.
|
23
23
|
|
24
|
-
終端ノードとリーフの間に描かれるコネクターの描画方法は3種の中から選べます(`auto`,`bar`,`none`).`auto` では,1つ以上の空白を含むリーフ(要するに「句」)に対しては終端ノードを頂点とした三角形を描画します.リーフが空白を含まない場合(つまり「単語」の場合),垂直線が描かれます .なお,リーフの先頭に `^` をつけると,そのリーフが句であると宣言することになります.したがって必ず三角形が描かれます. `bar` では,すべてのリーフに関して垂直線が描かれます. `none`
|
24
|
+
終端ノードとリーフの間に描かれるコネクターの描画方法は3種の中から選べます(`auto`,`bar`,`none`).`auto` では,1つ以上の空白を含むリーフ(要するに「句」)に対しては終端ノードを頂点とした三角形を描画します.リーフが空白を含まない場合(つまり「単語」の場合),垂直線が描かれます .なお,リーフの先頭に `^` をつけると,そのリーフが句であると宣言することになります.したがって必ず三角形が描かれます. `bar` では,すべてのリーフに関して垂直線が描かれます. `none` では終端ノードとリーフの間にコネクターは描かれません.これらのコネクターは `Hide default connectors` オプションをオンにすると非表示(透明)にすることができます.
|
25
25
|
|
26
26
|
ノードを表すテキストやリーフを表すテキストの中で改行を行たい場合,改行文字 `\n` を用いることができます.
|
27
27
|
|
@@ -86,7 +86,7 @@ SVG形式を用いる場合,期待通りの表示を得るためには,ご
|
|
86
86
|
|------------|--------|
|
87
87
|
|`X<>Y` |X Y|
|
88
88
|
|
89
|
-
|
89
|
+
リーフのテキスト中の半角スペースはそのままスペースとして表示されます.`<>`は基本的にはラベル内でスペースを表示したいときに使いますが,リーフ内のテキストでも有効です.
|
90
90
|
|
91
91
|
#### 改行
|
92
92
|
|
@@ -127,7 +127,7 @@ SVG形式を用いる場合,期待通りの表示を得るためには,ご
|
|
127
127
|
|
128
128
|
### 一部の文字を表示するためのエスケープ
|
129
129
|
|
130
|
-
文字装飾などのマークアップに使用される一部の文字をテキストとして表示するためには `\`
|
130
|
+
文字装飾などのマークアップに使用される一部の文字をテキストとして表示するためには `\` によってエスケープする必要があります.使用している環境で `\` が使えない場合は `¥` で代用することができます.
|
131
131
|
|
132
132
|
{% include escape_char_table.html %}
|
133
133
|
|
@@ -143,16 +143,16 @@ SVG形式を用いる場合,期待通りの表示を得るためには,ご
|
|
143
143
|
- 方向(矢印)のあるパス(`----->`)
|
144
144
|
- 両方向の矢印のあるパス(`<----->`)
|
145
145
|
|
146
|
-
樹形図の中でパスを表示したいとき,パスの両端を数字のID
|
147
|
-
プラス記号とID番号の間に `>` 記号を入れると(例:`+>7
|
146
|
+
樹形図の中でパスを表示したいとき,パスの両端を数字のIDで指定します.数字をプラス(`+`)記号と共にノードのテキストの最後で指定してください(例:`+7`).
|
147
|
+
プラス記号とID番号の間に `>` 記号を入れると(例:`+>7`),パスの終端に矢印が付きます.その際、`+>` と `+<` のどちらを用いるかで結果は変わりません。矢印の先は常にこれらのいずれかを用いたIDが指定された要素に向けられます。
|
148
148
|
|
149
149
|
IDにはどのような数字を用いても構いませんが,必ず **2箇所** で同じIDを指定することが必要です.同じIDを3箇所以上で指定することはできません.
|
150
150
|
|
151
151
|
### ノードからノードへの追加的なコネクターの描画(試験的機能)
|
152
152
|
|
153
|
-
|
153
|
+
パスの指定と類似した方式でノードからノードへのコネクターを追加することができます.追加的なコネクターは直線で描画されます(`polyline`にはなりません).追加的なコネクターを描画する際,デフォルトのコネクターを非表示(透明)にしたいときには `Hide default connectors`オプションをオンにすると良いでしょう.
|
154
154
|
|
155
|
-
追加のコネクターは数字のIDで指定します,プラスとマイナスを連続させた(`+-`)後にIDを指定してください(例:`+-8`).マイナス記号とID番号の間に `>` 記号を入れると(例:`+->8
|
155
|
+
追加のコネクターは数字のIDで指定します,プラスとマイナスを連続させた(`+-`)後にIDを指定してください(例:`+-8`).マイナス記号とID番号の間に `>` 記号を入れると(例:`+->8`),コネクターの終端に矢印が付きます.その際、`+->` と `+-<` のどちらを用いるかで結果は変わりません。矢印の先は常にこれらのいずれかを用いたIDが指定された要素に向けられます。
|
156
156
|
|
157
157
|
- 方向(矢印)のないコネクター(`-----`)
|
158
158
|
- 方向(矢印)のあるコネクター(`--▶--`)
|
data/docs/examples.html
CHANGED
@@ -37,7 +37,7 @@ layout: default
|
|
37
37
|
<tr><td>Category</td><td>{{ example.category}}</td></tr>
|
38
38
|
<tr><td>Connector</td><td>{{ example.connector }}</td></tr>
|
39
39
|
<tr><td>Polyline</td><td>{{ example.polyline }}</td></tr>
|
40
|
-
<tr><td>
|
40
|
+
<tr><td>Color</td><td>{{ example.color }}</td></tr>
|
41
41
|
<tr><td>Radical Symmetirization</td><td>{{ example.symmetrization }}</td></tr>
|
42
42
|
<tr><td>Font</td><td>{{ example.font }}</td></tr>
|
43
43
|
{% if example.reference %}
|
@@ -16,7 +16,19 @@ module RSyntaxTree
|
|
16
16
|
@element_list = element_list
|
17
17
|
@symmetrize = params[:symmetrize]
|
18
18
|
|
19
|
-
|
19
|
+
case params[:color]
|
20
|
+
# Okabe-Ito Color
|
21
|
+
when "modern"
|
22
|
+
@col_node = "#0072B2" # blue
|
23
|
+
@col_leaf = "#009E73" # bluishgreen
|
24
|
+
@col_path = "#CC79A7" # reddishpurple
|
25
|
+
@col_extra = "#D55E00" # vermillion
|
26
|
+
# "#000000" black
|
27
|
+
# "#E69F00" orange
|
28
|
+
# "#56B4E9" skyblue
|
29
|
+
# "#F0E442" yellow
|
30
|
+
# "#999999" grey
|
31
|
+
when "traditional"
|
20
32
|
@col_node = "blue"
|
21
33
|
@col_leaf = "green"
|
22
34
|
@col_path = "purple"
|
@@ -30,7 +42,12 @@ module RSyntaxTree
|
|
30
42
|
|
31
43
|
@col_bg = "none"
|
32
44
|
@col_fg = "black"
|
33
|
-
|
45
|
+
|
46
|
+
@col_line = if params[:hide_default_connectors]
|
47
|
+
"none"
|
48
|
+
else
|
49
|
+
"black"
|
50
|
+
end
|
34
51
|
|
35
52
|
@leafstyle = params[:leafstyle]
|
36
53
|
@fontset = params[:fontset]
|
@@ -224,11 +241,13 @@ module RSyntaxTree
|
|
224
241
|
end
|
225
242
|
|
226
243
|
def parse_list
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
244
|
+
if @element_list.elements.size > 1
|
245
|
+
calculate_level
|
246
|
+
calculate_width
|
247
|
+
make_balance if @symmetrize
|
248
|
+
calculate_indent
|
249
|
+
node_centering
|
250
|
+
end
|
232
251
|
|
233
252
|
top = @element_list.get_id(1)
|
234
253
|
diff = top.horizontal_indent
|
@@ -250,7 +269,6 @@ module RSyntaxTree
|
|
250
269
|
width = get_rightmost - get_leftmost + @global[:h_gap_between_nodes]
|
251
270
|
height = @element_list.get_id(1).height
|
252
271
|
height = @height if @height > height
|
253
|
-
|
254
272
|
{ height: height, width: width }
|
255
273
|
end
|
256
274
|
end
|
data/lib/rsyntaxtree/element.rb
CHANGED
@@ -27,7 +27,7 @@ module RSyntaxTree
|
|
27
27
|
@vertical_indent = 0 # Drawing offset
|
28
28
|
content = content.strip
|
29
29
|
|
30
|
-
@path = if /.+?\^?((
|
30
|
+
@path = if /.+?\^?((?:\+-?>?<?\d+)+)\^?\z/m =~ content
|
31
31
|
$1.sub(/\A\+/, "").split("+")
|
32
32
|
else
|
33
33
|
[]
|
@@ -57,6 +57,7 @@ module RSyntaxTree
|
|
57
57
|
def setup
|
58
58
|
total_width = 0
|
59
59
|
total_height = 0
|
60
|
+
one_bvm_given = false
|
60
61
|
@content.each do |content|
|
61
62
|
content_width = 0
|
62
63
|
case content[:type]
|
@@ -88,6 +89,7 @@ module RSyntaxTree
|
|
88
89
|
end
|
89
90
|
|
90
91
|
standard_metrics = FontMetrics.get_metrics('X', @fontset[:normal], fontsize, :normal, :normal)
|
92
|
+
|
91
93
|
height = standard_metrics.height
|
92
94
|
if /\A[<>]+\z/ =~ text
|
93
95
|
width = standard_metrics.width * text.size / 2
|
@@ -132,16 +134,22 @@ module RSyntaxTree
|
|
132
134
|
end
|
133
135
|
|
134
136
|
e[:height] = height
|
135
|
-
|
137
|
+
|
138
|
+
if one_bvm_given
|
139
|
+
elements_height << height
|
140
|
+
else
|
141
|
+
one_bvm_given = true
|
142
|
+
elements_height << height + @global[:box_vertical_margin] / 2
|
143
|
+
end
|
136
144
|
|
137
145
|
e[:width] = width
|
138
146
|
row_width += width
|
139
147
|
end
|
140
148
|
|
141
|
-
total_height += if @enclosure
|
142
|
-
elements_height.max + @global[:height_connector_to_text]
|
149
|
+
total_height += if @parent.zero? && @children.empty? && @enclosure == :none
|
150
|
+
elements_height.max + @global[:height_connector_to_text] * 2
|
143
151
|
else
|
144
|
-
elements_height.max
|
152
|
+
elements_height.max + @global[:height_connector_to_text]
|
145
153
|
end
|
146
154
|
content_width += row_width
|
147
155
|
end
|
@@ -13,7 +13,7 @@ class MarkupParser < Parslet::Parser
|
|
13
13
|
rule(:brackets) { str('#') }
|
14
14
|
rule(:triangle) { str('^') }
|
15
15
|
|
16
|
-
rule(:path) { (str('+') >> str('-').maybe >> str('>').maybe >> match('\d').repeat(1)).as(:path) }
|
16
|
+
rule(:path) { (str('+') >> str('-').maybe >> (str('>') | str('<')).maybe >> match('\d').repeat(1)).as(:path) }
|
17
17
|
rule(:escaped) { str('\\') >> match('[#<>{}\\^+*_=~\|\n\-]').as(:chr) }
|
18
18
|
rule(:non_escaped) { ((match('[#<>{}\\^+*_=~\|\-]') | str('\\n')).absent? >> any).as(:chr) }
|
19
19
|
rule(:text) { (escaped | non_escaped).repeat(1).as(:text) }
|
@@ -16,6 +16,7 @@ module RSyntaxTree
|
|
16
16
|
attr_accessor :width, :height
|
17
17
|
|
18
18
|
def initialize(element_list, params, global)
|
19
|
+
super(element_list, params, global)
|
19
20
|
@height = 0
|
20
21
|
@width = 0
|
21
22
|
@extra_lines = []
|
@@ -26,8 +27,8 @@ module RSyntaxTree
|
|
26
27
|
@fontstyle = params[:fontstyle]
|
27
28
|
@margin = params[:margin].to_i
|
28
29
|
@polyline = params[:polyline]
|
29
|
-
@line_styles = "<line style='stroke
|
30
|
-
@polyline_styles = "<polyline style='stroke
|
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
32
|
points='CHIX CHIY MIDX1 MIDY1 MIDX2 MIDY2 PARX PARY' />\n"
|
32
33
|
@polygon_styles = "<polygon style='fill: none; stroke: black; stroke-width:#{FONT_SCALING};' points='X1 Y1 X2 Y2 X3 Y3' />\n"
|
33
34
|
@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,12 +36,15 @@ module RSyntaxTree
|
|
35
36
|
@visited_x = {}
|
36
37
|
@visited_y = {}
|
37
38
|
@global = global
|
38
|
-
super(element_list, params, global)
|
39
39
|
end
|
40
40
|
|
41
41
|
def svg_data
|
42
42
|
metrics = parse_list
|
43
|
-
@height =
|
43
|
+
@height = if @element_list.elements.size == 1
|
44
|
+
metrics[:height]
|
45
|
+
else
|
46
|
+
metrics[:height] + @margin * 2
|
47
|
+
end
|
44
48
|
@width = metrics[:width] + @margin * 2
|
45
49
|
|
46
50
|
x1 = 0 - @margin
|
@@ -51,7 +55,7 @@ module RSyntaxTree
|
|
51
55
|
|
52
56
|
as = @global[:h_gap_between_nodes] / 4 * 0.8
|
53
57
|
as2 = @global[:h_gap_between_nodes] / 2 * 0.8
|
54
|
-
as4 = @global[:h_gap_between_nodes]
|
58
|
+
as4 = @global[:h_gap_between_nodes] * 1.2
|
55
59
|
|
56
60
|
header = <<~HDR
|
57
61
|
<?xml version="1.0" standalone="no"?>
|
@@ -61,12 +65,12 @@ module RSyntaxTree
|
|
61
65
|
<marker id="arrow" markerUnits="strokeWidth" markerWidth="#{as2}" markerHeight="#{as2}" viewBox="0 0 #{as2} #{as2}" refX="#{as}" refY="0">
|
62
66
|
<polyline fill="none" stroke="#{@col_path}" stroke-width="1" points="0,#{as2},#{as},0,#{as2},#{as2}" />
|
63
67
|
</marker>
|
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
68
|
<marker id="arrowBackward" viewBox="0 0 10 10" refX="5" refY="5" markerWidth="#{as2}" markerHeight="#{as2}" orient="auto">
|
68
69
|
<path d="M 0 0 L 10 5 L 0 10 z" fill="#{@col_extra}"/>
|
69
70
|
</marker>
|
71
|
+
<marker id="arrowForward" viewBox="0 0 10 10" refX="5" refY="5" markerWidth="#{as2}" markerHeight="#{as2}" orient="auto">
|
72
|
+
<path d="M 10 0 L 0 5 L 10 10 z" fill="#{@col_extra}"/>
|
73
|
+
</marker>
|
70
74
|
<marker id="arrowBothways" viewBox="0 0 30 10" refX="15" refY="5" markerWidth="#{as4}" markerHeight="#{as4}" orient="auto">
|
71
75
|
<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}"/>
|
72
76
|
</marker>
|
@@ -389,10 +393,10 @@ module RSyntaxTree
|
|
389
393
|
x1 = element.horizontal_indent + element.content_width / 2
|
390
394
|
x2 = element.horizontal_indent + element.content_width + @global[:h_gap_between_nodes]
|
391
395
|
y0 = element.vertical_indent + @global[:height_connector_to_text] / 2
|
392
|
-
y1 = element.vertical_indent + element.content_height + @global[:
|
396
|
+
y1 = element.vertical_indent + element.content_height + @global[:height_connector_to_text]
|
393
397
|
et = element.path
|
394
398
|
et.each do |tr|
|
395
|
-
if /\A-(
|
399
|
+
if /\A-(>|<)?(\d+)\z/ =~ tr
|
396
400
|
arrow = $1
|
397
401
|
tr = $2
|
398
402
|
if line_pool[tr]
|
@@ -401,7 +405,7 @@ module RSyntaxTree
|
|
401
405
|
line_pool[tr] = [{ x: { left: x0, center: x1, right: x2 }, y: { top: y0, center: y0 + (y1 - y0) / 2, bottom: y1 }, arrow: arrow }]
|
402
406
|
end
|
403
407
|
line_flags << tr
|
404
|
-
elsif /\A
|
408
|
+
elsif /\A(?:>|<)(\d+)\z/ =~ tr
|
405
409
|
tr = $1
|
406
410
|
if path_pool_target[tr]
|
407
411
|
path_pool_target[tr] << [x1, y1]
|
@@ -459,8 +463,8 @@ module RSyntaxTree
|
|
459
463
|
|
460
464
|
if a[:y][:top] > b[:y][:bottom]
|
461
465
|
draw_direct_line(a[:x][:center], a[:y][:top], b[:x][:center], b[:y][:bottom], a[:arrow], b[:arrow])
|
462
|
-
elsif
|
463
|
-
draw_direct_line(
|
466
|
+
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])
|
464
468
|
elsif a[:x][:center] < b[:x][:center]
|
465
469
|
draw_direct_line(a[:x][:right], a[:y][:center], b[:x][:left], b[:y][:center], a[:arrow], b[:arrow])
|
466
470
|
else
|