优化仿真求解性能并修复流量闭合问题(初版)
This commit is contained in:
1 parent
57b459bc72
commit
5332a788f3
55 files changed
+8973
-549
No files matched your search
@@ -0,0 +1,39 @@
|
||||
import { Background, BackgroundVariant } from "@xyflow/react";
|
||||
|
||||
export const CANVAS_GRID_SIZE = 18;
|
||||
|
||||
export type CanvasGridVisibility = {
|
||||
lines: boolean;
|
||||
dots: boolean;
|
||||
};
|
||||
|
||||
type CanvasGridBackgroundProps = {
|
||||
visibility: CanvasGridVisibility;
|
||||
};
|
||||
|
||||
export function CanvasGridBackground({
|
||||
visibility,
|
||||
}: CanvasGridBackgroundProps) {
|
||||
return (
|
||||
<>
|
||||
{visibility.lines ? (
|
||||
<Background
|
||||
color="#d6e0ea"
|
||||
gap={CANVAS_GRID_SIZE * 5}
|
||||
id="major-grid-lines"
|
||||
lineWidth={1}
|
||||
variant={BackgroundVariant.Lines}
|
||||
/>
|
||||
) : null}
|
||||
{visibility.dots ? (
|
||||
<Background
|
||||
color="#c4d0dd"
|
||||
gap={CANVAS_GRID_SIZE}
|
||||
id="minor-grid-dots"
|
||||
size={1}
|
||||
variant={BackgroundVariant.Dots}
|
||||
/>
|
||||
) : null}
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user