-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
36 lines (28 loc) · 875 Bytes
/
App.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import React, { useState, Component } from "react";
import fetch from 'node-fetch';
import "./styles.css";
//import { JsonEditor } from "jsoneditor-react";
//import "jsoneditor-react/es/editor.min.css";
import DAGViewer from "./DAGViewer";
class App extends Component {
constructor() {
super();
this.state = { dot_txt: ""};
}
async componentDidMount() {
const response = await fetch(`/deps-upd.dot?t=${new Date().getTime()}`);
const dot_txt = await response.text();
this.setState({dot_txt: dot_txt});
// console.log(dot_txt)
}
render() {
// const [dag, setDag] = useState(this.state.dot_txt);
return (
<div className="App">
{/*<textarea value={dag} onChange={(e) => setDag(e.target.value)}></textarea>*/}
<DAGViewer dot={this.state.dot_txt} height="100vh" />
</div>
);
}
}
export default App