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

Nested nodes too far apart #446

Open
arsen-a opened this issue Jul 23, 2024 · 6 comments
Open

Nested nodes too far apart #446

arsen-a opened this issue Jul 23, 2024 · 6 comments

Comments

@arsen-a
Copy link

arsen-a commented Jul 23, 2024

I'm struggling with customizing the behavior of the Dagre layout when it comes to a huge set of nodes. I'm sending you a screenshot to show what I mean. Can this be customized? Look at the very last row of nodes and how much they are separated when they should be close since there are no descendants.

Screenshot 2024-07-23 at 16 26 05

@not-anasali
Copy link

Facing the same issue. Have you had any luck solving it?

@arsen-a
Copy link
Author

arsen-a commented Aug 29, 2024

Facing the same issue. Have you had any luck solving it?

Moved to d3 🙂

@not-anasali
Copy link

@arsen-a d3-hierarchy with react flow?

@arsen-a
Copy link
Author

arsen-a commented Aug 29, 2024

@not-anasali vue-flow actually, but it comes down to the same thing

@zhoulingz
Copy link

@not-anasali vue-flow actually, but it comes down to the same thing

D3 doesn't have a similar example. Can you tell me which one you're using

@santhosh-c1
Copy link

I'm hitting this same issue. Look at node 2ab.

Image

These are my nodes and edges:

import { Position } from "reactflow";

export const initialNodes = [
  {
    id: "1",
    type: "input",
    data: { label: "input" },
    sourcePosition: Position.Right,
    targetPosition: Position.Left,
    // position: { x: 0, y: 0 },
  },
  {
    id: "2",
    data: { label: "node 2" },
    sourcePosition: Position.Right,
    targetPosition: Position.Left,
    // position: { x: 0, y: 100 },
  },
  {
    id: "2a",
    data: { label: "node 2a" },
    sourcePosition: Position.Right,
    targetPosition: Position.Left,
    // position: { x: 0, y: 200 },
  },
  {
    id: "2b",
    data: { label: "node 2b" },
    sourcePosition: Position.Right,
    targetPosition: Position.Left,
    // position: { x: 0, y: 300 },
  },
  {
    id: "2c",
    data: { label: "node 2c" },
    sourcePosition: Position.Right,
    targetPosition: Position.Left,
    // position: { x: 0, y: 300 },
  },
  {
    id: "2aa",
    data: { label: "node 2aa" },
    sourcePosition: Position.Right,
    targetPosition: Position.Left,
    // position: { x: 0, y: 400 },
  },
  {
    id: "2ab",
    data: { label: "node 2ab" },
    sourcePosition: Position.Right,
    targetPosition: Position.Left,
    // position: { x: 0, y: 500 },
  },
  {
    id: "3",
    data: { label: "node 3" },
    sourcePosition: Position.Right,
    targetPosition: Position.Left,
    // position: { x: 200, y: 100 },
  },
  {
    id: "3a",
    data: { label: "node 3a" },
    sourcePosition: Position.Right,
    targetPosition: Position.Left,
    // position: { x: 0, y: 200 },
  },
  {
    id: "3b",
    data: { label: "node 3b" },
    sourcePosition: Position.Right,
    targetPosition: Position.Left,
    // position: { x: 0, y: 300 },
  },
  {
    id: "3aa",
    data: { label: "node 3aa" },
    sourcePosition: Position.Right,
    targetPosition: Position.Left,
    // position: { x: 0, y: 400 },
  },
];

export const initialEdges = [
  { id: "1", source: "1", target: "2", animated: true },
  { id: "2", source: "1", target: "3", animated: true },
  { id: "3", source: "2", target: "2a", animated: true },
  { id: "4", source: "2", target: "2b", animated: true },
  { id: "5", source: "2", target: "2c", animated: true },
  { id: "6", source: "2a", target: "2aa", animated: true },
  { id: "11", source: "2a", target: "2ab", animated: true },
  { id: "7", source: "3", target: "3a", animated: true },
  { id: "8", source: "3", target: "3b", animated: true },
  { id: "9", source: "3b", target: "3aa", animated: true },
];

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants