Browse Source

some elementary action with lines

master
Sanj 13 years ago
parent
commit
3a28724be1
  1. 2
      idmapping.js
  2. 106
      index.html
  3. 118
      linemapping.js
  4. 27
      map_lines.py
  5. 1
      radia.css
  6. 106
      radia.js

2
idmapping.json → idmapping.js

@ -1,4 +1,4 @@
{
RIDS = {
"jbox": {
"name": "",
"type": "newsissue",

106
index.html

@ -7,6 +7,8 @@
<script type="text/javascript" src="jquery.tooltip.js"></script>
<script type="text/javascript" src="radia.js"></script>
<script type="text/javascript" src="padmaData.js"></script>
<script type="text/javascript" src="idmapping.js"></script>
<script type="text/javascript" src="linemapping.js"></script>
</head>
<body>
<!--
@ -97,68 +99,68 @@
<tspan x="640.888" y="319.758"></tspan>
</text>
<g id="rajakani">
<path style="fill: none; fill-opacity:0; stroke-width: 2; stroke-linejoin: round; stroke-dasharray: 4; stroke: #000000" d="M 792.766,574.431 A 51.1146,51.1146 0 0 0 843.881,625.546"/>
<line style="fill: none; fill-opacity:0; stroke-width: 2; stroke-linejoin: round; stroke-dasharray: 4; stroke: #000000" x1="792.766" y1="480.972" x2="792.766" y2="574.431"/>
<path style="fill: none; fill-opacity:0; stroke-width: 2; stroke-linejoin: round; stroke-dasharray: 4; stroke: #000000" d="M 960.834,644.059 A 18.5134,18.5134 0 0 0 942.321,625.546"/>
<line style="fill: none; fill-opacity:0; stroke-width: 2; stroke-linejoin: round; stroke-dasharray: 4; stroke: #000000" x1="843.881" y1="625.546" x2="942.321" y2="625.546"/>
<line style="fill: none; fill-opacity:0; stroke-width: 2; stroke-linejoin: round; stroke-dasharray: 4; stroke: #000000" x1="960.834" y1="644.059" x2="960.834" y2="677.91"/>
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="795.766,484.736 792.766,478.736 789.766,484.736 "/>
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="956.834,672.146 960.834,680.146 964.834,672.146 "/>
<path style="fill: none; fill-opacity:0; stroke-width: 2; stroke-linejoin: round; stroke-dasharray: 4; stroke: #666666" d="M 792.766,574.431 A 51.1146,51.1146 0 0 0 843.881,625.546"/>
<line style="fill: none; fill-opacity:0; stroke-width: 2; stroke-linejoin: round; stroke-dasharray: 4; stroke: #666666" x1="792.766" y1="480.972" x2="792.766" y2="574.431"/>
<path style="fill: none; fill-opacity:0; stroke-width: 2; stroke-linejoin: round; stroke-dasharray: 4; stroke: #666666" d="M 960.834,644.059 A 18.5134,18.5134 0 0 0 942.321,625.546"/>
<line style="fill: none; fill-opacity:0; stroke-width: 2; stroke-linejoin: round; stroke-dasharray: 4; stroke: #666666" x1="843.881" y1="625.546" x2="942.321" y2="625.546"/>
<line style="fill: none; fill-opacity:0; stroke-width: 2; stroke-linejoin: round; stroke-dasharray: 4; stroke: #666666" x1="960.834" y1="644.059" x2="960.834" y2="677.91"/>
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #666666" points="795.766,484.736 792.766,478.736 789.766,484.736 "/>
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #666666" points="956.834,672.146 960.834,680.146 964.834,672.146 "/>
</g>
<g id="rajaspec">
<line style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 20 4 4 4 4 4; stroke: #000000" x1="772.778" y1="549.889" x2="568.998" y2="698.861"/>
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="771.51,554.532 774.583,548.57 767.969,549.689 "/>
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="570.266,694.218 567.193,700.18 573.807,699.061 "/>
<line style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 20 4 4 4 4 4; stroke: #666666" x1="772.778" y1="549.889" x2="568.998" y2="698.861"/>
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #666666" points="771.51,554.532 774.583,548.57 767.969,549.689 "/>
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #666666" points="570.266,694.218 567.193,700.18 573.807,699.061 "/>
</g>
<g id="dmkcong">
<path style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 4; stroke: #000000" d="M 1021.47,691.044 A 269.538,269.538 0 0 0 990.511,214.791"/>
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="1023.21,686.581 1019.56,692.21 1026.25,691.752 "/>
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="997.396,213.332 988.469,213.882 994.265,220.694 "/>
<path style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 4; stroke: #666666" d="M 1021.47,691.044 A 269.538,269.538 0 0 0 990.511,214.791"/>
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #666666" points="1023.21,686.581 1019.56,692.21 1026.25,691.752 "/>
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #666666" points="997.396,213.332 988.469,213.882 994.265,220.694 "/>
</g>
<text style="fill: #000000;text-anchor:start;font-size:12.8px;font-family:sans-serif;font-style:normal;font-weight:normal" x="394.618" y="505.25">
<tspan x="394.618" y="505.25"></tspan>
</text>
<g id="gascorp">
<path style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 4; stroke: #000000" d="M 423.274,459.758 A 135.656,135.656 0 0 0 282.766,603.608"/>
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="419.311,462.411 425.508,459.842 419.734,456.426 "/>
<path style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 4; stroke: #666666" d="M 423.274,459.758 A 135.656,135.656 0 0 0 282.766,603.608"/>
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #666666" points="419.311,462.411 425.508,459.842 419.734,456.426 "/>
<path style="fill: #000000" d="M 282.766 603.608 C 281.768,603.669 280.709,602.732 280.648,601.734 C 280.586,600.736 281.523,599.677 282.522,599.615 C 283.52,599.554 284.579,600.491 284.64,601.49 C 284.701,602.488 283.764,603.547 282.766,603.608z"/>
<path style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" d="M 282.766 603.608 C 281.768,603.669 280.709,602.732 280.648,601.734 C 280.586,600.736 281.523,599.677 282.522,599.615 C 283.52,599.554 284.579,600.491 284.64,601.49 C 284.701,602.488 283.764,603.547 282.766,603.608"/>
<path style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #666666" d="M 282.766 603.608 C 281.768,603.669 280.709,602.732 280.648,601.734 C 280.586,600.736 281.523,599.677 282.522,599.615 C 283.52,599.554 284.579,600.491 284.64,601.49 C 284.701,602.488 283.764,603.547 282.766,603.608"/>
</g>
<g id="journosunil">
<path style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 4; stroke: #000000" d="M 586.458,354.571 A 299.608,299.608 0 0 0 150.82,295.382"/>
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="151.728,290.634 149.094,296.803 155.61,295.209 "/>
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="581.888,353.126 587.743,356.401 586.85,349.752 "/>
<path style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 4; stroke: #666666" d="M 586.458,354.571 A 299.608,299.608 0 0 0 150.82,295.382"/>
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #666666" points="151.728,290.634 149.094,296.803 155.61,295.209 "/>
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #666666" points="581.888,353.126 587.743,356.401 586.85,349.752 "/>
</g>
<g id="ambajourno">
<path style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 4; stroke: #000000" d="M 598.845,417.931 A 201.885,201.885 0 1 0 216.914,547.116"/>
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="595.054,415.014 599.446,420.084 600.867,413.528 "/>
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="210.932,543.395 217.743,549.192 218.294,540.265 "/>
<path style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 4; stroke: #666666" d="M 598.845,417.931 A 201.885,201.885 0 1 0 216.914,547.116"/>
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #666666" points="595.054,415.014 599.446,420.084 600.867,413.528 "/>
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #666666" points="210.932,543.395 217.743,549.192 218.294,540.265 "/>
</g>
<g id="tatabox">
<ellipse style="fill: #fff5e8" cx="296.116" cy="222.75" rx="38.7285" ry="16.5"/>
<ellipse style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" cx="296.116" cy="222.75" rx="38.7285" ry="16.5"/>
<ellipse style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #666666" cx="296.116" cy="222.75" rx="38.7285" ry="16.5"/>
</g>
<g id="relbox">
<ellipse style="fill: #f5ca9c" cx="318.618" cy="699.25" rx="42" ry="15.5"/>
<ellipse style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" cx="318.618" cy="699.25" rx="42" ry="15.5"/>
<ellipse style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #666666" cx="318.618" cy="699.25" rx="42" ry="15.5"/>
</g>
<g id="conbox">
<ellipse style="fill: #e8fedc" cx="926.717" cy="213.007" rx="59.6935" ry="21.6242"/>
<ellipse style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" cx="926.717" cy="213.007" rx="59.6935" ry="21.6242"/>
<ellipse style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #666666" cx="926.717" cy="213.007" rx="59.6935" ry="21.6242"/>
</g>
<g id="dmkbox">
<ellipse style="fill: #ffffbe" cx="984.36" cy="693.344" rx="33.2715" ry="15.5"/>
<ellipse style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" cx="984.36" cy="693.344" rx="33.2715" ry="15.5"/>
<ellipse style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #666666" cx="984.36" cy="693.344" rx="33.2715" ry="15.5"/>
</g>
<g id="gasjourno">
<path style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 4; stroke: #000000" d="M 621.067,339.096 A 225.94,225.94 0 0 0 292.409,625.24"/>
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="616.289,339.379 622.929,340.334 619.708,334.449 "/>
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="286.198,621.922 293.379,627.255 293.337,618.311 "/>
<path style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 4; stroke: #666666" d="M 621.067,339.096 A 225.94,225.94 0 0 0 292.409,625.24"/>
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #666666" points="616.289,339.379 622.929,340.334 619.708,334.449 "/>
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #666666" points="286.198,621.922 293.379,627.255 293.337,618.311 "/>
</g>
<g id="relkids">
<path style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 4; stroke: #000000" d="M 220.823,572.907 A 77.0866,77.0866 0 0 0 268.996,690.689"/>
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="264.79,693.204 271.178,691.158 265.708,687.274 "/>
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="220.831,577.866 222.052,571.043 215.861,574.161 "/>
<path style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 4; stroke: #666666" d="M 220.823,572.907 A 77.0866,77.0866 0 0 0 268.996,690.689"/>
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #666666" points="264.79,693.204 271.178,691.158 265.708,687.274 "/>
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #666666" points="220.831,577.866 222.052,571.043 215.861,574.161 "/>
</g>
<g>
<rect style="fill: #ffffff" x="235.318" y="331.089" width="52.9" height="11.85"/>
@ -173,9 +175,9 @@
</text>
</g>
<g id="jcong">
<path style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 4; stroke: #000000" d="M 690.898,350.797 A 163.395,163.395 0 0 0 916.715,236.629"/>
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="919.011,240.904 917.196,234.446 913.119,239.773 "/>
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="697.797,349.723 688.854,349.89 694.354,356.944 "/>
<path style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 4; stroke: #666666" d="M 690.898,350.797 A 163.395,163.395 0 0 0 916.715,236.629"/>
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #666666" points="919.011,240.904 917.196,234.446 913.119,239.773 "/>
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #666666" points="697.797,349.723 688.854,349.89 694.354,356.944 "/>
</g>
<g>
<rect style="fill: #ffffff" x="871.958" y="295.286" width="67.1" height="13"/>
@ -196,9 +198,9 @@
</text>
</g>
<g id="nitav">
<path style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 4; stroke: #000000" d="M 453.27,581.608 A 98.9704,98.9704 0 0 0 641.339,571.594"/>
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="457.21,584.27 452.47,579.522 451.516,586.162 "/>
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="643.566,575.936 641.912,569.435 637.704,574.659 "/>
<path style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 4; stroke: #666666" d="M 453.27,581.608 A 98.9704,98.9704 0 0 0 641.339,571.594"/>
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #666666" points="457.21,584.27 452.47,579.522 451.516,586.162 "/>
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #666666" points="643.566,575.936 641.912,569.435 637.704,574.659 "/>
</g>
<g>
<rect style="fill: #ffffff" x="579.465" y="625.925" width="28.6" height="14.95"/>
@ -293,9 +295,9 @@
</text>
</g>
<g id="airline">
<path style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 4; stroke: #000000" d="M 344.752 190.221 C 551,85.25 642,309.25 731.764,264.495"/>
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="346.745,185.841 342.759,191.236 349.467,191.188 "/>
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="729.734,268.86 733.765,263.498 727.057,263.49 "/>
<path style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 4; stroke: #666666" d="M 344.752 190.221 C 551,85.25 642,309.25 731.764,264.495"/>
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #666666" points="346.745,185.841 342.759,191.236 349.467,191.188 "/>
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #666666" points="729.734,268.86 733.765,263.498 727.057,263.49 "/>
</g>
<g>
<rect style="fill: #ffffff" x="601.838" y="229.75" width="55.1" height="13"/>
@ -322,10 +324,10 @@
</text>
</g>
<g id="gasvir">
<path style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 4; stroke: #000000" d="M 814.206,336.902 A 232.68,232.68 0 0 0 571.388,315.25"/>
<path style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 4; stroke: #666666" d="M 814.206,336.902 A 232.68,232.68 0 0 0 571.388,315.25"/>
<path style="fill: #000000" d="M 571.388 315.25 C 570.942,314.355 571.391,313.014 572.286,312.568 C 573.181,312.122 574.522,312.571 574.968,313.465 C 575.414,314.36 574.965,315.702 574.07,316.148 C 573.175,316.594 571.834,316.145 571.388,315.25z"/>
<path style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" d="M 571.388 315.25 C 570.942,314.355 571.391,313.014 572.286,312.568 C 573.181,312.122 574.522,312.571 574.968,313.465 C 575.414,314.36 574.965,315.702 574.07,316.148 C 573.175,316.594 571.834,316.145 571.388,315.25"/>
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="809.419,336.932 815.999,338.238 813.095,332.191 "/>
<path style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #666666" d="M 571.388 315.25 C 570.942,314.355 571.391,313.014 572.286,312.568 C 573.181,312.122 574.522,312.571 574.968,313.465 C 575.414,314.36 574.965,315.702 574.07,316.148 C 573.175,316.594 571.834,316.145 571.388,315.25"/>
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #666666" points="809.419,336.932 815.999,338.238 813.095,332.191 "/>
</g>
<g>
<polygon style="fill: #e0e0e0" points="742,200.25 795.388,239.5 659,256.25 "/>
@ -346,7 +348,7 @@
<text style="fill: #ab730c;text-anchor:middle;font-size:13.5467px;font-family:sans-serif;font-style:normal;font-weight:normal" x="440.388" y="693.2">
<tspan x="440.388" y="693.2">Iron Ore</tspan>
</text>
<path id="loveline" style="fill: none; fill-opacity:0; stroke-width: 1.8; stroke-dasharray: 20 8 4 8; stroke: #000000" d="M 788.766 551.5 C 763,594.25 806,698.25 926,627.25"/>
<path id="loveline" style="fill: none; fill-opacity:0; stroke-width: 1.8; stroke-dasharray: 20 8 4 8; stroke: #666666" d="M 788.766 551.5 C 763,594.25 806,698.25 926,627.25"/>
<g>
<rect style="fill: #ffffff" x="376.491" y="228" width="110.55" height="13"/>
<text style="fill: #0000ff;text-anchor:middle;font-size:11.1083px;font-family:sans-serif;font-style:normal;font-weight:normal" x="431.766" y="238.35">
@ -360,9 +362,9 @@
</text>
</g>
<g id="polcab">
<path style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 4; stroke: #000000" d="M 831.737,479.512 A 119.185,119.185 0 0 0 1050.39,463.753"/>
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="835.976,481.686 830.714,477.525 830.543,484.231 "/>
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="1052.25,468.252 1051.12,461.64 1046.51,466.513 "/>
<path style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 4; stroke: #666666" d="M 831.737,479.512 A 119.185,119.185 0 0 0 1050.39,463.753"/>
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #666666" points="835.976,481.686 830.714,477.525 830.543,484.231 "/>
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #666666" points="1052.25,468.252 1051.12,461.64 1046.51,466.513 "/>
</g>
<g>
<rect style="fill: #ffffff" x="968.391" y="530.225" width="20.75" height="12.55"/>
@ -383,8 +385,8 @@
</text>
</g>
<g id="paakani">
<path style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 4; stroke: #000000" d="M 973.078,615.242 A 51.9744,51.9744 0 0 0 989.766,542.858"/>
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="975.209,611.042 971.176,616.403 977.885,616.412 "/>
<path style="fill: none; fill-opacity:0; stroke-width: 2; stroke-dasharray: 4; stroke: #666666" d="M 973.078,615.242 A 51.9744,51.9744 0 0 0 989.766,542.858"/>
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #666666" points="975.209,611.042 971.176,616.403 977.885,616.412 "/>
</g>
<text style="fill: #0000ff;text-anchor:middle;font-size:11.6727px;font-family:sans-serif;font-style:normal;font-weight:normal" x="176.389" y="516.275">
<tspan x="176.389" y="516.275">Anil Ambani</tspan>
@ -407,7 +409,7 @@
<tspan x="510" y="170.1">Surojeet</tspan>
</text>
</g>
<rect style="fill: none; fill-opacity:0; stroke-width: 1.2; stroke-linejoin: round; stroke: #000000" x="1201.45" y="514.65" width="97" height="204.1" rx="6" ry="6"/>
<rect style="fill: none; fill-opacity:0; stroke-width: 1.2; stroke-linejoin: round; stroke: #666666" x="1201.45" y="514.65" width="97" height="204.1" rx="6" ry="6"/>
<g>
<rect style="fill: #ff0000" x="1212.25" y="549" width="21.202" height="15.2496"/>
<rect style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #ff0000" x="1212.25" y="549" width="21.202" height="15.2496"/>
@ -454,7 +456,7 @@
</text>
<g>
<rect style="fill: #ffffff" x="1208.45" y="519.25" width="83.7231" height="21.5" rx="3" ry="3"/>
<rect style="fill: none; fill-opacity:0; stroke-width: 0.6; stroke-linejoin: round; stroke: #000000" x="1208.45" y="519.25" width="83.7231" height="21.5" rx="3" ry="3"/>
<rect style="fill: none; fill-opacity:0; stroke-width: 0.6; stroke-linejoin: round; stroke: #666666" x="1208.45" y="519.25" width="83.7231" height="21.5" rx="3" ry="3"/>
</g>
<text style="fill: #000000;text-anchor:middle;font-size:12.4176px;font-family:sans-serif;font-style:normal;font-weight:normal" x="1250.31" y="534.3">
<tspan x="1250.31" y="534.3">LEGEND</tspan>

118
linemapping.js

@ -0,0 +1,118 @@
LINES = {
"gascorp": [
"Iron Ore",
"Spectrum",
"MDA",
"RIL",
"PMS Prasad",
"K.R. Raja",
"Manoj Modi",
"Anil Ambani",
"Gas Issue",
"Sasan - Coal"
],
"ambajourno": [
"Ambani kids",
"Jehangir P.",
"RIL",
"News",
"Senthil",
"Anil Ambani"
],
"relkids": [
"Ambani kids",
"Jehangir P.",
"News",
"Senthil"
],
"gasvir": [
"Vir Sanghvi"
],
"paakani": [
"N.K.Singh",
"Kanimozhi",
"Karunanidhi",
"Rajathi Ammal",
"Cabinet",
"PAA",
"R.K.Chandolia",
"A.Raja"
],
"journosunil": [
"Srinath Narasimhan",
"Ratan Tata",
"Bharti Airtel - Tata",
"News",
"ADAG",
"Sunil Mittal",
"TATA",
"Rashmi"
],
"jcong": [
"Vir Sanghvi",
"Congress",
"Cabinet",
"Barkha Dutt"
],
"nitav": [
"News",
"Srini",
"Manoj W",
"Shobhaa De",
"Nita"
],
"gasjourno": [
"Vir Sanghvi",
"Iron Ore",
"Spectrum",
"RIL",
"Rahul Joshi",
"Prabhu Chawla",
"Rajdeep S.",
"R. Sridharan",
"Anil Ambani",
"Gas Issue",
"Sasan - Coal"
],
"airline": [
"Airlines",
"Jaideep Bose",
"Upender",
"Sunil Arora",
"Ratan Tata",
"Surojeet",
"Praful Patel",
"Tarun Das"
],
"loveline": [
"A.Raja"
],
"polcab": [
"N.K.Singh",
"Karunanidhi",
"Cabinet",
"PAA",
"R.K.Chandolia",
"A.Raja"
],
"rajakani": [
"N.K.Singh",
"DMK",
"Kanimozhi",
"Karunanidhi",
"Rajathi Ammal",
"Cabinet",
"PAA",
"R.K.Chandolia",
"A.Raja"
],
"dmkcong": [
"DMK",
"Karunanidhi",
"Rajathi Ammal",
"Congress",
"Maran",
"Cabinet"
],
"rajaspec": []
}

27
map_lines.py

@ -0,0 +1,27 @@
import json
def do():
data = json.loads(open("radia.json").read())
ids = json.loads(open("idmapping.json").read())
lines = {}
for i in ids.keys():
if not i.endswith("box"):
lines[i] = []
for d in data:
print d
if data[d].has_key('lines'):
linestring = data[d]['lines']
else:
linestring = ''
theseLines = linestring.split(",")
for t in theseLines:
t = t.strip()
if t != '':
if lines.has_key(t):
lines[t].append(d)
else:
print t
out = open("linemapping.js", "w")
out.write("LINES = " + json.dumps(lines, indent=2))
out.close()

1
radia.css

@ -13,3 +13,4 @@
text-align: center;
margin-top: 4px;
}

106
radia.js

@ -1,5 +1,17 @@
// var R;
function getNode(nodeKey) {
var ret = false;
$('text').each(function() {
var $this = $(this);
if (typeof($(this).data("key")) != 'undefined') {
if ($this.data("key") == nodeKey) {
ret = $this;
}
}
});
return ret;
}
$(function() {
$(window).resize(function() {
@ -12,6 +24,16 @@ $(function() {
});
$(window).resize();
$.getJSON("radia.json", {}, function(data) {
var highlightCSS = {
'fontWeight': 'bold',
'backgroundColor': '#ffff00'
}
var unhighlightCSS = {
'fontWeight': 'normal',
'backgroundColor': '#ffffff'
}
var R = data;
var $texts = [];
$('g').each(function() {
@ -19,12 +41,51 @@ $(function() {
if (typeof($(this).attr("id")) === 'undefined') {
return;
}
$(this).click(function() {
// console.log($(this).attr("id"));
});
$(this).mouseover(function() {
$(this).hover(function() {
// console.log("hovered " + $(this).attr("id"));
var $this = $(this);
var id = $this.attr("id");
if (id.indexOf("box") != -1) {
return; //FIXME: handle box hovers
}
if (RIDS.hasOwnProperty(id)) {
$this.highlightLine();
// console.log(id);
if (LINES.hasOwnProperty(id)) {
var nodes = LINES[id];
// console.log(nodes);
for (var i=0; i<nodes.length; i++) {
console.log(nodes[i]);
var $node = getNode(nodes[i]);
$node.css(highlightCSS);
}
}
}
// console.log($(this).attr("id"));
}, function() {
var $this = $(this);
var id = $this.attr("id");
if (id.indexOf("box") != -1) {
return; //FIXME: handle box hovers
}
if (RIDS.hasOwnProperty(id)) {
$this.unhighlightLine();
// console.log(id);
if (LINES.hasOwnProperty(id)) {
var nodes = LINES[id];
// console.log(nodes);
for (var i=0; i<nodes.length; i++) {
console.log(nodes[i]);
var $node = getNode(nodes[i]);
$node.css(unhighlightCSS);
}
}
}
});
});
@ -34,7 +95,7 @@ $(function() {
// $('#rajakani').find('line').css({'stroke': '#ff00ff'});
$('#loveline').css({'stroke': '#ff00ff'});
}, function() {
$('#loveline').css({'stroke': '#000000'});
$('#loveline').css({'stroke': '#666666'});
});
// $('#heartpng').click(function() { alert("foo") });
@ -54,6 +115,8 @@ $(function() {
$this.data("name", thisData.name);
$this.data("type", thisData.type);
$this.data("link", thisData.link);
$this.data("lines", thisData.lines.split(", "));
// $this.addClass(thisData.type);
// console.log($this.data("key"));
// console.log($this.hasTooltip());
@ -74,17 +137,8 @@ $(function() {
}
$texts.push($this);
var highlightShadow = '2px 2px 1px #666';
var highlightCSS = {
'fontWeight': 'bold',
'backgroundColor': '#ffff00'
}
var unhighlightCSS = {
'fontWeight': 'normal',
'backgroundColor': '#ffffff'
}
// var highlightShadow = '2px 2px 1px #666';
$this.mouseover(function(e) {
var typ = $(this).data("type");
if (typ === "") { return }
@ -94,6 +148,15 @@ $(function() {
$t.css(highlightCSS);
}
}
var lines = $(this).data("lines");
if (lines.length > 0) {
for (var i=0; i<lines.length; i++) {
var thisLine = lines[i];
var $line = $('#' + thisLine);
$line.highlightLine();
}
}
// $('.' + cls).addClass("highlighted");
// console.log($('.' + cls).length);
});
@ -107,6 +170,15 @@ $(function() {
$t.css(unhighlightCSS);
}
}
var lines = $(this).data("lines");
if (lines.length > 0) {
for (var i=0; i<lines.length; i++) {
var thisLine = lines[i];
var $line = $('#' + thisLine);
$line.unhighlightLine();
}
}
// $('.' + cls).removeClass("highlighted");
});
@ -151,3 +223,11 @@ jQuery.fn.isLegend = function() {
}
return false;
}
jQuery.fn.highlightLine= function() {
this.find('line, polyline, path').css({'stroke': '#000000'});
}
jQuery.fn.unhighlightLine = function() {
this.find('line, polyline, path').css({'stroke': '#666666'});
}

Loading…
Cancel
Save