Skip to content
Discussion options

You must be logged in to vote

I solved it:
my be help somebody:

export function getMinSizeByChildren(
  graph: dia.Graph,
  cell: dia.Cell,
  offset = OFFSET_CHILDREN,
) {
  const embeds = cell.getEmbeddedCells();
  const currentBBox = cell.getBBox();
  const getCells = graph.getCellsBBox(embeds);

  if (getCells && embeds.length) {
    return getCells.inflate(offset);
  }

  const { width, height } = DEFAULT_SIZE;
  return new g.Rect(currentBBox.x, currentBBox.y, width, height);
}

minWidth: (cell, __, direction) => {
          const cellBBox = cell.getBBox();
          const childrenBBox = getMinSizeByChildren(graph, cell);

          const cellLeft = cellBBox.x;
          const cellRight = cellBBox.x + cellBBox.width;

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by VictorPulzz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant