Gojs+resizable not working if we give a min size of max size of height

Hi Gojs folks,

Am a newbie in gojs and exploring some bug fixes in my team.
so i was asked to give a max height of some value to all nodes , and when i give that resizable was already given true for that shape and that not working.
when i give
maxSize: new go.Size(250, NaN) ->its working
when i need to restrict the height also with 250 ,its not working
maxSize: new go.Size(250, 250) ->NOT working

Here goes sample code

$(
      go.Node,
      'Auto',
      {
        resizable: true,
        },
/////some panel and vertical

Apologies if am wrong about anything , since just started learning gojs .
Looking for → resizable true and with max height defined , user can resize height with resizable property

Cheers
J

I believe that what you describe is the normal behavior, if you are setting maxSize on the element that is being resized. That would be the object named by Part.resizeObjectName, if it is not the whole Part.

From what I see of your node template, you don’t set Part.resizeObjectName, so the whole Node is being resized, which means that you should be setting maxSize on the Node, not on any element inside the Node.

my apologies already there is Part.resizeObjectName
so the code goes like this

$(
      go.Node,
      'Auto',
      {
        resizable: true,
       resizeObjectName: 'SHAPE', // need to replace from here and paste where i need resize ?
        },
      $(go.Shape, { fill: 'gray', name: 'SHAPE', maxSize: new go.Size(200, 200) }),
$(
          go.Panel,
          'Table',
///some properties listed
),
$(
          go.Panel,
          'Table',
//some properties2 listed
),
$(
          go.Panel,
          'Table',
//some properties3 listed
),

so here is i dont give height a value and if i give as NaN , whole node can be resized , but am looking for resizing to take place in table3, so do i need to copy all properties of resizing to table 3

And i need table which hold properties3 section to be resizable
So my doubt is can i make some part of the panel resizable , if i give that panel these 2 properties like resizable true and resizeObjectName: ‘SHAPE’,

Thanks for the reply

As recommended at several places, including GoJS Panels -- Northwoods Software, one normally does not try to set the size of or resize the main element of an “Auto” Panel. (There are times it might be useful, but those are rare circumstances.)

I suggest you set maxSize on the Node and remove the setting of resizeObjectName. Of course I’m still guessing what it is that you want to do…

@walter its not working as you told. sorry
My requirement , is i have given maxsize to node , but need to resize a panel inside the node . so that its not restricted with node max height.
For example in the code above simply table3 need to be resized irrespective of its parent node within max size given.

Happy to answer if you are still not convinced

Thanks

OK, then set Part.resizeObjectName and set maxSize and/or minSize on that object in your template. And add a TwoWay Binding on that object’s desiredSize property.

Still its not working !

Saying “it’s not working” really doesn’t help us answer your question. What are you doing, what is happening, and what do you want to happen instead? Provide some small screenshots and your node template, plus any modifications you may have made to the ResizingTool, if there are any.

see if have a parent node and inside that many tables are there , like table 1, table2 and 3 , and i have given a max -height to node , indicating that it cant be resized , but table3 do have many rows and hence it cant be seen in first load , hence we are using scrollbar for table3 PLUS we need to resize table3 so that user can drag to bottom and see all rows within it (please see the above code)

$(
      go.Node,
      'Auto',
      {
         resizable: true, // I alredy changed as per you suggested , still no luck
        stretch: go.GraphObject.Fill,
        locationObjectName: 'SHAPE',
        resizeObjectName: 'SHAPE',
        },
      $(go.Shape, { fill: 'gray', name: 'SHAPE', maxSize: new go.Size(200, 200) }),

 $(
        go.Panel,
        'Vertical',

        $(
          go.Panel,
          'Auto',
$(
          go.Panel,
          'Table',
///some properties listed
),
),
$(
          go.Panel,
          'Table',
//some properties2 listed
),
$(
          'ScrollingTable',
          {
            name: 'PROPS',
            width: 271,
          },
//more rows and THIS TABLE TO BE RESIZED
new go.Binding('TABLE.itemArray', 'items'),
 {
            'TABLE.itemTemplate': $(
              go.Panel,
              'TableRow',
   //items in array 
),
)

We need to see the properties and bindings on the Node and on each of the “Table” panels.

Are you still trying to limit or constrain the size of the border Shape of the “Auto” Panel? Don’t.

I can share all the properties and binding on node in the given example. plus am restricting node height with maxsize , but my table 3 is having long list of items, so somehow either i need to resize my table 3 or i need a scroll that passes through entire node, a vertical scroll bar (not only on table 3, if its generic scroll bar , then its should go through all the tables , a single scroll bar

Could you replace your “Vertical” Panel with “ScrollingTable”?
And maybe convert the old “ScrollingTable” to a regular “Table” panel, if you do not want nested scrollbars.

Walter,
Apologies for the late response.
was trying to create a sandbox url for better transparency and it took more time than normal , since it involves learning phase as well

Let me know if this sandbox works for you
Now i believe with all contents in node, its height is more than 1300px for sure , hence i need a generic vertical scrollbar , not with individual scrollbar across all tables , that will flow from first element in first table to last element in last table, a vertical scroll bar
Also my requirement ,is i need to have a max height for the node like 500 px and rest contents can be visible if user scroll the vertical scroll bar downwards

@walter updated license in profile

Is this something like you are looking for?
image

<!DOCTYPE html>
<html>
<head>
  <title>Minimal GoJS Sample</title>
  <!-- Copyright 1998-2022 by Northwoods Software Corporation. -->
</head>
<body>
  <div id="myDiagramDiv" style="border: solid 1px black; width:100%; height:600px"></div>

  <script src="https://unpkg.com/gojs"></script>
  <script src="https://unpkg.com/gojs/extensions/ScrollingTable.js"></script>
  <script id="code">
const $ = go.GraphObject.make;

const myDiagram =
  $(go.Diagram, "myDiagramDiv",
    {
      initialScale: 2,
      "undoManager.isEnabled": true
    });

myDiagram.nodeTemplate =
  $(go.Node, "Vertical",
    {
      selectionObjectName: "SCROLLER",
      resizable: true, resizeObjectName: "SCROLLER",
    },
    $(go.TextBlock,
      { font: "bold 14px sans-serif" },
      new go.Binding("text")),
    $(go.Panel, "Auto",
      $(go.Shape, { fill: "white" }),
      $("ScrollingTable",
        {
          name: "SCROLLER",
          width: 120, height: 200, // initial size
          stretch: go.GraphObject.Fill       // but stretches vertically
        },
        new go.Binding("TABLE.itemArray", "items"),
        new go.Binding("desiredSize", "size", go.Size.parse).makeTwoWay(go.Size.stringify),
        {
          "TABLE.itemTemplate":
            $(go.Panel, "TableRow",
              { defaultStretch: go.GraphObject.Horizontal },
              $(go.Panel, "Table",
                { defaultStretch: go.GraphObject.Horizontal, margin: 1 },
                $(go.RowColumnDefinition, { row: 0, background: "gray" }),
                $(go.Panel, "Horizontal", { row: 0, margin: new go.Margin(2, 2, 0, 2) },
                  $("PanelExpanderButton"),
                  $(go.TextBlock,
                    new go.Binding("text", "name"))
                ),
                $(go.Panel, "Vertical", { row: 1, name: "COLLAPSIBLE" /*, visible: false */ },
                  new go.Binding("itemArray", "values"))
              )
            )
        }
      )
    )
  );

const arr = [ { text: "header", items: [] }];
const items = arr[0].items;
for (let i = 0; i < 5; i++) {
  const values = [];
  for (let j = 0; j < Math.random()*5; j++) values.push("value " + j.toString());
  items.push({ name: "item " + i.toString(), values: values });
}
myDiagram.model = new go.GraphLinksModel(arr);
  </script>
</body>
</html>

Yes, but can you help me to introduce same thing in my local sandbox code

Much appreciated
Thanks

Sorry, but I am unable to work in CodeSandbox or similar tools.