Customize Initial Placement for FMMMLayout

9 views
Skip to first unread message

Cici Bu

unread,
Jun 5, 2025, 3:59:04 PMJun 5
to ogdf
Hello,

We use FMMMLayout to generate the pangenome graph. Our goal is to adjust certain nodes horizontally to the top of the page after running the FMMMLayout.call() once. 

Below is the expected pipeline that we hope could work
  • Get the coordinates after FMMMLayout.call() was run once 
  • Adjust the y coordinates of targeting nodes to a constant
  • Set the customized coordinates as the new initial placement, run FMMMLayout.call() again
We expect that the nodes with adjusted positions can pull the others up to a more horizontal graph without randomized curves.

For example, the curvy line in the attached figure was generated from calling FMMMLayout.call() once. Our goal is to follow the pipeline above, and get an output like the horizontal line (where the red nodes are aligned horizontally)

Screenshot 2025-06-05 at 12.44.00 PM.png

However, I wasn't able to generate the expected result following the pipeline above. The coordinates after the second FMMMLayout call still generate the same coordinates as the first. What I set:
  • fmmm.setSingleLevel(True)
  • fmmm.useHighLevelOptions(True)
  • fmmm.initialPlacementForces(cppyy.gbl.ogdf.FMMMOptions.InitialPlacementForces.KeepPositions)
  • fmmm.initialPlacementMult(cppyy.gbl.ogdf.FMMMOptions.InitialPlacementMult.Simple)
I thought that with m_singleLevel as True, and initialPlacementForces as KeepPositions, we are fixing the initial placement of all the nodes as pre-defined with only one level (as max level). Let me know if there's anywhere I'm thinking wrong.

I would also love to know if there's any other way to achieve the goal. 

Best,
Cici
Reply all
Reply to author
Forward
0 new messages