dddd
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

30 lines
720 B

export default function registerTask (lf) {
lf.register('task', ({ RectNode, RectNodeModel, h }) => {
class View extends RectNode {
getShape() {
const style = this.getShapeStyle();
console.log(style);
const { width, height } = style;
const { x, y } = this.getAttributes();
const position = {
x: x - width / 2,
y: y- height / 2,
}
return h("rect", {
...style,
...position,
});
}
}
class Model extends RectNodeModel {
constructor (data, graphModel) {
super(data, graphModel)
this.radius = 20;
}
}
return {
view: View,
model: Model
}
})
}