Skip to content

Feature/checkpoints support#33

Merged
Aksem merged 4 commits intoAksem:new-emsdk-and-embindfrom
Qoolerus:feature/checkpoints-support
Feb 21, 2026
Merged

Feature/checkpoints support#33
Aksem merged 4 commits intoAksem:new-emsdk-and-embindfrom
Qoolerus:feature/checkpoints-support

Conversation

@Qoolerus
Copy link
Copy Markdown

Support of Checkpoints

@Aksem Aksem self-assigned this Jan 27, 2026
@K-4U
Copy link
Copy Markdown

K-4U commented Feb 21, 2026

Hi, can this be merged? I'm struggling with LibAvoid making my connections pretty, and i think i can fix it with these checkpoints.

@Aksem Aksem merged commit bd8af47 into Aksem:new-emsdk-and-embind Feb 21, 2026
@Aksem
Copy link
Copy Markdown
Owner

Aksem commented Feb 21, 2026

@Qoolerus thank you for the contribution!

@Aksem
Copy link
Copy Markdown
Owner

Aksem commented Feb 21, 2026

@K-4U Thanks for the reminder. I wasn’t sure about the changes in the typings, but I’ve just tested them, and they’re correct. Merged! A new beta version v0.5.0-beta.3 has been released as well.

@K-4U
Copy link
Copy Markdown

K-4U commented Feb 21, 2026

@K-4U Thanks for the reminder. I wasn’t sure about the changes in the typings, but I’ve just tested them, and they’re correct. Merged! A new beta version v0.5.0-beta.3 has been released as well.

Aahh, awesome. Thank you! I've been using libavoid to work together with ELK, as ELK doesn't do the whole edge-routing without nodes moving.
Thank you for your work on this port, otherwise i would've never gotten so far with my webapp!

@Qoolerus
Copy link
Copy Markdown
Author

Hi, can this be merged? I'm struggling with LibAvoid making my connections pretty, and i think i can fix it with these checkpoints.

Good evening! Please note that this PR introduces changes to the beta version, the "new-emsdk-and-embed" branch. This version has some differences in interfaces compared to 0.4.5, because it uses a different binder - Embind. But migration is quite simple and fast.
At first, I tried to support checkpoints in the main branch, but unfortunately, due to the limitations of the WebIDL binder, I couldn't do this, it's good that the library author has a beta branch :)

@K-4U
Copy link
Copy Markdown

K-4U commented Feb 21, 2026

Hi, can this be merged? I'm struggling with LibAvoid making my connections pretty, and i think i can fix it with these checkpoints.

Good evening! Please note that this PR introduces changes to the beta version, the "new-emsdk-and-embed" branch. This version has some differences in interfaces compared to 0.4.5, because it uses a different binder - Embind. But migration is quite simple and fast. At first, I tried to support checkpoints in the main branch, but unfortunately, due to the limitations of the WebIDL binder, I couldn't do this, it's good that the library author has a beta branch :)

Hah, yeah think i'm running into that, lots of "Cannot convert 'undefined' to " things. Thought it was just me at first, but looks like all enums aren't being filled now.
I didn't find any direct documentation changes though, so i had expected everything to just work as normal. Silly me.

@K-4U
Copy link
Copy Markdown

K-4U commented Feb 21, 2026

Hi, can this be merged? I'm struggling with LibAvoid making my connections pretty, and i think i can fix it with these checkpoints.

Good evening! Please note that this PR introduces changes to the beta version, the "new-emsdk-and-embed" branch. This version has some differences in interfaces compared to 0.4.5, because it uses a different binder - Embind. But migration is quite simple and fast. At first, I tried to support checkpoints in the main branch, but unfortunately, due to the limitations of the WebIDL binder, I couldn't do this, it's good that the library author has a beta branch :)

Hah, yeah think i'm running into that, lots of "Cannot convert 'undefined' to " things. Thought it was just me at first, but looks like all enums aren't being filled now. I didn't find any direct documentation changes though, so i had expected everything to just work as normal. Silly me.

Update: It helps to read some of the other MR's commits. I eventually found that they're now further moved into some objects. Probably more of a C thing than a nodejs thing, but i don't care.

One thing is that the ConnDirFlags has a big //todo in it. So i just looked into the C documentation of libavoid.

For anybody stumbling upon this closed MR, this'll help:

    const getDirFlag: any = (pos: string) => {
        const p = pos.toLowerCase();
        // These values are bit flags, so we can combine them for corners. The default (no match) is 15 (all directions allowed).
        if (p === 'right') return 8;
        if (p === 'left') return 4;
        if (p === 'top') return 1;
        if (p === 'bottom') return 2;
        return 15;
    };

@kumilingus
Copy link
Copy Markdown
Contributor

Great job! The checkpoints are working really well! See our example.

I only noticed a minor issue: setting checkpoints doesn’t mark connectors as dirty / trigger re-routing (#34).

Also, I occasionally see warnings like:

"Warning: skipping checkpoint for connector 7 at (400, 140)."

Is there a way to suppress these warnings?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants