Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web GUI for tvb-recon #68

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
48025f4
Adding home page
PUNITBATRA May 16, 2020
57d67b7
minor update
PUNITBATRA May 16, 2020
9f90af3
minor fix
PUNITBATRA May 20, 2020
fca8b92
Added input page for multiple patients
PUNITBATRA May 28, 2020
c6ddb25
gui for adding data processing type
PUNITBATRA May 31, 2020
fab5a87
update server.js for creating dir dynamically
PUNITBATRA Jun 3, 2020
06b72a4
adding initial configuration page
PUNITBATRA Jun 9, 2020
7952b97
adding updated config page
PUNITBATRA Jun 12, 2020
692e521
minor update
PUNITBATRA Jun 12, 2020
d2b0abd
updated path of the .properties file
PUNITBATRA Jun 12, 2020
cdf4291
refactoring some files
PUNITBATRA Jun 22, 2020
17b0373
update run_Sequentially.py and server.js
PUNITBATRA Jun 26, 2020
462fa6b
Dockerfiles according to condor image
PUNITBATRA Jul 30, 2020
c219ae1
adding workflow & hardcoded joblist component and some minor update
PUNITBATRA Aug 13, 2020
a71a8bb
final changes in joblist and workflowlist component
PUNITBATRA Aug 14, 2020
4e4af6b
initial readme for web GUI
PUNITBATRA Aug 17, 2020
6694211
Update README.md
PUNITBATRA Aug 17, 2020
f1c2bb8
minor update
PUNITBATRA Aug 17, 2020
adff004
minor update in readme images
PUNITBATRA Aug 18, 2020
af8db95
updated readme as suggested
PUNITBATRA Aug 21, 2020
331cf80
updated readme as suggested
PUNITBATRA Aug 21, 2020
34d8edf
Update README.md
PUNITBATRA Aug 21, 2020
d7c730b
adding slider in home page
PUNITBATRA Aug 21, 2020
27416c1
added config props info
PUNITBATRA Aug 22, 2020
be62030
parses the node and edges on server dynamically
PUNITBATRA Aug 31, 2020
193de3d
Final readme update
PUNITBATRA Aug 31, 2020
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
Prev Previous commit
Next Next commit
parses the node and edges on server dynamically
  • Loading branch information
