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

Update entity relationship diagram to use new renderer #5965

Open
wants to merge 32 commits into
base: develop
Choose a base branch
from

Conversation

yari-dewalt
Copy link
Collaborator

@yari-dewalt yari-dewalt commented Oct 15, 2024

📑 Summary

Updates the er diagram to the new unified way of rendering. Includes a new "erBox" shape to be used in diagrams as well as some other updates to bring it to the same level as the other diagrams including: support for styling nodes, the handDrawn look, the introduction of the classDef statement and class styling, support for styling the default class, support for unicode text and markdown formatting, and direction statements. Adds tests for all the new features and new rendered version.

📏 Design Decisions

  • The erDb gathers the necessary data and passes it to the v3 unified renderer.
  • The erBox shape is kind of complicated due to the placement and possibility of different text (attributes) and so it utilizes a helper text creation function (includes workaround for < and > syntax conflicts)
  • The style statement works the same as it does in other diagrams.
  • The classDef statement also works similarly as it does in other diagrams and defines a class that can be used in the diagram (either via the shorthand ::: or a class statement).
  • Style, classDef, and class statements, as well as the shorthand, are able to take in a list of ids (e.g. style entity1, entity2 color:red | classDef class1, class2 stroke:pink | class entity1, entity2 myClass | entity1:::class1,class2)
  • The erDiagram markers have been transitioned into the updated version.

📋 Tasks

Make sure you

  • 📖 have read the contribution guidelines
  • 💻 have added necessary unit/e2e tests.
  • 📓 have added documentation. Make sure MERMAID_RELEASE_VERSION is used for all new features.
  • 🦋 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:.

Copy link

changeset-bot bot commented Oct 15, 2024

⚠️ No Changeset found

Latest commit: 5a2a8f9

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

Copy link

netlify bot commented Oct 15, 2024

Deploy Preview for mermaid-js ready!

Name Link
🔨 Latest commit 5a2a8f9
🔍 Latest deploy log https://app.netlify.com/sites/mermaid-js/deploys/67211c8f0d0c84000832ed67
😎 Deploy Preview https://deploy-preview-5965--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 site configuration.

Copy link

pkg-pr-new bot commented Oct 16, 2024

Open in Stackblitz

pnpm add https://pkg.pr.new/mermaid-js/mermaid@5965
pnpm add https://pkg.pr.new/mermaid-js/mermaid/@mermaid-js/mermaid-zenuml@5965
pnpm add https://pkg.pr.new/mermaid-js/mermaid/@mermaid-js/layout-elk@5965
pnpm add https://pkg.pr.new/mermaid-js/mermaid/@mermaid-js/parser@5965

commit: 5a2a8f9

Copy link

codecov bot commented Oct 16, 2024

Codecov Report

Attention: Patch coverage is 0% with 814 lines in your changes missing coverage. Please review.

Project coverage is 4.44%. Comparing base (8d0902d) to head (5a2a8f9).

Files with missing lines Patch % Lines
.../rendering-util/rendering-elements/shapes/erBox.ts 0.00% 331 Missing ⚠️
packages/mermaid/src/diagrams/er/erDb.ts 0.00% 240 Missing ⚠️
...d/src/rendering-util/rendering-elements/markers.js 0.00% 126 Missing ⚠️
...ages/mermaid/src/diagrams/er/erRenderer-unified.ts 0.00% 71 Missing ⚠️
packages/mermaid/src/diagrams/er/styles.js 0.00% 30 Missing ⚠️
...id/src/rendering-util/rendering-elements/shapes.ts 0.00% 9 Missing ⚠️
...rc/rendering-util/rendering-elements/edgeMarker.ts 0.00% 4 Missing ⚠️
...rc/rendering-util/layout-algorithms/dagre/index.js 0.00% 2 Missing ⚠️
packages/mermaid/src/diagrams/er/erDiagram.ts 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           develop   #5965      +/-   ##
==========================================
- Coverage     4.50%   4.44%   -0.06%     
==========================================
  Files          383     386       +3     
  Lines        53873   54591     +718     
  Branches       622     598      -24     
==========================================
  Hits          2425    2425              
- Misses       51448   52166     +718     
Flag Coverage Δ
unit 4.44% <0.00%> (-0.06%) ⬇️

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

Files with missing lines Coverage Δ
packages/mermaid/src/diagrams/er/erDiagram.ts 0.00% <0.00%> (ø)
...rc/rendering-util/layout-algorithms/dagre/index.js 0.00% <0.00%> (ø)
...rc/rendering-util/rendering-elements/edgeMarker.ts 0.00% <0.00%> (ø)
...id/src/rendering-util/rendering-elements/shapes.ts 0.00% <0.00%> (ø)
packages/mermaid/src/diagrams/er/styles.js 0.00% <0.00%> (ø)
...ages/mermaid/src/diagrams/er/erRenderer-unified.ts 0.00% <0.00%> (ø)
...d/src/rendering-util/rendering-elements/markers.js 0.00% <0.00%> (ø)
packages/mermaid/src/diagrams/er/erDb.ts 0.00% <0.00%> (ø)
.../rendering-util/rendering-elements/shapes/erBox.ts 0.00% <0.00%> (ø)

... and 1 file with indirect coverage changes

Copy link

argos-ci bot commented Oct 16, 2024

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

Waiting for the first build to start…

Copy link
Contributor

@jgreywolf jgreywolf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of small comments to start :)

packages/mermaid/src/diagrams/er/erDb.ts Show resolved Hide resolved
packages/mermaid/src/diagrams/er/erDb.ts Outdated Show resolved Hide resolved
@yari-dewalt yari-dewalt changed the title Update entity relationship diagram to v3 using new renderer Update entity relationship diagram to use new renderer Oct 23, 2024
@yari-dewalt yari-dewalt marked this pull request as ready for review October 23, 2024 19:17
@yari-dewalt
Copy link
Collaborator Author

E2E tests failing because of screenshot capacity

An error was thrown in your plugins file while executing the handler for the after:run event.

The error we received was:

Error: You have reached the maximum screenshot capacity included in your Pro open source xl Plan. Please upgrade your Plan.
at throwAPIError (file:///__w/mermaid/mermaid/node_modules/.pnpm/@argos-ci[email protected]/node_modules/@argos-ci/api-client/dist/index.mjs:28:15)
at upload (file:///__w/mermaid/mermaid/node_modules/.pnpm/@argos-ci[email protected]/node_modules/@argos-ci/core/dist/index.mjs:886:9)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object. (file:///__w/mermaid/mermaid/node_modules/.pnpm/@argos-ci[email protected][email protected]/node_modules/@argos-ci/cypress/dist/task.mjs:32:21)
at async Object.handlerThatCallsUserDefinedHandler [as handler] (/__w/mermaid/mermaid/node_modules/.pnpm/@applitools[email protected][email protected][email protected]/node_modules/@applitools/eyes-cypress/dist/plugin/pluginExport.js:105:21)
Test run failed, code 1
More information might be available above
Cypress module has returned the following error message:
Could not find Cypress test run results
Error: Could not find Cypress test run results

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.

2 participants