Skip to content

Commit 3724b9e

Browse files
committed
remove source and unobserve state
1 parent 72eaa76 commit 3724b9e

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

src/model.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ export class DrawIODocumentModel implements DocumentRegistry.IModel {
115115
const cells = source.match(patternCells);
116116

117117
this.transact(() => {
118-
this.sharedModel.setSource(source);
118+
//this.sharedModel.setSource(source);
119119

120120
attrs.forEach(attr => {
121121
const patternAttr = new RegExp(/(?<key>\w+)="(?<value>[^"]*)"/g);
@@ -230,6 +230,7 @@ export class YDrawIO extends YDocument<IDrawIOChange> {
230230
* Dispose of the resources.
231231
*/
232232
dispose(): void {
233+
this._state.unobserve(this._stateObserver);
233234
this._root.unobserve(this._rootObserver);
234235
}
235236

testfiles/test.dio

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22
<root>
33
<mxCell id="0"/>
44
<mxCell id="1" parent="0"/>
5-
<mxCell id="3" value="" style="shape=hexagon;perimeter=hexagonPerimeter2;whiteSpace=wrap;html=1;fillColor=#97D077;" parent="1" vertex="1"><mxGeometry x="558" y="341" width="120" height="80" as="geometry"/></mxCell>
6-
<mxCell id="4" value="" style="shape=hexagon;perimeter=hexagonPerimeter2;whiteSpace=wrap;html=1;fillColor=#FFD966;" parent="1" vertex="1"><mxGeometry x="149" y="341" width="120" height="80" as="geometry"/></mxCell>
7-
<mxCell id="6" value=": )" style="shape=umlActor;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;html=1;" parent="1" vertex="1"><mxGeometry x="170" y="490" width="100" height="160" as="geometry"/></mxCell>
8-
<mxCell id="8" value="" style="shape=image;imageAspect=0;aspect=fixed;verticalLabelPosition=bottom;verticalAlign=top;image=https://quantstack.net/img/logo.svg;" parent="1" vertex="1"><mxGeometry x="209" y="168" width="409" height="105" as="geometry"/></mxCell>
9-
<mxCell id="9" value="" style="shape=image;imageAspect=0;aspect=fixed;verticalLabelPosition=bottom;verticalAlign=top;image=https://camo.githubusercontent.com/3a5e37dc07744e58761dc92794e7c6414e1cf3966aab3fadf088194c9f6b1a36/68747470733a2f2f796a732e6465762f696d616765732f6c6f676f2f796a732d313230783132302e706e67;" parent="1" vertex="1"><mxGeometry x="354" y="360" width="120" height="120" as="geometry"/></mxCell>
10-
<mxCell id="10" value="" style="shape=hexagon;perimeter=hexagonPerimeter2;whiteSpace=wrap;html=1;fillColor=#7EA6E0;" parent="1" vertex="1"><mxGeometry x="354" y="545" width="120" height="80" as="geometry"/></mxCell>
5+
<mxCell id="3" value="" style="shape=hexagon;perimeter=hexagonPerimeter2;whiteSpace=wrap;html=1;fillColor=#97D077;" parent="1" vertex="1"><mxGeometry x="530" y="538" width="120" height="80" as="geometry"/></mxCell>
6+
<mxCell id="4" value="" style="shape=hexagon;perimeter=hexagonPerimeter2;whiteSpace=wrap;html=1;fillColor=#FFD966;" parent="1" vertex="1"><mxGeometry x="122" y="538" width="120" height="80" as="geometry"/></mxCell>
7+
<mxCell id="9" value="" style="shape=image;imageAspect=0;aspect=fixed;verticalLabelPosition=bottom;verticalAlign=top;image=https://camo.githubusercontent.com/3a5e37dc07744e58761dc92794e7c6414e1cf3966aab3fadf088194c9f6b1a36/68747470733a2f2f796a732e6465762f696d616765732f6c6f676f2f796a732d313230783132302e706e67;" parent="1" vertex="1"><mxGeometry x="326" y="650" width="120" height="120" as="geometry"/></mxCell>
8+
<mxCell id="10" value="" style="shape=hexagon;perimeter=hexagonPerimeter2;whiteSpace=wrap;html=1;fillColor=#7EA6E0;" parent="1" vertex="1"><mxGeometry x="326" y="833" width="120" height="80" as="geometry"/></mxCell>
9+
<mxCell id="11" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;entryX=0.02;entryY=0.516;entryPerimeter=0;jettySize=auto;orthogonalLoop=1;" parent="1" source="4" target="3" edge="1"><mxGeometry relative="1" as="geometry"/></mxCell>
10+
<mxCell id="12" value="" style="shape=image;imageAspect=0;aspect=fixed;verticalLabelPosition=bottom;verticalAlign=top;image=https://quantstack.net/img/logo.svg;" parent="1" vertex="1"><mxGeometry x="102" y="270" width="623" height="160" as="geometry"/></mxCell>
11+
<mxCell id="13" value="" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1"><mxGeometry x="320" y="90" width="120" height="60" as="geometry"/></mxCell>
12+
<mxCell id="14" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;jettySize=auto;orthogonalLoop=1;" edge="1" parent="1" source="13" target="12"><mxGeometry relative="1" as="geometry"/></mxCell>
1113
</root>
1214
</mxGraphModel>

0 commit comments

Comments
 (0)