Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New nodes will now appear with the header mostly centered on the header. #403

Merged
merged 1 commit into from
Jan 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions frontend/chains/ChainGraphEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,10 @@ const ChainGraphEditor = ({ graph }) => {
return;
}

// target middle-ish of header
const position = reactFlowInstance.project({
x: event.clientX - reactFlowBounds.left,
y: event.clientY - reactFlowBounds.top,
x: event.clientX - reactFlowBounds.left - 120,
y: event.clientY - reactFlowBounds.top - 50,
});

const newNodeID = uuid4();
Expand Down Expand Up @@ -215,7 +216,7 @@ const ChainGraphEditor = ({ graph }) => {
}
}

// create data object instead of waiting for graphql
// create data object instead of waiting for API
const data = {
id: newNodeID,
chain_id: chain?.id || null,
Expand Down