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

A Bottom part of big digram can be hidden. #243

Open
satabol opened this issue Feb 10, 2024 · 15 comments
Open

A Bottom part of big digram can be hidden. #243

satabol opened this issue Feb 10, 2024 · 15 comments

Comments

@satabol
Copy link

satabol commented Feb 10, 2024

Proposal.

Problem:

Windows 11, vscode 1.86.0, vscode-antlr4 2.4.6.

Long rule:

ANTLR-BUG-hide-button.mp4

If append this css code then all looks good:
image

#container svg:last-child {
    width: 100%;
    margin-bottom: 50px;
}
ANTLR-BUG-hide-button.fixed.mp4
@mike-lischke
Copy link
Owner

IIRC this is not only a problem for the last rule. I have seen this also for rules in the middle somewhere. Last time I looked it was so that the railroad library did not correctly compute the total height of the diagram. Needs investigation, but your proposal would only fix a part of the problem.

@satabol
Copy link
Author

satabol commented Feb 10, 2024

Do you have an example about rules in the middle somewhere? If not can you put them later?

@satabol
Copy link
Author

satabol commented Feb 10, 2024

I found something interesting. You build tab with next structure.

  1. semitransparent header with g4 info:
    image

  2. You have a container with rail structure:
    image

In 2 you use a property with name "padding" that has a parameter "60px". This has incorrect influence to "height:100vh" (100vh do not enlarge on 60px):
(example: https://css-tricks.com/almanac/properties/p/padding/#aa-padding-and-element-width-calculations)

image

To fix this I found a property "box-sizing: border-box":
image

Now all looks good: first element is not under a header and a last element is not hidden. What do you think?

info of a box-sizing:

@satabol
Copy link
Author

satabol commented Feb 10, 2024

that the railroad library did not correctly compute the total height of the diagram

Now I think that this railroad issue is another issue.

@satabol satabol changed the title A Botton part of big digram can be hidden. A Bottom part of big digram can be hidden. Feb 11, 2024
@mike-lischke
Copy link
Owner

My assumption was that the missing space at the end is the same problem like missing space in the middle of the document:

Bildschirmfoto 2024-02-13 um 09 30 01

But you might have a point in your analysis of other spacing and the boxing model. I'll have to investigate.

@satabol
Copy link
Author

satabol commented Feb 13, 2024

Can you give me this example? Or send it by email satabolxyz@gmail.com ? I promise not to show anyone.

@mike-lischke
Copy link
Owner

mike-lischke commented Feb 13, 2024

It's open source like everything I do on Github 😄

Note also the other display problems like in alterListItem:

Bildschirmfoto 2024-02-13 um 09 57 47

@satabol
Copy link
Author

satabol commented Feb 13, 2024

I'm sorry I found MySQLParser.g4 file with another syntax. Now I use your grammar. Can you show your extension settings?

@mike-lischke
Copy link
Owner

It probably doesn't make a difference, but here they are:

    "antlr4.rrd.saveDir": "/Users/Mike/Desktop/rrd",
    "antlr4.atn.saveDir": "",
    "antlr4.atn.maxLabelCount": 10,
    "antlr4.call-graph.saveDir": "/tmp/",
    "antlr4.debug": {
        "visualParseTreeHorizontal": true,
        "visualParseTreeClustered": true
    },
    "antlr4.generation": {
        "mode": "internal",
        "listeners": true,
        "visitors": false,
        "outputDir": "./generated"
    },
    "antlr4.format": {
        "disabled": false,
        "alignTrailingComments": true,
        "allowShortBlocksOnASingleLine": true,
        "breakBeforeBraces": false,
        "columnLimit": 150,
        "continuationIndentWidth": 4,
        "indentWidth": 4,
        "keepEmptyLinesAtTheStartOfBlocks": false,
        "maxEmptyLinesToKeep": 1,
        "reflowComments": false,
        "spaceBeforeAssignmentOperators": true,
        "tabWidth": 4,
        "useTab": false,
        "alignColons": "none",
        "singleLineOverrulesHangingColon": false,
        "allowShortRulesOnASingleLine": false,
        "alignSemicolons": "ownLine",
        "breakBeforeParens": false,
        "ruleInternalsOnSingleLine": false,
        "minEmptyLines": 1,
        "groupedAlignments": true,
        "alignFirstTokens": true,
        "alignLexerCommands": false,
        "alignActions": false,
        "alignLabels": true,
        "alignTrailers": false
    },

@satabol
Copy link
Author

satabol commented Feb 13, 2024

At last I got these errors after settings:
image

Nice:
image

)))

@mike-lischke
Copy link
Owner

Yes, that's the setting for wrapping long sequence lines in the diagram. Of course, if no wrapping occurs then the display is fine. IMO the RRD script does not fully cover some of the cases we use in these diagrams.

@satabol
Copy link
Author

satabol commented Feb 13, 2024

I found something - version of railroad.js file in this repo is too old. I try last (newest) version and all look good:

https://github.com/tabatkins/railroad-diagrams/blob/gh-pages/railroad.js
image

and all look good

image

I use setting "wrapAfter"=60.

@mike-lischke
Copy link
Owner

mike-lischke commented Feb 14, 2024

That would be great news! This (just fixed) issue looks very much like the problems here. Unfortunately, this project neither releases packages nor bundles, so it's tricky to know when a new release comes out (if they even make releases).

@satabol
Copy link
Author

satabol commented Feb 14, 2024

Happy to help you. I just compare count of lines of code. Intuition. ))) Are you planning to update this library?

@mike-lischke
Copy link
Owner

Yes, I will update the library, but I'm pretty busy with other stuff. Need to find some time for it...

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

2 participants