Files
react-diagrams/demos/demo-custom-node1/DiamondPortModel.ts
2018-01-04 21:45:23 +02:00

23 lines
439 B
TypeScript

import * as SRD from "../../src/main";
import * as _ from "lodash";
export class DiamondPortModel extends SRD.PortModel {
position: string | "top" | "bottom" | "left" | "right";
constructor(pos: string = "top") {
super(pos);
this.position = pos;
}
serialize() {
return _.merge(super.serialize(), {
position: this.position
});
}
deSerialize(data: any) {
super.deSerialize(data);
this.position = data.position;
}
}