-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
VT-23. Create layout for all necessary components; start working on e…
…xpanding nodes
- Loading branch information
1 parent
65c6c6e
commit c235815
Showing
12 changed files
with
207 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import React, { useEffect, useState } from 'react'; | ||
import '../style/layout.css'; | ||
import { OntologyWidgetComponent } from './OntologyWidget'; | ||
import TreeViewComponent from './components/TreeView'; | ||
import SeachBarComponent from './components/SearchBar'; | ||
import InfoBoxComponent from './components/InfoBox'; | ||
import WorkspaceComponent from './components/Workspace'; | ||
|
||
interface IAppProps { | ||
fetchData: () => Promise<any>; | ||
} | ||
|
||
const App: React.FC<IAppProps> = ({ fetchData }) => { | ||
const [data, setData] = useState(null); | ||
|
||
useEffect(() => { | ||
const fetchAndSetData = async () => { | ||
try { | ||
const result = await fetchData(); | ||
setData(result); | ||
console.log(data); | ||
} catch (error) { | ||
console.error('Failed to fetch data:', error); | ||
} | ||
}; | ||
|
||
fetchAndSetData(); | ||
}, [fetchData]); | ||
|
||
return ( | ||
<div className="layout"> | ||
<SeachBarComponent /> | ||
<TreeViewComponent /> | ||
<InfoBoxComponent /> | ||
<WorkspaceComponent /> | ||
<OntologyWidgetComponent fetchData={fetchData} /> | ||
</div> | ||
); | ||
}; | ||
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { ReactWidget } from '@jupyterlab/apputils'; | ||
import React from 'react'; | ||
import App from './App'; | ||
|
||
export class AppWidget extends ReactWidget { | ||
fetchData: () => Promise<any>; | ||
constructor(fetchData: () => Promise<any>) { | ||
super(); | ||
this.addClass('tvbo-AppWidget'); | ||
this.fetchData = fetchData; | ||
} | ||
|
||
render(): React.ReactElement { | ||
return <App fetchData={this.fetchData} />; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import React from 'react'; | ||
|
||
const InfoBoxComponent: React.FC = () => { | ||
return <div className="info-box">Info Box</div>; | ||
}; | ||
|
||
export default InfoBoxComponent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import React from 'react'; | ||
|
||
const SeachBarComponent: React.FC = () => { | ||
return <div className="search-bar">Search Bar</div>; | ||
}; | ||
|
||
export default SeachBarComponent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import React from 'react'; | ||
|
||
const TreeViewComponent: React.FC = () => { | ||
return <div className="tree-view">Tree View</div>; | ||
}; | ||
|
||
export default TreeViewComponent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import React from 'react'; | ||
|
||
const WorkspaceComponent: React.FC = () => { | ||
return <div className="workspace">Workspace</div>; | ||
}; | ||
|
||
export default WorkspaceComponent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
.layout { | ||
display: grid; | ||
grid-template: | ||
'search-bar tree-view info-box' auto | ||
'ontology-graph ontology-graph info-box' 1fr | ||
'ontology-graph ontology-graph workspace' 1fr / 1fr 1fr 1fr; | ||
height: 90vh; | ||
gap: 10px; | ||
background-color: white; | ||
} | ||
|
||
.search-bar { | ||
grid-area: search-bar; | ||
border: 1px solid #ddd; | ||
padding: 10px; | ||
overflow: auto; | ||
background-color: whitesmoke; | ||
} | ||
|
||
.tree-view { | ||
grid-area: tree-view; | ||
border: 1px solid #ddd; | ||
padding: 10px; | ||
overflow: auto; | ||
background-color: whitesmoke; | ||
} | ||
|
||
.ontology-graph { | ||
grid-area: ontology-graph; | ||
border: 1px solid #ddd; | ||
padding: 10px; | ||
overflow: auto; | ||
background-color: whitesmoke; | ||
} | ||
|
||
.info-box { | ||
grid-area: info-box; | ||
border: 1px solid #ddd; | ||
padding: 10px; | ||
overflow: auto; | ||
background-color: whitesmoke; | ||
} | ||
|
||
.workspace { | ||
grid-area: workspace; | ||
border: 1px solid #ddd; | ||
padding: 10px; | ||
overflow: auto; | ||
background-color: whitesmoke; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters