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

Add positioning for elk layout renderer. This can enable Horizontal Order and Vertical Order #5420

Open
Ogglas opened this issue Mar 27, 2024 · 0 comments
Labels
Status: Triage Needs to be verified, categorized, etc Type: Enhancement New feature or request

Comments

@Ogglas
Copy link
Contributor

Ogglas commented Mar 27, 2024

Proposal

elkjs supports position for nodes. Given that mermaid now supports this it would be a great additon.

https://mermaid.js.org/config/schema-docs/config.html#defaultrenderer

https://rtsys.informatik.uni-kiel.de/elklive/examples.html?e=user-hints%2Flayered%2FhorizontalOrder

https://rtsys.informatik.uni-kiel.de/elklive/examples.html?e=user-hints%2Flayered%2FverticalOrder

Example

Example in elkjs for Horizontal Order

aspectRatio: 0.1 // for presentation only

node default {
    algorithm: layered
    nodeLabels.placement: "INSIDE V_TOP H_CENTER"
    label "Default" { layout [ size: 43, 15 ] }
    node n1 { label "1" }
    node n2 { label "2" }
    node n3 { label "3" }
    edge n1 -> n2
    edge n2 -> n3
}

node partitions {
    algorithm: layered
    partitioning.activate: true
    
    nodeLabels.placement: "INSIDE V_TOP H_CENTER"
    label "Partitions" { layout [ size: 56, 15 ] }

    node n1 { partition: 1 label "1" }
    node n2 { partition: 2 label "2" }
    node n3 { partition: 0 label "3" }
    edge n1 -> n2
    edge n2 -> n3
}

node interactive {
    algorithm: layered
    cycleBreaking.strategy: INTERACTIVE
    layering.strategy: INTERACTIVE
    
    nodeLabels.placement: "INSIDE V_TOP H_CENTER"
    label "Interactive" { layout [ size: 58, 15 ] }

    node n1 { layout [ position: 200, 0 ] label "1" }
    node n2 { layout [ position: 300, 0 ] label "2" }
    node n3 { layout [ position: 100, 0 ] label "3" }
    edge n1 -> n2
    edge n2 -> n3
}

Screenshots

No response

@Ogglas Ogglas added Status: Triage Needs to be verified, categorized, etc Type: Enhancement New feature or request labels Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Triage Needs to be verified, categorized, etc Type: Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant