Skip to content

refactor: update dagre-d3-es to v7.0.14#7357

Merged
ashishjain0512 merged 2 commits intomermaid-js:developfrom
aloisklink:refactor/fix-broken-createGraphWithElements-function
Jan 30, 2026
Merged

refactor: update dagre-d3-es to v7.0.14#7357
ashishjain0512 merged 2 commits intomermaid-js:developfrom
aloisklink:refactor/fix-broken-createGraphWithElements-function

Conversation

@aloisklink
Copy link
Copy Markdown
Member

📑 Summary

This release includes some TypeScript types for graphlib, which makes our life easier!

See: https://github.com/tbo47/dagre-es/releases/tag/7.0.14
See: tbo47/dagre-es#61
See: tbo47/dagre-es#60

This should unblock #7274

📏 Design Decisions

The broken types caught an issue in the createGraphWithElements function in packages/mermaid/src/rendering-util/createGraph.ts, where we were calling graph.setEdge with the arguments in the wrong order. See https://github.com/dagrejs/graphlib/wiki

This function isn't actually used anywhere in our code, which is why this PR is only a refactor PR and why I haven't added a changeset to this PR.

But according to @knsv, we are going to use the file in the future (it seems like it was accidentally committed from a different WIP branch), so it's best to keep it in to avoid merge conflicts.

📋 Tasks

Make sure you

  • 📖 have read the contribution guidelines
  • 💻 have added necessary unit/e2e tests.
    • N/A
  • 📓 have added documentation. Make sure MERMAID_RELEASE_VERSION is used for all new features.
    • N/A
  • 🦋 If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running pnpm changeset and following the prompts. Changesets that add features should be minor and those that fix bugs should be patch. Please prefix changeset messages with feat:, fix:, or chore:.
    • There should be no user-visible changes in this code, so there's no need for a changeset.

The order of the arguments for `graph.setEdge()` in
`createGraphWithElements` is incorrect.

I've updated the call to instead use an object to make it a bit more
clear, since the order is a bit unusual.

This function isn't actually used anywhere in our code, which is why
this is only a `refactor:` commit, not a `fix:` commit.
But from talking to @knsv, it sounds like this is going to be used by
future layout algorithms, so we should keep this file.

But, this  unblocks upgrading to `dagre-d3-es` `7.0.14`,
which has updated types for this.
This release includes some basic TypeScript types, which makes our life
easier!

See: https://github.com/tbo47/dagre-es/releases/tag/7.0.14
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jan 29, 2026

⚠️ No Changeset found

Latest commit: a411b9f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@netlify
Copy link
Copy Markdown

netlify Bot commented Jan 29, 2026

Deploy Preview for mermaid-js ready!

Name Link
🔨 Latest commit a411b9f
🔍 Latest deploy log https://app.netlify.com/projects/mermaid-js/deploys/697b4eeafb8e7900081b1a97
😎 Deploy Preview https://deploy-preview-7357--mermaid-js.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions Bot added the Type: Other Not an enhancement or a bug label Jan 29, 2026
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Jan 29, 2026

Open in StackBlitz

@mermaid-js/examples

npm i https://pkg.pr.new/mermaid-js/mermaid/@mermaid-js/examples@7357

mermaid

npm i https://pkg.pr.new/mermaid-js/mermaid@7357

@mermaid-js/layout-elk

npm i https://pkg.pr.new/mermaid-js/mermaid/@mermaid-js/layout-elk@7357

@mermaid-js/layout-tidy-tree

npm i https://pkg.pr.new/mermaid-js/mermaid/@mermaid-js/layout-tidy-tree@7357

@mermaid-js/mermaid-zenuml

npm i https://pkg.pr.new/mermaid-js/mermaid/@mermaid-js/mermaid-zenuml@7357

@mermaid-js/parser

npm i https://pkg.pr.new/mermaid-js/mermaid/@mermaid-js/parser@7357

@mermaid-js/tiny

npm i https://pkg.pr.new/mermaid-js/mermaid/@mermaid-js/tiny@7357

commit: a411b9f

@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 29, 2026

Codecov Report

❌ Patch coverage is 0% with 18 lines in your changes missing coverage. Please review.
✅ Project coverage is 3.58%. Comparing base (09d0650) to head (a411b9f).
⚠️ Report is 6 commits behind head on develop.

Files with missing lines Patch % Lines
packages/mermaid/src/rendering-util/createGraph.ts 0.00% 18 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           develop   #7357      +/-   ##
==========================================
- Coverage     3.59%   3.58%   -0.01%     
==========================================
  Files          474     474              
  Lines        47514   47529      +15     
  Branches       740     740              
==========================================
  Hits          1706    1706              
- Misses       45808   45823      +15     
Flag Coverage Δ
unit 3.58% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
packages/mermaid/src/rendering-util/createGraph.ts 0.00% <0.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@argos-ci
Copy link
Copy Markdown

argos-ci Bot commented Jan 29, 2026

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) ✅ No changes detected - Jan 29, 2026, 12:24 PM

@ashishjain0512 ashishjain0512 added this pull request to the merge queue Jan 30, 2026
Merged via the queue into mermaid-js:develop with commit d4611b5 Jan 30, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Other Not an enhancement or a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants