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

Implement a strategy to "line break" a diagram section, when it gets too wide #9

Open
lukaseder opened this issue Jun 9, 2017 · 2 comments

Comments

@lukaseder
Copy link
Collaborator

The diagrams of some rules may become quite wide. Of course, we can use GrammarToRRDiagram.setRuleConsideredAsLineBreak() to insert explicit line breaks into grammars, but sometimes, we don't want to put UI information into a grammar for cleaner separation of concerns. So it would be interesting if we could produce automatic line breaks at a certain width. There are different possible strategies which could be discussed in this issue.

@Chrriis
Copy link
Owner

Chrriis commented Jun 11, 2017

When the railroad has only one rail, that rail can be cut and continue under.
When the railroad has several rails, cutting many rails and continuing them under would be hard to read. Cutting is not the problem, we could continue the lines so all parallel rails end at the same length, but readability is the issue.
A complex rule that is h-long is likely to be v-wide too, so the multi-rail cutting is likely to be the norm.

I personally don't see width as a problem.

  • If the problem is that a web page including an SVG shows horizontal scrolling, then place the svg in a h-scrollable div (a bit like embedded code editors).
  • If the problem is that people are not used to scroll horizontally, maybe we need a mode where rails go from top to bottom (with vertical texts), but I tend to think it would be less readable.

@lukaseder
Copy link
Collaborator Author

A complex rule that is h-long is likely to be v-wide too, so the multi-rail cutting is likely to be the norm.

Yes, the problem is far from trivial. Note that the current explicit break rule doesn't seem to work / to be implemented in a "multi-rail" diagram (i.e. when among several options, one is too wide).

If the problem is that a web page including an SVG shows horizontal scrolling, then place the svg in a h-scrollable div (a bit like embedded code editors).

I personally see horizontal scrolling as a big UX no-go and I try to avoid it whenever possible. Which is why I created this issue :)

If the problem is that people are not used to scroll horizontally, maybe we need a mode where rails go from top to bottom (with vertical texts), but I tend to think it would be less readable.

Yeah that would be confusing, I think, and it would just trade h-long for v-wide to become v-long / h-wide.

Another option would be to emit synthetic rules for certain paths that tend to get too wide...

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

No branches or pull requests

2 participants