fix(dashboard): extract shared node dimension constants to layout utility

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Lum1104
2026-03-14 19:36:48 +08:00
Unverified
parent 9f16c2c0e5
commit d6d937e53b
2 changed files with 3 additions and 5 deletions
@@ -13,11 +13,9 @@ import "@xyflow/react/dist/style.css";
import CustomNode from "./CustomNode";
import type { CustomFlowNode } from "./CustomNode";
import { useDashboardStore } from "../store";
import { applyDagreLayout } from "../utils/layout";
import { applyDagreLayout, NODE_WIDTH, NODE_HEIGHT } from "../utils/layout";
import { getLayerColor, getLayerBorderColor } from "./LayerLegend";
const NODE_WIDTH = 280;
const NODE_HEIGHT = 120;
const LAYER_PADDING = 40;
const nodeTypes = { custom: CustomNode };
+2 -2
View File
@@ -1,8 +1,8 @@
import dagre from "@dagrejs/dagre";
import type { Node, Edge } from "@xyflow/react";
const NODE_WIDTH = 280;
const NODE_HEIGHT = 120;
export const NODE_WIDTH = 280;
export const NODE_HEIGHT = 120;
export function applyDagreLayout(
nodes: Node[],