8000 make label types generic by SorenHolstHansen · Pull Request #211 · dagrejs/graphlib · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

make label types generic #211

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

Merged
merged 6 commits into from
Jun 9, 2025
Merged

Conversation

SorenHolstHansen
Copy link
Contributor
@SorenHolstHansen SorenHolstHansen commented Feb 24, 2025

This makes graph label, node label and edge label types generic which results in better type safety when creating and getting nodes and so on.

This is also more inline with the graphlib types that dagre exposes.

The generics default to any, so this is completely backwards compatible.

@SorenHolstHansen SorenHolstHansen changed the title make graph label, node label and edge label generic make label types generic Feb 24, 2025
@ajvincent
Copy link

Drive-by comment: Can you use this as a return type perhaps, or does that break things?

    setDefaultNodeLabel(
      label: NodeLabel,
    ): this;

@SorenHolstHansen
Copy link
Contributor Author

Drive-by comment: Can you use this as a return type perhaps, or does that break things?

    setDefaultNodeLabel(
      label: NodeLabel,
    ): this;

Good idea, changed the return types to this

@ajvincent
Copy link

Ok, I now realize why so many lines of whitespace were in the patch last time. You've accidentally replaced spaces with tabs.

@SorenHolstHansen
Copy link
Contributor Author

Ok, I now realize why so many lines of whitespace were in the patch last time. You've accidentally replaced spaces with tabs.

I fixed it now, thanks for reminding me

@rustedgrail rustedgrail merged commit dce01bf into dagrejs:master Jun 9, 2025
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.

3 participants
0