Skip to content

autolayout does weird things when switching source/target #27

Description

@bjdmeest

See following example

Global

autoLayout: true
animated: true
markerEnd:
  type: arrowclosed
strokeDasharray: 2 2

Nodes

- shape: comunica
- shape: rmlio
- shape: solid
- shape: cylinder
  label: DB1
- shape: cylinder
  label: DB2

Edges

- source: DB1
  target: rmlio
  edgeThickness: 5
- source: DB2
  target: rmlio
  edgeThickness: 5
- source: rmlio
  target: solid
- source: solid
  target: comunica
- source: DB2
  target: comunica
  animated: true
  edgeThickness: 2

image

This image is almost perfect, but I want to last edge to change direction. Switching source and target of the latest element however totally messes up the autoLayout

image

I figured it might have been because the edge handlers are by default right for source and left for target (in horizontal mode), so I changed that too, last element is now

- source: comunica
  target: DB2
  sourceHandle: left-source
  targetHandle: right-target
  animated: true
  edgeThickness: 2

but no :(

image

I can then move the comunica node to have almost the same layout as originally, but I'm wondering if there's a smarter layouting idea we can do, eg by reordering the nodes based on the edges before doing the layout? reordering the nodes changes the layout only when there's a 'reverse' edge somewhere.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestlarge-effortWill be a large effort to fix

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions