Skip to content

Commit c2d67e1

Browse files
committed
Set up initial dashboard layout
1 parent fa4f7f2 commit c2d67e1

4 files changed

Lines changed: 33 additions & 12 deletions

File tree

sensorgriddashboard/src/components/HomePage.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,7 @@
22
height: 10000px;
33
background-color: aqua;
44
}
5+
6+
.container {
7+
margin-left: 15% !important
8+
}

sensorgriddashboard/src/components/HomePage.js

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import NavBar from './NavBar'
44
import Battery from './Battery'
55
import MyGoogleMap from './MyGoogleMap'
66
import TimeSeries from './TimeSeries'
7+
import Average from './Average'
78
import realTestData from '../TestData/testData';
89

910
import {
@@ -54,15 +55,32 @@ class HomePage extends Component {
5455
<NavLink href="/components/">Components</NavLink>
5556
</NavItem>
5657
<NavItem>
57-
<NavLink href="https://github.com/reactstrap/reactstrap">Github</NavLink>
58+
<NavLink href="https://github.com/NUKnightLab/SensorGridAPI">Github</NavLink>
5859
</NavItem>
5960
</Nav>
6061
</Collapse>
6162
</Navbar>
62-
<Battery className = "Battery" />
63-
<NavBar className = "Navigation"/>
64-
<TimeSeries displayData={this.state.displayData}/>
65-
<MyGoogleMap />
63+
<Battery className = "Battery" />
64+
<NavBar className = "Navigation"/>
65+
<Container>
66+
<Row>
67+
<MyGoogleMap />
68+
</Row>
69+
<Row>
70+
<h2>Gas</h2>
71+
</Row>
72+
<Row>
73+
<Col>
74+
<Average />
75+
</Col>
76+
<Col>
77+
<Average />
78+
</Col>
79+
</Row>
80+
<Row>
81+
<TimeSeries displayData={this.state.displayData}/>
82+
</Row>
83+
</Container>
6684
</div>
6785
)
6886
}

sensorgriddashboard/src/components/MyGoogleMap.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ const MyMapComponent = compose(
77
googleMapURL: "https://maps.googleapis.com/maps/api/js?v=3.exp&libraries=geometry,drawing,places",
88
loadingElement: <div style={{ height: `100%` }} />,
99
containerElement: <div style={{ height: `600px`, width: `1000px`,
10-
position: `relative`,
11-
top: `50px`, left: `300px` }} />,
10+
}} />,
1211
mapElement: <div style={{ height: `100%` }} />,
1312
}),
1413
withScriptjs,
@@ -55,4 +54,4 @@ class MyGoogleMap extends React.PureComponent {
5554
}
5655
}
5756

58-
export default MyGoogleMap
57+
export default MyGoogleMap

sensorgriddashboard/src/components/TimeSeries.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@ class TimeSeries extends Component {
99
constructor(props){
1010
super(props)
1111
}
12-
12+
1313
render() {
1414
return (
1515
<XYFrame
16-
size={[1200, 500]}
16+
size={[1000, 500]}
1717
lines={this.props.displayData}
1818
lineDataAccessor={"data"}
1919
lineStyle={d => ({ fill: d.color, fillOpacity: 0.5, stroke: d.color, strokeWidth: '3px' })}
2020
xAccessor="created_at"
2121
yAccessor="gasSensor"
2222
xScaleType={scaleTime()}
2323
lineIDAccessor="id"
24-
margin={{ "top": 60, "bottom": 65, "left": 260, "right": 20 }}
24+
margin={{ "top": 60, "bottom": 65, "left": 0, "right": 0 }}
2525
hoverAnnotation={true}
2626
axes={[
2727
{ orient: 'left', tickFormat: d => d },
@@ -37,4 +37,4 @@ render() {
3737
);
3838
}
3939
}
40-
export default TimeSeries
40+
export default TimeSeries

0 commit comments

Comments
 (0)