Quantcast
Channel: Northwoods Software - Latest topics
Viewing all articles
Browse latest Browse all 7425

Adornment for link with a label panel

$
0
0

@anvlkv wrote:

Hello,

How would you make a link adornment that outlines link and it's label?

By default link looks like this:

The closest I came to is:

selectionAdornmentTemplate: $(go.Adornment, 'Auto', $(go.Shape, {
	fill: null,
	stroke: 'dodgerblue',
	strokeWidth: 3
}, new go.Binding('geometry', '', (data, part) => {
		let diagram = part.diagram;
		let geometry;
		if (diagram && diagram.selection) {
			diagram.selection.each((selection) => {
				if (selection.data === data) {
					geometry = selection.geometry.copy();
					selection.elements.each((el) => {
						combineFigures(el, geometry);
					})
				}
			})
		}
		return geometry;
	})
))

And

function combineFigures(el, geometry) {

	if (el.geometry) {
		el.geometry.figures.each((fig) => {
			geometry.add(fig)
		})
	}
	else if (el.panel) {
		combineFigures(el.panel, geometry);
	}
}

But it seems that link label is passes by and I got almost same arrow.

Posts: 4

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 7425

Latest Images

Trending Articles



Latest Images