When do panel sizes recalculate?

Suppose I have a table panel, with various items in it.
If I set the visible=false/true on some items in the table, the table will update in the diagram, growing/shrinking accordingly.

When does the update happen, however?

I tried doing something like this in code:

function dumpsizes(part){ ... dump out natural/actual/measured/desired size etc };

subpart.visible = false;
dumpsizes(part);
subpart.visible = true;
dumpsizes(part);
...

The sizes never change.

I interspersed updateAllTargetBindings between the calls and that didn’t seem to help.
If I come back “later” and look, the bounds have updated like I would expect.

When does the table (or any auto panel for that matter) recalculate the values?

The re-measurement of GraphObjects is not guaranteed until the transaction is finished.

What are you trying to accomplish? Maybe there’s a good way to do what you want.

Long story, but I think I found another way to do what I want.

I want to show or hide some ports as the user does a mouseover.
But I want the visible ports to still affect the size of the node.
I settled on making their fill/stroke transparent instead.

I was going to somehow get the node to calculate its full size with visible nodes, then lock in the size with minsize or something. Hence my attempt to set visibility, check the size, then toggle the visibility off, all before stuff actually renders to screen.

Now I have fill and stroke on the port bound to a function that checks a custom “_visible” variable that I set programmatically.
The only issue now is that I can only seem to get things to work by calling diagram.updateAllTargetBindings a lot.

I tried calling panel.updateTargetBindings() but it seemed to not trigger the fill/stroke function.
What is the logic of that method? Does it walk through all bindings and call them? Or does it check something else to see if it should bother?

I understand now – and I think you made a good choice, using “transparent” instead of null.

updateTargetBindings only has an effect if Panel.data is non-null – were you calling that method on the Node? Panels within the Node (or any Part) will not have a data binding unless they represent items in a containing Panel’s Panel.itemArray.