Skip to content
Snippets Groups Projects

fix: max zoom for schema layout

Merged Dennis Collaris requested to merge fix/schema-layouting into main
@@ -27,10 +27,6 @@ interface Props {
onRemove?: () => void;
}
const onInit = (reactFlowInstance: ReactFlowInstance) => {
setTimeout(() => reactFlowInstance.fitView(), 100);
};
const graphEntityPillNodeTypes = {
entity: SchemaEntityPill,
relation: SchemaRelationPill,
@@ -92,9 +88,10 @@ export const Schema = (props: Props) => {
layout.current = layoutFactory.createLayout(settings.layoutName);
}
const maxZoom = 1.2;
const fitView = () => {
if (reactFlowInstanceRef.current) {
reactFlowInstanceRef.current.fitView();
reactFlowInstanceRef.current.fitView({maxZoom});
}
};
@@ -376,7 +373,7 @@ export const Schema = (props: Props) => {
edges={edges}
onInit={(reactFlowInstance) => {
reactFlowInstanceRef.current = reactFlowInstance;
onInit(reactFlowInstance);
setTimeout(() => fitView(), 100);
}}
onClick={handleOnClick}
proOptions={{ hideAttribution: true }}
Loading