fix map_lines.py

This commit is contained in:
Sanj 2011-06-27 22:47:39 +05:30
parent 7012cff89d
commit 2829ab5ae2
3 changed files with 39 additions and 7 deletions

View File

@ -2,7 +2,7 @@ import json
def do(): def do():
data = json.loads(open("radia.json").read()) data = json.loads(open("radia.json").read())
ids = json.loads(open("idmapping.json").read()) ids = json.loads(open("idmapping.js").read().replace("RIDS = ", ""))
lines = {} lines = {}
for i in ids.keys(): for i in ids.keys():
if not i.endswith("box"): if not i.endswith("box"):

View File

@ -1,3 +1,9 @@
/*
body {
background-color: #FAFBD6;
}
*/
#tooltip { #tooltip {
padding: 4px; padding: 4px;
border: 1px solid #000; border: 1px solid #000;
@ -22,9 +28,11 @@
text { text {
background-color: #ffff00; background-color: #ffff00;
opacity: 0.6; opacity: 0.7;
} }
/*
tspan { tspan {
font-weight: bold; font-weight: bold;
} }
*/

View File

@ -31,7 +31,7 @@ $(function() {
} }
var unhighlightCSS = { var unhighlightCSS = {
'opacity': "0.6" 'opacity': "0.7"
// 'fontWeight': 'normal', // 'fontWeight': 'normal',
// 'backgroundColor': '#ffffff' // 'backgroundColor': '#ffffff'
} }
@ -64,7 +64,7 @@ $(function() {
for (var i=0; i<nodes.length; i++) { for (var i=0; i<nodes.length; i++) {
console.log(nodes[i]); console.log(nodes[i]);
var $node = getNode(nodes[i]); var $node = getNode(nodes[i]);
$node.css(highlightCSS); $node.highlightNode();
} }
} }
} }
@ -84,7 +84,7 @@ $(function() {
for (var i=0; i<nodes.length; i++) { for (var i=0; i<nodes.length; i++) {
console.log(nodes[i]); console.log(nodes[i]);
var $node = getNode(nodes[i]); var $node = getNode(nodes[i]);
$node.css(unhighlightCSS); $node.unhighlightNode();
} }
} }
} }
@ -150,7 +150,7 @@ $(function() {
for (var i=0; i<$texts.length;i++) { for (var i=0; i<$texts.length;i++) {
var $t = $texts[i]; var $t = $texts[i];
if ($t.data("type") == typ) { if ($t.data("type") == typ) {
$t.css(highlightCSS); $t.highlightNode();
} }
} }
@ -172,7 +172,7 @@ $(function() {
for (var i=0; i<$texts.length;i++) { for (var i=0; i<$texts.length;i++) {
var $t = $texts[i]; var $t = $texts[i];
if ($t.data("type") == typ) { if ($t.data("type") == typ) {
$t.css(unhighlightCSS); $t.unhighlightNode();
} }
} }
@ -238,3 +238,27 @@ jQuery.fn.unhighlightLine = function() {
this.find('line, polyline, path').css({'stroke': '#666666'}); this.find('line, polyline, path').css({'stroke': '#666666'});
this.find("path").css({'strokeDasharray': '4'}); this.find("path").css({'strokeDasharray': '4'});
} }
jQuery.fn.highlightNode = function() {
this.css({'opacity': '1.0'});
if (this.data("type") == 'rivalgroup') {
this.css({'fontWeight': 'bold'});
} else {
var prev = this.prev();
if (prev.is('rect')) {
this.prev().css({'fill': '#FAFF3E'});
}
}
}
jQuery.fn.unhighlightNode = function() {
this.css({'opacity': '0.7'});
if (this.data("type") == 'rivalgroup') {
this.css({'fontWeight': 'normal'});
} else {
var prev = this.prev();
if (prev.is('rect')) {
this.prev().css({'fill': '#ffffff'});
}
}
}