SchemaFlow() — supabase Function Reference
Architecture documentation for the SchemaFlow() function in SchemaFlow.tsx from the supabase codebase.
Entity Profile
Relationship Graph
Source Code
apps/studio/components/interfaces/ProjectCreation/SchemaFlow.tsx lines 26–86
export const SchemaFlow = ({ nodes: initialNodes, edges: initialEdges }: SchemaFlowProps) => {
const [nodes, setNodes] = useNodesState(initialNodes)
const [edges, setEdges] = useEdgesState(initialEdges)
const nodeTypes = useMemo(
() => ({ table: (props: NodeProps<TableNodeData>) => <TableNode {...props} placeholder /> }),
[]
)
const reactFlowInstance = useReactFlow<TableNodeData>()
useEffect(() => {
setNodes(initialNodes)
setEdges(initialEdges)
}, [initialNodes, initialEdges, setNodes, setEdges])
useEffect(() => {
reactFlowInstance.fitView()
}, [reactFlowInstance, nodes, edges])
const onNodesChange = useCallback(
(changes: NodeChange[]) => {
setNodes((nds) => applyNodeChanges(changes, nds))
},
[setNodes]
)
return (
<div
style={{ maskImage: 'linear-gradient(to right, transparent 2%, black 13%)' }}
className="absolute inset-0"
>
<ReactFlow
nodes={nodes}
edges={edges}
nodeTypes={nodeTypes}
onNodesChange={onNodesChange}
defaultEdgeOptions={{
type: 'smoothstep',
animated: true,
deletable: false,
style: {
stroke: 'hsl(var(--border-stronger))',
strokeWidth: 0.5,
},
}}
fitView
minZoom={0.8}
maxZoom={1.8}
proOptions={{ hideAttribution: true }}
panOnScroll
panOnScrollSpeed={1}
>
<Background
gap={16}
className="[&>*]:stroke-foreground-muted opacity-[50%]"
variant={BackgroundVariant.Dots}
color={'inherit'}
/>
</ReactFlow>
</div>
)
}
Domain
Subdomains
Source
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free