Skip to content
Discussion options

You must be logged in to vote

Great questions, Nitin-Shandilya! 🙏

1. Connection points on custom SVG equipment

Use the Ports API rather than raw magnets. You get named, addressable points, and links snap to them automatically. For precise inlet/outlet positions on irregular SVG shapes, define a port group with the absolute layout and give each port explicit coordinates (px, % of the element bbox, or calc() expressions):

const Pump = dia.Element.define('hmi.Pump', {
    size: { width: 80, height: 60 },
    ports: {
        groups: {
            pipe: {
                position: { name: 'absolute' },
                attrs: { portBody: { r: 5, magnet: 'active' } },
                markup: util.svg`<circle @selector="port…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ZoranJambor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants