Browse Source

fix map_lines.py

master
Sanj 13 years ago
parent
commit
2829ab5ae2
  1. 2
      map_lines.py
  2. 10
      radia.css
  3. 34
      radia.js

2
map_lines.py

@ -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"):

10
radia.css

@ -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;
}
*/

34
radia.js

@ -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'});
}
}
}

Loading…
Cancel
Save