node add args & input & output
This commit is contained in:
1 parent
6c3a83ce77
commit
f08e0e3c67
3 files changed
+55
-7
No files matched your search
@@ -14,7 +14,7 @@ export interface BehaviorNodeModel {
|
||||
id: number;
|
||||
name: string;
|
||||
desc?: string;
|
||||
args?: string[][3];
|
||||
args?: {[key: string]: any};
|
||||
input?: string[];
|
||||
output?: string;
|
||||
children?: BehaviorNodeModel[];
|
||||
@@ -28,7 +28,7 @@ export interface BehaviorTreeModel {
|
||||
export interface GraphNodeModel extends TreeGraphData {
|
||||
name: string;
|
||||
desc?: string;
|
||||
args?: string[][3];
|
||||
args?: {[key: string]: any};
|
||||
input?: string[];
|
||||
output?: string;
|
||||
children?: GraphNodeModel[];
|
||||
|
||||
+4
-4
@@ -26,15 +26,15 @@ export const refreshNodeId = (nodeData: GraphNodeModel, id?: number) => {
|
||||
|
||||
export const calcTreeNodeSize = (treeNode: GraphNodeModel) => {
|
||||
var height = 40;
|
||||
const updateHeight = (arr: any) => {
|
||||
if(arr && arr.length > 0) {
|
||||
height += 30;
|
||||
const updateHeight = (obj: any) => {
|
||||
if (Array.isArray(obj) || (obj && Object.keys(obj).length > 0)) {
|
||||
height += 25;
|
||||
}
|
||||
}
|
||||
updateHeight(treeNode.args);
|
||||
updateHeight(treeNode.input);
|
||||
updateHeight(treeNode.output);
|
||||
return [150, height];
|
||||
return [200, height];
|
||||
}
|
||||
|
||||
export const createTreeData = (bNode: BehaviorNodeModel) => {
|
||||
|
||||
Reference in new issue
Block a user