Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mermaid-js/mermaid
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v10.1.0
Choose a base ref
...
head repository: mermaid-js/mermaid
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v10.2.0
Choose a head ref

Commits on Dec 21, 2022

  1. Copy the full SHA
    1495ae6 View commit details

Commits on Feb 24, 2023

  1. Merge branch 'develop' into sidv/contributors

    * develop: (309 commits)
      Update docs
      fix Lint
      Update CHANGELOG.md
      Update CHANGELOG.md
      fix: fix exports
      Doc (typo): remove duplicate "be"
      Fix readme link
      Regenerate mermaid docs
      Add deepdwn to cspell
      Add Deepdwn to native integrations list
      docs: Fix changelog
      docs: v10 breaking changes
      Remove `null` from diagrams before render
      fix docs diagram
      Updated version
      Minor cleanup to trigger build.
      Fix spellings
      Wrap option working in test case
      Fix typos
      Minor cleanup
      ...
    sidharthv96 committed Feb 24, 2023
    Copy the full SHA
    8c2dbaf View commit details
  2. fix lockfile

    sidharthv96 committed Feb 24, 2023
    Copy the full SHA
    d688f1f View commit details
  3. WIP: Contributors

    sidharthv96 committed Feb 24, 2023
    Copy the full SHA
    00a14ee View commit details

Commits on Mar 7, 2023

  1. Add UMD back

    sidharthv96 committed Mar 7, 2023
    Copy the full SHA
    5338301 View commit details

Commits on Mar 11, 2023

  1. Support node16 module resolution

    The `node16` module resolution requires imports to use the `.js` file
    extension in type definitions.
    
    `@rollup/plugin-typescript` is needed to make this work with the Vite
    setup used by Mermaid.
    
    The module option for Mermaid internally is set to `nodenext`. This is
    needed to support `.json` imports. Note that setting `module` to
    `node16` or `nodenext` implies a matching `moduleResolution` value.
    remcohaszing committed Mar 11, 2023
    Copy the full SHA
    b7d31ad View commit details
  2. Fix vue import error

    remcohaszing committed Mar 11, 2023
    Copy the full SHA
    fd01328 View commit details
  3. Fix import extensions

    remcohaszing committed Mar 11, 2023
    Copy the full SHA
    fc80ba6 View commit details

Commits on Mar 15, 2023

  1. Copy the full SHA
    c1df626 View commit details
  2. Copy the full SHA
    4017bb3 View commit details
  3. Copy the full SHA
    75502d0 View commit details
  4. Implement rendering logic

    ksilverwall committed Mar 15, 2023
    Copy the full SHA
    434961b View commit details

Commits on Mar 17, 2023

  1. Copy the full SHA
    b51b2c7 View commit details
  2. Copy the full SHA
    b725b69 View commit details
  3. Copy the full SHA
    f3bebf2 View commit details
  4. Fix Cypress tests

    remcohaszing committed Mar 17, 2023
    Copy the full SHA
    b719fa9 View commit details

Commits on Mar 20, 2023

  1. Copy the full SHA
    0dc6e0a View commit details
  2. Copy the full SHA
    4515c58 View commit details

Commits on Mar 30, 2023

  1. Copy the full SHA
    e357bbe View commit details

Commits on Mar 31, 2023

  1. Bar chart

    karistom authored Mar 31, 2023
    Copy the full SHA
    a58d014 View commit details
  2. Copy the full SHA
    e6db9e8 View commit details
  3. updated labels in the chart

    karistom authored Mar 31, 2023
    Copy the full SHA
    64baf2d View commit details

Commits on Apr 1, 2023

  1. Copy the full SHA
    da7725f View commit details

Commits on Apr 3, 2023

  1. Copy the full SHA
    bc573ef View commit details

Commits on Apr 4, 2023

  1. Adding Mermaid Strings to news

    knsv committed Apr 4, 2023
    Copy the full SHA
    80df100 View commit details
  2. Copy the full SHA
    756fc06 View commit details
  3. Update docs

    knsv committed Apr 4, 2023
    Copy the full SHA
    e96c830 View commit details
  4. Update docs

    knsv committed Apr 4, 2023
    Copy the full SHA
    8e6d16e View commit details
  5. Copy the full SHA
    5693f63 View commit details
  6. Copy the full SHA
    efc4062 View commit details
  7. linting

    karistom authored Apr 4, 2023
    Copy the full SHA
    7ac84fb View commit details

