@@ -36,16 +36,16 @@ class Chart extends Component {
36
36
37
37
maked3Tree ( ) {
38
38
this . removed3Tree ( ) ;
39
- let width = 600 ;
40
-
41
- const margin = {
42
- top : 20 ,
43
- right : 120 ,
44
- bottom : 20 ,
45
- left : 120 ,
46
- } ;
39
+ let width = 960 ;
40
+ let height = 1060 ;
41
+ // const margin = {
42
+ // top: 0 ,
43
+ // right: 60 ,
44
+ // bottom: 80 ,
45
+ // left: 120,
46
+ // };
47
47
// const width = 600 - margin.right - margin.left;
48
- const height = 600 - margin . top - margin . bottom ;
48
+ // const height = 600 - margin.top - margin.bottom;
49
49
50
50
let chartContainer = d3 . select ( this . chartRef . current )
51
51
. append ( 'svg' ) // chartContainer is now pointing to svg
@@ -99,24 +99,24 @@ class Chart extends Component {
99
99
} ) ;
100
100
101
101
node . append ( "circle" )
102
- . attr ( "r" , 15 )
102
+ . attr ( "r" , 12 )
103
103
104
104
//creating a d3.tip method where the html has a function that returns the data we passed into tip.show from line 120
105
105
let tip = d3Tip ( )
106
106
. attr ( "class" , "d3-tip" )
107
- . html ( function ( d ) { return "State Snapshot : " + d ; } )
107
+ . html ( function ( d ) { return "State: " + d ; } )
108
108
109
109
//invoking tooltip for nodes
110
110
node . call ( tip )
111
111
112
112
node
113
113
. append ( "text" )
114
114
// adjusts the y coordinates for the node text
115
- . attr ( "dy" , "0.276em " )
115
+ . attr ( "dy" , "0.35em " )
116
116
. attr ( "x" , function ( d ) {
117
117
// this positions how far the text is from leaf nodes (ones without children)
118
118
// negative number before the colon moves the text of rightside nodes, positive number moves the text for the leftside nodes
119
- return d . x < Math . PI === ! d . children ? - 5 : 9 ;
119
+ return d . x < Math . PI === ! d . children ? - 4 : 5 ;
120
120
} )
121
121
. attr ( "text-anchor" , function ( d ) { return d . x < Math . PI === ! d . children ? "start" : "end" ; } )
122
122
// this arranges the angle of the text
@@ -131,7 +131,7 @@ class Chart extends Component {
131
131
// without JSON.stringify, data will display as object Object
132
132
// console.log('d.data --> ', JSON.stringify(d.data))
133
133
let displayedState ;
134
- tip . show ( JSON . stringify ( d . data . stateSnapshot ) , this )
134
+ tip . show ( JSON . stringify ( d . data . stateSnapshot . children [ 0 ] . state ) , this )
135
135
} )
136
136
. on ( 'mouseout' , tip . hide )
137
137
0 commit comments