Skip to content

Commit

Permalink
fix: add graph reference on model
Browse files Browse the repository at this point in the history
  • Loading branch information
bubkoo committed May 14, 2020
1 parent f510dc8 commit 9f5e88d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/x6/src/core/graph.ts
Expand Up @@ -295,6 +295,7 @@ export class Graph extends View<Graph.EventArgs> {

setModel(model: Model) {
this.model = model == null ? this.createModel() : model
this.model.graph = this
}

init() {
Expand Down
2 changes: 1 addition & 1 deletion packages/x6/src/core/model.ts
Expand Up @@ -14,7 +14,7 @@ export class Model extends Basecoat<Model.EventArgs> {
protected readonly batches: KeyValue<number> = {}
protected readonly addings: WeakMap<Cell, boolean> = new WeakMap()

protected graph: Graph | null
public graph: Graph | null
protected nodes: KeyValue<boolean> = {}
protected edges: KeyValue<boolean> = {}

Expand Down

0 comments on commit 9f5e88d

Please sign in to comment.