skanaar / nomnoml

The sassy UML diagram renderer
https://www.nomnoml.com
MIT License
2.71k stars 208 forks source link

How to force an element position? #188

Closed witszymanski closed 1 year ago

witszymanski commented 1 year ago

Hi! Is there a way how to fix a position of a particular box to be on TOP or LEFT as a starting point? Example: This looks fine for now image

But now I want to have a line going from last box to the first, like this: image

However, in the nomnoml I always get it wrong image

2nd question: what does acyclicer do?


[<actor> idea] -:> [<phospho>experimental design ]
[<phospho>experimental design | sample origin |  quantification strategy |correct controls|number of replicates] -:> [<condb>sample preparation]
[<condb>sample preparation | lysis | digestion | fractionation  | purification | enrichment ] -:> [<boxa>chromatography]
[<boxa>chromatography | gradient length | column | elution profile]  -:> [<boxb>mass spectrometry]
[<boxb>mass spectrometry | acquisition mode | instrument settings ] -:> [<conda>spectra identification]
[<boxb>mass spectrometry | acquisition mode ] -:> [<boxc>acquisition mode | DDA | DIA | PRM | SRM ]
[<boxb>mass spectrometry | acquisition mode ] -:> [<boxc>instrument settings | resolution | mass range | mass accuracy | speed | ionization energy | fragmentation method ]
[<conda>spectra identification | software | database | modifications | settings] -:> [<boxd>data analysis ]
[<boxd>data analysis | filtering | normalization | imputation | statistics ] -:> [<phospho> experimental design]

#.msmeas: fill=#fddbb6ff title=bold 
#.conda: fill=pink title=bold 
#.condb: fill=lightblue title=bold 
#.platec: visual=roundrect fill=white
#.box: fill=#caffbf dashed title=bold
#.boxa: fill=#ffd166 title=bold
#.boxb: fill=#bdb2ff title=bold
#.boxc: fill=#dad5f7 title=bold
#.boxd: fill=#f7d4fa title=bold
#.inputa: fill=pink  title=bold
#.inputb: fill=lightblue  title=bold
#.labela: visual=none bold

#.samplea: fill=#b39eb5
#.sampleb: fill=#f38fa9 dashed
#.phospho: fill=#6bff91dc title=bold

#padding: 10
#spacing: 80down
#arrowSize: 0.6
#direction: right
#background: transparent
#font: Calibri
#lineWidth: 4
#edges: rounded
#edgeMargin: 7
#gravity: 1
#fontSize: 18
#ranker: tight-tree 

Greets!

skanaar commented 1 year ago

Direction and order of the relations affect the layout.

Try to flip the direction of the last relation (on line 9)

[<phospho> experimental design] <:- [<boxd>data analysis | filtering | normalization | imputation | statistics ]


About acyclicer:

Nomnoml uses a fork of Dagre for layouting. From their documentation:

acyclicer If set to greedy, uses a greedy heuristic for finding a feedback arc set for a graph. A feedback arc set is a set of edges that can be removed to make a graph acyclic.

witszymanski commented 1 year ago

It kind of worked! Thanks! image

Now, are there arguments, where we can disable relation crossing? Like the line goes on top instead of doing this: image

skanaar commented 1 year ago

Reorder the relations and layout will shift around. The layouter should try to minimize edge crossings, but it is a bit of a black box.