Commits on Apr 5, 2023

  1. Copy the full SHA
    43137fb View commit details
  2. Copy the full SHA
    ee455c1 View commit details
  3. Copy the full SHA
    721208e View commit details
  4. doc update

    chriskim-au1 committed Apr 5, 2023
    Copy the full SHA
    3b861ab View commit details
  5. revert pnpm changes

    sidharthv96 committed Apr 5, 2023
    Copy the full SHA
    d1e369e View commit details
  6. Merge pull request #4261 from karistom/develop

    Bar chart (using gantt chart)
    sidharthv96 authored Apr 5, 2023
    Copy the full SHA
    777a781 View commit details
  7. Merge branch 'develop' into sidv/addUMD

    * develop: (81 commits)
      revert pnpm changes
      doc update
      auto generated from pnpm run
      auto generated from pnpm run
      linting
      added example of Bar chart
      Update docs
      Adding rendering tests and unit tests
      Syntax for markdown strings is a single backtick.
      updated labels in the chart
      Update docs
      updated example data smaller
      Bar chart
      fix: Remove comment line completely
      fix: trimStart to text
      test: add space before init
      fix uncaughexception in tests
      fix(#4256): Keep error diagram on screen
      fix(#4137): Cleanup comments before parsing
      Update docs
      ...
    sidharthv96 committed Apr 5, 2023
    Copy the full SHA
    ca8ce82 View commit details
  8. fix version

    sidharthv96 committed Apr 5, 2023
    Copy the full SHA
    24c9506 View commit details

Commits on Apr 6, 2023

  1. Copy the full SHA
    d132d26 View commit details

Commits on Apr 8, 2023

  1. Copy the full SHA
    4643bb1 View commit details
  2. Copy the full SHA
    9bb0cef View commit details

Commits on Apr 9, 2023

  1. Copy the full SHA
    37eb100 View commit details
  2. Merge pull request #4285 from emersonbottero/dayjs-esm

    fix: really import esm version of dayjs
    sidharthv96 authored Apr 9, 2023
    Copy the full SHA
    f08778d View commit details

Commits on Apr 10, 2023

  1. Fix #4195 start and end arrow have different sizes

    In #3938, it appears that the marker sizes for pointEnd was
    unintentionally changed. This reverts the change in marker size.
    
    It is also possible that the intention was to change the viewBox size
    for both start and end, but I doubt this since it makes the arrows
    significantly smaller than other markers.
    legonigel committed Apr 10, 2023
    Copy the full SHA
    aa3c002 View commit details
  2. Merge pull request #4268 from Valentine14th/bug/4023-image-rendering

    fix: image rendering in nodes
    jgreywolf authored Apr 10, 2023
    Copy the full SHA
    727bf30 View commit details

Commits on Apr 13, 2023

  1. Update index.md

    Minor grammatical and editorial changes; Updated Mermaid API section to make use of active voice for enhanced readability and comprehension.
    onayiga committed Apr 13, 2023
    Copy the full SHA
    1c98621 View commit details
  2. fix: fix invalid CSS for class diagram

    `.divider` had a `stroke` property of `1` that was invalid.
    
    This looks like a typo from PR
    #1567,
    as the `src/theme/class.scss` file's `.divider` section correctly
    shows `stroke-width: 1;`.
    
    Fixes: #1567
    aloisklink committed Apr 13, 2023
    Copy the full SHA
    83d7d6c View commit details
  3. fix: fix personBorder/Bkg C4 diagram theme vars

    The current `personBorder`/`personBkg` theme variables for C4 diagrams
    are set to the string `'calculated'`.
    
    However, despite being `'calculated'`, they never seem to change to
    anything else, and so become invalid CSS variables.
    
    I've instead changed these to just default to base theme vars,
    as that's what they do in [`these-base.js`][1].
    
    [1]: https://github.com/mermaid-js/mermaid/blob/727bf30824e08c672c7f13ed83f111c2d1596935/packages/mermaid/src/themes/theme-base.js#L106-L107
    aloisklink committed Apr 13, 2023
    Copy the full SHA
    616d370 View commit details
  4. fix: fix invalid CSS fill-opacity value

    Fix an invalid value for the CSS `fill-opacity` value.
    
    Percentage values for `fill-opacity` are only supported in the SVG 2.0
    draft, so according to [MDN][1]:
    
    > it is not widely supported yet, […] as a consequence, it is best
    > practices [sic] to set opacity with a value in the range `[0-1]`.
    
    [1]: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/fill-opacity
    aloisklink committed Apr 13, 2023
    Copy the full SHA
    9cb7a4a View commit details
Showing 302 changed files with 12,892 additions and 6,422 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -50,7 +50,7 @@ body:
attributes:
label: Setup
description: |-
Please fill out the below info.
Please fill out the info below.
Note that you only need to fill out the relevant section
value: |-
- Mermaid version:
29 changes: 29 additions & 0 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Build Vitepress docs

on:
pull_request:

permissions:
contents: read

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- uses: pnpm/action-setup@v2

- name: Setup Node.js
uses: actions/setup-node@v3
with:
cache: pnpm
node-version: 18

- name: Install Packages
run: pnpm install --frozen-lockfile

- name: Run Build
run: pnpm --filter mermaid run docs:build:vitepress
20 changes: 8 additions & 12 deletions .github/workflows/e2e-applitools.yml
Original file line number Diff line number Diff line change
@@ -38,35 +38,31 @@ jobs:
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
cache: pnpm
node-version: ${{ matrix.node-version }}

- name: Install Packages
run: |
pnpm install --frozen-lockfile
env:
CYPRESS_CACHE_FOLDER: .cache/Cypress

- if: ${{ env.USE_APPLI }}
name: Notify applitools of new batch
# Copied from docs https://applitools.com/docs/topics/integrations/github-integration-ci-setup.html
run: curl -L -d '' -X POST "$APPLITOOLS_SERVER_URL/api/externals/github/push?apiKey=$APPLITOOLS_API_KEY&CommitSha=$GITHUB_SHA&BranchName=${APPLITOOLS_BRANCH}$&ParentBranchName=$APPLITOOLS_PARENT_BRANCH"
env:
# e.g. mermaid-js/mermaid/my-branch
APPLITOOLS_BRANCH: ${{ github.repository }}/${{ github.ref_name }}
APPLITOOLS_PARENT_BRANCH: ${{ github.inputs.parent_branch }}
APPLITOOLS_PARENT_BRANCH: ${{ github.event.inputs.parent_branch }}
APPLITOOLS_API_KEY: ${{ secrets.APPLITOOLS_API_KEY }}
APPLITOOLS_SERVER_URL: 'https://eyesapi.applitools.com'

- name: Run E2E Tests
run: pnpm run e2e
- name: Cypress run
uses: cypress-io/github-action@v4
id: cypress
with:
start: pnpm run dev
wait-on: 'http://localhost:9000'
env:
CYPRESS_CACHE_FOLDER: .cache/Cypress
# Mermaid applitools.config.js uses this to pick batch name.
APPLI_BRANCH: ${{ github.ref_name }}
APPLITOOLS_BATCH_ID: ${{ github.sha }}
# e.g. mermaid-js/mermaid/my-branch
APPLITOOLS_BRANCH: ${{ github.repository }}/${{ github.ref_name }}
APPLITOOLS_PARENT_BRANCH: ${{ github.inputs.parent_branch }}
APPLITOOLS_PARENT_BRANCH: ${{ github.event.inputs.parent_branch }}
APPLITOOLS_API_KEY: ${{ secrets.APPLITOOLS_API_KEY }}
APPLITOOLS_SERVER_URL: 'https://eyesapi.applitools.com'
2 changes: 1 addition & 1 deletion .github/workflows/link-checker.yml
Original file line number Diff line number Diff line change
@@ -36,7 +36,7 @@ jobs:
restore-keys: cache-lychee-

- name: Link Checker
uses: lycheeverse/lychee-action@v1.6.1
uses: lycheeverse/lychee-action@v1.7.0
with:
args: >-
--verbose
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -42,7 +42,7 @@ jobs:
if ! pnpm run lint; then
# print a nice error message on lint failure
ERROR_MESSAGE='Running `pnpm run lint` failed.'
ERROR_MESSAGE+=' Running `pnpm run lint:fix` may fix this issue. '
ERROR_MESSAGE+=' Running `pnpm -w run lint:fix` may fix this issue. '
ERROR_MESSAGE+=" If this error doesn't occur on your local machine,"
ERROR_MESSAGE+=' make sure your packages are up-to-date by running `pnpm install`.'
ERROR_MESSAGE+=' You may also need to delete your prettier cache by running'
7 changes: 1 addition & 6 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
@@ -5,10 +5,6 @@ on:
push:
branches:
- master
pull_request:

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
@@ -53,12 +49,11 @@ jobs:

# Deployment job
deploy:
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
environment:
name: github-pages
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
uses: actions/deploy-pages@v2
2 changes: 1 addition & 1 deletion .github/workflows/release-publish.yml
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: fregante/setup-git-user@v1
- uses: fregante/setup-git-user@v2

- uses: pnpm/action-setup@v2
# uses version from "packageManager" field in package.json
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -36,3 +36,6 @@ tsconfig.tsbuildinfo
knsv*.html
local*.html
stats/

**/user-avatars/*
**/contributor-names.json
2 changes: 1 addition & 1 deletion .lintstagedrc.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export default {
'!(docs/**/*)*.{ts,js,json,html,md,mts}': [
'!(docs/**/*)*.{ts,js,html,md,mts}': [
'eslint --cache --cache-strategy content --fix',
// don't cache prettier yet, since we use `prettier-plugin-jsdoc`,
// and prettier doesn't invalidate cache on plugin updates"
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -4,4 +4,5 @@ cypress/platform/xss3.html
coverage
# Autogenerated by PNPM
pnpm-lock.yaml
stats
stats
packages/mermaid/src/docs/.vitepress/components.d.ts
21 changes: 17 additions & 4 deletions .vite/build.ts
Original file line number Diff line number Diff line change
@@ -3,13 +3,15 @@ import { resolve } from 'path';
import { fileURLToPath } from 'url';
import jisonPlugin from './jisonPlugin.js';
import { readFileSync } from 'fs';
import typescript from '@rollup/plugin-typescript';
import { visualizer } from 'rollup-plugin-visualizer';
import type { TemplateType } from 'rollup-plugin-visualizer/dist/plugin/template-types.js';

const visualize = process.argv.includes('--visualize');
const watch = process.argv.includes('--watch');
const mermaidOnly = process.argv.includes('--mermaid');
const __dirname = fileURLToPath(new URL('.', import.meta.url));
const sourcemap = false;

type OutputOptions = Exclude<
Exclude<InlineConfig['build'], undefined>['rollupOptions'],
@@ -59,9 +61,15 @@ export const getBuildConfig = ({ minify, core, watch, entryName }: BuildOptions)
{
name,
format: 'esm',
sourcemap: true,
sourcemap,
entryFileNames: `${name}.esm${minify ? '.min' : ''}.mjs`,
},
{
name,
format: 'umd',
sourcemap,
entryFileNames: `${name}${minify ? '.min' : ''}.js`,
},
];

if (core) {
@@ -78,7 +86,7 @@ export const getBuildConfig = ({ minify, core, watch, entryName }: BuildOptions)
{
name,
format: 'esm',
sourcemap: true,
sourcemap,
entryFileNames: `${name}.core.mjs`,
},
];
@@ -102,9 +110,14 @@ export const getBuildConfig = ({ minify, core, watch, entryName }: BuildOptions)
},
},
resolve: {
extensions: ['.jison', '.js', '.ts', '.json'],
extensions: [],
},
plugins: [jisonPlugin(), ...visualizerOptions(packageName, core)],
plugins: [
jisonPlugin(),
// @ts-expect-error According to the type definitions, rollup plugins are incompatible with vite
typescript({ compilerOptions: { declaration: false } }),
...visualizerOptions(packageName, core),
],
};

if (watch && config.build) {
52 changes: 52 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -165,6 +165,13 @@ class Class10 {
int id
size()
}
namespace Namespace01 {
class Class11
class Class12 {
int id
size()
}
}
```

```mermaid
@@ -184,6 +191,13 @@ class Class10 {
int id
size()
}
namespace Namespace01 {
class Class11
class Class12 {
int id
size()
}
}
```

### State diagram [<a href="https://mermaid-js.github.io/mermaid/#/stateDiagram">docs</a> - <a href="https://mermaid.live/edit#pako:eNpdkEFvgzAMhf8K8nEqpYSNthx22Xbcqcexg0sCiZQQlDhIFeK_L8A6TfXp6fOz9ewJGssFVOAJSbwr7ByadGR1n8T6evpO0vQ1uZDSekOrXGFsPqJPO6q-2-imH8f_0TeHXm50lfelsAMjnEHFY6xpMdRAUhhRQxUlFy0GTTXU_RytYeAx-AdXZB1ULWovdoCB7OXWN1CRC-Ju-r3uz6UtchGHJqDbsPygU57iysb2reoWHpyOWBINvsqypb3vFMlw3TfWZF5xiY7keC6zkpUnZIUojwW-FAVvrvn51LLnvOXHQ84Q5nn-AVtLcwk">live editor</a>]
@@ -226,6 +240,44 @@ pie

### Git graph [experimental - <a href="https://mermaid.live/edit#pako:eNqNkMFugzAMhl8F-VyVAR1tOW_aA-zKxSSGRCMJCk6lCvHuNZPKZdM0n-zf3_8r8QIqaIIGMqnB8kfEybQ--y4VnLP8-9RF9Mpkmm40hmlnDKmvkPiH_kfS7nFo_VN0FAf6XwocQGgxa_nGsm1bYEOOWmik1dRjGrmF1q-Cpkkj07u2HCI0PY4zHQATh8-7V9BwTPSE3iwOEd1OjQE1iWkBvk_bzQY7s0Sq4Hs7bHqKo8iGeZqbPN_WR7mpSd1RHpvPVhuMbG7XOq_L-oJlRfW5wteq0qorrpe-PBW9Pr8UJcK6rg-BLYPQ">live editor</a>]

### Bar chart (using gantt chart) [<a href="https://mermaid-js.github.io/mermaid/#/gantt">docs</a> - <a href="https://mermaid.live/edit#pako:eNptkU1vhCAQhv8KIenNugiI4rkf6bmXpvEyFVxJFDYyNt1u9r8X63Z7WQ9m5pknLzieaBeMpQ3dg0dsPUkPOhwteXZIXmJcbCT3xMAxkuh8Z8kIEclyMIB209fqKcwTICFvG4IvFy_oLrZ-g9F26ILfQgvNFN94VaRXQ1iWqpumZBcu1J8p1E1TXDx59eQNr5LyEqjJn6hv5QnGNlxevZJmdLLpy5xJSzut45biYCfb0iaVxvawjNjS1p-TCguG16PvaIPzYjO67e3BwX6GiTY9jPFKH43DMF_hGMDY1J4oHg-_f8hFTJFd8L3br3yZx4QHxENsdrt1nO8dDstH3oVpF50ZYMbhU6ud4qoGLqyqBJRCmO6j0HXPZdGbihUc6Pmc0QP49xD-b5X69ZQv2gjO81IwzWqhC1lKrjJ6pA3nVS7SMiVjrKirWlYp5fs3osgrWeo00lorLWvOzz8JVbXm">live editor</a>]

```
gantt
title Git Issues - days since last update
dateFormat X
axisFormat %s
section Issue19062
71 : 0, 71
section Issue19401
36 : 0, 36
section Issue193
34 : 0, 34
section Issue7441
9 : 0, 9
section Issue1300
5 : 0, 5
```

```mermaid
gantt
title Git Issues - days since last update
dateFormat X
axisFormat %s
section Issue19062
71 : 0, 71
section Issue19401
36 : 0, 36
section Issue193
34 : 0, 34
section Issue7441
9 : 0, 9
section Issue1300
5 : 0, 5
```

### User Journey diagram [<a href="https://mermaid-js.github.io/mermaid/#/user-journey">docs</a> - <a href="https://mermaid.live/edit#pako:eNplkMFuwjAQRH9l5TMiTVIC-FqqnjhxzWWJN4khsSN7XRSh_HsdKBVt97R6Mzsj-yoqq0hIAXCywRkaSwNxWHNHsB_hYt1ZmwYUfiueKtbWwIcFtjf5zgH2eCZgQgkrCXt64GgMg2fUzkvIn5Xd_V5COtMFvCH_62ht_5yk7MU8sn61HDTfxD8VYiF6cj1qFd94nWkpuKWYKWRcFdUYOi5FaaZoDYNCpnel2Toha-w8LQQGtofRVEKyC_Qw7TQ2DvsfV2dRUTy6Ch6H-UMb7TlGVtbUupl5cF3ELfPgZZLM8rLR3IbjsrJ94rVq0XH7uS2SIis2mOVUrHNc5bmqjul2U2evaa3WL2mGYpqmL2BGiho">live editor</a>]

```
2 changes: 1 addition & 1 deletion __mocks__/d3.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @ts-nocheck TODO: Fix TS
import { MockedD3 } from '../packages/mermaid/src/tests/MockedD3';
import { MockedD3 } from '../packages/mermaid/src/tests/MockedD3.js';

export const select = function () {
return new MockedD3();
Loading