Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import './App.css';
*/
interface IState {
data: ServerRespond[],
showGraph: boolean,
}

/**
Expand All @@ -21,15 +22,18 @@ class App extends Component<{}, IState> {
this.state = {
// data saves the server responds.
// We use this state to parse data down to the child element (Graph) as element property
data: [],
data: [],
showGraph: false,
};
}

/**
* Render Graph react component with state.data parse as property data
*/
renderGraph() {
if (this.state.showGraph) {
return (<Graph data={this.state.data}/>)
}
}

/**
Expand Down