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

Position object is not working in first updateData method. #82

Open
24thdiv opened this issue Jul 28, 2017 · 0 comments
Open

Position object is not working in first updateData method. #82

24thdiv opened this issue Jul 28, 2017 · 0 comments
Labels

Comments

@24thdiv
Copy link

24thdiv commented Jul 28, 2017

Hi, I want to fox the position of nodes so I am adding position:{x:value , y:value} in my regional nodes. I am refreshing my data using socket io every 3 seconds for new values in connections but my nodes and connections remains same. I am using vizceral-react for this project. Now the problem I am facing is that when first time I add data in my react component, nodes position randomly selected but after next iteration it uses my nodes position. I don't know why this is happing. This is my code.


 class App extends Component {

    constructor() {
      super();
       this.state={
         
         isShow:false,
          allowDraggingOfNodes:true
        }
          socket.on('event',function(data){
            self.setState({ trafficData: data, isShow:true });
          });
    }
render() {
    
    return (
      <div>
             <Vizceral traffic={this.state.trafficData}
                  allowDraggingOfNodes={this.state.allowDraggingOfNodes}
               />
       </div>
          
    );
  }
}

Every time I send my data with positions. This issue is common in simple javascript also thats why I created issue here.

@jrsquared jrsquared added the bug label Apr 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants