Skip to content

Commit

Permalink
Merge pull request #58 from MetaCell/feature/psyneu-56
Browse files Browse the repository at this point in the history
serialisables for ports
  • Loading branch information
ddelpiano authored Jul 17, 2023
2 parents cc29d89 + eb58bc0 commit 9c89333
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/models/MetaPort.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,12 @@ export class MetaPort {
getType(): string {
return this.type;
}

serialise(): any {
return {
'id': this.getId(),
'name': this.getName(),
'type': this.getType(),
};
}
}
15 changes: 14 additions & 1 deletion src/react-diagrams/MetaNodeModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,15 @@ export class MetaNodeModel extends NodeModel {
return this.getOptions()[label];
}

setLoggable(loggable: string, value: any, triggerUpdate?: boolean | undefined) {
// TODO: we need to move this away from meta-diagram but I don't really have time to think about this atm
// @ts-ignore
this.options['Loggables'][loggable] = value;
if (triggerUpdate) {
this.flagUpdate(CallbackTypes.OPTIONS_UPDATED);
}
}

getId(): string[] {
return [...this.getOption('id')];
}
Expand Down Expand Up @@ -107,7 +116,11 @@ export class MetaNodeModel extends NodeModel {
});
return {
...super.serialize(),
...additionalParams,
'name': this.getOption('name'),
'graphPath': this.getOption('graphPath'),
'class_inputs': {
...additionalParams,
}
};
}
}

0 comments on commit 9c89333

Please sign in to comment.