How to use goxam custom partmanager in gojs

How to use goxam base.set_PartManager(new CustomPartManager()); in gojs

The GoXam PartManager was merged into the Diagram class for GoJS.

In goxam we can override this method PartManager.OnNodeAdded(Node node) & PartManager.OnNodeRemoving.

In Gojs, I think we don’t have OnNodeAdded, OnNodeRemoving methods. Is there event available for this methods in gojs. If so, Shall we override these methods?

You can implement a Changed listener on the Diagram, looking for e.change === go.ChangedEvent.Insert (or .Remove), and e.propertyName === “parts”, when e.object will be a Layer. You’ll want to check the e.newValue (or .oldValue when removing) being a Node.

Converting Goxam to gojs for making port:




makePort(name:any, spot:any, output:any, input:any) {
var GO = go.GraphObject.make;

    return GO(go.Shape, "Square",
            fill: null,
            stroke: null,
            strokeWidth: 1.5,
            desiredSize: new go.Size(7, 7),
            alignment: spot,
            alignmentFocus: spot,
            portId: name,
            fromSpot: spot, toSpot: spot,
            fromLinkable: output, toLinkable: input,
            fromMaxLinks: 1, toMaxLinks: 1,
            cursor: "pointer"

In this conversion I am missing conversion of go:SpotPanel.Spot=“MiddleLeft” in Gojs. Can you tell me how to use this in gojs.

Spot --> alignment
Alignment --> alignmentFocus