theia-ide / sprotty

A next-gen web-based graphics framework
Apache License 2.0
138 stars 23 forks source link

[layout] revise client/server layout #180

Closed JanKoehnlein closed 7 years ago

JanKoehnlein commented 7 years ago

We should make a clearer distinction between client-based and server-based layout.

Currently, the client layout is for arranging the elements of a node/compartment, while server-based layout runs ELK and is mostly for node placement and edge routing. This is not only confusing but also yields some strange assumptions in our code, e.g. that SNode should be ignored in the client layouts.

Initial action items would be

Further questions arise: 1) Are these responsibilities going to stay in the long term? 2) Wouldn't it make sense to use ELK on the client? There is a JS version (compiled with GWT) which seems to work. We'd get rid of a pretty complicated and time consuming additional client/server message cycle. 3) How about letting ELK do micro-layouts? What are the features and limitations?

An additional node: I just found out that MS browsers don't support dominant-baseline, so there is no portable SVG-only way of vertically centering a text element. I.e., unless we assume fixed fonts, we need our own (stack) layout to center text, like in the icons in the header compartments in our YANG diagrams.

JanKoehnlein commented 7 years ago

We stick with the ELK / client layout separation as is