Merge branch 'hotfix/cjc' into 'main'
增加进入新函数不计算泄露结点的功能 See merge request phenomLi/StructV2!9
This commit is contained in:
commit
b3b31edd85
@ -98,142 +98,140 @@
|
||||
"BinaryTree0": {
|
||||
"data": [{
|
||||
"external": [
|
||||
"T1"
|
||||
"T"
|
||||
],
|
||||
"child": [
|
||||
"0x617ee0",
|
||||
"0x617f10"
|
||||
"0x616060",
|
||||
"0x615f40"
|
||||
],
|
||||
"id": "0x617eb0",
|
||||
"name": "T1",
|
||||
"data": "Z",
|
||||
"id": "0x615f10",
|
||||
"name": "T",
|
||||
"data": "F",
|
||||
"root": true,
|
||||
"type": "default"
|
||||
}, {
|
||||
"child": [
|
||||
"0x0",
|
||||
"0x0"
|
||||
"0x616090"
|
||||
],
|
||||
"id": "0x617ee0",
|
||||
"name": "T1->lchild",
|
||||
"id": "0x616060",
|
||||
"name": "T->lchild",
|
||||
"data": "A",
|
||||
"type": "default"
|
||||
}, {
|
||||
"child": [
|
||||
"0x0",
|
||||
"0x6160c0",
|
||||
"0x0"
|
||||
],
|
||||
"id": "0x617f10",
|
||||
"name": "T1->rchild",
|
||||
"data": "B",
|
||||
"type": "default",
|
||||
"external": [
|
||||
"r",
|
||||
"t"
|
||||
]
|
||||
}],
|
||||
"layouter": "BinaryTree"
|
||||
},
|
||||
"BinaryTree3": {
|
||||
"data": [{
|
||||
"external": [
|
||||
"T2",
|
||||
"r2"
|
||||
],
|
||||
"child": [
|
||||
"0x617f70",
|
||||
"0x0"
|
||||
],
|
||||
"id": "0x617f40",
|
||||
"name": "T2",
|
||||
"data": "Z",
|
||||
"root": true,
|
||||
"id": "0x616090",
|
||||
"name": "(T->lchild)->rchild",
|
||||
"data": "E",
|
||||
"type": "default"
|
||||
}, {
|
||||
"child": [
|
||||
"0x0",
|
||||
"0x0"
|
||||
],
|
||||
"id": "0x617f70",
|
||||
"name": "T2->lchild",
|
||||
"id": "0x6160c0",
|
||||
"name": "((T->lchild)->rchild)->lchild",
|
||||
"data": "D",
|
||||
"type": "default",
|
||||
"external": [
|
||||
"t2"
|
||||
]
|
||||
"type": "default"
|
||||
}, {
|
||||
"child": [
|
||||
"0x615f70",
|
||||
"0x615fd0"
|
||||
],
|
||||
"id": "0x615f40",
|
||||
"name": "T->rchild",
|
||||
"data": "U",
|
||||
"type": "default"
|
||||
}, {
|
||||
"child": [
|
||||
"0x615fa0",
|
||||
"0x616000"
|
||||
],
|
||||
"id": "0x615f70",
|
||||
"name": "(T->rchild)->lchild",
|
||||
"data": "S",
|
||||
"type": "default"
|
||||
}, {
|
||||
"child": [
|
||||
"0x0",
|
||||
"0x0"
|
||||
],
|
||||
"id": "0x615fa0",
|
||||
"name": "((T->rchild)->lchild)->lchild",
|
||||
"data": "R",
|
||||
"type": "default"
|
||||
}, {
|
||||
"child": [
|
||||
"0x0",
|
||||
"0x0"
|
||||
],
|
||||
"id": "0x616000",
|
||||
"name": "((T->rchild)->lchild)->rchild",
|
||||
"data": "T",
|
||||
"type": "default"
|
||||
}, {
|
||||
"child": [
|
||||
"0x0",
|
||||
"0x616030"
|
||||
],
|
||||
"id": "0x615fd0",
|
||||
"name": "(T->rchild)->rchild",
|
||||
"data": "V",
|
||||
"type": "default"
|
||||
}, {
|
||||
"child": [
|
||||
"0x0",
|
||||
"0x0"
|
||||
],
|
||||
"id": "0x616030",
|
||||
"name": "((T->rchild)->rchild)->rchild",
|
||||
"data": "X",
|
||||
"type": "default"
|
||||
}],
|
||||
"layouter": "BinaryTree"
|
||||
}
|
||||
},
|
||||
"isEnterFunction": true
|
||||
}, {
|
||||
"BinaryTree0": {
|
||||
"data": [{
|
||||
"external": [
|
||||
"T1"
|
||||
"T"
|
||||
],
|
||||
"child": [
|
||||
"0x617ee0",
|
||||
"0x617f10"
|
||||
"0x0",
|
||||
"0x616090"
|
||||
],
|
||||
"id": "0x617eb0",
|
||||
"name": "T1",
|
||||
"data": "Z",
|
||||
"id": "0x616060",
|
||||
"name": "T",
|
||||
"data": "A",
|
||||
"root": true,
|
||||
"type": "default"
|
||||
}, {
|
||||
"child": [
|
||||
"0x6160c0",
|
||||
"0x0"
|
||||
],
|
||||
"id": "0x616090",
|
||||
"name": "T->rchild",
|
||||
"data": "E",
|
||||
"type": "default"
|
||||
}, {
|
||||
"child": [
|
||||
"0x0",
|
||||
"0x0"
|
||||
],
|
||||
"id": "0x617ee0",
|
||||
"name": "T1->lchild",
|
||||
"data": "A",
|
||||
"type": "default"
|
||||
}, {
|
||||
"child": [
|
||||
"0x0",
|
||||
"0x617eb0"
|
||||
],
|
||||
"id": "0x617f10",
|
||||
"name": "T1->rchild",
|
||||
"data": "B",
|
||||
"id": "0x6160c0",
|
||||
"name": "(T->rchild)->lchild",
|
||||
"data": "D",
|
||||
"type": "default"
|
||||
}],
|
||||
"layouter": "BinaryTree"
|
||||
},
|
||||
|
||||
"BinaryTree3": {
|
||||
"data": [{
|
||||
"external": [
|
||||
"T2",
|
||||
"r2"
|
||||
],
|
||||
"child": [
|
||||
"0x617f70",
|
||||
"0x0"
|
||||
],
|
||||
"id": "0x617f40",
|
||||
"name": "T2",
|
||||
"data": "Z",
|
||||
"root": true,
|
||||
"type": "default"
|
||||
}, {
|
||||
"child": [
|
||||
"0x0",
|
||||
"0x0"
|
||||
],
|
||||
"id": "0x617f70",
|
||||
"name": "T2->lchild",
|
||||
"data": "D",
|
||||
"type": "default",
|
||||
"external": [
|
||||
"t2"
|
||||
]
|
||||
}],
|
||||
"layouter": "BinaryTree"
|
||||
}
|
||||
}
|
||||
|
||||
];
|
||||
"isEnterFunction": true
|
||||
}];
|
||||
|
||||
let dataIndex = 0,
|
||||
curData = data[dataIndex];
|
||||
|
11621
dist/sv.js
vendored
11621
dist/sv.js
vendored
File diff suppressed because one or more lines are too long
@ -367,9 +367,9 @@ export class Reconcile {
|
||||
* @param accumulateLeakModels
|
||||
* @returns
|
||||
*/
|
||||
public diff(layoutGroupTable: LayoutGroupTable, prevModelList: SVModel[], modelList: SVModel[], accumulateLeakModels: SVModel[]): DiffResult {
|
||||
public diff(layoutGroupTable: LayoutGroupTable, prevModelList: SVModel[], modelList: SVModel[], accumulateLeakModels: SVModel[], isEnterFunction: boolean): DiffResult {
|
||||
const continuousModels: SVModel[] = this.getContinuousModels(prevModelList, modelList);
|
||||
const leakModels: SVModel[] = this.getLeakModels(layoutGroupTable, prevModelList, modelList);
|
||||
const leakModels: SVModel[] = isEnterFunction? []: this.getLeakModels(layoutGroupTable, prevModelList, modelList);
|
||||
const appendModels: SVModel[] = this.getAppendModels(prevModelList, modelList, accumulateLeakModels);
|
||||
const removeModels: SVModel[] = this.getRemoveModels(prevModelList, modelList);
|
||||
const updateModels: SVModel[] = [
|
||||
|
@ -140,9 +140,9 @@ export class ViewContainer {
|
||||
* @param models
|
||||
* @param layoutFn
|
||||
*/
|
||||
render(layoutGroupTable: LayoutGroupTable) {
|
||||
render(layoutGroupTable: LayoutGroupTable, isEnterFunction: boolean) {
|
||||
const modelList = Util.convertGroupTable2ModelList(layoutGroupTable),
|
||||
diffResult = this.reconcile.diff(this.layoutGroupTable, this.prevModelList, modelList, this.accumulateLeakModels),
|
||||
diffResult = this.reconcile.diff(this.layoutGroupTable, this.prevModelList, modelList, this.accumulateLeakModels, isEnterFunction),
|
||||
renderModelList = [
|
||||
...modelList,
|
||||
...diffResult.REMOVE,
|
||||
|
@ -67,7 +67,7 @@ export class Engine {
|
||||
const layoutGroupTable = this.modelConstructor.construct(source);
|
||||
|
||||
// 2 渲染(使用g6进行渲染)
|
||||
this.viewContainer.render(layoutGroupTable);
|
||||
this.viewContainer.render(layoutGroupTable, source.isEnterFunction as boolean);
|
||||
}
|
||||
|
||||
|
||||
|
@ -19,7 +19,8 @@ export type Sources = {
|
||||
[key: string]: {
|
||||
data: SourceNode[];
|
||||
layouter: string;
|
||||
}
|
||||
};
|
||||
isEnterFunction?: any;
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user