PageRenderTime 32ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 1ms

/external/phylomel/tests/dendog0.svg

https://github.com/Tener/pfff
SVG | 160 lines | 145 code | 15 blank | 0 comment | 5 complexity | 9accddc5ef09f8955c4acaebebb4a5ff MD5 | raw file
  1. <?xml version="1.0" standalone="no"?>
  2. <svg width="1280" height="375" version="1.1"
  3. baseProfile="full"
  4. xmlns="http://www.w3.org/2000/svg"
  5. xmlns:xlink="http://www.w3.org/1999/xlink"
  6. xmlns:ev="http://www.w3.org/2001/xml-events"
  7. onload="Init( evt )">
  8. <script type="text/ecmascript
  9. ">//<![CDATA[
  10. var svgRoot;
  11. var toScale;
  12. var toTranslate;
  13. var myLine;
  14. var myLegend;
  15. var b_mouse_down = false;
  16. var b_drag = false;
  17. var last_pos = 909;
  18. function Init() {
  19. svgRoot = document.documentElement;
  20. toScale = document.getElementById("to_scale");
  21. toTranslate = document.getElementById("to_translate");
  22. myLine = document.getElementById("line");
  23. myLegend = document.getElementById("legend");
  24. }
  25. function getMouse(evt) {
  26. var pos = svgRoot.createSVGPoint();
  27. pos.x = evt.clientX;
  28. pos.y = evt.clientY;
  29. return pos;
  30. }
  31. function onMouseDown(evt) {
  32. b_mouse_down = true;
  33. if(isPointInVertLine(getMouse(evt), myLine)) {
  34. b_drag = true;
  35. }
  36. }
  37. function onMouseMove(evt) {
  38. if(b_drag) {
  39. doUpdate(evt);
  40. }
  41. }
  42. function onMouseUp(evt) {
  43. var newP = getMouse(evt);
  44. if(b_drag) {
  45. toScale.setAttribute("transform", "matrix(" + newP.x / 909 + " 0 0 1 0 0)");
  46. toTranslate.setAttribute("transform", "translate(" + (-(909 - newP.x)) + " 0)");
  47. //Update legend (10, 20, .. 100)
  48. for (i=0; i<=10; i++) {
  49. var text = document.getElementById("Legend" + i);
  50. x0 = text.getAttribute("x0");
  51. //text.setAttribute("x",x0 * newP.x / 909);
  52. orig_pos = 9 + 9 * (i*10);
  53. text.setAttribute("x",orig_pos * newP.x / 909);
  54. }
  55. //Update legend marks
  56. for (i=0; i<=20; i++) {
  57. var text = document.getElementById("LegendLine" + i);
  58. orig_pos = 9 + 9 * (i*5);
  59. text.setAttribute("x1",orig_pos * newP.x / 909);
  60. text.setAttribute("x2",orig_pos * newP.x / 909);
  61. }
  62. }
  63. b_mouse_down = false;
  64. b_drag = false;
  65. }
  66. function doUpdate(evt) {
  67. var newP = getMouse(evt);
  68. myLine.setAttributeNS(null, "x1", newP.x );
  69. myLine.setAttributeNS(null, "x2", newP.x );
  70. }
  71. function isPointInVertLine(p,line) {
  72. x = line.getAttribute("x1");
  73. return Math.abs(x - p.x) <= 4
  74. }
  75. // ]]></script>
  76. <g id="to_scale" transform="matrix(1 0 0 1 0 0)">
  77. <line id="" x1="8.10" y1="23.00" x2="909.90" y2="23.00" style="stroke:black;stroke-width:2.000000"/>
  78. <polyline id="" points="769.56,246.97 9.00,246.97 9.00,337.50 839.28,337.50" style="fill:none;stroke:black;stroke-width:2.000000"/>
  79. <polyline id="" points="804.42,206.45 769.56,206.45 769.56,287.50 839.28,287.50" style="fill:none;stroke:black;stroke-width:2.000000"/>
  80. <polyline id="" points="839.28,175.39 804.42,175.39 804.42,237.50 839.28,237.50" style="fill:none;stroke:black;stroke-width:2.000000"/>
  81. <polyline id="" points="839.28,150.78 839.28,150.78 839.28,200.00 909.00,200.00" style="fill:none;stroke:black;stroke-width:2.000000"/>
  82. <polyline id="" points="839.28,126.56 839.28,126.56 839.28,175.00 909.00,175.00" style="fill:none;stroke:black;stroke-width:2.000000"/>
  83. <polyline id="" points="839.28,103.12 839.28,103.12 839.28,150.00 909.00,150.00" style="fill:none;stroke:black;stroke-width:2.000000"/>
  84. <polyline id="" points="839.28,81.25 839.28,81.25 839.28,125.00 909.00,125.00" style="fill:none;stroke:black;stroke-width:2.000000"/>
  85. <polyline id="" points="839.28,62.50 839.28,62.50 839.28,100.00 909.00,100.00" style="fill:none;stroke:black;stroke-width:2.000000"/>
  86. <polyline id="" points="909.00,50.00 839.28,50.00 839.28,75.00 909.00,75.00" style="fill:none;stroke:black;stroke-width:2.000000"/>
  87. <polyline id="" points="909.00,225.00 839.28,225.00 839.28,250.00 909.00,250.00" style="fill:none;stroke:black;stroke-width:2.000000"/>
  88. <polyline id="" points="909.00,275.00 839.28,275.00 839.28,300.00 909.00,300.00" style="fill:none;stroke:black;stroke-width:2.000000"/>
  89. <polyline id="" points="909.00,325.00 839.28,325.00 839.28,350.00 909.00,350.00" style="fill:none;stroke:black;stroke-width:2.000000"/>
  90. </g>
  91. <line id="LegendLine0" x1="9.00" y1="23.00" x2="9.00" y2="25.60" style="stroke:black;stroke-width:2.000000"/>
  92. <line id="LegendLine1" x1="54.00" y1="23.00" x2="54.00" y2="25.60" style="stroke:black;stroke-width:2.000000"/>
  93. <line id="LegendLine2" x1="99.00" y1="23.00" x2="99.00" y2="25.60" style="stroke:black;stroke-width:2.000000"/>
  94. <line id="LegendLine3" x1="144.00" y1="23.00" x2="144.00" y2="25.60" style="stroke:black;stroke-width:2.000000"/>
  95. <line id="LegendLine4" x1="189.00" y1="23.00" x2="189.00" y2="25.60" style="stroke:black;stroke-width:2.000000"/>
  96. <line id="LegendLine5" x1="234.00" y1="23.00" x2="234.00" y2="25.60" style="stroke:black;stroke-width:2.000000"/>
  97. <line id="LegendLine6" x1="279.00" y1="23.00" x2="279.00" y2="25.60" style="stroke:black;stroke-width:2.000000"/>
  98. <line id="LegendLine7" x1="324.00" y1="23.00" x2="324.00" y2="25.60" style="stroke:black;stroke-width:2.000000"/>
  99. <line id="LegendLine8" x1="369.00" y1="23.00" x2="369.00" y2="25.60" style="stroke:black;stroke-width:2.000000"/>
  100. <line id="LegendLine9" x1="414.00" y1="23.00" x2="414.00" y2="25.60" style="stroke:black;stroke-width:2.000000"/>
  101. <line id="LegendLine10" x1="459.00" y1="23.00" x2="459.00" y2="25.60" style="stroke:black;stroke-width:2.000000"/>
  102. <line id="LegendLine11" x1="504.00" y1="23.00" x2="504.00" y2="25.60" style="stroke:black;stroke-width:2.000000"/>
  103. <line id="LegendLine12" x1="549.00" y1="23.00" x2="549.00" y2="25.60" style="stroke:black;stroke-width:2.000000"/>
  104. <line id="LegendLine13" x1="594.00" y1="23.00" x2="594.00" y2="25.60" style="stroke:black;stroke-width:2.000000"/>
  105. <line id="LegendLine14" x1="639.00" y1="23.00" x2="639.00" y2="25.60" style="stroke:black;stroke-width:2.000000"/>
  106. <line id="LegendLine15" x1="684.00" y1="23.00" x2="684.00" y2="25.60" style="stroke:black;stroke-width:2.000000"/>
  107. <line id="LegendLine16" x1="729.00" y1="23.00" x2="729.00" y2="25.60" style="stroke:black;stroke-width:2.000000"/>
  108. <line id="LegendLine17" x1="774.00" y1="23.00" x2="774.00" y2="25.60" style="stroke:black;stroke-width:2.000000"/>
  109. <line id="LegendLine18" x1="819.00" y1="23.00" x2="819.00" y2="25.60" style="stroke:black;stroke-width:2.000000"/>
  110. <line id="LegendLine19" x1="864.00" y1="23.00" x2="864.00" y2="25.60" style="stroke:black;stroke-width:2.000000"/>
  111. <line id="LegendLine20" x1="909.00" y1="23.00" x2="909.00" y2="25.60" style="stroke:black;stroke-width:2.000000"/>
  112. <text id="Legend0" x="9.000000" y="36.000000" x0="9.000000" style="font-family:Arial;font-size:10px;text-anchor:middle"> 0 </text>
  113. <text id="Legend1" x="99.000000" y="36.000000" x0="99.000000" style="font-family:Arial;font-size:10px;text-anchor:middle"> 10 </text>
  114. <text id="Legend2" x="189.000000" y="36.000000" x0="189.000000" style="font-family:Arial;font-size:10px;text-anchor:middle"> 20 </text>
  115. <text id="Legend3" x="279.000000" y="36.000000" x0="279.000000" style="font-family:Arial;font-size:10px;text-anchor:middle"> 30 </text>
  116. <text id="Legend4" x="369.000000" y="36.000000" x0="369.000000" style="font-family:Arial;font-size:10px;text-anchor:middle"> 40 </text>
  117. <text id="Legend5" x="459.000000" y="36.000000" x0="459.000000" style="font-family:Arial;font-size:10px;text-anchor:middle"> 50 </text>
  118. <text id="Legend6" x="549.000000" y="36.000000" x0="549.000000" style="font-family:Arial;font-size:10px;text-anchor:middle"> 60 </text>
  119. <text id="Legend7" x="639.000000" y="36.000000" x0="639.000000" style="font-family:Arial;font-size:10px;text-anchor:middle"> 70 </text>
  120. <text id="Legend8" x="729.000000" y="36.000000" x0="729.000000" style="font-family:Arial;font-size:10px;text-anchor:middle"> 80 </text>
  121. <text id="Legend9" x="819.000000" y="36.000000" x0="819.000000" style="font-family:Arial;font-size:10px;text-anchor:middle"> 90 </text>
  122. <text id="Legend10" x="909.000000" y="36.000000" x0="909.000000" style="font-family:Arial;font-size:10px;text-anchor:middle"> 100 </text>
  123. <text id="" x="54" y="16" style="font-family: Arial; font-size:12px; text-anchor: left"> Homology percentage </text>
  124. <line id="line" x1="909" y1="23" x2="909" y2="350" style="stroke:black;stroke-width:1" opacity="0.5" />
  125. <rect id="canvas" x="0" y="0" width="1280" height="375" opacity="0"
  126. pointer-events="visible"
  127. onmousedown="onMouseDown(evt)"
  128. onmousemove="onMouseMove(evt)"
  129. onmouseup="onMouseUp(evt)"/>
  130. <g id="to_translate" transform="translate(0 0)">
  131. <text id="" x="918" y="54" style="font-family: Arial; font-size:10px; text-anchor: left"> 425 France Bordeaux </text>
  132. <text id="" x="918" y="80" style="font-family: Arial; font-size:10px; text-anchor: left"> 404 France Paris </text>
  133. <text id="" x="918" y="104" style="font-family: Arial; font-size:10px; text-anchor: left"> 386 France Paris </text>
  134. <text id="" x="918" y="130" style="font-family: Arial; font-size:10px; text-anchor: left"> 389 France Bordeaux </text>
  135. <text id="" x="918" y="154" style="font-family: Arial; font-size:10px; text-anchor: left"> 422 France Paris </text>
  136. <text id="" x="918" y="180" style="font-family: Arial; font-size:10px; text-anchor: left"> 392 France Bordeaux </text>
  137. <text id="" x="918" y="204" style="font-family: Arial; font-size:10px; text-anchor: left"> 415 France Paris </text>
  138. <text id="" x="918" y="230" style="font-family: Arial; font-size:10px; text-anchor: left"> 423 France Paris </text>
  139. <text id="" x="918" y="254" style="font-family: Arial; font-size:10px; text-anchor: left"> 419 Germany Berlin </text>
  140. <text id="" x="918" y="280" style="font-family: Arial; font-size:10px; text-anchor: left"> 413 France Paris </text>
  141. <text id="" x="918" y="304" style="font-family: Arial; font-size:10px; text-anchor: left"> 421 France Bordeaux </text>
  142. <text id="" x="918" y="330" style="font-family: Arial; font-size:10px; text-anchor: left"> 406 France Paris </text>
  143. <text id="" x="918" y="354" style="font-family: Arial; font-size:10px; text-anchor: left"> 427 France Bordeaux </text>
  144. </g>
  145. </svg>