Skip to content

Commit

Permalink
Dynamic project title is added
Browse files Browse the repository at this point in the history
DESIGN EXPLORER title will be dynamically replaced by filename. See #13
  • Loading branch information
mostaphaRoudsari committed Aug 6, 2015
1 parent 65c183e commit f303e98
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
File renamed without changes.
22 changes: 18 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -650,25 +650,34 @@
var inputLabelColor = "tomato",
outputLabelColor = "green",
inputLabels = d3.keys(inputData[0]),
outputLabels = d3.keys(outputData[0]);
outputLabels = d3.keys(outputData[0])
colorset = [];

d3.selectAll("text.label")
// move every other label up
.attr("transform", function(d,i){return "translate (0 , -" + (10 + ((i%2) * 15)) + ")"})
.style("fill", function(d){
// change colors for inputs vs outputs
if (inputLabels.indexOf(d) != -1) {
colorset.push(inputLabelColor);
return inputLabelColor; // it is an input

} else if (outputLabels.indexOf(d) != -1) {
colorset.push(outputLabelColor);
return outputLabelColor; //it's an output

} else {
// undefined
colorset.push("black");
return "black";
};
})
}
});


//modify axes
d3.selectAll("path.domain")
.style("stroke", function(d,i){ return colorset[i];});
};

</script>

Expand Down Expand Up @@ -951,9 +960,14 @@

var regex = /^([a-zA-Z0-9\s_\\.\-:])+(.csv|.txt)$/;


if (regex.test(file.name.toLowerCase())) {

// Update project name
var inputFileName = file.name.toUpperCase().replace(".CSV","");

d3.select("p.navbar-brand").text(inputFileName);

reader.onload = function(e) {

var inputString = e.target.result;
Expand Down

0 comments on commit f303e98

Please sign in to comment.