}
$c->stash->{'result'} = $tradition->stemma_count
- ? $tradition->stemma(0)->as_svg
+ ? $tradition->stemma(0)->as_svg( { size => [ 500, 375 ] } )
: '';
$c->forward('View::SVG');
}
};
var imghtml = '<img src="' + basepath + '/images/ajax-loader.gif" alt="Loading SVG..."/>'
$('#stemma_graph').empty();
- $('#variant_graph').empty();
$('#stemma_graph').append( imghtml );
- $('#variant_graph').append( imghtml );
// Then get and load the actual content.
// TODO: scale #stemma_grpah both horizontally and vertically
// TODO: load svgs from SVG.Jquery (to make scaling react in Safari)
$('#stemma_graph').load( basepath + "/stemma/" + textid );
- $('#variant_graph').load( basepath + "/variantgraph/" + textid , function() {
- var variant_svg_element = $('#variant_graph svg').svg().svg('get').root();
- var svg_height = variant_svg_element.height.baseVal.value;
- var svg_width = variant_svg_element.width.baseVal.value;
- var container_height = $('#variant_graph').height();
- variant_svg_element.height.baseVal.value = container_height;
- variant_svg_element.width.baseVal.value = (svg_width/svg_height * container_height);
- });
// Then populate the various elements with the right text name/ID.
// Stemma and variant graph titles
<span>Examine variants against this stemma</span>
</div>
</form>
- </div>
- <div id="variant_container">
- <div style="float: left"><h2>Variant graph for <span class="texttitle">selected text</span></h2></div>
<form id="run_relater" action="" method="GET" name="run_relater">
<div class="button" id="relater_button" onClick="$('#run_relater').submit()">
<span>Run relationship mapper</span>
</div>
</form>
- <div id="variant_graph"></div>
+ </div>
+ <div id="variant_container">
</div>
[% PROCESS footer.tt %]
\ No newline at end of file