From 4bbb5e5cde0d8c34dcb64e897e1f171cf4b6aacc Mon Sep 17 00:00:00 2001 From: WaylonWalker Date: Sat, 29 Feb 2020 19:48:59 -0600 Subject: [PATCH] attempting to fix window not available on build --- gatsby-kedro-viz/package.json | 4 ++-- gatsby-kedro-viz/src/pages/index.js | 32 +++++++++++++++++++++-------- 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/gatsby-kedro-viz/package.json b/gatsby-kedro-viz/package.json index b351e77..410086c 100644 --- a/gatsby-kedro-viz/package.json +++ b/gatsby-kedro-viz/package.json @@ -5,7 +5,7 @@ "version": "0.1.0", "author": "Kyle Mathews ", "dependencies": { - "@quantumblack/kedro-viz": "^3.2.0", + "@quantumblack/kedro-viz": "3.0.1", "gatsby": "^2.19.7", "gatsby-image": "^2.2.39", "gatsby-plugin-manifest": "^2.2.39", @@ -43,4 +43,4 @@ "bugs": { "url": "https://github.com/gatsbyjs/gatsby/issues" } -} +} \ No newline at end of file diff --git a/gatsby-kedro-viz/src/pages/index.js b/gatsby-kedro-viz/src/pages/index.js index 683d80e..8f3dc4e 100644 --- a/gatsby-kedro-viz/src/pages/index.js +++ b/gatsby-kedro-viz/src/pages/index.js @@ -7,14 +7,28 @@ import SEO from "../components/seo" import data from './default-kedro157.json' import KedroViz from '@quantumblack/kedro-viz'; -const IndexPage = () => ( - - -

default kedro pipeline

-
- -
-
-) +class IndexPage extends React.Component { + constructor(props) { + super(props) + this.state = { + loaded: false + } + this.componentDidMount = () => { + this.setState({ loaded: false }) + + } + } + render() { + return ( + + +

default kedro pipeline

+
+ {this.state.loaded === false ? 'loading' : } +
+
+ ) + } +} export default IndexPage