I'm trying to draw a GraphViz graph (using version 2.38.0 (20140413.2041)), and having a lot of trouble getting it to lay out the way I want it. I've tried many different combinations of hidden edges, constraint manipulation, subgraphs (both cluster and non-cluster), etc., and nothing seems to be doing what I want.
Here's my current code:
digraph G {
subgraph clustera {
style=invis;rank=same
A->B->C
}
subgraph clusterb {
style=invis;rank=same;rankdir=LR
D->E [constraint=false]
}
subgraph clusterc {
style=invis;rank=same
F->G [constraint=false]
}
C -> D
D -> F [constraint=false]
E -> C
F -> A [constraint=false]
F -> C [constraint=false]
F -> E [constraint=false]
}
And here's how it renders with dot -Tpng:
(All the F edges have "constraint" turned off, because almost anything else distorts the graph horribly.)
What I want is:
node F above node G
F and G more or less centered vertically on the graph
F and G to the right of A through E
A through E in more or less the arrangement they're in now
the edges from F to A, C, and E, and from D to F, following more or less straight lines (i.e. not routing around the right-hand side of the F/G group)
as a bonus, I'd kind of like to get A through C to center properly above D and E, but that's less important
(One thing I very much don't want is for F to appear above A, as if it were the root of the graph.)
Here's an approximation of what I'm looking for, laid out by hand in yEd:
Is this doable in GraphViz?
(I should note that I'm perfectly willing to use one of the other GraphViz tools, it's just that dot is the only one I'm at all familiar with.)
Here's my approach without subgraphs and weigths, only groups to vertically align nodes, and constraint=false as well as dir=back to preserve layout distortion.
digraph G {
// nodes without a group
D;
E;
// group left side
node[group=left];
A -> B -> C -> D;
C -> E [dir=back];
D -> E [constraint=false];
// group right side
node[group=right];
F -> G;
// inter group edges
F -> C;
edge [constraint=false];
D -> F;
F -> A;
F -> E;
}
The result can be seen here and corresponds to your approximation.
Interpreting your requirement with a little freedom you may have a graph without edges crossing
digraph G { rankdir = LR ranksep = 1.2 nodesep = 0.5
{ rank=same A -> B -> C -> D -> E }
D -> F
{ rank=same F -> G }
edge [constraint=false]
E -> C
F -> A
F -> C
F -> E
}
<!--?xml version="1.0" encoding="UTF-8" standalone="no"?-->
<!-- Generated by graphviz version 2.28.0 (20110507.0327)
-->
<!-- Title: G Pages: 1 -->
<svg width="250pt" height="332pt" viewBox="0.00 0.00 250.29 332.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph1" class="graph" transform="scale(1 1) rotate(0) translate(4 328)">
<title>G</title>
<polygon fill="white" stroke="white" points="-4,5 -4,-328 247.294,-328 247.294,5 -4,5"></polygon>
<!-- A -->
<g id="node2" class="node"><title>A</title>
<ellipse fill="none" stroke="black" cx="75.2936" cy="-306" rx="27" ry="18"></ellipse>
<text text-anchor="middle" x="75.2936" y="-301.8" font-family="Times,serif" font-size="14.00">A</text>
</g>
<!-- B -->
<g id="node4" class="node"><title>B</title>
<ellipse fill="none" stroke="black" cx="75.2936" cy="-234" rx="27" ry="18"></ellipse>
<text text-anchor="middle" x="75.2936" y="-229.8" font-family="Times,serif" font-size="14.00">B</text>
</g>
<!-- A->B -->
<g id="edge3" class="edge"><title>A->B</title>
<path fill="none" stroke="black" d="M75.2936,-287.859C75.2936,-279.268 75.2936,-270.677 75.2936,-262.085"></path>
<polygon fill="black" stroke="black" points="78.7937,-262 75.2936,-252 71.7937,-262 78.7937,-262"></polygon>
</g>
<!-- C -->
<g id="node5" class="node"><title>C</title>
<ellipse fill="none" stroke="black" cx="75.2936" cy="-162" rx="27" ry="18"></ellipse>
<text text-anchor="middle" x="75.2936" y="-157.8" font-family="Times,serif" font-size="14.00">C</text>
</g>
<!-- B->C -->
<g id="edge4" class="edge"><title>B->C</title>
<path fill="none" stroke="black" d="M75.2936,-215.859C75.2936,-207.268 75.2936,-198.677 75.2936,-190.085"></path>
<polygon fill="black" stroke="black" points="78.7937,-190 75.2936,-180 71.7937,-190 78.7937,-190"></polygon>
</g>
<!-- D -->
<g id="node6" class="node"><title>D</title>
<ellipse fill="none" stroke="black" cx="75.2936" cy="-90" rx="27" ry="18"></ellipse>
<text text-anchor="middle" x="75.2936" y="-85.8" font-family="Times,serif" font-size="14.00">D</text>
</g>
<!-- C->D -->
<g id="edge5" class="edge"><title>C->D</title>
<path fill="none" stroke="black" d="M75.2936,-143.859C75.2936,-135.268 75.2936,-126.677 75.2936,-118.085"></path>
<polygon fill="black" stroke="black" points="78.7937,-118 75.2936,-108 71.7937,-118 78.7937,-118"></polygon>
</g>
<!-- E -->
<g id="node7" class="node"><title>E</title>
<ellipse fill="none" stroke="black" cx="75.2936" cy="-18" rx="27" ry="18"></ellipse>
<text text-anchor="middle" x="75.2936" y="-13.8" font-family="Times,serif" font-size="14.00">E</text>
</g>
<!-- D->E -->
<g id="edge6" class="edge"><title>D->E</title>
<path fill="none" stroke="black" d="M75.2936,-71.8594C75.2936,-63.2681 75.2936,-54.6768 75.2936,-46.0854"></path>
<polygon fill="black" stroke="black" points="78.7937,-46 75.2936,-36 71.7937,-46 78.7937,-46"></polygon>
</g>
<!-- F -->
<g id="node9" class="node"><title>F</title>
<ellipse fill="none" stroke="black" cx="215.294" cy="-90" rx="27" ry="18"></ellipse>
<text text-anchor="middle" x="215.294" y="-85.8" font-family="Times,serif" font-size="14.00">F</text>
</g>
<!-- D->F -->
<g id="edge8" class="edge"><title>D->F</title>
<path fill="none" stroke="black" d="M102.575,-90C123.965,-90 154.385,-90 178.082,-90"></path>
<polygon fill="black" stroke="black" points="178.11,-93.5001 188.11,-90 178.11,-86.5001 178.11,-93.5001"></polygon>
</g>
<!-- E->C -->
<g id="edge13" class="edge"><title>E->C</title>
<path fill="none" stroke="black" d="M52.7625,-28.3877C36.2645,-37.3556 15.1112,-52.027 5.2936,-72 -1.76453,-86.3591 -1.76453,-93.6409 5.2936,-108 13.4238,-124.54 29.3279,-137.445 43.9243,-146.485"></path>
<polygon fill="black" stroke="black" points="42.3564,-149.621 52.7625,-151.612 45.8691,-143.567 42.3564,-149.621"></polygon>
</g>
<!-- F->A -->
<g id="edge15" class="edge"><title>F->A</title>
<path fill="none" stroke="black" d="M204.475,-106.621C185.434,-138.661 141.876,-211.016 102.294,-270 99.7106,-273.849 96.9068,-277.876 94.1283,-281.785"></path>
<polygon fill="black" stroke="black" points="91.1877,-279.879 88.1817,-290.038 96.8671,-283.971 91.1877,-279.879"></polygon>
</g>
<!-- F->C -->
<g id="edge17" class="edge"><title>F->C</title>
<path fill="none" stroke="black" d="M193.492,-100.853C170.263,-112.973 132.471,-132.69 106.103,-146.447"></path>
<polygon fill="black" stroke="black" points="104.2,-143.492 96.9536,-151.221 107.438,-149.698 104.2,-143.492"></polygon>
</g>
<!-- F->E -->
<g id="edge19" class="edge"><title>F->E</title>
<path fill="none" stroke="black" d="M193.492,-79.1472C170.263,-67.0274 132.471,-47.31 106.103,-33.5528"></path>
<polygon fill="black" stroke="black" points="107.438,-30.3018 96.9536,-28.7791 104.2,-36.5079 107.438,-30.3018"></polygon>
</g>
<!-- G -->
<g id="node12" class="node"><title>G</title>
<ellipse fill="none" stroke="black" cx="215.294" cy="-18" rx="27" ry="18"></ellipse>
<text text-anchor="middle" x="215.294" y="-13.8" font-family="Times,serif" font-size="14.00">G</text>
</g>
<!-- F->G -->
<g id="edge11" class="edge"><title>F->G</title>
<path fill="none" stroke="black" d="M215.294,-71.8594C215.294,-63.2681 215.294,-54.6768 215.294,-46.0854"></path>
<polygon fill="black" stroke="black" points="218.794,-46 215.294,-36 211.794,-46 218.794,-46"></polygon>
</g>
</g>
</svg>
alternatively with bottom nodes on the same height
digraph G { rankdir = LR ranksep = 1.2 nodesep = 0.5
{ rank=same A -> B -> C -> D }
D -> E
B -> F [style=invis]
{ rank=same F -> G }
edge [constraint=false]
E -> C
F -> A
F:w -> C
D -> F
F:e -> E:e
}
<!--?xml version="1.0" encoding="UTF-8" standalone="no"?-->
<!-- Generated by graphviz version 2.28.0 (20110507.0327)
-->
<!-- Title: G Pages: 1 -->
<svg width="250pt" height="260pt" viewBox="0.00 0.00 250.27 260.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph1" class="graph" transform="scale(1 1) rotate(0) translate(4 256)">
<title>G</title>
<polygon fill="white" stroke="white" points="-4,5 -4,-256 247.27,-256 247.27,5 -4,5"></polygon>
<!-- A -->
<g id="node2" class="node"><title>A</title>
<ellipse fill="none" stroke="black" cx="27" cy="-234" rx="27" ry="18"></ellipse>
<text text-anchor="middle" x="27" y="-229.8" font-family="Times,serif" font-size="14.00">A</text>
</g>
<!-- B -->
<g id="node4" class="node"><title>B</title>
<ellipse fill="none" stroke="black" cx="27" cy="-162" rx="27" ry="18"></ellipse>
<text text-anchor="middle" x="27" y="-157.8" font-family="Times,serif" font-size="14.00">B</text>
</g>
<!-- A->B -->
<g id="edge3" class="edge"><title>A->B</title>
<path fill="none" stroke="black" d="M27,-215.859C27,-207.268 27,-198.677 27,-190.085"></path>
<polygon fill="black" stroke="black" points="30.5001,-190 27,-180 23.5001,-190 30.5001,-190"></polygon>
</g>
<!-- C -->
<g id="node5" class="node"><title>C</title>
<ellipse fill="none" stroke="black" cx="27" cy="-90" rx="27" ry="18"></ellipse>
<text text-anchor="middle" x="27" y="-85.8" font-family="Times,serif" font-size="14.00">C</text>
</g>
<!-- B->C -->
<g id="edge4" class="edge"><title>B->C</title>
<path fill="none" stroke="black" d="M27,-143.859C27,-135.268 27,-126.677 27,-118.085"></path>
<polygon fill="black" stroke="black" points="30.5001,-118 27,-108 23.5001,-118 30.5001,-118"></polygon>
</g>
<!-- F -->
<g id="node10" class="node"><title>F</title>
<ellipse fill="none" stroke="black" cx="167" cy="-162" rx="27" ry="18"></ellipse>
<text text-anchor="middle" x="167" y="-157.8" font-family="Times,serif" font-size="14.00">F</text>
</g>
<!-- B->F -->
<!-- D -->
<g id="node6" class="node"><title>D</title>
<ellipse fill="none" stroke="black" cx="27" cy="-18" rx="27" ry="18"></ellipse>
<text text-anchor="middle" x="27" y="-13.8" font-family="Times,serif" font-size="14.00">D</text>
</g>
<!-- C->D -->
<g id="edge5" class="edge"><title>C->D</title>
<path fill="none" stroke="black" d="M27,-71.8594C27,-63.2681 27,-54.6768 27,-46.0854"></path>
<polygon fill="black" stroke="black" points="30.5001,-46 27,-36 23.5001,-46 30.5001,-46"></polygon>
</g>
<!-- E -->
<g id="node8" class="node"><title>E</title>
<ellipse fill="none" stroke="black" cx="167" cy="-18" rx="27" ry="18"></ellipse>
<text text-anchor="middle" x="167" y="-13.8" font-family="Times,serif" font-size="14.00">E</text>
</g>
<!-- D->E -->
<g id="edge7" class="edge"><title>D->E</title>
<path fill="none" stroke="black" d="M54.2816,-18C75.6717,-18 106.092,-18 129.789,-18"></path>
<polygon fill="black" stroke="black" points="129.816,-21.5001 139.816,-18 129.816,-14.5001 129.816,-21.5001"></polygon>
</g>
<!-- D->F -->
<g id="edge20" class="edge"><title>D->F</title>
<path fill="none" stroke="black" d="M42.2487,-32.8682C66.5235,-58.1984 116.031,-109.859 144.521,-139.587"></path>
<polygon fill="black" stroke="black" points="142.176,-142.199 151.622,-146.997 147.23,-137.355 142.176,-142.199"></polygon>
</g>
<!-- E->C -->
<g id="edge14" class="edge"><title>E->C</title>
<path fill="none" stroke="black" d="M145.199,-28.8528C121.969,-40.9726 84.1776,-60.69 57.8095,-74.4472"></path>
<polygon fill="black" stroke="black" points="55.9069,-71.4921 48.66,-79.2209 59.1449,-77.6982 55.9069,-71.4921"></polygon>
</g>
<!-- F->A -->
<g id="edge16" class="edge"><title>F->A</title>
<path fill="none" stroke="black" d="M145.199,-172.853C121.969,-184.973 84.1776,-204.69 57.8095,-218.447"></path>
<polygon fill="black" stroke="black" points="55.9069,-215.492 48.66,-223.221 59.1449,-221.698 55.9069,-215.492"></polygon>
</g>
<!-- F->C -->
<g id="edge18" class="edge"><title>F:w->C</title>
<path fill="none" stroke="black" d="M140,-162C103.148,-162 68.7605,-134.078 48.0591,-113.01"></path>
<polygon fill="black" stroke="black" points="50.4865,-110.483 41.0722,-105.623 45.4009,-115.293 50.4865,-110.483"></polygon>
</g>
<!-- F->E -->
<g id="edge22" class="edge"><title>F:e->E:e</title>
<path fill="none" stroke="black" d="M194,-162C254.5,-162 257.809,-33.3193 203.926,-19.2449"></path>
<polygon fill="black" stroke="black" points="204.358,-15.7717 194,-18 203.487,-22.7173 204.358,-15.7717"></polygon>
</g>
<!-- G -->
<g id="node13" class="node"><title>G</title>
<ellipse fill="none" stroke="black" cx="167" cy="-90" rx="27" ry="18"></ellipse>
<text text-anchor="middle" x="167" y="-85.8" font-family="Times,serif" font-size="14.00">G</text>
</g>
<!-- F->G -->
<g id="edge12" class="edge"><title>F->G</title>
<path fill="none" stroke="black" d="M167,-143.859C167,-135.268 167,-126.677 167,-118.085"></path>
<polygon fill="black" stroke="black" points="170.5,-118 167,-108 163.5,-118 170.5,-118"></polygon>
</g>
</g>
</svg>
Only needed one cluster to keep the ABCDE group aligned. Backward directional arrows and weighting helped a lot.
digraph g
{
subgraph cluster_subCDE {
color=invis;
A; B; C; D; E;
}
A->B [weight=10];
A->F [dir=back];
B->C [weight=10];
F->C;
C->E [color=invis];
C->D;
D->E [constraint=false];
E->C;
F->G [weight=10];
F->D [dir=back];
F->E;
}
I am trying to use svg animation to get a dragonfly to flap its wings.
I am doing this by scaling the left and right wing on the x axis. the problem is when I scale it the wing moves. I want the left or right edge of the wing to stay in one spot when it scales.
here is the code for one wing
<g id="wing_left">
<g>
<path fill="#88C9CE" d="M254.8,132.1c-66.2,6.7-130.7,21.1-193.3,47.2c-7.4,3.1-58.6,24.1-44.8,37.4
c15.2,14.8,88.3,17.3,109.3,11.3C162.6,217.8,279.4,129.7,254.8,132.1z"/>
<path fill="#92D9DE" d="M237.3,113.7c-16.1,3.6-245.9-31.8-250-22.3c-11.5,26.7,38.3,51.9,56.1,58.2
c88.5,31.4,185.6,6.2,202.5-11.3C251.7,132.4,247.9,111.3,237.3,113.7z"/>
<path fill="#FFFFFF" d="M-1.2,97.7c9.1-4.5,84.8,7.2,83.7,7.1c-16.4-1.7-49.9-3.3-56.9-3.5c-32.2-1.2-24,7.4-22.5,11.8
C5,118.4-7.2,100.6-1.2,97.7z"/>
<path fill="#76B0B3" d="M249.3,145.5c-2.9,3-8,7.3-11.5,10.2c-21.1,17.5-102.1,8.9-102.1,8.9s54.5-2.2,86-13.4
c13.2-4.7,21-10.2,23.2-12c0,0,1.1,1.4,2.1,2.5c1,1.1,2.3,1.8,2.3,1.8S249.3,145.5,249.3,145.5z"/>
</g>
<animateTransform id="wlFlapDown" attributeName="transform"
type="scale"
from="1 1" to="0.5 1"
begin="0s;wlFlapUp.end" dur="160ms"
repeatCount="indefinite"
fill="freeze"
/>
<animateTransform id="wlFlapUp" attributeName="transform"
type="scale"
from="0.5 1" to="1 1"
begin="wlFlapDown.end" dur="160ms"
repeatCount="indefinite"
fill="freeze"
/>
</g>
Here is the whole svg code or you can see it in codepen
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 18.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="-14.4 7.7 550.5 426.8" enable-background="new -14.4 7.7 550.5 426.8" xml:space="preserve">
<g id="wing_left">
<g>
<path fill="#88C9CE" d="M254.8,132.1c-66.2,6.7-130.7,21.1-193.3,47.2c-7.4,3.1-58.6,24.1-44.8,37.4
c15.2,14.8,88.3,17.3,109.3,11.3C162.6,217.8,279.4,129.7,254.8,132.1z"/>
<path fill="#92D9DE" d="M237.3,113.7c-16.1,3.6-245.9-31.8-250-22.3c-11.5,26.7,38.3,51.9,56.1,58.2
c88.5,31.4,185.6,6.2,202.5-11.3C251.7,132.4,247.9,111.3,237.3,113.7z"/>
<path fill="#FFFFFF" d="M-1.2,97.7c9.1-4.5,84.8,7.2,83.7,7.1c-16.4-1.7-49.9-3.3-56.9-3.5c-32.2-1.2-24,7.4-22.5,11.8
C5,118.4-7.2,100.6-1.2,97.7z"/>
<path fill="#76B0B3" d="M249.3,145.5c-2.9,3-8,7.3-11.5,10.2c-21.1,17.5-102.1,8.9-102.1,8.9s54.5-2.2,86-13.4
c13.2-4.7,21-10.2,23.2-12c0,0,1.1,1.4,2.1,2.5c1,1.1,2.3,1.8,2.3,1.8S249.3,145.5,249.3,145.5z"/>
</g>
<animateTransform id="wlFlapDown" attributeName="transform"
type="scale"
from="1 1" to="0.5 1"
begin="0s;wlFlapUp.end" dur="160ms"
repeatCount="indefinite"
fill="freeze"
/>
<animateTransform id="wlFlapUp" attributeName="transform"
type="scale"
from="0.5 1" to="1 1"
begin="wlFlapDown.end" dur="160ms"
repeatCount="indefinite"
fill="freeze"
/>
</g>
<g id="wing_right">
<g>
<path fill="#88C9CE" d="M275.9,134c66.4,4.7,131.2,17.1,194.6,41.4c7.5,2.9,59.3,22.3,45.9,36.1c-14.8,15.2-87.7,19.9-109,14.6
C370.6,216.9,251.2,132.2,275.9,134z"/>
<path fill="#92D9DE" d="M285,113c16.2,3.1,244.8-39.1,249.2-29.7c12.3,26.3-36.8,53-54.4,59.8c-87.6,34-185.4,11.7-202.8-5.2
C271.1,132.1,274.2,110.9,285,113z"/>
<path fill="#FFFFFF" d="M451.2,98.5c25.6-4.3,28.9-4.8,58.9-8.8c1.9-0.3,16.3-1.3,15.6,4.3c-0.2,1.4-6.5,17.8-6,13.2
c0.1-0.8,0.9-9.8-1.3-12.5C513.9,88.7,445.7,99.5,451.2,98.5z"/>
<path fill="#76B0B3" d="M291.3,155.4c21.9,16.6,99.9,5.4,99.9,5.4s-54.7-0.2-86.7-9.9c-13.4-4.1-22.5-9.1-24.1-10.3
c0,0-0.8,0.9-1.8,1.6c0,0,0.1,2.2,0.1,2.2S287.6,152.7,291.3,155.4z"/>
</g>
<animateTransform id="wrFlapDown" attributeName="transform"
type="scale"
from="1 1" to="0.5 1"
begin="0s; wrFlapUp.end" dur="160ms"
repeatCount="indefinite"
fill="freeze"
/>
<animateTransform id="wrFlapDown" attributeName="transform"
type="scale"
from="0.5 1" to="1 1"
begin="wrFlapDown.end" dur="160ms"
repeatCount="indefinite"
fill="freeze"
/>
</g>
<g id="body" xmlns:inkpad="http://taptrix.com/inkpad/svg_extensions">
<g id="Layer_2" inkpad:layerName="body">
<path fill="#D9AC32" d="M253.8,83.2c-4.5-29.5-6.4-53.2-16-74.7c-0.8-1.9-4.3,1-3.4,1.6c0.4,0.2,12.6,13.5,17.3,73.2
C252.2,88.9,254.5,87.3,253.8,83.2z"/>
<path fill="#D9AC32" d="M272.2,82.6c5.2-29.3,7.8-53,17.9-74.3c0.9-1.9,4.3,1.1,3.3,1.7c-0.4,0.2-12.9,13.2-19.1,72.7
C273.7,88.2,271.5,86.6,272.2,82.6z"/>
<path fill="#FFE008" d="M249.8,128.8l28.2-0.4c0,0,10.4,208,2.7,260.4c-10.3,71.1-18.9,49.7-27.9,0.4
C243.4,337.1,249.8,128.8,249.8,128.8z"/>
<path fill="#FFE008" d="M242.5,130.2c-0.2-12,9-21.8,20.6-22c11.5-0.2,21.1,9.4,21.2,21.4c0.2,12-9.7,17-21.2,17.2
C251.5,146.9,242.7,142.2,242.5,130.2z"/>
<path fill="#FFE008" d="M236.8,110.7c-0.3-18.4,12-32.8,26.5-33c14.5-0.2,25.8,13.9,26.1,32.2c0.3,18.4-11.7,25.1-26.3,25.3
C248.6,135.4,237.1,129,236.8,110.7z"/>
</g>
<g id="Layer_3" inkpad:layerName="eyes">
<g>
<path fill="#F5F2E1" d="M227.8,95.9c-0.1-8.3,7.2-15.1,16.4-15.3c9.2-0.1,16.7,6.5,16.8,14.8c0.1,8.3-7.2,15.1-16.4,15.3
C235.4,110.9,227.9,104.2,227.8,95.9z"/>
<path d="M255.1,92c-0.6,1.6-7.3-5.5-19.7,3.7c-2.4,1.8-1.8-4.6-0.1-6C244.1,82.6,255.8,90.4,255.1,92z"/>
<path fill="#D8E6C3" d="M228,96.2c-0.1-5.4,2.1,9.9,15.5,11.1c8.1,0.7,14.5-2.9,14.2-2.5c-3.9,4.4-9,5.5-10.5,5.7
C236.8,111.8,228.2,106.5,228,96.2z"/>
</g>
<g>
<path fill="#F5F2E1" d="M295.8,94.9c-0.1-8.3-7.7-14.9-16.8-14.8c-9.2,0.1-16.5,7-16.4,15.3c0.1,8.3,7.7,14.9,16.8,14.8
C288.6,110.1,295.9,103.2,295.8,94.9z"/>
<path d="M268.3,91.8c0.7,1.6,7.1-5.7,19.8,3.1c2.5,1.7,1.7-4.7-0.1-6C279.1,82.1,267.6,90.3,268.3,91.8z"/>
<path fill="#D8E6C3" d="M295.5,95.2c-0.1-5.4-1.8,9.9-15.2,11.5c-8.1,1-14.6-2.5-14.3-2.1c4,4.3,9.2,5.2,10.7,5.4
C287.2,111,295.7,105.5,295.5,95.2z"/>
</g>
</g>
<path fill="#E5C907" d="M242.6,127.9c0-0.1,4.8,8.1,22.5,7.2c13.6-0.7,19-8.1,19-8.1c-0.4,4.9-11.3,11.2-18.3,11.6
C260.3,139,247.3,137.3,242.6,127.9z"/>
<path fill="#E5C907" d="M249.3,143.6c0,0,6,3.9,15,3.2c10.4-0.8,14.4-4.7,14.4-4.6c0.2,4.1,0.5,8.3,0.4,8.6
c-3.5,7.1-20.6,9.4-29.8,2C249,152.5,249.3,147.1,249.3,143.6z"/>
</g>
</svg>
The problem here is that the origin for all scale transforms is at (0,0) which is at the top left of the SVG. So your scale animations are centred on the left side of the SVG (x=0).
Basically you need to move the coordinate space for the wings, so that when the scale is applied, the wings are centred on x=0.
So the steps would be:
Use a translate transform to move your wings so they are centred at x=0
apply your scale animation in this coordinate space
surround that with a group with a transform that moves them back to their original position
For example:
<g id="wings" transform="translate(270,0)">
<g>
<g transform="translate(-270,0)">
<g "left wing">
<g "right wing">
</g>
<animateTransform .../>
</g>
</g>
Demo here