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

changed angles of arrows in graph #26

Merged
merged 1 commit into from
Aug 28, 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
4 changes: 2 additions & 2 deletions src/Flowchart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -352,9 +352,9 @@ class Flowchart extends Component<Props, State> {
// Calculate the control point for the curve
const midX = (sourceX + targetX) / 2;
const midY = (sourceY + targetY) / 2;
const curvature = 50; // Adjust this value to control the curvature
const curvature = (targetX > sourceX ? -20 : 20 ) * Math.abs(sourceX - targetX) / 150; // Adjust this value to control the curvature
const controlPointX = midX;
const controlPointY = sourceY < targetY ? midY - curvature : midY + curvature;
const controlPointY = midY + curvature;

return d3.line().curve(d3.curveBasis)([
[sourceX, sourceY],
Expand Down
Loading