Skip to content

Commit 0defcc5

Browse files
committed
adjusted css for d3 nodes
1 parent 1eb4064 commit 0defcc5

File tree

3 files changed

+13
-14
lines changed

3 files changed

+13
-14
lines changed

src/app/components/Chart.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,12 @@ class Chart extends Component {
8888
});
8989

9090
node.append("circle")
91-
.attr("r", 20)
91+
.attr("r", 15)
9292

9393
node
9494
.append("text")
9595
// adjusts the y coordinates for the node text
96-
.attr("dy", "0.3em")
96+
.attr("dy", "0.276em")
9797
.attr("x", function (d) {
9898
// this positions how far the text is from leaf nodes (ones without children)
9999
// negative number before the colon moves the text of rightside nodes, positive number moves the text for the leftside nodes

src/app/components/ChartOLD.jsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,11 @@ class Chart extends Component {
107107
.on('mouseover', mouseover)
108108
.on('mouseout', mouseout)
109109
.on('mousemove', d => mousemove(d));
110+
111+
function mousemove(d) {
112+
div
113+
.text(!d.state ? 'No state found' : JSON.stringify(d.state, null, 4))
114+
}
110115

111116
nodeEnter
112117
.append('circle')
@@ -228,13 +233,6 @@ class Chart extends Component {
228233
.style('display', 'none');
229234
}
230235

231-
function mousemove(d) {
232-
div
233-
.text(!d.state ? 'No state found' : JSON.stringify(d.state, null, 4))
234-
.style('left', `${d3.event.pageX}px`)
235-
.style('top', `${d3.event.pageY}px`);
236-
}
237-
238236
update(root);
239237
duration = 750;
240238

src/app/styles/components/d3graph.css

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
}
1010
.node text {
1111
font-size: 15px;
12-
font-family: 'Raleway', sans-serif;;
12+
font-family: 'Raleway', sans-serif;
1313
}
1414
/* this represents text for leaf nodes aka the ones with no children */
1515
.node--leaf{
16-
fill: #F4C1B6;
16+
fill: #71e9e1;
1717
}
1818

1919
/* this represents those nodes that have children */
@@ -22,13 +22,14 @@
2222
}
2323
/* modifies text of parent nodes (has children) */
2424
.node--internal text {
25-
fill: white;
26-
font-size: 25px;
25+
fill: #fae6e4;
26+
font-size: 19px;
2727

2828
}
2929
.link {
3030
fill: none;
3131
stroke: #3853ea ;
3232
stroke-opacity: 0.4;
3333
stroke-width: 3px;
34-
}
34+
}
35+

0 commit comments

Comments
 (0)