Do u mean this one?
export class ActivityShape extends BaseShape {
constructor(data: MinShapeConstructionProperties<ActivityShape>) {
super(data);
Object.assign(this, { ...data });
this.category = CanvasShapesCategory.ACTIVITY;
}
public static getTemplate(contextMenu: go.Adornment | go.HTMLInfo): go.Node {
const $ = go.GraphObject.make;
return $(
go.Node,
"Spot",
{
shadowColor: "rgb(0,0,0,0.2)",
shadowBlur: 6,
shadowOffset: new go.Point(0, 2),
isShadowed: true,
contextMenu,
linkValidation: GRAPH_CONFIG.LINK_VALIDATIONS.ACTIVITY,
},
new go.Binding("location", "position", parseNodeLocation).makeTwoWay(
convertNodeLocationPoint
),
{
locationSpot: go.Spot.Center,
},
new go.Binding("isSelected", "isSelected").makeTwoWay(),
blurIfPlaceholder(),
toolTipHandler(),
$(
go.Panel,
"Auto",
{
padding: 2,
},
$(
go.Shape,
"RoundedRectangle",
{
fill: GRAPH_CONFIG.SHAPE_COLORS.whiteColor,
width: 220,
height: 70,
name: GRAPH_CONFIG.ERROR_BLOCK_NAME.SHAPE_BLOCK,
shadowVisible: true,
margin: new go.Margin(0),
},
new go.Binding("figure", "shape"),
new go.Binding("stroke", "", (node: go.Node) => {
const { isSelected } = node;
const { syncState } = node?.data;
if (syncState?.status !== CanvasEntityState.Invalid) {
return isSelected
? GRAPH_CONFIG.SHAPE_COLORS.blueColor
: GRAPH_CONFIG.SHAPE_COLORS.whiteColor;
}
}).ofObject(),
new go.Binding("fill", "", (node: go.Node) => {
const { isSelected } = node;
const { syncState } = node?.data;
if (syncState?.status !== CanvasEntityState.Invalid) {
return isSelected
? GRAPH_CONFIG.SHAPE_COLORS.activityHighlightColor
: GRAPH_CONFIG.SHAPE_COLORS.whiteColor;
}
}).ofObject(),
new go.Binding("height", "isLooped", (isLoooped: boolean) => {
return isLoooped ? 80 : 70;
}),
canvasValidationHandler("errorRedColor", "whiteColor", "stroke"),
canvasValidationHandler("lightRedColor", "whiteColor", "fill"),
),
$(
go.TextBlock,
{
alignment: go.Spot.Left,
margin: new go.Margin(-20, 0, 0, 10),
stroke: "#060322",
font: "600 14px sans-serif",
editable: true,
isActionable: true,
isMultiline: true,
width: 188,
shadowVisible: false,
overflow: go.TextBlock.OverflowEllipsis,
maxLines: 1,
textValidation: GRAPH_CONFIG.TEXT_VALIDATIONS.ACTIVITY,
textEdited: GRAPH_CONFIG.TEXT_EDITED.ACTIVITY,
text: "Untitled Activity",
},
new go.Binding("text", "name").makeTwoWay(),
new go.Binding("margin", "isLooped", (isLoooped: boolean) => {
return isLoooped
? new go.Margin(-26, 0, 0, 10)
: new go.Margin(-20, 0, 0, 10);
}),
hideIfPlaceholder()
),
//#region AHT
$(
go.Panel,
{
padding: 0,
alignment: go.Spot.Left,
margin: new go.Margin(28, 0, 0, 5),
},
new go.Binding("margin", "isLooped", (isLoooped: boolean) => {
return isLoooped
? new go.Margin(14, 0, 0, 5)
: new go.Margin(28, 0, 0, 5);
}),
$(go.Picture, {
maxSize: new go.Size(11, 11),
margin: new go.Margin(5, 0, 0, 5),
source: "assets/sds/images/gojs/schedule.svg",
}),
$(
go.TextBlock,
{
alignment: go.Spot.Left,
margin: new go.Margin(5, 0, 0, 17),
stroke: "#060322",
font: "400 12px sans-serif",
editable: true,
shadowVisible: false,
isActionable: true,
isMultiline: true,
maxLines: 1,
textValidation: GRAPH_CONFIG.TEXT_VALIDATIONS.ACTIVITY,
textEdited: GRAPH_CONFIG.TEXT_EDITED.ACTIVITY,
},
new go.Binding("text", "aht", (data: string) => {
return data + " " + (parseFloat(data) > 1 ? "mins" : "min");
})
),
new go.Binding("visible", "aht", (data: number) => !!data),
hideIfPlaceholder()
),
//#endregion
//#region COST
$(
go.Panel,
{
padding: 0,
margin: new go.Margin(28, 0, 0, 75),
alignment: go.Spot.Left,
},
new go.Binding("margin", "isLooped", (isLoooped: boolean) => {
return isLoooped
? new go.Margin(14, 0, 0, 75)
: new go.Margin(28, 0, 0, 75);
}),
$(go.Picture, {
maxSize: new go.Size(11, 11),
margin: new go.Margin(5, 0, 0, 5),
source: "assets/sds/images/gojs/activity_coin.svg",
}),
$(
go.TextBlock,
{
alignment: go.Spot.Left,
margin: new go.Margin(5, 0, 0, 17),
stroke: "#060322",
font: "400 12px sans-serif",
editable: true,
shadowVisible: false,
isActionable: true,
isMultiline: true,
maxLines: 1,
textValidation: GRAPH_CONFIG.TEXT_VALIDATIONS.ACTIVITY,
textEdited: GRAPH_CONFIG.TEXT_EDITED.ACTIVITY,
},
new go.Binding("text", "cost", (data: string) => "$ " + data)
),
new go.Binding("visible", "cost", (data: number) => !!data),
hideIfPlaceholder()
),
//#endregion
//#region Loop icon
$(
go.Panel,
{
alignment: go.Spot.BottomCenter,
margin: new go.Margin(4, 0, 3, 0),
visible: false,
},
$(go.Picture, {
maxSize: new go.Size(13, 13),
source: "assets/sds/images/gojs/loop_icon.svg",
}),
new go.Binding("visible", "isLooped")
)
//#endregion
),
...ENTITY_PORTS.ACTIVITY,
GRAPH_CONFIG.REMOVE_DEFAULT_BORDER
);
}
}
let me know if you were asking for this code or not.