diff --git a/src/components/app.js b/src/components/app.js index 8f8492ed..a4a1ec30 100644 --- a/src/components/app.js +++ b/src/components/app.js @@ -39,6 +39,23 @@ class App extends React.Component { first request includes query straight off the url bar for now */ this.props.dispatch(actions.requestCells(window.location.search)); + /* listen for resize events */ + window.addEventListener("resize", () => { + this.props.dispatch({ + type: "window resize", + data: { + height: window.innerHeight, + width: window.innerWidth + } + }); + }); + this.props.dispatch({ + type: "window resize", + data: { + height: window.innerHeight, + width: window.innerWidth + } + }); } render() { diff --git a/src/components/graph/graph.js b/src/components/graph/graph.js index 7d8ca50e..122ca2b6 100644 --- a/src/components/graph/graph.js +++ b/src/components/graph/graph.js @@ -45,7 +45,8 @@ import FaSave from "react-icons/lib/fa/download"; graphVec: state.controls.graphVec, currentCellSelection: state.controls.currentCellSelection, graphBrushSelection: state.controls.graphBrushSelection, - opacityForDeselectedCells: state.controls.opacityForDeselectedCells + opacityForDeselectedCells: state.controls.opacityForDeselectedCells, + responsive: state.responsive }; }) class Graph extends React.Component { @@ -53,6 +54,7 @@ class Graph extends React.Component { super(props); this.count = 0; this.inverse = mat4.identity([]); + this.graphPaddingTop = 100; this.state = { drawn: false, svg: null, @@ -291,7 +293,16 @@ class Graph extends React.Component { -