vector_salad 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Rakefile +17 -0
- data/examples/birthday.rb +0 -1
- data/examples/birthday.svg +273 -273
- data/examples/boolean_operations.svg +258 -258
- data/examples/bp_logo.svg +18 -18
- data/examples/bunny_card.svg +119 -119
- data/examples/chill.svg +80 -80
- data/examples/circle_line_segments.svg +19 -19
- data/examples/circles.svg +3 -3
- data/examples/clip_operations.svg +1 -1
- data/examples/cog_menu.svg +1 -1
- data/examples/cubic_circle.svg +16 -16
- data/examples/flower.svg +200 -200
- data/examples/fox.svg +10 -10
- data/examples/gold_stars.svg +5 -5
- data/examples/paths.svg +3 -3
- data/examples/pepsi_logo.svg +2 -2
- data/examples/polygons.svg +6 -6
- data/examples/simple_path.svg +2 -2
- data/examples/space.svg +5838 -5838
- data/examples/spiro_nodes.svg +1 -1
- data/examples/transforms.svg +58 -58
- data/examples/triangles.svg +1 -1
- data/lib/vector_salad/exporters/svg_exporter.rb +5 -5
- data/lib/vector_salad/monkeypatches.rb +5 -0
- data/lib/vector_salad/version.rb +1 -1
- data/vector_salad.gemspec +1 -0
- metadata +16 -2
data/examples/spiro_nodes.svg
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
height="250">
|
5
5
|
|
6
6
|
<rect x="0" y="0" width="450" height="250" fill="none"/>
|
7
|
-
<path d="M 50.0 120.0 C 54.
|
7
|
+
<path d="M 50.0 120.0 C 54.66240026 140.80364056, 69.05944734 159.20881585, 88.12836313 168.74327375 C 107.19727891 178.27773164, 130.5596474 178.75226413, 150.0 170.0 C 158.31014456 166.25867999, 165.83002539 160.98255767, 173.89194035 156.73267471 C 181.95385531 152.48279174, 190.92064794 149.21174615, 200.0 150.0 C 205.45423204 150.47352712, 210.72150522 152.40946505, 215.44476861 155.17779633 C 220.16803199 157.9461276, 224.37153552 161.53206153, 228.21294228 165.43289083 C 235.89575579 173.23454941, 242.19370055 182.32190199, 250.0 190.0 C 267.87890767 207.58528563, 293.63091058 216.8457373, 318.61451674 214.67386395 C 343.59812289 212.50199059, 367.36583919 198.93669366, 381.94203241 178.53002315 C 396.51822563 158.12335264, 401.64181474 131.240822, 395.59349835 106.90328969 C 389.54518196 82.56575738, 372.4332943 61.20914435, 350.0 50.0" fill="red" stroke="black" stroke-width="4"/>
|
8
8
|
<circle cx="50" cy="120" r="5" fill="green"/>
|
9
9
|
<circle cx="350" cy="50" r="5" fill="green"/>
|
10
10
|
<circle cx="150" cy="170" r="5" fill="blue"/>
|
data/examples/transforms.svg
CHANGED
@@ -26,21 +26,21 @@
|
|
26
26
|
<path d="M 200 30 L 170 60 L 230 60 Z" fill="firebrick"/>
|
27
27
|
<path d="M 240 60 L 210 30 L 270 30 Z" fill="darkorange"/>
|
28
28
|
<path d="M 280 30 L 250 60 L 310 60 Z" fill="firebrick"/>
|
29
|
-
<path d="M 16.
|
30
|
-
<path d="M 36.
|
31
|
-
<path d="M 56.
|
32
|
-
<path d="M 76.
|
33
|
-
<path d="M 96.
|
34
|
-
<path d="M 116.
|
35
|
-
<path d="M 136.
|
36
|
-
<path d="M 156.
|
37
|
-
<path d="M 176.
|
38
|
-
<path d="M 196.
|
39
|
-
<path d="M 216.
|
40
|
-
<path d="M 236.
|
41
|
-
<path d="M 256.
|
42
|
-
<path d="M 276.
|
43
|
-
<path d="M 296.
|
29
|
+
<path d="M 16.47328849 84.85410197 L 14.2936609 78.14589803 L 20.0 74.0 L 25.7063391 78.14589803 L 23.52671151 84.85410197 Z" fill="white"/>
|
30
|
+
<path d="M 36.47328849 84.85410197 L 34.2936609 78.14589803 L 40.0 74.0 L 45.7063391 78.14589803 L 43.52671151 84.85410197 Z" fill="black"/>
|
31
|
+
<path d="M 56.47328849 84.85410197 L 54.2936609 78.14589803 L 60.0 74.0 L 65.7063391 78.14589803 L 63.52671151 84.85410197 Z" fill="saddlebrown"/>
|
32
|
+
<path d="M 76.47328849 84.85410197 L 74.2936609 78.14589803 L 80.0 74.0 L 85.7063391 78.14589803 L 83.52671151 84.85410197 Z" fill="darkorange"/>
|
33
|
+
<path d="M 96.47328849 84.85410197 L 94.2936609 78.14589803 L 100.0 74.0 L 105.7063391 78.14589803 L 103.52671151 84.85410197 Z" fill="firebrick"/>
|
34
|
+
<path d="M 116.47328849 84.85410197 L 114.2936609 78.14589803 L 120.0 74.0 L 125.7063391 78.14589803 L 123.52671151 84.85410197 Z" fill="white"/>
|
35
|
+
<path d="M 136.47328849 84.85410197 L 134.2936609 78.14589803 L 140.0 74.0 L 145.7063391 78.14589803 L 143.52671151 84.85410197 Z" fill="black"/>
|
36
|
+
<path d="M 156.47328849 84.85410197 L 154.2936609 78.14589803 L 160.0 74.0 L 165.7063391 78.14589803 L 163.52671151 84.85410197 Z" fill="saddlebrown"/>
|
37
|
+
<path d="M 176.47328849 84.85410197 L 174.2936609 78.14589803 L 180.0 74.0 L 185.7063391 78.14589803 L 183.52671151 84.85410197 Z" fill="darkorange"/>
|
38
|
+
<path d="M 196.47328849 84.85410197 L 194.2936609 78.14589803 L 200.0 74.0 L 205.7063391 78.14589803 L 203.52671151 84.85410197 Z" fill="firebrick"/>
|
39
|
+
<path d="M 216.47328849 84.85410197 L 214.2936609 78.14589803 L 220.0 74.0 L 225.7063391 78.14589803 L 223.52671151 84.85410197 Z" fill="white"/>
|
40
|
+
<path d="M 236.47328849 84.85410197 L 234.2936609 78.14589803 L 240.0 74.0 L 245.7063391 78.14589803 L 243.52671151 84.85410197 Z" fill="black"/>
|
41
|
+
<path d="M 256.47328849 84.85410197 L 254.2936609 78.14589803 L 260.0 74.0 L 265.7063391 78.14589803 L 263.52671151 84.85410197 Z" fill="saddlebrown"/>
|
42
|
+
<path d="M 276.47328849 84.85410197 L 274.2936609 78.14589803 L 280.0 74.0 L 285.7063391 78.14589803 L 283.52671151 84.85410197 Z" fill="darkorange"/>
|
43
|
+
<path d="M 296.47328849 84.85410197 L 294.2936609 78.14589803 L 300.0 74.0 L 305.7063391 78.14589803 L 303.52671151 84.85410197 Z" fill="firebrick"/>
|
44
44
|
<rect x="0" y="100" width="320" height="160" fill="saddlebrown"/>
|
45
45
|
<path d="M 85 200 L 70 100 L 100 100 Z" fill="white"/>
|
46
46
|
<path d="M 115 200 L 100 100 L 130 100 Z" fill="white"/>
|
@@ -50,8 +50,8 @@
|
|
50
50
|
<path d="M 235 200 L 220 100 L 250 100 Z" fill="white"/>
|
51
51
|
<path d="M 35 145 L 10 125 L 60 125 Z" fill="black"/>
|
52
52
|
<path d="M 285 145 L 260 125 L 310 125 Z" fill="black"/>
|
53
|
-
<path d="M 42 160 C 42 156.
|
54
|
-
<path d="M 292 160 C 292 156.
|
53
|
+
<path d="M 42 160 C 42 156.13659483, 38.86340517 153, 35 153 C 31.13659483 153, 28 156.13659483, 28 160 C 28 163.86340517, 31.13659483 167, 35 167 C 38.86340517 167, 42 163.86340517, 42 160 Z" fill="firebrick"/>
|
54
|
+
<path d="M 292 160 C 292 156.13659483, 288.86340517 153, 285 153 C 281.13659483 153, 278 156.13659483, 278 160 C 278 163.86340517, 281.13659483 167, 285 167 C 288.86340517 167, 292 163.86340517, 292 160 Z" fill="firebrick"/>
|
55
55
|
<path d="M 70 160.0 L 55 260.0 L 85 260.0 Z" fill="white"/>
|
56
56
|
<path d="M 100 160.0 L 85 260.0 L 115 260.0 Z" fill="white"/>
|
57
57
|
<path d="M 130 160.0 L 115 260.0 L 145 260.0 Z" fill="white"/>
|
@@ -59,50 +59,50 @@
|
|
59
59
|
<path d="M 190 160.0 L 175 260.0 L 205 260.0 Z" fill="white"/>
|
60
60
|
<path d="M 220 160.0 L 205 260.0 L 235 260.0 Z" fill="white"/>
|
61
61
|
<path d="M 250 160.0 L 235 260.0 L 265 260.0 Z" fill="white"/>
|
62
|
-
<path d="M 16.
|
63
|
-
<path d="M 36.
|
64
|
-
<path d="M 56.
|
65
|
-
<path d="M 76.
|
66
|
-
<path d="M 96.
|
67
|
-
<path d="M 116.
|
68
|
-
<path d="M 136.
|
69
|
-
<path d="M 156.
|
70
|
-
<path d="M 176.
|
71
|
-
<path d="M 196.
|
72
|
-
<path d="M 216.
|
73
|
-
<path d="M 236.
|
74
|
-
<path d="M 256.
|
75
|
-
<path d="M 276.
|
76
|
-
<path d="M 296.
|
62
|
+
<path d="M 16.47328849 284.85410197 L 14.2936609 278.14589803 L 20.0 274.0 L 25.7063391 278.14589803 L 23.52671151 284.85410197 Z" fill="saddlebrown"/>
|
63
|
+
<path d="M 36.47328849 284.85410197 L 34.2936609 278.14589803 L 40.0 274.0 L 45.7063391 278.14589803 L 43.52671151 284.85410197 Z" fill="darkorange"/>
|
64
|
+
<path d="M 56.47328849 284.85410197 L 54.2936609 278.14589803 L 60.0 274.0 L 65.7063391 278.14589803 L 63.52671151 284.85410197 Z" fill="black"/>
|
65
|
+
<path d="M 76.47328849 284.85410197 L 74.2936609 278.14589803 L 80.0 274.0 L 85.7063391 278.14589803 L 83.52671151 284.85410197 Z" fill="firebrick"/>
|
66
|
+
<path d="M 96.47328849 284.85410197 L 94.2936609 278.14589803 L 100.0 274.0 L 105.7063391 278.14589803 L 103.52671151 284.85410197 Z" fill="white"/>
|
67
|
+
<path d="M 116.47328849 284.85410197 L 114.2936609 278.14589803 L 120.0 274.0 L 125.7063391 278.14589803 L 123.52671151 284.85410197 Z" fill="saddlebrown"/>
|
68
|
+
<path d="M 136.47328849 284.85410197 L 134.2936609 278.14589803 L 140.0 274.0 L 145.7063391 278.14589803 L 143.52671151 284.85410197 Z" fill="darkorange"/>
|
69
|
+
<path d="M 156.47328849 284.85410197 L 154.2936609 278.14589803 L 160.0 274.0 L 165.7063391 278.14589803 L 163.52671151 284.85410197 Z" fill="black"/>
|
70
|
+
<path d="M 176.47328849 284.85410197 L 174.2936609 278.14589803 L 180.0 274.0 L 185.7063391 278.14589803 L 183.52671151 284.85410197 Z" fill="firebrick"/>
|
71
|
+
<path d="M 196.47328849 284.85410197 L 194.2936609 278.14589803 L 200.0 274.0 L 205.7063391 278.14589803 L 203.52671151 284.85410197 Z" fill="white"/>
|
72
|
+
<path d="M 216.47328849 284.85410197 L 214.2936609 278.14589803 L 220.0 274.0 L 225.7063391 278.14589803 L 223.52671151 284.85410197 Z" fill="saddlebrown"/>
|
73
|
+
<path d="M 236.47328849 284.85410197 L 234.2936609 278.14589803 L 240.0 274.0 L 245.7063391 278.14589803 L 243.52671151 284.85410197 Z" fill="darkorange"/>
|
74
|
+
<path d="M 256.47328849 284.85410197 L 254.2936609 278.14589803 L 260.0 274.0 L 265.7063391 278.14589803 L 263.52671151 284.85410197 Z" fill="black"/>
|
75
|
+
<path d="M 276.47328849 284.85410197 L 274.2936609 278.14589803 L 280.0 274.0 L 285.7063391 278.14589803 L 283.52671151 284.85410197 Z" fill="firebrick"/>
|
76
|
+
<path d="M 296.47328849 284.85410197 L 294.2936609 278.14589803 L 300.0 274.0 L 305.7063391 278.14589803 L 303.52671151 284.85410197 Z" fill="white"/>
|
77
77
|
<path d="M 160.0 330.0 L 140.0 350.0 L 180.0 350.0 Z" fill="black"/>
|
78
|
-
<path d="M 133.
|
79
|
-
<path d="M 212.
|
80
|
-
<path d="M 85.
|
81
|
-
<path d="M 253.
|
82
|
-
<path d="M 51.
|
83
|
-
<path d="M 276.
|
78
|
+
<path d="M 133.29748793 566.99134946 L 103.36126677 585.80152392 L 152.10766238 596.92757062 Z" fill="white"/>
|
79
|
+
<path d="M 212.06604869 341.88373585 L 185.36899655 351.22543843 L 221.40775127 368.58078799 Z" fill="darkorange"/>
|
80
|
+
<path d="M 85.18122378 543.8197779 L 50.04819167 547.77831991 L 89.13976579 578.95281 Z" fill="firebrick"/>
|
81
|
+
<path d="M 253.8197779 375.18122378 L 225.71335221 372.01439016 L 250.65294428 403.28764946 Z" fill="black"/>
|
82
|
+
<path d="M 51.88373585 502.06604869 L 18.51242068 490.38892047 L 40.20660763 535.43736387 Z" fill="white"/>
|
83
|
+
<path d="M 276.99134946 423.29748793 L 253.04237254 408.24934836 L 261.9432099 447.24646485 Z" fill="darkorange"/>
|
84
84
|
<path d="M 40.0 450.0 L 15.0 425.0 L 15.0 475.0 Z" fill="firebrick"/>
|
85
|
-
<path d="M 276.
|
86
|
-
<path d="M 51.
|
87
|
-
<path d="M 253.
|
88
|
-
<path d="M 85.
|
89
|
-
<path d="M 212.
|
90
|
-
<path d="M 133.
|
91
|
-
<path d="M 160.
|
92
|
-
<path d="M 186.
|
93
|
-
<path d="M 107.
|
94
|
-
<path d="M 234.
|
95
|
-
<path d="M 66.
|
96
|
-
<path d="M 268.
|
97
|
-
<path d="M 43.
|
85
|
+
<path d="M 276.99134946 476.70251207 L 261.9432099 452.75353515 L 253.04237254 491.75065164 Z" fill="black"/>
|
86
|
+
<path d="M 51.88373585 397.93395131 L 40.20660763 364.56263613 L 18.51242068 409.61107953 Z" fill="white"/>
|
87
|
+
<path d="M 253.8197779 524.81877622 L 250.65294428 496.71235054 L 225.71335221 527.98560984 Z" fill="darkorange"/>
|
88
|
+
<path d="M 85.18122378 356.1802221 L 89.13976579 321.04719 L 50.04819167 352.22168009 Z" fill="firebrick"/>
|
89
|
+
<path d="M 212.06604869 558.11626415 L 221.40775127 531.41921201 L 185.36899655 548.77456157 Z" fill="black"/>
|
90
|
+
<path d="M 133.29748793 333.00865054 L 152.10766238 303.07242938 L 103.36126677 314.19847608 Z" fill="white"/>
|
91
|
+
<path d="M 160.0 570.0 L 180.0 550.0 L 140.0 550.0 Z" fill="darkorange"/>
|
92
|
+
<path d="M 186.70251207 333.00865054 L 216.63873323 314.19847608 L 167.89233762 303.07242938 Z" fill="firebrick"/>
|
93
|
+
<path d="M 107.93395131 558.11626415 L 134.63100345 548.77456157 L 98.59224873 531.41921201 Z" fill="black"/>
|
94
|
+
<path d="M 234.81877622 356.1802221 L 269.95180833 352.22168009 L 230.86023421 321.04719 Z" fill="white"/>
|
95
|
+
<path d="M 66.1802221 524.81877622 L 94.28664779 527.98560984 L 69.34705572 496.71235054 Z" fill="darkorange"/>
|
96
|
+
<path d="M 268.11626415 397.93395131 L 301.48757932 409.61107953 L 279.79339237 364.56263613 Z" fill="firebrick"/>
|
97
|
+
<path d="M 43.00865054 476.70251207 L 66.95762746 491.75065164 L 58.0567901 452.75353515 Z" fill="black"/>
|
98
98
|
<path d="M 280.0 450.0 L 305.0 475.0 L 305.0 425.0 Z" fill="white"/>
|
99
|
-
<path d="M 43.
|
100
|
-
<path d="M 268.
|
101
|
-
<path d="M 66.
|
102
|
-
<path d="M 234.
|
103
|
-
<path d="M 107.
|
104
|
-
<path d="M 186.
|
105
|
-
<path d=" M 141.
|
99
|
+
<path d="M 43.00865054 423.29748793 L 58.0567901 447.24646485 L 66.95762746 408.24934836 Z" fill="darkorange"/>
|
100
|
+
<path d="M 268.11626415 502.06604869 L 279.79339237 535.43736387 L 301.48757932 490.38892047 Z" fill="firebrick"/>
|
101
|
+
<path d="M 66.1802221 375.18122378 L 69.34705572 403.28764946 L 94.28664779 372.01439016 Z" fill="black"/>
|
102
|
+
<path d="M 234.81877622 543.8197779 L 230.86023421 578.95281 L 269.95180833 547.77831991 Z" fill="white"/>
|
103
|
+
<path d="M 107.93395131 341.88373585 L 98.59224873 368.58078799 L 134.63100345 351.22543843 Z" fill="darkorange"/>
|
104
|
+
<path d="M 186.70251207 566.99134946 L 167.89233762 596.92757062 L 216.63873323 585.80152392 Z" fill="firebrick"/>
|
105
|
+
<path d=" M 141.83714962 498.54101944 L 103.05687046 431.37160587 L 132.47236156 410.0 L 187.52763939 410.00000095 L 216.94313049 431.37160587 L 178.16285133 498.54101944 Z" fill="firebrick"/>
|
106
106
|
<circle cx="20.0" cy="625" r="5" fill="firebrick"/>
|
107
107
|
<circle cx="40.0" cy="625" r="5" fill="darkorange"/>
|
108
108
|
<circle cx="60.0" cy="625" r="5" fill="white"/>
|
data/examples/triangles.svg
CHANGED
@@ -4,6 +4,6 @@
|
|
4
4
|
height="400">
|
5
5
|
|
6
6
|
<path d="M 100 50 L 50 100 L 150 100 Z"/>
|
7
|
-
<path d="M 56.
|
7
|
+
<path d="M 56.69872981 245.0 L 100.0 170.0 L 143.30127019 245.0 Z" fill="#666"/>
|
8
8
|
<path d="M 100 300 L 75 400 L 125 400 Z" fill="lightgrey"/>
|
9
9
|
</svg>
|
@@ -39,7 +39,7 @@ module VectorSalad
|
|
39
39
|
svg = '<path d="'
|
40
40
|
svg << to_svg_d_attribute
|
41
41
|
svg << '"'
|
42
|
-
svg <<
|
42
|
+
svg << Exporters::SvgExporter.options(@options)
|
43
43
|
svg << "/>"
|
44
44
|
end
|
45
45
|
|
@@ -93,7 +93,7 @@ module VectorSalad
|
|
93
93
|
svg << " #{path.to_svg_d_attribute}"
|
94
94
|
end
|
95
95
|
svg << '"'
|
96
|
-
svg <<
|
96
|
+
svg << Exporters::SvgExporter.options(@options)
|
97
97
|
svg << "/>"
|
98
98
|
end
|
99
99
|
end
|
@@ -102,7 +102,7 @@ module VectorSalad
|
|
102
102
|
# Export the shape to an svg string
|
103
103
|
def to_svg
|
104
104
|
svg = "<circle cx=\"#{at[0]}\" cy=\"#{at[1]}\" r=\"#{radius}\""
|
105
|
-
svg <<
|
105
|
+
svg << Exporters::SvgExporter.options(@options)
|
106
106
|
svg << "/>"
|
107
107
|
end
|
108
108
|
end
|
@@ -112,7 +112,7 @@ module VectorSalad
|
|
112
112
|
def to_svg
|
113
113
|
svg = "<ellipse cx=\"#{at[0]}\" cy=\"#{at[1]}\""
|
114
114
|
svg << " rx=\"#{width}\" ry=\"#{height}\""
|
115
|
-
svg <<
|
115
|
+
svg << Exporters::SvgExporter.options(@options)
|
116
116
|
svg << "/>"
|
117
117
|
end
|
118
118
|
end
|
@@ -122,7 +122,7 @@ module VectorSalad
|
|
122
122
|
def to_svg
|
123
123
|
svg = "<rect x=\"#{at[0]}\" y=\"#{at[1]}\""
|
124
124
|
svg << " width=\"#{width}\" height=\"#{height}\""
|
125
|
-
svg <<
|
125
|
+
svg << Exporters::SvgExporter.options(@options)
|
126
126
|
svg << "/>"
|
127
127
|
end
|
128
128
|
end
|
data/lib/vector_salad/version.rb
CHANGED
data/vector_salad.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vector_salad
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Simon George
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pretty_backtrace
|
@@ -94,6 +94,20 @@ dependencies:
|
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '10.0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: minitest
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '5.8'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '5.8'
|
97
111
|
description: |-
|
98
112
|
A tool aiming to intuitively enable designers with
|
99
113
|
basic programming experience such as front-end designer/developers to create
|