PUNITBATRA committed Aug 31, 2020
commit be62030740d24d8ac9b23d6980bc1350b6e96d2c
Binary file modified web/Images/JobList.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
71 changes: 71 additions & 0 deletions web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@
"react-scripts": "3.4.1",
"react-slick": "^0.26.1",
"react-spinners": "^0.9.0",
"reactjs-graphs": "^1.4.0",
"slick-carousel": "^1.8.1",
"styled-components": "^5.1.0"
"styled-components": "^5.1.0",
"xml2js": "^0.4.23"
},
"scripts": {
"start": "react-scripts start",
Expand Down
31 changes: 31 additions & 0 deletions web/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ app.use(express.json())
var parser = require("properties-file");
var base64 = require('base-64');
var fetch=require('node-fetch');
var xml2js = require('xml2js');
var parser = new xml2js.Parser();

//For Patient 1
var storage = multer.diskStorage({
Expand Down Expand Up @@ -345,6 +347,35 @@ app.get('/auth/:wf_id/:state',function(request,response){
console.log("No Jobs are in the "+state+" state");
});
})


// parse the dax edges and nodes
function length(obj) {
return Object.keys(obj).length;
}
app.get('/nodes',function(req,res){
fs.readFile( './TVB_patients/TVB1/configs/dax/main_bnm.dax', function(err, data) {
parser.parseString(data, function (err, result) {
for(var i=0;i< length (result.adag.child);i++){
res.write(result.adag.child[i].$.ref+'\n')
}
res.end()
});
});
});

app.get('/edges',function(req,res){
fs.readFile( './TVB_patients/TVB1/configs/dax/main_bnm.dax', function(err, data) {
parser.parseString(data, function (err, result) {
for(var i=0;i< length (result.adag.child);i++){
for(var j=0;j<length (result.adag.child[i].parent);j++)
res.write(result.adag.child[i].$.ref+","+result.adag.child[i].parent[j].$.ref+'\n')
}
res.end()
});
});
})

app.listen(8000, function() {
console.log('App running on port 8000');
});
5 changes: 5 additions & 0 deletions web/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import Input from './components/Input/Input';
import Configuration from './components/Configuration/Configuration'
import WorkflowList from './components/WorkflowList/WorkflowList';
import JobList from './components/WorkflowList/JobList/JobList';
import DAXGraph from './components/WorkflowList/JobList/DAXGraph'

class App extends Component {
render(){
return (
Expand All @@ -14,6 +16,9 @@ class App extends Component {
<Route path="/jobList/:jobid">
<JobList />
</Route>
<Route path="/daxgraph">
<DAXGraph />
</Route>
<Route path="/workflowList">
<WorkflowList />
</Route>
Expand Down
Binary file modified web/src/components/Home/image/JobList.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
98 changes: 98 additions & 0 deletions web/src/components/WorkflowList/JobList/DAXGraph.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
import React from 'react'
import Graph from 'reactjs-graphs'
import axios from 'axios'

const onClick = (label, index, extras) => {
console.log(label, index, extras)
}

const vertices = [
{ label: "A", onClick },
{ label: "B", onClick },
{ label: "C", onClick },
{ label: "D", onClick },
{ label: "E", onClick },
{ label: "F", onClick },
{ label: "G", onClick },
{ label: "H", },
{ label: "I", },
{ label: "J", },
{ label: "K", },
{ label: "L", },
{ label: "M", },
{ label: "N", },
]

const edges = [
["A", "B"],
["B", "C"],
["C", "D"],
["C", "E"],
["C", "F"],
["C", "G"],
["F", "H"],
["E", "H"],
["G", "H"],
["H", "I"],
["H", "J"],
["H", "K"],
["K", "L"],
["J", "L"],
["I", "L"],
["L", "M"],
["L", "N"]
]


class DAXGraph extends React.Component{
constructor() {
super();
this.state = {
nodes:[],
edges:[]
}
}
componentDidMount() {
axios.get('http:https://localhost:8000/nodes')
.then(response => {
this.setState({
nodes:response.data
});
})
axios.get('http:https://localhost:8000/edges')
.then(response => {
this.setState({
edges:response.data
});
})
}

render(){
return(
<div>
<h3>Work in Progress...This graph is an example from reactjs-graph npm module data.</h3>
<Graph
vertices={vertices}
edges={edges}
width={1000}
height={500}
autoWidth={true}
vertexStroke="#df6766"
edgeStroke="#ebb2b2"
edgeWidth={2}
vertexRadius={15}
vertexGap={200}
labelFontSize={20}
activeVertexFill="blue"
inactiveVertexFill="white"
fontFamily="Airbnb Cereal"
labelColor="black"
className="className"
centerInCanvas={true}
/>
</div>
)

}
}
export default DAXGraph;
12 changes: 11 additions & 1 deletion web/src/components/WorkflowList/JobList/JobList.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,20 @@
.job_table{
padding: 40px;
}

.spinner{
display: flex;
align-self: center;
justify-content: center;

}
.button_dax{
font-size: 20px;
background-color:green;
color: white;
border-radius: 10px;
width: 30%;
margin-left: 35%;
margin-right: 35%;
margin-top:30px;
cursor: pointer
}
17 changes: 15 additions & 2 deletions web/src/components/WorkflowList/JobList/JobList.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,24 @@ function successfulStyle(row) {
return { backgroundColor: row ='green' };
}
class JobList extends Component {
state = {
constructor() {
super();
this.state = {
jobs: [],
successful:[],
failed:[],
running:[],
failing:[],
loading:false
}
this.handleClick = this.handleClick.bind(this);
}

handleClick=(event)=>{
event.preventDefault();
this.props.history.push('/daxgraph');
}

componentDidMount() {
var wf_id=this.props.match.params.jobid
axios.get('http:https://localhost:8000/auth/'+wf_id)
Expand Down Expand Up @@ -109,7 +119,10 @@ class JobList extends Component {
<TableHeaderColumn dataField="exec_job_id">Job Name</TableHeaderColumn>
</BootstrapTable>:
<div className='spinner'><BeatLoader color={"#00BFFF"}/></div> }
</div>


<button className="button_dax" onClick={this.handleClick}>Click Here To View the DAX </button>
</div>
);
}
}
Expand Down