attempting to fix window not available on build

This commit is contained in:
WaylonWalker 2020-02-29 19:48:59 -06:00
parent 48680dfd5b
commit 4bbb5e5cde
2 changed files with 25 additions and 11 deletions

View file

@ -5,7 +5,7 @@
"version": "0.1.0", "version": "0.1.0",
"author": "Kyle Mathews <mathews.kyle@gmail.com>", "author": "Kyle Mathews <mathews.kyle@gmail.com>",
"dependencies": { "dependencies": {
"@quantumblack/kedro-viz": "^3.2.0", "@quantumblack/kedro-viz": "3.0.1",
"gatsby": "^2.19.7", "gatsby": "^2.19.7",
"gatsby-image": "^2.2.39", "gatsby-image": "^2.2.39",
"gatsby-plugin-manifest": "^2.2.39", "gatsby-plugin-manifest": "^2.2.39",
@ -43,4 +43,4 @@
"bugs": { "bugs": {
"url": "https://github.com/gatsbyjs/gatsby/issues" "url": "https://github.com/gatsbyjs/gatsby/issues"
} }
} }

View file

@ -7,14 +7,28 @@ import SEO from "../components/seo"
import data from './default-kedro157.json' import data from './default-kedro157.json'
import KedroViz from '@quantumblack/kedro-viz'; import KedroViz from '@quantumblack/kedro-viz';
const IndexPage = () => ( class IndexPage extends React.Component {
<Layout> constructor(props) {
<SEO title="Home" /> super(props)
<h1>default kedro pipeline</h1> this.state = {
<div className="pipeline" style={{ minHeight: '80vh' }}> loaded: false
<KedroViz style={{ minHeight: '80vh' }} data={data} /> }
</div> this.componentDidMount = () => {
</Layout> this.setState({ loaded: false })
)
}
}
render() {
return (
<Layout>
<SEO title="Home" />
<h1>default kedro pipeline</h1>
<div className="pipeline" style={{ minHeight: '80vh' }}>
{this.state.loaded === false ? 'loading' : <KedroViz style={{ minHeight: '80vh' }} data={data} />}
</div>
</Layout>
)
}
}
export default IndexPage export default IndexPage