public ColorChange(args) {
//Get the selected node from diagram’s selected items collection.
let node: NodeModel = this.diagram.selectedItems.nodes[0];
node.style.fill = args.target.value;
this.diagram.dataBind();
}
public StrokeChange(args) {
let node: NodeModel = this.diagram.selectedItems.nodes[0];
node.style.strokeColor = args.target.value;
node.style.strokeWidth = 3;
this.diagram.dataBind();
}
public OnHeight() {
let node: NodeModel = this.diagram.selectedItems.nodes[0];
node.height = 200;
this.diagram.dataBind();
}
public OnWidth() {
let node: NodeModel = this.diagram.selectedItems.nodes[0];
node.width = 200;
this.diagram.dataBind();
} |
how can just updating a property update the node/connector if that property is already bound to some UI element
We updated the sample for your use. Here, we included a color-picker component to let you alter the node's fill and stroke colors as well as a numeric text box to let you change the node's height and width. Refer to the sample below.
Sample
https://stackblitz.com/edit/angular-g1wq1a-61uczh?file=app.component.html |