Update node spacing

This commit is contained in:
Andrew Kingston 2024-09-12 16:11:37 +01:00
parent d4451a487c
commit 87206b1c43
No known key found for this signature in database
2 changed files with 3 additions and 2 deletions

View File

@ -8,6 +8,7 @@
import { rolesToNodes, autoLayout } from "./layout"
import { onMount, setContext } from "svelte"
import Controls from "./Controls.svelte"
import { MaxAutoZoom } from "./constants"
const nodes = writable([])
const edges = writable([])
@ -37,7 +38,7 @@
nodeTypes={{ role: RoleNode }}
edgeTypes={{ role: RoleEdge }}
proOptions={{ hideAttribution: true }}
fitViewOptions={{ maxZoom: 1 }}
fitViewOptions={{ maxZoom: MaxAutoZoom }}
defaultEdgeOptions={{ type: "role", animated: true, selectable: false }}
onconnectstart={() => dragging.set(true)}
onconnectend={() => dragging.set(false)}

View File

@ -79,7 +79,7 @@ const dagreLayout = ({ nodes, edges }) => {
dagreGraph.setGraph({
rankdir: "LR",
ranksep: 200,
nodesep: 100,
nodesep: 50,
})
nodes.forEach(node => {
dagreGraph.setNode(node.id, { width: NodeWidth, height: NodeHeight })