changes merged

This commit is contained in:
zi 2011-06-27 22:49:53 +05:30
commit 007df8a51a
3 changed files with 39 additions and 7 deletions

View File

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

View File

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

View File

@ -31,7 +31,7 @@ $(function() {
}
var unhighlightCSS = {
'opacity': "0.6"
'opacity': "0.7"
// 'fontWeight': 'normal',
// 'backgroundColor': '#ffffff'
}
@ -64,7 +64,7 @@ $(function() {
for (var i=0; i<nodes.length; i++) {
console.log(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++) {
console.log(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++) {
var $t = $texts[i];
if ($t.data("type") == typ) {
$t.css(highlightCSS);
$t.highlightNode();
}
}
@ -172,7 +172,7 @@ $(function() {
for (var i=0; i<$texts.length;i++) {
var $t = $texts[i];
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("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'});
}
}
}