summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--code/weightvis.js12
-rw-r--r--index.css2
-rw-r--r--index.html8
3 files changed, 12 insertions, 10 deletions
diff --git a/code/weightvis.js b/code/weightvis.js
index 409eb90..10a9ed2 100644
--- a/code/weightvis.js
+++ b/code/weightvis.js
@@ -20,17 +20,16 @@ var
primaryColor = [pDeepPurple[1], pDeepPurple[5], pDeepPurple[7]],
secondaryColor = pBlueA[3],
- tertiaryColor = [pPink[1], pPink[5], pPink[7]],
themeColor = pLight,
accentColor = secondaryColor,
bgColor = themeColor[3],
- linkColor = primaryColor[0],
- linkColorAlt = tertiaryColor[0],
- linkHighlightColor = primaryColor[1],
- linkHighlightColorAlt = tertiaryColor[1],
- nodeColor = textColor[0],
+ linkColor = pDeepPurple[2],
+ linkColorAlt = pPink[2],
+ linkHighlightColor = pDeepPurple[5],
+ linkHighlightColorAlt = pPink[5],
+ nodeColor = pDeepPurple[4],
nodeHighlightColor = accentColor
;
@@ -341,6 +340,7 @@ var Visualizer = (function() {
};
Visualizer.prototype.reposition = function() {
+ if (!this.svg) return;
var width = parseInt(this.svg.style("width")) || 800,
height = parseInt(this.svg.style("height")) || 600;
var node = this.svg.selectAll(".node");
diff --git a/index.css b/index.css
index d863e90..7083fca 100644
--- a/index.css
+++ b/index.css
@@ -21,6 +21,8 @@ time, mark, audio, video {
}
.svgContainer {
+ margin-top: 1.5em;
+ margin-bottom: 1.5em;
height: 70%;
}
diff --git a/index.html b/index.html
index c1858fd..fb88382 100644
--- a/index.html
+++ b/index.html
@@ -71,8 +71,8 @@
var attrFontSize = 20;
function placeAttributes() {
- var inputNodes = d3.selectAll(".layer-1").node();
- var attrs = d3.selectAll(".attribute").node();
+ var inputNodes = d3.selectAll(".layer-1")[0];
+ var attrs = d3.selectAll(".attribute")[0];
for (node=0; node<inputNodes.length; node++) {
var iNode = d3.select(inputNodes[node]);
d3.select(attrs[node])
@@ -86,9 +86,9 @@
d3.select("#visContainer").node().appendChild(svg.node());
var attributeNames =
["CRIM", "ZN", "INDUS", "CHAS", "NOX", "RM", "AGE", "DIS", "RAD", "TAX", "PTRATIO", "B", "LSTAT"];
- var inputNodes = d3.selectAll(".layer-1").node();
+ var inputNodes = d3.selectAll(".layer-1")[0];
+ console.log(inputNodes);
for (node=0; node<inputNodes.length; node++) {
- var iNode = d3.select(inputNodes[node]);
svg
.append("text")
.attr("class", "attribute")