Skip to content

Problem of calling updateData with same trafficData #131

@starfuxks

Description

@starfuxks

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 {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions