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

child edge positioning #26

Open
forresto opened this issue Oct 28, 2016 · 2 comments
Open

child edge positioning #26

forresto opened this issue Oct 28, 2016 · 2 comments

Comments

@forresto
Copy link

In klayjs-svg, child edges are rendered as children of the translated group. This means that the edges are layered behind other groups.

child edge

{ children:
  [ { id: 'Parent1'
    , children:
      [ { id: 'Child1' }
      ]
    , edges:
      [ {source: 'Child1', target: 'Child2'}
      ]
    }
  , { id: 'Parent2'
    , children:
      [ { id: 'Child2' }
      ]
    }
  ]
, edges:
  [ {source: 'Parent1', target: 'Parent2'}
  ]
}

If I don't define the edges as child edges in the input graph, their positioning is still offset, so I'd have to walk the graph to find the edge's source node's parent's offset. This seems like a bug: edges defined on the root node should be positioned relative to the root.

root edge

{ children:
  [ { id: 'Parent1'
    , children:
      [ { id: 'Child1' }
      ]
    }
  , { id: 'Parent2'
    , children:
      [ { id: 'Child2' }
      ]
    }
  ]
, edges:
  [ {source: 'Parent1', target: 'Parent2'}
  , {source: 'Child1', target: 'Child2'}
  ]
}
@uruuru
Copy link
Member

uruuru commented Oct 29, 2016

The calculated coordinates correspond to elk's coordinate system, in which the positions of an edge are relative to the edge's source node (with one exception).
It's somewhat of a peculiarity of the js json version that edges can be specified anywhere (instead of as children of the source node).
While I see your point, I'm not sure if it's a good idea to become inconsistent with the coordinate system used in the java version.

@le-cds
Copy link
Member

le-cds commented Nov 2, 2016

We are currently changing the graph data structure in the ELK project. This issue is in fact one we're addressing there. We haven't decided yet whether the changes will find their way into the JSON specification of graphs.

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

3 participants