Hi Team,
I have simple group template and i want to define custom selection adornment to it, but it doesnt seem to work.
here is my code.
export const groupTemplate = (minWidth: number, minHeight: number, color: string, groupZOrder: zOrder) => {
return $(
Group,
'Auto',
groupShadow(),
settings(),
{ selectable: true },
{ zOrder: groupZOrder },
{ minSize: new Size(minWidth, minHeight) },
{ layout: diagramTreeLayout() },
{ isLayoutPositioned: true },
roundedPanel(
color,
true,
'flowShape',
{ alignment: Spot.Center },
selectionAdornment('flowShape'),
),
);
export const selectionAdornment = (
...props: PartialShape[]
): { [selectionAdornmentTemplate: string]: Adornment } => {
return {
selectionAdornmentTemplate: $(
Adornment,
'Auto',
$(Shape, 'RoundedRectangle', { parameter1: 4 }, { strokeWidth: 2, stroke: 'red' }, ...props),
$(Placeholder),
),
};
};
for some reason, it doesnt seem to work.
infact if i even remove the custom adornment, the default blue border should anyway show up around the group, but even that doesnt seem to show up on canvas, when i click over the group.
i also tried to to set { selectable: true },
, still no use.
is there anything wrong with my code and also i observed that the ChangedSelection
event is never triggered on the diagram object, when I interact with the group.
diagram.addDiagramListener('ChangedSelection', (event: DiagramEvent) => {
console.log('change event', event);
});
any quick help would be really appreciated @walter