fix: 修改了节点下标文本的底层实现

This commit is contained in:
黎智洲
2021-12-14 19:13:26 +08:00
parent 6a0139eaeb
commit e1a69b5e91
18 changed files with 14563 additions and 495 deletions
+13 -13
View File
@@ -16,18 +16,17 @@ SV.registerLayout('Array', {
defineOptions() {
return {
element: {
node: {
default: {
type: 'indexed-node',
type: 'rect',
label: '[id]',
size: [60, 30],
labelOptions: {
style: { fontSize: 20 }
},
style: {
stroke: '#333',
fill: '#95e1d3'
},
indexOptions: {
index: { position: 'bottom' },
indexTop: { position: 'top' }
}
}
},
@@ -47,8 +46,9 @@ SV.registerLayout('Array', {
}
}
},
behavior: {
dragNode: false
indexLabel: {
index: { position: 'bottom' },
indexRight: { position: 'right' }
}
};
},
@@ -84,7 +84,7 @@ SV.registerLayout('Array', {
defineOptions() {
return {
element: {
node: {
default: {
type: 'indexed-node',
label: '[id]',
@@ -92,10 +92,6 @@ SV.registerLayout('Array', {
style: {
stroke: '#333',
fill: '#355c7d'
},
indexOptions: {
index: { position: 'bottom' },
indexTop: { position: 'top' }
}
}
},
@@ -114,6 +110,10 @@ SV.registerLayout('Array', {
fill: '#f08a5d'
}
}
},
indexLabel: {
index: { position: 'bottom' },
indexTop: { position: 'top' }
}
};
},
+10 -16
View File
@@ -1,11 +1,3 @@
/*
* @Author: your name
* @Date: 2021-12-12 20:35:54
* @LastEditTime: 2021-12-13 21:31:01
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \froend_studentc:\Users\13127\Desktop\最近的前端文件\可视化源码\StructV2\demoV2\Layouter\PTree.js
*/
// 解析数据:
// {
@@ -50,27 +42,29 @@ SV.registerLayout('PTree', {
return sources;
},
defineOptions() {
return {
node: {
default: {
type: 'indexed-node',
type: 'rect',
label: '[data]',
size: [40, 40],
labelOptions: {
style: { fontSize: 16 }
},
style: {
stroke: '#333',
fill: '#95e1d3',
offset: 25
},
indexOptions: {
index: { position: 'top' },
indexLeft: { position: 'left' }
}
},
},
behavior: {
dragNode: false
}
indexLabel: {
index: { position: 'top' },
indexLeft: { position: 'left' }
}
};
},