Permalink
Browse files

visual improvements

  • Loading branch information...
1 parent b75430e commit 0edf7eaab69c52bc848dc2a622a592a99d0a4a78 @psawaya psawaya committed Jan 18, 2012
Showing with 17 additions and 14 deletions.
  1. +12 −5 data/js/view_passwords.js
  2. +5 −9 data/view_passwords.html
View
@@ -1,9 +1,14 @@
var loginData;
var vis;
-var w=800;var h=600;var fill = d3.scale.category10();
+var fill = d3.scale.category10();
+
+var w,h;
function init() {
+ w = 800;
+ h = 600;
+
vis = d3.select("#chart").append("svg:svg")
.attr("width", w)
.attr("height", h);
@@ -19,7 +24,7 @@ function startViz() {
.charge(-100)
.nodes(loginData.nodes)
.links(loginData.links)
- .size([800, 600])
+ .size([w, h])
.start();
var link = vis.selectAll("line.link")
@@ -77,7 +82,7 @@ function startViz() {
node.on("mouseout", function(e) {
$('.infoPopup').hide();
});
-
+
vis.style("opacity", 1e-6)
.transition()
.duration(1000)
@@ -112,8 +117,10 @@ function drawPasswordHash(canvas,password) {
}
function mouseOver(e) {
- $('.infoPopup').css('left',e.x + 20);
- $('.infoPopup').css('top',e.y);
+ // FIXME: Find a better way to translate viz-space to screen space.
+ $('.infoPopup').css('left',e.x + w/2);
+ $('.infoPopup').css('top',e.y+20);
+ console.log(e);
if (e.group == 0) {
$('#obfuscatePassword').html(obfuscatePassword(e.name));
View
@@ -1,16 +1,10 @@
<html>
<head>
<title>Password Reuse Visualizer</title>
- <style>
- body {
-/* background-color:#000000;*/
+ <style>
+ #chart {
+ text-align:center;
}
-
- #paper {
- width:100%;
- height:100%;
- }
-
#obfuscatePassword {
display:none;
}
@@ -49,6 +43,7 @@
<body onload="init();">
<div id="chart">
</div>
+
<div id="siteInfo" class="infoPopup"></div>
<div id="passwordInfo" class="infoPopup">
<div id="passwordHash">
@@ -62,5 +57,6 @@
</div>
</div>
</div>
+
</body>
</html>

0 comments on commit 0edf7ea

Please sign in to comment.