Skip to content

Edge crossings with a simple graph #271

@usrlocl

Description

@usrlocl

I modified the Direction example in the layout story to add another connected node. But the layout is getting generated with an edge crossing as shown in the image below.

    <Canvas
      nodes={[
        {
          id: '1',
          text: '1'
        },
        {
          id: '2',
          text: '2'
        },
        {
          id: '3',
          text: '3'
        },
      ]}
      edges={[
        {
          id: '1-2',
          from: '1',
          to: '2',
          text: '1-2'
        },
        {
          id: '2-3',
          from: '2',
          to: '3',
          text: '2-3'
        },
        {
          id: '1-3',
          from: '1',
          to: '3',
          text: '1-3'
        },
      ]}

Image

The same graph using D2 with Elk gives a clean diagram without any crossings here.

I'm wondering if there's some elk configuration that can achieve this, but the settings are quite overwhelming. It would be good if reaflow can have some sane defaults to achieve reasonably clean diagrams out of the box.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions