Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usage with React App #10

Open
ghost opened this issue Jul 14, 2017 · 4 comments
Open

Usage with React App #10

ghost opened this issue Jul 14, 2017 · 4 comments

Comments

@ghost
Copy link

ghost commented Jul 14, 2017

Is there a way to use neo4jd3 with React app ?

@dougajmcdonald
Copy link

I got this working in my react app in the following way:

General:

  • npm i neo4jd3
  • add a reference to d3 from a cdn in your index page

In the component:

import React from 'react'
import Neo4JD3 from 'neo4jd3'

class Graph extends React.Component {

  componentDidMount() {
    this.props.getGraph() // this sets a state property in my app with the neo4j data
  }

  componentDidUpdate(prevProps, prevState) {

    const { data } = this.props; // the data retreived from getGraph() is passed to the component through props

    if(data) {
      new Neo4JD3('#graph', {
        neo4jData: data,
        minCollision: 75,
        nodeRadius: 20
      })
    }
  }

  render() {
    return <GraphGrid>
      <TableTitle>Graph visualisation</TableTitle>
      <Panel>
        <GraphContainer id="graph"></GraphContainer>
      </Panel>
    </GraphGrid>
  }

}

export default Graph

@chandra155
Copy link

not working.. getting lots of error. GraphGrid, TableTitle, Panel, GraphContainer not defined

@MoMoWongHK
Copy link

not working.. getting lots of error. GraphGrid, TableTitle, Panel, GraphContainer not defined

how to fix this

@nitinreddy3
Copy link

nitinreddy3 commented Jul 22, 2020

not working.. getting lots of error. GraphGrid, TableTitle, Panel, GraphContainer not defined

how to fix this

It was an example. You can remove those Components and create your own

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants