Skip to content

Commit 2d0d4a9

Browse files
committed
chart merged successfully
1 parent e848f7e commit 2d0d4a9

File tree

1 file changed

+4
-38
lines changed

1 file changed

+4
-38
lines changed

src/app/components/Chart.jsx

Lines changed: 4 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -5,34 +5,6 @@ import * as d3 from 'd3';
55
var root={};
66
let duration = 750;
77

8-
// var test={
9-
// name: 'root',
10-
// state: {
11-
// "kids": 0,
12-
// "kids1": 0,
13-
// "kids2": 0,
14-
// "kids3": 0,
15-
// "kids4": 0,
16-
// "kids5": {
17-
// subkid: 3,
18-
// subkid3: 5,
19-
// sukid5:{
20-
// kid:1,
21-
// kid:3
22-
// }
23-
// },
24-
// "kids6": 0,
25-
// "kids7": 0,
26-
// "kids8": 0,
27-
// "kids9": 0,
28-
// "kids10": 0,
29-
// "kids11": 0,
30-
// "kids12": 0,
31-
// "kids13": 0,
32-
// },
33-
// children: [{name: 'hello',state:{name: "codesmith"}},{name: 'bye'}]
34-
// }
35-
368
class Chart extends Component {
379
constructor(props) {
3810
super(props);
@@ -50,20 +22,17 @@ class Chart extends Component {
5022
}
5123
}
5224

53-
5425
removed3Tree() {
5526
const { anchor } = this.refs;
5627
while (anchor.hasChildNodes()) {
5728
anchor.removeChild(anchor.lastChild);
5829
}
5930
}
6031

61-
6232
maked3Tree(){
6333
this.removed3Tree();
6434

6535
duration=0;
66-
// root = test;
6736

6837
var margin = {top: 20, right: 120, bottom: 20, left: 120},
6938
width = 960 - margin.right - margin.left,
@@ -90,8 +59,6 @@ class Chart extends Component {
9059
.on("mouseover", tipMouseover)
9160
.on("mouseout", tipMouseout)
9261

93-
94-
9562
root.x0 = height / 2;
9663
root.y0 = 0;
9764

@@ -198,29 +165,28 @@ class Chart extends Component {
198165
update(d);
199166
}
200167

201-
202168
// Show state on mouse over
203-
function mouseover(d) {
169+
function mouseover() {
204170
div.transition()
205171
.duration(300)
206172
.style("display", "block")
207173
.style("opacity", 1)
208174
}
209175

210-
function mouseout(d) {
176+
function mouseout() {
211177
div.transition()
212178
.duration(3000)
213179
.style("opacity", 1e-6)
214180
.style("display", "none");
215181
}
216182

217-
function tipMouseover(d){
183+
function tipMouseover(){
218184
div.transition()
219185
.duration(300)
220186
.style("opacity", 1);
221187
}
222188

223-
function tipMouseout(d) {
189+
function tipMouseout() {
224190
div.transition()
225191
.duration(3000)
226192
.style("opacity", 1e-6)

0 commit comments

Comments
 (0)