Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

(Bug report) Mermaid diagrams rendered out of viewport #474

Closed
daneos opened this issue Oct 10, 2024 · 2 comments
Closed

(Bug report) Mermaid diagrams rendered out of viewport #474

daneos opened this issue Oct 10, 2024 · 2 comments

Comments

@daneos
Copy link

daneos commented Oct 10, 2024

TriliumNext Version

0.90.4

What operating system are you using?

Other Linux

What is your setup?

Local + server sync

Operating System Version

Linux Mint 21.1 Cinnamon

Description

Big mermaid diagrams are being rendered "below" the viewport, which makes it necessary to use the arrows to scroll down and bring the diagram up on every change. In the maximized window on screenshot below you can just see the top of the diagram, but if the window size is smaller the diagram is completely invisible.
Skärmbild från 2024-10-10 11-41-05
I suppose the expected behaviour would be to render the diagram centered in the viewport, more or less like this:
Skärmbild från 2024-10-10 11-29-45

Error logs

No response

@eliandoran
Copy link
Contributor

@daneos , could you provide a sample diagram that I could analyze the problem with?

@daneos
Copy link
Author

daneos commented Mar 18, 2025

Sure, here's the diagram that you can see on my screenshots:

sequenceDiagram

Note over e3-module/Makefile: $(TOP) defined to e3-module path
%%create participant e3-module/CONFIG
e3-module/Makefile ->> e3-module/CONFIG: include
create participant e3-module/RELEASE
e3-module/CONFIG ->> e3-module/RELEASE: include
destroy e3-module/RELEASE
e3-module/RELEASE -->> e3-module/CONFIG: 
create participant e3-module/CONFIG_MODULE
e3-module/CONFIG ->> e3-module/CONFIG_MODULE: include
Note over e3-module/CONFIG_MODULE: Defines $(E3_MODULE_MAKEFILE)<br>as module.Makefile
destroy e3-module/CONFIG_MODULE
e3-module/CONFIG_MODULE -->> e3-module/CONFIG: 
create participant require/CONFIG
e3-module/CONFIG ->> require/CONFIG: include

Note over require/CONFIG: Includes bunch of other files<br>that only define variables
create participant require/CONFIG_E3_MAKEFILE
require/CONFIG ->> require/CONFIG_E3_MAKEFILE: include
Note over require/CONFIG_E3_MAKEFILE: Defines $(E3_MODULE_MAKE_CMDS)<br>which runs make with<br>$(E3_MODULE_MAKEFILE) as input
destroy require/CONFIG_E3_MAKEFILE
require/CONFIG_E3_MAKEFILE -->> require/CONFIG: 
destroy require/CONFIG
require/CONFIG -->> e3-module/CONFIG: 
destroy e3-module/CONFIG
e3-module/CONFIG -->> e3-module/Makefile: 

create participant e3-module/RULES
e3-module/Makefile ->> e3-module/RULES: include
create participant require/RULES_SITEMODS
e3-module/RULES ->> require/RULES_SITEMODS: include

create participant require/RULES_E3
require/RULES_SITEMODS ->> require/RULES_E3: include
Note over require/RULES_E3: Defines .PHONY targets<br>like init, build, install...
require/RULES_E3 -->> require/RULES_SITEMODS: 

Note over require/RULES_SITEMODS: Includes various other<br>RULES_* files which<br>define additional targets
destroy require/RULES_SITEMODS
require/RULES_SITEMODS -->> e3-module/RULES: 
destroy e3-module/RULES
e3-module/RULES -->> e3-module/Makefile: 


Note over e3-module/Makefile, require/RULES_E3: run target (build, install, etc.)
e3-module/Makefile ->> require/RULES_E3: runs build target from
Note over require/RULES_E3: Runs $(E3_MODULE_MAKE_CMDS) build

create participant e3-module/module.Makefile
require/RULES_E3 -->> e3-module/module.Makefile: runs in separate<br>make process


create participant driver.makefile
e3-module/module.Makefile ->> driver.makefile: include
Note over driver.makefile: $(USERMAKEFILE) is set to<br>makefile that included<br>driver.makefile<br>(e3-module/module.Makefile)

create participant base/CONFIG
driver.makefile ->> base/CONFIG: include

create participant base/CONFIG_COMMON
base/CONFIG ->> base/CONFIG_COMMON: include
Note over base/CONFIG_COMMON: Defines install locations,<br>compiler flags, etc.
destroy base/CONFIG_COMMON
base/CONFIG_COMMON -->> base/CONFIG: 

create participant base/CONFIG_SITE
base/CONFIG ->> base/CONFIG_SITE: include
Note over base/CONFIG_SITE: Cross-compilation definitions,<br>additional compiler flags
destroy base/CONFIG_SITE
base/CONFIG_SITE -->> base/CONFIG: 

Note over base/CONFIG: This checks for $(T_A) which suggests<br>that this file is passed multiple times<br>together with driver.makefile
Note over base/CONFIG: Includes files from base/cfg<br>Where are those?
Note over base/CONFIG: Includes base/os/CONFIG_SITE.$(T_A)<br>(Probably for each build arch?)

destroy base/CONFIG
base/CONFIG -->> driver.makefile: 

Note over e3-module/module.Makefile, driver.makefile: Black magic happens<br>(i.e. actual build runs... somehow)
Note over driver.makefile: -include *.d<br>WTF??

create participant base/RULES
driver.makefile ->> base/RULES: include
create participant base/RULES_BUILD
base/RULES ->> base/RULES_BUILD: include
Note over base/RULES_BUILD: Defines actual build rules
Note over base/RULES_BUILD: Includes various other RULES_* files

destroy base/RULES_BUILD
base/RULES_BUILD -->> base/RULES: 
destroy base/RULES
base/RULES -->> driver.makefile: 

loop
    driver.makefile ->> e3-module/module.Makefile: calls various targets via<br>$(USERMAKEFILE) passing $(T_A)<br>keyword: target_rule
    e3-module/module.Makefile -->> driver.makefile: 
end
destroy driver.makefile
driver.makefile -->> e3-module/module.Makefile: 


destroy e3-module/module.Makefile
e3-module/module.Makefile -->> require/RULES_E3: returns from external<br>make process
destroy require/RULES_E3
require/RULES_E3 -->> e3-module/Makefile: 

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

No branches or pull requests

3 participants