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

Problem of calling updateData with same trafficData #131

Open
starfuxks opened this issue Jul 19, 2018 · 1 comment
Open

Problem of calling updateData with same trafficData #131

starfuxks opened this issue Jul 19, 2018 · 1 comment

Comments

@starfuxks
Copy link

starfuxks commented Jul 19, 2018

For example, after executing following code, all nodes will be one on top of another in the view.

const trafficData1 = dataInFrame1;
const trafficData2 = dataInFrame2;

viz.updateData(trafficData1);
// do some stuff
viz.updateData(trafficData2);
// do other stuff
viz.updateData(trafficData1);

I reviewed the source code. Found that ltrTreeLayout()'s cache is the key.

Code will push a map of three elements in the cache.

cachePositions (nodeKey, edgeKey, positions) {
    this.cache.push({
      nodeKey: nodeKey,
      edgeKey: edgeKey,
      positions: positions
    });
  }

But using cache as a object that represents positions alone in the following execution after line 75. so bug emerges.

const existingPositions = this.findPositions(nodeKey, edgeKey);
if (existingPositions) {
  this.layoutPositions(graph, existingPositions);
  layoutComplete();
} else {
@voelzmo
Copy link

voelzmo commented Aug 9, 2018

does it look like this? Netflix/vizceral-react#8

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

2 participants