Add a changeset that explains that overflowing blocks no longer
create an empty line in block diagrams or cause bugs in later lines.
Technically, this is a breaking change since it can change the layout of
block diagrams, but this diagram is still in `-beta` and they all will
still render correctly.
Changed packages/mermaid-zenuml/README.md from a symbolic link pointing to ../mermaid/src/docs/syntax/zenuml.md to a standalone README file with comprehensive documentation for the @mermaid-js/mermaid-zenuml package.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Fixes a runtime error in cose-bilkent layout caused by insertEdge calling .filter() on an undefined edge list. Now defaults to an empty array to prevent the crash.
on-behalf-of: @Mermaid-Chart <hello@mermaidchart.com>
* develop:
chore: Update jsdom
Update @argos-ci/cypress to v5.0.2
Update @argos-ci/cypress to v5.0.1
chore: Upgrade cypress
chore: Update @argos-ci/cypress to v5
chore(test): Finish refactoring of jsdomit tests
docs(tests): Documentation for `jsdomIt` tests
test(refactor): Provide SVG selection in `jsdomIt` function
test(refactor): Use real-ish rendering instead of heavy mocking in unit tests
* Creates a utility method `jsdomIt` that overrides `it` from `vitest` and fakes a browser environment by :
* Creating a DOM with `jsdom` (and `canvas`)
* Adding (for the duration of the test) that DOM's `window` and `document` on `global`
* Monkey-patching DOM methods that require a rendering engine (`Element.getBBox` & `Element.getComputedLength`)
* Removes all d3 mocking since it can now work normally in `jsdomIt` tests
* Re-writes existing rendering tests to :
* Use `jsdomIt`
* Get rid of most of the involved mocking
* Run `expect` calls on the generated SVG instead
Inspired by d3's own test code mocking : https://github.com/d3/d3-selection/blob/v3.0.0/test/jsdom.js
Edited flowDB.ts which already had interpolate for styling links
individually. Added the ability to modify this parameter using the
newer @ syntax using the curve property.
* develop: (266 commits)
chore: update E2E timings
docs: Update changeset
fix: Add useful error message to test
chore: Add treemap example
chore: Add treemap example
chore: Add peerDependency to @mermaid-js/examples
Version Packages
docs: Update changeset
update in changeset
updated validaor and tests to use treemap
Updated parser to use treemap
chore: Fail build in CI on type errors
fix text going outside node
Version Packages
Updated phpbb url to support 403 in lychee
Updated lychee for working url phpbb.com
resolve PR comment
resolve PR comments
chore: update E2E timings
add changeset
...
* develop: (198 commits)
Version Packages
docs: Update changeset
update in changeset
updated validaor and tests to use treemap
Updated parser to use treemap
chore: Fail build in CI on type errors
Version Packages
Updated phpbb url to support 403 in lychee
Updated lychee for working url phpbb.com
resolve PR comment
resolve PR comments
chore: update E2E timings
add changeset
log warning when duplicate commit IDs are encountered
Added updated chatgpt plugin url and removed failing url
Added classes and outernodes in imperativestate
Updated code as per suggestions
fixed unwanted vitepress from lockfile
Updated as per suggestions
Added step to install pnpm and echo statements for debugging.
...
This seems like an abandoned product, where the author went on a rampage trying to get it included into as many repositories as he can as a publicity stunt and no longer even works...
* master: (46 commits)
Add canonicals to pages migrated to docs.mermaidchart.com
chore: minor update
chore: dynamically change text size depending on route
chore: update text size to lg
chore: remove tooltip
chore: update as per PR comment
chore: Update banner ad
chore: Use mermaid.live as fallback links in button
chore: Tweak shadows
chore : fix UI
chore: Update URL
chore: UI refactor
chore: Update UI design
chore: removed index and used flag
chore: code refactor
chore: Update as per PR suggestion.
chore: add event listener for button.
Feat: Add editor popup modal
Skip foswiki link check
feat: Pause animation when hovering
...
- Fixed inconsistent vertical line lengths in timeline diagrams
- All vertical lines now extend to same depth regardless of event count
- Added sufficient padding for clear visibility of dashed lines and arrowheads
- Added comprehensive test case and demo example
Fixes#6610
This feature looks like it's been broken for a long time, but something
about the Cypress environment was rewriting the URL to be relative,
causing this test to incorrectly pass.
* develop: (189 commits)
chore(deps): update dependency vite to v6.1.6 [security]
corrected font size text
docs(theme): fix table formatting by removing extra line between fontFamily and fontSize
chore(deps): update dependency eslint-plugin-unicorn to v59
chore(deps): update dependency vite to v6.1.5 [security]
docs(theme): document fontFamily customization in themeVariables
chore(deps): update eslint
chore(deps): update peter-evans/create-pull-request digest to 3b1f4bf
chore(deps): update dependency vite to v6.1.5 [security]
Added the changeset
Deleted unused code
Deleted unused method
chore: update E2E timings
added changeset and unit test
fix(sequenceDiagram): allow empty message after colon (Fixes#6518)
chore(deps): update wei/curl digest to 012398a
`layout-elk` package documentation misleading version
[autofix.ci] apply automated fixes
code review - wording and removals
[autofix.ci] apply automated fixes
...
- wording choice to match writing
- removing incorrect assumptions about String quotation and insensitivity.
Co-authored-by: Sidharth Vinod <github@sidharth.dev>
Following on from recommendation from code senior👌;
adding details to mermaid syntax in a more useful location;
- comments (tho not totally truethful)
- indenting
- case insensitive
- string handling
- expectations with invalid keywords or parameters
* shifting directives to frontmatter as recomended - it is literally about to me removed,
* tweaking context comment about directives
* tweaking code in general formatting, spelling, wording
Add ZenUML changesets for:
- Bumping the minimum version of ZenUML to 3.23.28
- Limiting the `peerDepdencies` to v10 and v11
See: 9d06d8f31e
See: 0ad44c12fe
Previously, the h4 line "#### Using Dagre Layout with Classic Look:" was included at the bottom of the previous Example configuration code block. Now it renders as a h4
* develop: (52 commits)
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.
revert from and to type to object
add eslint rule consistent-type-definations
Update createText.ts
chore(deps): update all patch dependencies
revert lock file
simplify message type from and to
move types to separate file
use interfaces instead of types
feat: create utils func + test cases
...
* develop: (101 commits)
Add extra test
Add visual test
Wait for image to be rendered
Update docs
Linting
chore: temp fix for eslint OOM
chore: Update error snapshots
Fix ESLint
chore: Prettier
chore: YOLO `pnpm --recursive update`
chore: Remove commitlint
Fix flowchart-elk render test
chore: Add example page link in index
Fix flowchart-elk render test
chore: Add example page link in index
fix: Remove space which caused extra newline on diagrams
fix: Remove repeated config calls
fix: ELK diagram remove re-parsing
chore: Minor fixes#4856
chore: Increase ESLint memory limit
...
* develop: (31 commits)
make LLM integrations a new headline
build docs
ci(e2e): avoid commenting on PRs in CI
chore: Remove unused imports in block
Fix spelling
Update docs
Lychee ignore chrome webstore
Update link
chore(deps): update all patch dependencies
build(docs): vendor CSS dependencies
chore(deps): update all minor dependencies
fix linting issues
Ran lint:fix
Fix chrome webstore url causing 404
Add LLM integration section in productivity tools and add HueHive
build(deps): update `langium` to `v3` and apply the required changes
Remove dummy change from e2e.yml
Remove dummy change
Remove log
Format message
...
* next: (269 commits)
Resolves E2E testing issues and issue #5343
Fix spelling
Fix community integrations
Fix docs
docs: Fix config
Update all minor dependencies
Amend docs to document gitgraph parallel commits
Fix lint
Use Yarn Add COREPACK_ENABLE_STRICT
Added link to Blazorade Mermaid to the community integrations page.
Bump node version
Add lcov to cspell
Correcting path to docker-entrypoint.sh
Update recommended Vitest extension
Replace mermaid-js.github.io links
Replace links to docs with links to webhelp
Link to contributing page on webhelp
Changes to timeline.md 1. Added colons to all 'NOTES' for consistency.
Changes to timeline.md 1. Updates the Wikipedia citation to include a link. 2. Removed periods from documentation sections to be consistent (some had periods, some didn't) 3. Added a space to a coding example for spacing consistency.
Replace version number placeholder
...
* next: (27 commits)
chore: Fix type
refactor!: remove MermaidConfig type enum fallback
test: rewrite some `config` vals to tighten types
chore: Add comment for `yy`.
chore: Increase heap size when building
chore: increase `test-util.ts` converage by returning `undefined`
chore: add `vitest` imports to `test-util.ts`
chore: run `pnpm lint:fix`
create `noErrorsOrAlternatives` parser helper function
chore: export `InfoModule` from `infoModule.ts`
docs(parser): create `packages/parser` README.md file
build: build `.langium` file using `generate` from `langium-cli`
build: update `langium` and `langium-cli` to `v2.0.1`
fix: fix if statment logic checks if `parser` is not `undefined`
chore: add a comment illustrate why we build packages sequentially
chore: refactore `&&` into `if` in `populateCommonDb`
chore: remove `./*` part from `exports` in `parser/package.json`
fix: use `execFileSync` instead of `execSync` in `generateLangium`
fix(mermaid): mark `mermaid-parser` dependecy with `^`
reorder `packages/parser` after `packages/mermaid/src/vitepress`
...
* next:
chore: Move SVG import to comment.
build docs
Remove whitespace on empty line
chore: Fix minify
Documentation for #2509
Update all minor dependencies
Update all patch dependencies
make more `RectData` required and remove optional assignment
use lineBreakRegex in `svgDrawCommon`
fix svgDrawCommon import by adding `.js`
add types to `svgDrawCommon.ts`
convert `svgDrawCommon` to TS
args:-X POST "$APPLITOOLS_SERVER_URL/api/externals/github/push?apiKey=$APPLITOOLS_API_KEY&CommitSha=$GITHUB_SHA&BranchName=${APPLITOOLS_BRANCH}$&ParentBranchName=$APPLITOOLS_PARENT_BRANCH"
@@ -44,7 +44,7 @@ Try Live Editor previews of future releases: <a href="https://develop.git.mermai
**Thanks to all involved, people committing pull requests, people answering questions! 🙏**
<ahref="https://mermaid.js.org/landing/"><imgsrc="https://github.com/mermaid-js/mermaid/blob/master/docs/intro/img/book-banner-post-release.jpg"alt="Explore Mermaid.js in depth, with real-world examples, tips & tricks from the creator... The first official book on Mermaid is available for purchase. Check it out!"></a>
<ahref="https://mermaid.js.org/landing/"><imgsrc="https://github.com/mermaid-js/mermaid/blob/master/docs/intro/img/book-banner-post-release.jpg"alt='Banner for "The Official Guide to Mermaid.js" book'></a>
## Table of content
@@ -95,10 +95,6 @@ In our release process we rely heavily on visual regression tests using [applito
<!-- </Main description> -->
## Mermaid AI Bot
[Mermaid](https://codeparrot.ai/oracle?owner=mermaid-js&repo=mermaid) Bot will help you understand this repository better. You can ask for code examples, installation guide, debugging help and much more.
## Examples
**The following are some examples of the diagrams, charts and graphs that can be made using Mermaid. Click here to jump into the [text syntax](https://mermaid.js.org/intro/syntax-reference.html).**
@@ -451,7 +447,7 @@ For public sites, it can be precarious to retrieve text from users on the intern
As an extra level of security for sites with external users we are happy to introduce a new security level in which the diagram is rendered in a sandboxed iframe preventing javascript in the code from being executed. This is a great step forward for better security.
_Unfortunately you cannot have a cake and eat it at the same time which in this case means that some of the interactive functionality gets blocked along with the possible malicious code._
_Unfortunately you cannot have a cake and eat it at the same time which in this case means that some of the interactive functionality gets blocked along with the possible malicious code._
<ahref="https://mermaid.js.org/landing/"><imgsrc="https://github.com/mermaid-js/mermaid/blob/master/docs/intro/img/book-banner-post-release.jpg"alt="Explore Mermaid.js in depth, with real-world examples, tips & tricks from the creator... The first official book on Mermaid is available for purchase. Check it out!"></a>
<ahref="https://mermaid.js.org/landing/"><imgsrc="https://github.com/mermaid-js/mermaid/blob/master/docs/intro/img/book-banner-post-release.jpg"alt='Banner for "The Official Guide to Mermaid.js" book'></a>
it('Graph: should handle a click on a node with a bound url',()=>{
// When there is a URL, cy.contains selects the a tag instead of the span. The .node is a child of a, so we have to use find instead of parent.
// When there is a URL, `cy.contains()` selects the `a` tag instead of the `span` tag. The .node is a child of `a`, so we have to use `find()` instead of `parent`.
apa[I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on]
apa2[I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on]
b
c
d
B
apa3[I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on]
D
apa5[I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on]
apa4[I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on]
apa[I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on]
apa2[I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on]
b
apa3[I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on]
apa4[I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on]
</pre>
<preid="diagram4"class="mermaid2">
---
config:
layout: tidy-tree
---
flowchart TB
A --> n0["1"]
A --> n1["2"]
A --> n2["3"]
A --> n3["4"] --> Q & R & S & T
</pre>
<preid="diagram4"class="mermaid2">
---
config:
layout: elk
---
flowchart TB
A --> n0["1"]
A --> n1["2"]
A --> n2["3"]
A --> n3["4"] --> Q & R & S & T
</pre>
<preid="diagram4"class="mermaid2">
---
config:
layout: dagre
---
mindmap
root((mindmap is a long thing))
Origins
Long history
::icon(fa fa-book)
Popularisation
British popular psychology author Tony Buzan
Research
On effectiveness<br/>and features
On Automatic creation
Uses
Creative techniques
Strategic planning
Argument mapping
Tools
Pen and paper
Mermaid
</pre>
<preid="diagram4"class="mermaid2">
---
config:
layout: cose-bilkent
---
mindmap
root((mindmap))
Origins
Long history
::icon(fa fa-book)
Popularisation
British popular psychology author Tony Buzan
Research
On effectiveness<br/>and features
On Automatic creation
Uses
Creative techniques
Strategic planning
Argument mapping
Tools
Pen and paper
Mermaid
</pre>
<preid="diagram4"class="mermaid2">
---
config:
layout: elk
---
mindmap
root((mindmap))
Origins
Long history
::icon(fa fa-book)
Popularisation
British popular psychology author Tony Buzan
Research
On effectiveness<br/>and features
On Automatic creation
Uses
Creative techniques
Strategic planning
Argument mapping
Tools
Pen and paper
Mermaid
</pre>
<preid="diagram4"class="mermaid2">
---
config:
layout: cose-bilkent
---
flowchart LR
root{mindmap} --- Origins --- Europe
Origins --> Asia
root --- Background --- Rich
Background --- Poor
subgraph apa
Background
Poor
end
</pre>
<preid="diagram4"class="mermaid2">
---
config:
layout: elk
---
flowchart LR
root{mindmap} --- Origins --- Europe
Origins --> Asia
root --- Background --- Rich
Background --- Poor
</pre>
<preid="diagram4"class="mermaid2">
flowchart
D(("for D"))
</pre>
<preid="diagram4"class="mermaid">
<preid="diagram4"class="mermaid2">
flowchart LR
A e1@==> B
e1@{ animate: true}
</pre>
<preid="diagram4"class="mermaid">
<preid="diagram4"class="mermaid2">
flowchart LR
A e1@--> B
classDef animate stroke-width:2,stroke-dasharray:10\,8,stroke-dashoffset:-180,animation: edge-animation-frame 6s linear infinite, stroke-linecap: round
@@ -189,6 +465,44 @@ config:
</pre>
<preid="diagram4"class="mermaid2">
---
config:
layout: elk
---
flowchart LR
a
subgraph s0["APA"]
subgraph s8["APA"]
subgraph s1["APA"]
D{"X"}
E[Q]
end
subgraph s3["BAPA"]
F[Q]
I
end
D --> I
D --> I
D --> I
I{"X"}
end
end
</pre>
<preid="diagram4"class="mermaid2">
---
config:
layout: elk
---
flowchart LR
a
D{"Use the editor"}
D -- Mermaid js --> I{"fa:fa-code Text"}
D-->I
D-->I
</pre>
<preid="diagram4"class="mermaid2">
---
config:
layout: elk
---
@@ -386,7 +700,7 @@ kanban
[Create Documentation]
docs[Create Blog about the new diagram]
id7[In progress]
id6[Create renderer so that it works in all cases. We also add som extra text here for testing purposes. And some more just for the extra flare.]
id6[Create renderer so that it works in all cases. We also add some extra text here for testing purposes. And some more just for the extra flare.]
apa[I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on]
apa2[I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on]
b
c
d
B
apa3[I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on]
D
apa5[I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on]
apa4[I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on]
</pre>
<preclass="mermaid">
---
config:
layout: dagre
---
mindmap
root((mindmap))
A
a
apa[I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on]
apa2[I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on]
b
c
d
B
apa3[I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on]
D
apa5[I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on]
apa4[I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on]
</pre>
<preclass="mermaid">
---
config:
layout: elk
---
mindmap
root((mindmap))
A
a
apa[I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on]
apa2[I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on]
b
c
d
B
apa3[I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on]
D
apa5[I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on]
apa4[I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on]
</pre>
<preclass="mermaid">
---
config:
layout: cose-bilkent
---
mindmap
root((mindmap))
A
a
apa[I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on]
apa2[I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on]
b
c
d
B
apa3[I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on]
D
apa5[I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on]
apa4[I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on. I am a long long multline string passing several levels of text. Lorum ipsum and so on]
title Component diagram for Internet Banking System - API Application
Container(spa, "Single Page Application", "javascript and angular", "Provides all the internet banking functionality to customers via their web browser.")
Container(ma, "Mobile App", "Xamarin", "Provides a limited subset ot the internet banking functionality to customers via their mobile mobile device.")
Container(ma, "Mobile App", "Xamarin", "Provides a limited subset ot the internet banking functionality to customers via their mobile device.")
x-axis [jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec]
y-axis "Revenue (in $)" 4000 --> 11000
@@ -26,7 +26,7 @@
<hr/>
<h1>XY Charts horizontal</h1>
<preclass="mermaid">
xychart-beta horizontal
xychart horizontal
title "Basic xychart"
x-axis "this is x axis" [category1, "category 2", category3, category4]
y-axis yaxisText 10 --> 150
@@ -36,7 +36,7 @@
<hr/>
<h1>XY Charts only lines and bar</h1>
<preclass="mermaid">
xychart-beta
xychart
line [23, 46, 77, 34]
line [45, 32, 33, 12]
line [87, 54, 99, 85]
@@ -48,13 +48,13 @@
<hr/>
<h1>XY Charts with +ve and -ve numbers</h1>
<preclass="mermaid">
xychart-beta
xychart
line [+1.3, .6, 2.4, -.34]
</pre>
<h1>XY Charts Bar with multiple category</h1>
<preclass="mermaid">
xychart-beta
xychart
title "Basic xychart with many categories"
x-axis "this is x axis" [category1, "category 2", category3, category4, category5, category6, category7]
y-axis yaxisText 10 --> 150
@@ -63,7 +63,7 @@
<h1>XY Charts line with multiple category</h1>
<preclass="mermaid">
xychart-beta
xychart
title "Line chart with many category"
x-axis "this is x axis" [category1, "category 2", category3, category4, category5, category6, category7]
y-axis yaxisText 10 --> 150
@@ -72,7 +72,7 @@
<h1>XY Charts category with large text</h1>
<preclass="mermaid">
xychart-beta
xychart
title "Basic xychart with many categories with category overlap"
x-axis "this is x axis" [category1, "Lorem ipsum dolor sit amet, qui minim labore adipisicing minim sint cillum sint consectetur cupidatat.", category3, category4, category5, category6, category7]
@@ -29,7 +29,8 @@ In GitHub, you first [**fork a mermaid repository**](https://github.com/mermaid-
Then you **clone** a copy to your local development machine (e.g. where you code) to make a copy with all the files to work with.
> **💡 Tip** > [Here is a GitHub document that gives an overview of the process](https://docs.github.com/en/get-started/quickstart/fork-a-repo).
> **💡 Tip**
> [Here is a GitHub document that gives an overview of the process](https://docs.github.com/en/get-started/quickstart/fork-a-repo).
```bash
git clone git@github.com/your-fork/mermaid
@@ -301,7 +302,7 @@ If you are adding a feature, you will definitely need to add tests. Depending on
Unit tests are tests that test a single function or module. They are the easiest to write and the fastest to run.
Unit tests are mandatory for all code except the renderers. (The renderers are tested with integration tests.)
Unit tests are mandatory for all code except the layout tests. (The layouts are tested with integration tests.)
We use [Vitest](https://vitest.dev) to run unit tests.
@@ -327,6 +328,30 @@ When using Docker prepend your command with `./run`:
./run pnpm test
```
##### Testing the DOM
One can use `jsdomIt` to test any part of Mermaid that interacts with the DOM, as long as it is not related to the layout.
The function `jsdomIt` ([developed in utils.ts](../../tests/util.ts)) overrides `it` from `vitest`, and creates a pseudo-browser environment that works almost like the real deal for the duration of the test. It uses JSDOM to create a DOM, and adds objects `window` and `document` to `global` to mock the browser environment.
> \[!NOTE]
> The layout cannot work in `jsdomIt` tests because JSDOM has no rendering engine, hence the pseudo-browser environment.
jsdomIt('should add element "thing" in the SVG',({svg})=>{
// Code in this block runs in a pseudo-browser environment
addThing(svg);// The svg item is the D3 selection of the SVG node
constsvgNode=ensureNodeFromSelector('svg');// Retrieve the DOM node using the DOM API
expect(svgNode.querySelector('thing')).not.toBeNull();// Test the structure of the SVG
});
```
They can be used to test any method that interacts with the DOM, including for testing renderers. For renderers, additional integration testing is necessary to test the layout though.
#### Integration / End-to-End (E2E) Tests
These test the rendering and visual appearance of the diagrams.
@@ -497,14 +522,14 @@ This is a danger alert
### Navigation
If you want to propose changes to how the documentation is _organized_, such as adding a new section or re-arranging or renaming a section, you must update the **sidebar navigation**, which is defined in [the vitepress config](../.vitepress/config.ts). The same goes to **topbar**.
If you want to propose changes to how the documentation is _organized_, such as adding a new section or re-arranging or renaming a section, you must update the **sidebar navigation**, which is defined in [the vitepress config](../.vitepress/config.ts). The same goes for **topbar**.
### Build Docs
The content of `/docs` folder is built with Github Actions.
The content of `/docs` folder is built with GitHub Actions.
> **Warning**
> So as to allow automatic compilation of documentation pages you have to enable Github Actions on your fork first
> So as to allow automatic compilation of documentation pages you have to enable GitHub Actions on your fork first
The actual options and values for the colors are defined in **src/theme/theme-\[xyz].js**. If you provide the options your diagram needs in the existing theme files then the theming will work smoothly without hiccups.
## Examples
The `@mermaid-js/examples` package contains a collection of examples that are used by tools like mermaid.live to help users get started with the new diagram.
You can duplicate an existing diagram example file, eg: `packages/examples/src/examples/flowchart.ts`, and modify it with details specific to your diagram.
Then you can import the example in the `packages/examples/src/index.ts` file and add it to the `examples` array.
Each diagram should have at least one example, and that should be marked as default. It is good to add more examples to showcase different features of the diagram.
@@ -22,4 +22,4 @@ This helps the team know the relative interest in something and helps them set p
You have not found anything that already addresses your request, or maybe you have come up with the new idea? Feel free to open a new issue or discussion.
Log in to [GitHub.com](https://www.github.com), and use [GitHub issue tracker of the mermaid-js repository](https://github.com/mermaid-js/mermaid/issues). Press \[<https://github.com/mermaid-js/mermaid/issues/new/choose>] issue, select the appropriate template and describe your problem.
Log in to [GitHub.com](https://www.github.com), and use [GitHub issue tracker of the mermaid-js repository](https://github.com/mermaid-js/mermaid/issues). Press [issue, select the appropriate template](https://github.com/mermaid-js/mermaid/issues/new/choose) and describe your problem.
@@ -22,7 +22,6 @@ While directives allow you to change most of the default configuration settings,
Mermaid basically supports two types of configuration options to be overridden by directives.
1._General/Top Level configurations_ : These are the configurations that are available and applied to all the diagram. **Some of the most important top-level** configurations are:
- theme
- fontFamily
- logLevel
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.