|
|
@@ -959,7 +959,12 @@ export default function CategoryEffectTreeApp() {
|
|
|
);
|
|
|
|
|
|
const maxDepth = layoutNodes.reduce((max, node) => Math.max(max, node.depth), 0);
|
|
|
- const maxY = layoutNodes.reduce((max, node) => Math.max(max, node.y + NODE_HEIGHT), 0);
|
|
|
+ const maxNodeBottom = layoutNodes.reduce(
|
|
|
+ (max, node) => Math.max(max, node.y + NODE_HEIGHT),
|
|
|
+ 0,
|
|
|
+ );
|
|
|
+ const contentBottom = Math.max(yCursor - ROW_GAP, maxNodeBottom);
|
|
|
+ const canvasHeight = contentBottom + CANVAS_PADDING;
|
|
|
|
|
|
const levelHeaders: LevelHeader[] = [];
|
|
|
for (let depth = 0; depth <= maxDepth; depth += 1) {
|
|
|
@@ -985,7 +990,7 @@ export default function CategoryEffectTreeApp() {
|
|
|
connectors,
|
|
|
levelHeaders,
|
|
|
canvasWidth: (maxDepth + 1) * (NODE_WIDTH + COLUMN_GAP) + CANVAS_PADDING * 2,
|
|
|
- canvasHeight: Math.max(420, maxY + CANVAS_PADDING),
|
|
|
+ canvasHeight,
|
|
|
};
|
|
|
}, [data, roots, detachedCategories, childrenMap, elementsByCategory, expandedCategoryIds, expandedElementParents, showInvalidNodes, expandLevelFilter, categoryDepthMap]);
|
|
|
|