@lfrederic wrote:
Hi,
In one of my diagrams, I have a group and its member nodes looking like the following:
The enclosing group (titled "[Value Stream] Acquire Product") is implemented as an auto panel containing the segmented banner at the top, then the icon and title, and then a standard placeholder holding the member nodes.
The banner at the top is constructed from an item array, and can contain an arbitrary number of colored segments. Each segment is implemented as a TextBlock with a dynamic background color, text and tooltip. Additionally, the relative width it should span is defined through a bound property named "widthPercentage".
Basically, what I want from the banner is to:
- span the whole width of the auto panel, whatever it is
- have each colored segment span a width that corresponds to its widthPercentageThe way I tried to do it is to bind the "width" property for each segment's TextBlock, and derive it from the widthPercentage value and the enclosing auto panel's bounds. This approach somewhat works for groups with static content. However, it fails for groups whose width changes because of dynamic content (e.g. member nodes being added or removed).
The reason for this is pretty clear: the main auto panel tries to compute its width by considering, among others, the width of the banner, which in turn is derived from the main auto panel's width.
My question: is there a way out of this cycle? Is there a way to tell GoJS in effect: set the width for this element as X% of its parent auto panel's width, whatever it is? Or alternatively, is there a way to tell an auto panel to ignore a given element when computing its size, so that the cycle can be broken?
Or is there some other approach that could work here?
Posts: 5
Participants: 3
