public ngAfterViewInit() {
createCustomButton()
}
public createCustomButton() {
go.GraphObject.defineBuilder("PanelExpanderButton", function(args) {
var eltname = /** @type {string} */ (go.GraphObject.takeBuilderArgument(args, "COLLAPSIBLE"));
var button = /** @type {Panel} */ (
go.GraphObject.make("Button",
{ // set these values for the visible binding conversion
"_buttonExpandedFigure": "MinusLine",
"_buttonCollapsedFigure": "PlusLine"
},
go.GraphObject.make(go.Shape, "PlusLine",
{ name: "ButtonIcon", desiredSize: new go.Size(6, 4) },
new go.Binding("figure", "visible",
function(vis) { return vis ? button["_buttonExpandedFigure"] : button["_buttonCollapsedFigure"]; })
.ofObject(eltname)))
);
var border = button.findObject("ButtonBorder");
if (border instanceof go.Shape) {
border.stroke = null;
border.fill = "transparent";
}
button.click = function(e, button) {
var diagram = button.diagram;
if (diagram === null) return;
if (diagram.isReadOnly) return;
var elt = button.findTemplateBinder();
if (elt === null) elt = button.part;
if (elt !== null) {
var pan = elt.findObject(eltname);
if (pan !== null) {
diagram.startTransaction('Collapse/Expand Panel');
pan.visible = !pan.visible;
diagram.commitTransaction('Collapse/Expand Panel');
}
}
}
return button;
});
//return button;
}```
i have tried above one used it not showing any effect
following the below giving blackscreen in place of button
$(“PanelExpanderButton”, “LIST”, // the name of the element whose visibility this button toggles
{ row: 0,
“_buttonExpandedFigure”: “MinusLine”,
“_buttonCollapsedFigure”: “PlusLine”
alignment: go.Spot.TopRight })```