Skip to content

Commit

Permalink
Make graph work in other browsers. Fixes #1
Browse files Browse the repository at this point in the history
  • Loading branch information
turt2live committed Mar 21, 2017
1 parent 676e43f commit d733aaf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 5 additions & 1 deletion app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ d3.json(source, function (error, graph) {

var display = {};
var images = {"count": 0};
for (var node of graph.nodes) {
for (var key in graph.nodes) {
var node = graph.nodes[key]; // can't use `for x of y` because IE
display[node.id] = node.display || node.id;

var imgSize = node.type == 'user' ? 24 : 44;
Expand Down Expand Up @@ -73,6 +74,9 @@ d3.json(source, function (error, graph) {
.attr("class", function (d) {
return d.type;
})
.attr("r", function(d) {
return d.type == "room" ? 22 : 12;
})
.call(d3.drag()
.on("start", dragstarted)
.on("drag", dragged)
Expand Down
2 changes: 0 additions & 2 deletions app/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ body {
.nodes circle {
stroke: #fff;
stroke-width: 1px;
r: 12;
}

.nodes circle.user {
Expand All @@ -53,6 +52,5 @@ body {

.nodes circle.room {
/*fill: #a36aba;*/
r: 22;
stroke-width: 1.5px;
}

0 comments on commit d733aaf

Please sign in to comment.