Visibility of group members inside a placeholder

I have a group template that toggle the visibility of two parts based on the empty field of the group data.

          $(go.Placeholder, new go.Binding("visible", "empty", v => !v), {
            minSize: new go.Size(240, 160),
            background: "lightblue",
          }),
          $(go.Panel, "Spot", new go.Binding("visible", "empty"), {
            desiredSize: new go.Size(240, 160),
            background: "palegreen",
          }),

As shown below, either the placeholder or the part is visible.

Screen Shot 2023-02-24 at 7.20.02 PM
Screen Shot 2023-02-24 at 7.20.22 PM

However, why are the group members (two red dots + the edges between them) always visible, even when the placeholder is not visible? If I understand correctly, this document indicates that the group member should not be displayed if the placeholder is not visible. Did I do anything wrong?

I am including the complete HTML and JS code below. You can toggle the empty value of the object with key: "lane" in the nodeDataArray.

Thanks for your time.

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      body {
        margin: 0;
        padding: 0;
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
      }
    </style>
  </head>
  <body>
    <div
      id="myDiagramDiv"
      style="border: solid 1px black; width: 100%; height: 70%"
    ></div>
    <script src="../../release/go-debug.js"></script>
    <script>
      const init = () => {
        const $ = go.GraphObject.make;

        myDiagram = $(go.Diagram, "myDiagramDiv", {
          layout: $(go.LayeredDigraphLayout),
        });

        myDiagram.groupTemplate = $(
          go.Group,
          "Auto",
          {
            layout: $(go.LayeredDigraphLayout),
          },
          $(go.Shape, "RoundedRectangle", {
            desiredSize: new go.Size(240, 220),
            fill: "white",
          }),
          $(go.Placeholder, new go.Binding("visible", "empty", v => !v), {
            minSize: new go.Size(240, 160),
            background: "lightblue",
          }),
          $(go.Panel, "Spot", new go.Binding("visible", "empty"), {
            desiredSize: new go.Size(240, 160),
            background: "palegreen",
          }),
        );

        myDiagram.nodeTemplate = $(
          go.Node,
          "Auto",
          $(go.Shape, "Rectangle", {
            width: 6,
            height: 6,
            fill: "red",
          }),
        );

        const nodeDataArray = [
          {
            key: "lane",
            isGroup: true,
            empty: false,
          },
          {
            key: "lane-start",
            group: "lane",
          },
          {
            key: "lane-end",
            group: "lane",
          },
        ];

        const linkDataArray = [
          {
            from: "lane-start",
            to: "lane-end",
          },
        ];

        const model = new go.GraphLinksModel();
        model.nodeGroupKey = "group";
        model.nodeDataArray = nodeDataArray;
        model.linkDataArray = linkDataArray;

        myDiagram.model = model;
      };
      window.addEventListener("DOMContentLoaded", init);
    </script>
  </body>
</html>

The member Parts of a Group will not be visible if Group.isSubGraphExpanded is false. (Or if the member’s Part.visible is false or if the Group is not visible or if a member’s tree parent node’s Node.isTreeExpanded is false or if a member’s layer’s Layer.visible is false.)

Use a Placeholder when you want a Group (or Adornment) to have its position and size determined by the area occupied by its member Parts (or Adornment.adornedObject). But whether you use a Placeholder or not will not affect the position or size or visibility of the member Parts (or adorned GraphObject).

Thank you so much Walter! isSubGraphExpanded works for my use case.