@@ -48,18 +48,11 @@ interface StateRouteProps {
48
48
const StateRoute = ( props : StateRouteProps ) => {
49
49
const { snapshot, hierarchy, snapshots, viewIndex } = props ;
50
50
51
- console . log ( hierarchy )
51
+ console . log ( hierarchy ) ;
52
52
53
53
const isRecoil = snapshot . atomsComponents ? true : false ;
54
54
const [ noRenderData , setNoRenderData ] = useState ( false ) ;
55
55
56
- // component map zoom state
57
- const [ { x, y, k } , setZoomState ] : any = useState ( {
58
- x : 150 ,
59
- y : 250 ,
60
- k : 1 ,
61
- } ) ;
62
-
63
56
// Map
64
57
const renderComponentMap = ( ) => {
65
58
if ( hierarchy ) {
@@ -71,12 +64,12 @@ const StateRoute = (props: StateRouteProps) => {
71
64
</ ParentSize >
72
65
) ;
73
66
}
74
- return < div className = " noState" > { NO_STATE_MSG } </ div > ;
67
+ return < div className = ' noState' > { NO_STATE_MSG } </ div > ;
75
68
} ;
76
69
77
70
// the hierarchy gets set on the first click in the page
78
71
// when the page is refreshed we may not have a hierarchy, so we need to check if hierarchy was initialized
79
- // if true involk render chart with hierarchy
72
+ // if true invoke render chart with hierarchy
80
73
const renderHistory = ( ) => {
81
74
if ( hierarchy ) {
82
75
return (
@@ -90,41 +83,41 @@ const StateRoute = (props: StateRouteProps) => {
90
83
</ div >
91
84
) ;
92
85
}
93
- return < div className = " noState" > { NO_STATE_MSG } </ div > ;
86
+ return < div className = ' noState' > { NO_STATE_MSG } </ div > ;
94
87
} ;
95
88
96
89
const renderAtomsRelationship = ( ) => (
97
-
98
- < ParentSize > { ( { width, height } ) =>
99
- < Example
100
- width = { width }
101
- height = { height }
102
- snapshots = { snapshots } /> }
90
+ < ParentSize >
91
+ { ( { width, height } ) => (
92
+ < Example width = { width } height = { height } snapshots = { snapshots } />
93
+ ) }
103
94
</ ParentSize >
104
95
) ;
105
96
106
97
// the hierarchy gets set on the first click in the page
107
98
// when the page is refreshed we may not have a hierarchy, so we need to check if hierarchy was initialized
108
- // if true involk render Tree with snapshot
99
+ // if true invoke render Tree with snapshot
109
100
const renderTree = ( ) => {
110
101
if ( hierarchy ) {
111
102
return < Tree snapshot = { snapshot } /> ;
112
103
}
113
- return < div className = " noState" > { NO_STATE_MSG } </ div > ;
104
+ return < div className = ' noState' > { NO_STATE_MSG } </ div > ;
114
105
} ;
115
106
116
107
const renderPerfView = ( ) => {
117
108
if ( hierarchy ) {
118
109
return (
119
- < ParentSize > { ( { width, height } ) =>
120
- < PerformanceVisx
121
- width = { width }
122
- height = { height }
123
- snapshots = { snapshots }
124
- hierarchy = { hierarchy }
125
- /> }
110
+ < ParentSize >
111
+ { ( { width, height } ) => (
112
+ < PerformanceVisx
113
+ width = { width }
114
+ height = { height }
115
+ snapshots = { snapshots }
116
+ hierarchy = { hierarchy }
117
+ />
118
+ ) }
126
119
</ ParentSize >
127
-
120
+
128
121
// <PerfView
129
122
// viewIndex={viewIndex}
130
123
// snapshots={snapshots}
@@ -134,55 +127,55 @@ const StateRoute = (props: StateRouteProps) => {
134
127
// />
135
128
) ;
136
129
}
137
- return < div className = " noState" > { NO_STATE_MSG } </ div > ;
130
+ return < div className = ' noState' > { NO_STATE_MSG } </ div > ;
138
131
} ;
139
132
140
133
return (
141
134
< Router >
142
- < div className = " navbar" >
135
+ < div className = ' navbar' >
143
136
< NavLink
144
- className = " router-link"
145
- activeClassName = " is-active"
137
+ className = ' router-link'
138
+ activeClassName = ' is-active'
146
139
exact
147
- to = "/"
140
+ to = '/'
148
141
>
149
142
Tree
150
143
</ NavLink >
151
144
< NavLink
152
- className = " router-link"
153
- activeClassName = " is-active"
154
- to = " /history"
145
+ className = ' router-link'
146
+ activeClassName = ' is-active'
147
+ to = ' /history'
155
148
>
156
149
History
157
150
</ NavLink >
158
- < NavLink className = " router-link" activeClassName = " is-active" to = " /map" >
151
+ < NavLink className = ' router-link' activeClassName = ' is-active' to = ' /map' >
159
152
Map
160
153
</ NavLink >
161
154
162
155
{ isRecoil && (
163
156
< NavLink
164
- className = " router-link"
165
- activeClassName = " is-active"
166
- to = " /relationship"
157
+ className = ' router-link'
158
+ activeClassName = ' is-active'
159
+ to = ' /relationship'
167
160
>
168
161
AtomsRecoil
169
162
</ NavLink >
170
163
) }
171
164
172
165
< NavLink
173
- className = " router-link"
174
- activeClassName = " is-active"
175
- to = " /performance"
166
+ className = ' router-link'
167
+ activeClassName = ' is-active'
168
+ to = ' /performance'
176
169
>
177
170
Performance
178
171
</ NavLink >
179
172
</ div >
180
173
< Switch >
181
- < Route path = " /map" render = { renderComponentMap } />
182
- < Route path = " /history" render = { renderHistory } />
183
- < Route path = " /relationship" render = { renderAtomsRelationship } />
184
- < Route path = " /performance" render = { renderPerfView } />
185
- < Route path = "/" render = { renderTree } />
174
+ < Route path = ' /map' render = { renderComponentMap } />
175
+ < Route path = ' /history' render = { renderHistory } />
176
+ < Route path = ' /relationship' render = { renderAtomsRelationship } />
177
+ < Route path = ' /performance' render = { renderPerfView } />
178
+ < Route path = '/' render = { renderTree } />
186
179
</ Switch >
187
180
</ Router >
188
181
) ;
0 commit comments