Skip to content

Commit

Permalink
Merge pull request #6 from pablo-mayrgundter/main
Browse files Browse the repository at this point in the history
Peg web-ifc-viewer to 1.0.14 to avoid some breaking API changes there…
  • Loading branch information
OlegMoshkovich committed Jul 21, 2021
2 parents 80bb7d3 + 0ba9ff1 commit bd56a2c
Show file tree
Hide file tree
Showing 4 changed files with 1,717 additions and 1,758 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"react-dom": "^17.0.2",
"react-router-dom": "^5.2.0",
"react-scripts": "4.0.3",
"three": "^0.130.1",
"web-ifc-viewer": "^1.0.14",
"three": "^0.128.0",
"web-ifc-viewer": "1.0.14",
"web-vitals": "^1.0.1"
},
"scripts": {
Expand Down
25 changes: 0 additions & 25 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,31 +38,6 @@
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<div
id="viewer-container"
style="
position: absolute;
top: 30%;
left: 30%;
color: blue;
text-align: center;
border: 3px solid lime;
height: 400px;
width: 600px;
overflow: hidden;
"
></div>
<div
id="fileInput"
style="
position: absolute;
top: 26%;
left: 30%;
color: blue;
text-align: center;
overflow: hidden;
"
></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
Expand Down
23 changes: 21 additions & 2 deletions src/Components/ifcViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@ export default class Viewer extends React.Component {
constructor(props) {
super(props);
this.viewer = null;
console.log('Viewer init...');
}


componentDidMount() {
const container = document.getElementById("viewer-container");
console.log('Componentdidmount...');
this.viewer = new IfcViewerAPI({ container });
this.viewer.addAxes();
this.viewer.addGrid();
Expand Down Expand Up @@ -45,6 +43,27 @@ export default class Viewer extends React.Component {
render() {
return (
<div style={{ position: "absolute", bottom: "30px", left: "30%" }}>
<div
id="viewer-container"
style={{
position: 'relative',
color: 'blue',
textAlign: 'center',
border: '3px solid lime',
height: '400px',
width: '600px',
overflow: 'hidden'
}}></div>
<div
id="fileInput"
style={{
position: 'absolute',
top: '26%',
left: '30%',
color: 'blue',
textAlign: 'center',
overflow: 'hidden'
}}></div>
<Button
variant="contained"
color="primary"
Expand Down

0 comments on commit bd56a2c

Please sign in to comment.