增加^符号

This commit is contained in:
zgt
2022-02-23 22:48:01 +08:00
parent fd4b0f6054
commit e23c87e732
4 changed files with 141 additions and 11599 deletions
+34
View File
@@ -63,6 +63,40 @@ SV.registerShape('three-cell-node', {
}); });
} }
//节点没有原子时
if(!cfg.sub){
group.addShape('text', {
attrs: {
x: width,
y: height * ( 8 / 7),
textAlign: 'center',
textBaseline: 'middle',
text: '^',
fill: '#000',
fontSize: 20,
},
name: 'text',
draggable: true
});
}
//节点没有子表时
if(!cfg.next){
group.addShape('text', {
attrs: {
x: width * (4 / 3),
y: height * ( 8 / 7),
textAlign: 'center',
textBaseline: 'middle',
text: '^',
fill: '#000',
fontSize: 20,
},
name: 'text',
draggable: true
});
}
return wrapperRect; return wrapperRect;
}, },
Vendored
+31 -11598
View File
File diff suppressed because one or more lines are too long
+39 -1
View File
@@ -1,3 +1,4 @@
import { Util } from '../Common/util'; import { Util } from '../Common/util';
@@ -35,8 +36,10 @@ export default Util.registerShape('binary-tree-node', {
draggable: true draggable: true
}); });
const style = (cfg.labelCfg && cfg.labelCfg.style) || {};
if (cfg.label) { if (cfg.label) {
const style = (cfg.labelCfg && cfg.labelCfg.style) || {};
group.addShape('text', { group.addShape('text', {
attrs: { attrs: {
x: width, // 居中 x: width, // 居中
@@ -53,6 +56,41 @@ export default Util.registerShape('binary-tree-node', {
}); });
} }
//节点没有左孩子节点时
if(cfg.child[0] == "0x0"){
group.addShape('text', {
attrs: {
x: width * (5 / 8),
y: height * ( 8 / 7),
textAlign: 'center',
textBaseline: 'middle',
text: '^',
fill: style.fill || '#000',
fontSize: 18,
cursor: cfg.style.cursor,
},
name: 'text',
draggable: true
});
}
//节点没有右孩子节点时
if(cfg.child[1] == "0x0"){
group.addShape('text', {
attrs: {
x: width * (11 / 8),
y: height * ( 8 / 7),
textAlign: 'center',
textBaseline: 'middle',
text: '^',
fill: style.fill || '#000',
fontSize: 18,
cursor: cfg.style.cursor,
},
name: 'text',
draggable: true
});
}
return wrapperRect; return wrapperRect;
}, },
+37
View File
@@ -87,7 +87,44 @@ export default Util.registerShape('two-cell-node', {
}); });
} }
} }
console.log(cfg);
//图 数据结构中没有后续指针
if(cfg.id.includes('tableHeadNode') && !cfg.headNext){
group.addShape('text', {
attrs: {
x: width * (5 / 4),
y: height * ( 8 / 7),
textAlign: 'center',
textBaseline: 'middle',
text: '^',
fill: style.fill || '#000',
fontSize: 20,
cursor: cfg.style.cursor,
},
name: 'text',
draggable: true
});
}
//哈希表 数据结构中没有后续指针
if(cfg.id.includes('head') && !cfg.start){
group.addShape('text', {
attrs: {
x: width * (5 / 4),
y: height * ( 8 / 7),
textAlign: 'center',
textBaseline: 'middle',
text: '^',
fill: style.fill || '#000',
fontSize: 20,
cursor: cfg.style.cursor,
},
name: 'text',
draggable: true
});
}
return wrapperRect; return wrapperRect;
}, },