Scaling.
[scpubgit/stemmatology.git] / stemmaweb / root / js / componentload.js
CommitLineData
cf9626aa 1function loadTradition( textid ) {
a88e75b1 2 $('#stemma_graph').load( "stemma/" + textid , function() {
3 var stemma_svg_element = $('#stemma_graph svg').svg().svg('get').root();
4 stemma_svg_element.height.baseVal.value = $('#stemma_graph').height();
5 });
6 $('#variant_graph').load( "variantgraph/" + textid , function() {
7 var variant_svg_element = $('#variant_graph svg').svg().svg('get').root();
8 var svg_height = variant_svg_element.height.baseVal.value;
9 var svg_width = variant_svg_element.width.baseVal.value;
10 var container_height = $('#variant_graph').height();
11 variant_svg_element.height.baseVal.value = container_height;
12 variant_svg_element.width.baseVal.value = (svg_width/svg_height * container_height);
13 });
14}