Skip to content

Commit

Permalink
fix: should use id in json data as cell's id
Browse files Browse the repository at this point in the history
  • Loading branch information
bubkoo committed Feb 19, 2020
1 parent 431ca27 commit 24d4cfb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/x6/src/graph/creation-manager.ts
Expand Up @@ -53,6 +53,7 @@ export class CreationManager extends BaseManager {
const { parent, id, ...dataItem } = nodeDataMap[i]
nodeMap[i] = this.graph.addNode({
...dataItem,
id,
data: { ...nodeDataMap[i] },
parent: parentGroup,
})
Expand All @@ -70,6 +71,7 @@ export class CreationManager extends BaseManager {
if (nodeMap[id] == null) {
nodeMap[id] = this.graph.addNode({
...dataItem,
id,
data: { ...item },
parent: parent ? nodeMap[parent] : undefined,
})
Expand All @@ -83,6 +85,7 @@ export class CreationManager extends BaseManager {
if (edgeMap[id] == null) {
edgeMap[id] = this.graph.addEdge({
...dataItem,
id,
data: { ...item },
parent: parent != null ? nodeMap[parent] : undefined,
source: source != null ? nodeMap[source] : undefined,
Expand Down

0 comments on commit 24d4cfb

Please sign in to comment.