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

[layout] consider getting layout params from CSS #54

Open
JanKoehnlein opened this issue Feb 8, 2019 · 0 comments
Open

[layout] consider getting layout params from CSS #54

JanKoehnlein opened this issue Feb 8, 2019 · 0 comments
Labels
enhancement New feature or request

Comments

@JanKoehnlein
Copy link
Contributor

Sprotty is using CSS to style diagrams. This is very useful to interactively change some styling aspect in the diagram using the style editor in browser. Unfortunately, this stops at layout options, whcih are currently defined in as LayoutOptions in the SModel. The disadvantages of this are

  • tuning the node/edge layouts has very long turnarounds
  • the SModel blows up, which is problematic for client/server communication
  • to compensate we sometimes adapt the SModelFactory which adds further complexity,
  • we intoduced a cascading mechanism to collect the layout options by spreading them all values from the root to the current element, which may not scale well.

We should consider getting the layout options as CSS variables. We'd get

  • using the browser's internal and optimized capabilities for merging styles
  • interactive layout editing as with other styles
  • a better separation of concerns
  • a much smaller SModel.

The only problem may be that we have to listen for CSS changes in order to trigger a relayout. AFAIK we can only add change listeners to the direct CSS properties of the element. We'd maybe have to trigger the relayout manually, e.g. on a certain keystroke.

@JanKoehnlein JanKoehnlein added enhancement New feature or request question Further information is requested labels Feb 8, 2019
@spoenemann spoenemann removed the question Further information is requested label Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants