Skip to content

Commit

Permalink
flow color
Browse files Browse the repository at this point in the history
  • Loading branch information
csaladenes committed May 28, 2017
1 parent 48ece44 commit 0216d93
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion index.html
Expand Up @@ -350,7 +350,7 @@
<span><button onclick="removelink()" style="width:45%; min-width:100px; float:right;">Remove link</button></span>
</div>
<div class="likeform" id="links-form" >
<div><input type="text" value='{"source":0,"target":3,"value":15}'/></div>
<div><input type="text" value='{"source":0,"target":3,"value":15,"fill":"blue"}'/></div>
<div><input type="text" value='{"source":1,"target":3,"value":20}'/></div>
<div><input type="text" value='{"source":2,"target":3,"value":25}'/></div>
<div><input type="text" value='{"source":2,"target":4,"value":25}'/></div>
Expand Down
5 changes: 3 additions & 2 deletions js/food.js
Expand Up @@ -206,8 +206,9 @@ change = function(d) {
var e = g.append("path") //path2
.attr("d", path(2));
g.attr("fill", function(i) {
if (i.source.fill) return i.source.fill;
else return i.source.color = color(i.source.name.replace(/ .*/, ""))
if (i.fill) return i.fill;
else if (i.source.fill) return i.source.fill;
else return i.source.color = color(i.source.name.replace(/ .*/, ""))
}).attr("opacity", lowopacity).on("mouseover", function(d) {
d3.select(this).style('opacity', highopacity);
}).on("mouseout", function(d) {
Expand Down

0 comments on commit 0216d93

Please sign in to comment.