Skip to content

Streamlining and enhancing diagram rendering across various diagram types - #5604

Merged
ashishjain0512 merged 274 commits into
developfrom
5237-unified-layout-common-renderer
Aug 12, 2024
Merged

ashishjain0512 merged 274 commits into
developfrom
5237-unified-layout-common-renderer

Conversation

@knsv

@knsv knsv commented Jun 28, 2024

Copy link
Copy Markdown
Collaborator

📑 Summary

There is noticeable duplication in functionality among different diagram types. Several graph-based diagrams share common features in rendering, but these are implemented separately in each diagram type.

This PR introduces a Unified Layout Engine: Implement a singular layout engine for all graph-based diagrams.

Benefits:

  • Facilitates the introduction of new layout algorithms universally across all graph-based diagrams.
  • Enhances consistency in diagram layouts.
  • Standardizes interaction, styling, and class handling across diagrams.
  • Enables shape reusability between different diagram types.
  • Simplifies introduction of additional layout engines
  • New layout engines will work for all diagrams using this way of rendering

Resolves #5237

📏 Design Decisions

Describe the way your implementation works or what design decisions you made if applicable.

📋 Tasks

Make sure you

ashishjain0512 and others added 30 commits May 3, 2024 12:50
* develop: (462 commits)
  Update packages/mermaid/src/diagrams/sequence/parser/sequenceDiagram.jison
  fix: Simplify actor type of activeStart and activeEnd
  chore(deps): update all patch dependencies
  chore: Fix typo
  chore(deps): update all patch dependencies
  chore: remove repetitive words
  Update stateDiagram.md
  Update stateDiagram.md
  fix: simply from and to in message to string type
  docs: Add quadrant point styling
  feat: Change precedence of styling
  chore(deps): update all minor dependencies
  chore(deps): update all patch dependencies
  fix: eslint ignore, type definition
  chore(deps): update all patch dependencies
  fix: Remove `ImperativeState` type restriction.
  📝🐛 fix schema link
  update latest news section
  Changes to rendering/gitGraph.spec.js - Added additional rendering test functionality for recognizing 'switch' as an alias to 'checkout'.
  1. Changes to gitGraph.jison - Updated the regex to allow either 'checkout' or 'switch' 2. Changes to gitGraphParser.spec.js - Additional test coverage added for the changes made to the parser. 3. Changes to gitGraphParserV2.spec.js - Additional test coverafe added for the changes made to the parser. 4. Changes to gitgraph.md - Updated documentation to let users know that checkout/switch can be used interchangeably.
  ...
…com/mermaid-js/mermaid into 5237-unified-layout-common-renderer

* '5237-unified-layout-common-renderer' of https://github.com/mermaid-js/mermaid:
  #5237 Theme support for stateStart, stateEnd, choice and fork/join
  #5237 Improved Edge Handling
  #5237 pass css node style like bgColor, borderColor, borderWeight for roughjs
'<span class="' +
labelClass +
'" ' +
(node.labelStyle ? 'style="' + node.labelStyle + '"' : '') + // codeql [js/html-constructed-from-input] : false positive

Check warning

Code scanning / CodeQL

Unsafe HTML constructed from library input

This HTML construction which depends on [library input](1) might later allow [cross-site scripting](2). This HTML construction which depends on [library input](3) might later allow [cross-site scripting](2). This HTML construction which depends on [library input](4) might later allow [cross-site scripting](2).
@ashishjain0512
ashishjain0512 added this pull request to the merge queue Aug 12, 2024
Merged via the queue into develop with commit 87b2084 Aug 12, 2024
@ashishjain0512
ashishjain0512 deleted the 5237-unified-layout-common-renderer branch August 12, 2024 12:38
@perseveringman

Copy link
Copy Markdown

@sidharthv96 This PR unifies rendering, but data4Layout still only contains the most basic information. As mentioned in #6095, the hope is to add layout information changes without imposing additional burdens on users who do not need this capability. I fully agree with this. Would it be a good idea to add a parameter in the db.getData function to indicate whether to additionally return graphData? I am very much looking forward to this capability and am happy to provide any assistance. Please let me know how I can help. Thank you very much! Looking forward to your reply!

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.

Make common layout and render engines that can be used by many diagrams

6 participants