mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-11-18 11:44:07 +01:00
Merge branch 'develop' into sidv/testArgos
* develop: (80 commits) chore: update browsers list chore(deps): update eslint fix(class): #5624 Reset direction to default in classDiagram ci: upgrade to pnpm/action-setup@v4 to avoid CI failures chore(deps): update dependency eslint-plugin-unicorn to v54 chore(deps): update dependency eslint-plugin-jsdoc to v48.5.0 chore(deps): update all patch dependencies Sync docs folder Add Doctave to .cspell libraries Adds Doctave to list of integrations chore: update browsers list chore: Cleanup tsconfig chore: Fix lint Apply suggestions from code review chore: Remove extra words from cspell chore: Log granular rebuild times fix: Message wrap fix: Message wrap chore: Use `??` instead of `||` chore: Organise imports ...
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
/* eslint-disable no-console */
|
||||||
import { packageOptions } from './common.js';
|
import { packageOptions } from './common.js';
|
||||||
import { execSync } from 'child_process';
|
import { execSync } from 'child_process';
|
||||||
|
|
||||||
@@ -5,11 +6,17 @@ const buildType = (packageName: string) => {
|
|||||||
console.log(`Building types for ${packageName}`);
|
console.log(`Building types for ${packageName}`);
|
||||||
try {
|
try {
|
||||||
const out = execSync(`tsc -p ./packages/${packageName}/tsconfig.json --emitDeclarationOnly`);
|
const out = execSync(`tsc -p ./packages/${packageName}/tsconfig.json --emitDeclarationOnly`);
|
||||||
out.length > 0 && console.log(out.toString());
|
if (out.length > 0) {
|
||||||
|
console.log(out.toString());
|
||||||
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
e.stdout.length > 0 && console.error(e.stdout.toString());
|
if (e.stdout.length > 0) {
|
||||||
e.stderr.length > 0 && console.error(e.stderr.toString());
|
console.error(e.stdout.toString());
|
||||||
|
}
|
||||||
|
if (e.stderr.length > 0) {
|
||||||
|
console.error(e.stderr.toString());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ bqstring
|
|||||||
BQUOTE
|
BQUOTE
|
||||||
bramp
|
bramp
|
||||||
BRKT
|
BRKT
|
||||||
|
brotli
|
||||||
callbackargs
|
callbackargs
|
||||||
callbackname
|
callbackname
|
||||||
classdef
|
classdef
|
||||||
@@ -111,6 +112,7 @@ STYLECLASS
|
|||||||
STYLEOPTS
|
STYLEOPTS
|
||||||
subcomponent
|
subcomponent
|
||||||
subcomponents
|
subcomponents
|
||||||
|
subconfig
|
||||||
SUBROUTINEEND
|
SUBROUTINEEND
|
||||||
SUBROUTINESTART
|
SUBROUTINESTART
|
||||||
Subschemas
|
Subschemas
|
||||||
@@ -125,6 +127,7 @@ titlevalue
|
|||||||
topbar
|
topbar
|
||||||
TRAPEND
|
TRAPEND
|
||||||
TRAPSTART
|
TRAPSTART
|
||||||
|
treemap
|
||||||
ts-nocheck
|
ts-nocheck
|
||||||
tsdoc
|
tsdoc
|
||||||
typeof
|
typeof
|
||||||
|
|||||||
@@ -4,5 +4,6 @@ cpettitt
|
|||||||
Dong Cai
|
Dong Cai
|
||||||
Nikolay Rozhkov
|
Nikolay Rozhkov
|
||||||
Peng Xiao
|
Peng Xiao
|
||||||
|
Per Brolin
|
||||||
subhash-halder
|
subhash-halder
|
||||||
Vinod Sidharth
|
Vinod Sidharth
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ dagre-d3
|
|||||||
Deepdwn
|
Deepdwn
|
||||||
Docsify
|
Docsify
|
||||||
Docsy
|
Docsy
|
||||||
|
Doctave
|
||||||
DokuWiki
|
DokuWiki
|
||||||
dompurify
|
dompurify
|
||||||
elkjs
|
elkjs
|
||||||
@@ -55,12 +56,14 @@ pyplot
|
|||||||
redmine
|
redmine
|
||||||
rehype
|
rehype
|
||||||
rscratch
|
rscratch
|
||||||
|
shiki
|
||||||
sparkline
|
sparkline
|
||||||
sphinxcontrib
|
sphinxcontrib
|
||||||
ssim
|
ssim
|
||||||
stylis
|
stylis
|
||||||
Swimm
|
Swimm
|
||||||
tsbuildinfo
|
tsbuildinfo
|
||||||
|
tseslint
|
||||||
Tuleap
|
Tuleap
|
||||||
Typora
|
Typora
|
||||||
unocss
|
unocss
|
||||||
|
|||||||
@@ -1 +1,4 @@
|
|||||||
|
BRANDES
|
||||||
|
handdrawn
|
||||||
|
KOEPF
|
||||||
newbranch
|
newbranch
|
||||||
|
|||||||
@@ -2,7 +2,8 @@ import { build } from 'esbuild';
|
|||||||
import { mkdir, writeFile } from 'node:fs/promises';
|
import { mkdir, writeFile } from 'node:fs/promises';
|
||||||
import { packageOptions } from '../.build/common.js';
|
import { packageOptions } from '../.build/common.js';
|
||||||
import { generateLangium } from '../.build/generateLangium.js';
|
import { generateLangium } from '../.build/generateLangium.js';
|
||||||
import { MermaidBuildOptions, defaultOptions, getBuildConfig } from './util.js';
|
import type { MermaidBuildOptions } from './util.js';
|
||||||
|
import { defaultOptions, getBuildConfig } from './util.js';
|
||||||
|
|
||||||
const shouldVisualize = process.argv.includes('--visualize');
|
const shouldVisualize = process.argv.includes('--visualize');
|
||||||
|
|
||||||
@@ -35,11 +36,11 @@ const buildPackage = async (entryName: keyof typeof packageOptions) => {
|
|||||||
|
|
||||||
if (shouldVisualize) {
|
if (shouldVisualize) {
|
||||||
for (const { metafile } of results) {
|
for (const { metafile } of results) {
|
||||||
if (!metafile) {
|
if (!metafile?.outputs) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
const fileName = Object.keys(metafile.outputs)
|
const fileName = Object.keys(metafile.outputs)
|
||||||
.filter((file) => !file.includes('chunks') && file.endsWith('js'))[0]
|
.find((file) => !file.includes('chunks') && file.endsWith('js'))
|
||||||
.replace('dist/', '');
|
.replace('dist/', '');
|
||||||
// Upload metafile into https://esbuild.github.io/analyze/
|
// Upload metafile into https://esbuild.github.io/analyze/
|
||||||
await writeFile(`stats/${fileName}.meta.json`, JSON.stringify(metafile));
|
await writeFile(`stats/${fileName}.meta.json`, JSON.stringify(metafile));
|
||||||
@@ -48,13 +49,14 @@ const buildPackage = async (entryName: keyof typeof packageOptions) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handler = (e) => {
|
const handler = (e) => {
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
console.error(e);
|
console.error(e);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
};
|
};
|
||||||
|
|
||||||
const main = async () => {
|
const main = async () => {
|
||||||
await generateLangium();
|
await generateLangium();
|
||||||
await mkdir('stats').catch(() => {});
|
await mkdir('stats', { recursive: true });
|
||||||
const packageNames = Object.keys(packageOptions) as (keyof typeof packageOptions)[];
|
const packageNames = Object.keys(packageOptions) as (keyof typeof packageOptions)[];
|
||||||
// it should build `parser` before `mermaid` because it's a dependency
|
// it should build `parser` before `mermaid` because it's a dependency
|
||||||
for (const pkg of packageNames) {
|
for (const pkg of packageNames) {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { readFile } from 'node:fs/promises';
|
import { readFile } from 'node:fs/promises';
|
||||||
import { transformJison } from '../.build/jisonTransformer.js';
|
import { transformJison } from '../.build/jisonTransformer.js';
|
||||||
import { Plugin } from 'esbuild';
|
import type { Plugin } from 'esbuild';
|
||||||
|
|
||||||
export const jisonPlugin: Plugin = {
|
export const jisonPlugin: Plugin = {
|
||||||
name: 'jison',
|
name: 'jison',
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
import express from 'express';
|
/* eslint-disable no-console */
|
||||||
import type { NextFunction, Request, Response } from 'express';
|
|
||||||
import cors from 'cors';
|
|
||||||
import { getBuildConfig, defaultOptions } from './util.js';
|
|
||||||
import { context } from 'esbuild';
|
|
||||||
import chokidar from 'chokidar';
|
import chokidar from 'chokidar';
|
||||||
import { generateLangium } from '../.build/generateLangium.js';
|
import cors from 'cors';
|
||||||
|
import { context } from 'esbuild';
|
||||||
|
import type { Request, Response } from 'express';
|
||||||
|
import express from 'express';
|
||||||
import { packageOptions } from '../.build/common.js';
|
import { packageOptions } from '../.build/common.js';
|
||||||
|
import { generateLangium } from '../.build/generateLangium.js';
|
||||||
|
import { defaultOptions, getBuildConfig } from './util.js';
|
||||||
|
|
||||||
const configs = Object.values(packageOptions).map(({ packageName }) =>
|
const configs = Object.values(packageOptions).map(({ packageName }) =>
|
||||||
getBuildConfig({ ...defaultOptions, minify: false, core: false, entryName: packageName })
|
getBuildConfig({ ...defaultOptions, minify: false, core: false, entryName: packageName })
|
||||||
@@ -19,16 +20,28 @@ const mermaidIIFEConfig = getBuildConfig({
|
|||||||
});
|
});
|
||||||
configs.push(mermaidIIFEConfig);
|
configs.push(mermaidIIFEConfig);
|
||||||
|
|
||||||
const contexts = await Promise.all(configs.map((config) => context(config)));
|
const contexts = await Promise.all(
|
||||||
|
configs.map(async (config) => ({ config, context: await context(config) }))
|
||||||
|
);
|
||||||
|
|
||||||
|
let rebuildCounter = 1;
|
||||||
const rebuildAll = async () => {
|
const rebuildAll = async () => {
|
||||||
console.time('Rebuild time');
|
const buildNumber = rebuildCounter++;
|
||||||
await Promise.all(contexts.map((ctx) => ctx.rebuild())).catch((e) => console.error(e));
|
const timeLabel = `Rebuild ${buildNumber} Time (total)`;
|
||||||
console.timeEnd('Rebuild time');
|
console.time(timeLabel);
|
||||||
|
await Promise.all(
|
||||||
|
contexts.map(async ({ config, context }) => {
|
||||||
|
const buildVariant = `Rebuild ${buildNumber} Time (${Object.keys(config.entryPoints!)[0]} ${config.format})`;
|
||||||
|
console.time(buildVariant);
|
||||||
|
await context.rebuild();
|
||||||
|
console.timeEnd(buildVariant);
|
||||||
|
})
|
||||||
|
).catch((e) => console.error(e));
|
||||||
|
console.timeEnd(timeLabel);
|
||||||
};
|
};
|
||||||
|
|
||||||
let clients: { id: number; response: Response }[] = [];
|
let clients: { id: number; response: Response }[] = [];
|
||||||
function eventsHandler(request: Request, response: Response, next: NextFunction) {
|
function eventsHandler(request: Request, response: Response) {
|
||||||
const headers = {
|
const headers = {
|
||||||
'Content-Type': 'text/event-stream',
|
'Content-Type': 'text/event-stream',
|
||||||
Connection: 'keep-alive',
|
Connection: 'keep-alive',
|
||||||
@@ -45,19 +58,20 @@ function eventsHandler(request: Request, response: Response, next: NextFunction)
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
let timeoutId: NodeJS.Timeout | undefined = undefined;
|
let timeoutID: NodeJS.Timeout | undefined = undefined;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Debounce file change events to avoid rebuilding multiple times.
|
* Debounce file change events to avoid rebuilding multiple times.
|
||||||
*/
|
*/
|
||||||
function handleFileChange() {
|
function handleFileChange() {
|
||||||
if (timeoutId !== undefined) {
|
if (timeoutID !== undefined) {
|
||||||
clearTimeout(timeoutId);
|
clearTimeout(timeoutID);
|
||||||
}
|
}
|
||||||
timeoutId = setTimeout(async () => {
|
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
||||||
|
timeoutID = setTimeout(async () => {
|
||||||
await rebuildAll();
|
await rebuildAll();
|
||||||
sendEventsToAll();
|
sendEventsToAll();
|
||||||
timeoutId = undefined;
|
timeoutID = undefined;
|
||||||
}, 100);
|
}, 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -74,15 +88,16 @@ async function createServer() {
|
|||||||
ignoreInitial: true,
|
ignoreInitial: true,
|
||||||
ignored: [/node_modules/, /dist/, /docs/, /coverage/],
|
ignored: [/node_modules/, /dist/, /docs/, /coverage/],
|
||||||
})
|
})
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
||||||
.on('all', async (event, path) => {
|
.on('all', async (event, path) => {
|
||||||
// Ignore other events.
|
// Ignore other events.
|
||||||
if (!['add', 'change'].includes(event)) {
|
if (!['add', 'change'].includes(event)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (/\.langium$/.test(path)) {
|
console.log(`${path} changed. Rebuilding...`);
|
||||||
|
if (path.endsWith('.langium')) {
|
||||||
await generateLangium();
|
await generateLangium();
|
||||||
}
|
}
|
||||||
console.log(`${path} changed. Rebuilding...`);
|
|
||||||
handleFileChange();
|
handleFileChange();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -99,4 +114,4 @@ async function createServer() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
createServer();
|
void createServer();
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ export const getBuildConfig = (options: MermaidBuildOptions): BuildOptions => {
|
|||||||
const external: string[] = ['require', 'fs', 'path'];
|
const external: string[] = ['require', 'fs', 'path'];
|
||||||
const { name, file, packageName } = packageOptions[entryName];
|
const { name, file, packageName } = packageOptions[entryName];
|
||||||
const outFileName = getFileName(name, options);
|
const outFileName = getFileName(name, options);
|
||||||
let output: BuildOptions = buildOptions({
|
const output: BuildOptions = buildOptions({
|
||||||
absWorkingDir: resolve(__dirname, `../packages/${packageName}`),
|
absWorkingDir: resolve(__dirname, `../packages/${packageName}`),
|
||||||
entryPoints: {
|
entryPoints: {
|
||||||
[outFileName]: `src/${file}`,
|
[outFileName]: `src/${file}`,
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
.gitignore
|
|
||||||
190
.eslintrc.cjs
190
.eslintrc.cjs
@@ -1,190 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
env: {
|
|
||||||
browser: true,
|
|
||||||
es6: true,
|
|
||||||
'jest/globals': true,
|
|
||||||
node: true,
|
|
||||||
},
|
|
||||||
root: true,
|
|
||||||
parser: '@typescript-eslint/parser',
|
|
||||||
parserOptions: {
|
|
||||||
ecmaFeatures: {
|
|
||||||
experimentalObjectRestSpread: true,
|
|
||||||
jsx: true,
|
|
||||||
},
|
|
||||||
tsconfigRootDir: __dirname,
|
|
||||||
sourceType: 'module',
|
|
||||||
ecmaVersion: 2022,
|
|
||||||
allowAutomaticSingleRunInference: true,
|
|
||||||
project: ['./tsconfig.eslint.json', './packages/*/tsconfig.json'],
|
|
||||||
parser: '@typescript-eslint/parser',
|
|
||||||
},
|
|
||||||
extends: [
|
|
||||||
'eslint:recommended',
|
|
||||||
'plugin:@typescript-eslint/recommended',
|
|
||||||
'plugin:json/recommended',
|
|
||||||
'plugin:markdown/recommended-legacy',
|
|
||||||
'plugin:@cspell/recommended',
|
|
||||||
'prettier',
|
|
||||||
],
|
|
||||||
plugins: [
|
|
||||||
'@typescript-eslint',
|
|
||||||
'no-only-tests',
|
|
||||||
'html',
|
|
||||||
'jest',
|
|
||||||
'jsdoc',
|
|
||||||
'json',
|
|
||||||
'@cspell',
|
|
||||||
'lodash',
|
|
||||||
'unicorn',
|
|
||||||
],
|
|
||||||
ignorePatterns: [
|
|
||||||
// this file is automatically generated by `pnpm run --filter mermaid types:build-config`
|
|
||||||
'packages/mermaid/src/config.type.ts',
|
|
||||||
],
|
|
||||||
rules: {
|
|
||||||
curly: 'error',
|
|
||||||
'no-console': 'error',
|
|
||||||
'no-prototype-builtins': 'off',
|
|
||||||
'no-unused-vars': 'off',
|
|
||||||
'cypress/no-async-tests': 'off',
|
|
||||||
'@typescript-eslint/consistent-type-imports': 'error',
|
|
||||||
'@typescript-eslint/no-explicit-any': 'warn',
|
|
||||||
'@typescript-eslint/no-floating-promises': 'error',
|
|
||||||
'@typescript-eslint/no-misused-promises': 'error',
|
|
||||||
'@typescript-eslint/no-unused-vars': 'warn',
|
|
||||||
'@typescript-eslint/consistent-type-definitions': 'error',
|
|
||||||
'@typescript-eslint/ban-ts-comment': [
|
|
||||||
'error',
|
|
||||||
{
|
|
||||||
'ts-expect-error': 'allow-with-description',
|
|
||||||
'ts-ignore': 'allow-with-description',
|
|
||||||
'ts-nocheck': 'allow-with-description',
|
|
||||||
'ts-check': 'allow-with-description',
|
|
||||||
minimumDescriptionLength: 10,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
'@typescript-eslint/naming-convention': [
|
|
||||||
'error',
|
|
||||||
{
|
|
||||||
selector: 'typeLike',
|
|
||||||
format: ['PascalCase'],
|
|
||||||
custom: {
|
|
||||||
regex: '^I[A-Z]',
|
|
||||||
match: false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
'json/*': ['error', 'allowComments'],
|
|
||||||
'@cspell/spellchecker': [
|
|
||||||
'error',
|
|
||||||
{
|
|
||||||
checkIdentifiers: true,
|
|
||||||
checkStrings: true,
|
|
||||||
checkStringTemplates: true,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
'no-empty': [
|
|
||||||
'error',
|
|
||||||
{
|
|
||||||
allowEmptyCatch: true,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
'no-only-tests/no-only-tests': 'error',
|
|
||||||
'lodash/import-scope': ['error', 'method'],
|
|
||||||
'unicorn/better-regex': 'error',
|
|
||||||
'unicorn/no-abusive-eslint-disable': 'error',
|
|
||||||
'unicorn/no-array-push-push': 'error',
|
|
||||||
'unicorn/no-for-loop': 'error',
|
|
||||||
'unicorn/no-instanceof-array': 'error',
|
|
||||||
'unicorn/no-typeof-undefined': 'error',
|
|
||||||
'unicorn/no-unnecessary-await': 'error',
|
|
||||||
'unicorn/no-unsafe-regex': 'warn',
|
|
||||||
'unicorn/no-useless-promise-resolve-reject': 'error',
|
|
||||||
'unicorn/prefer-array-find': 'error',
|
|
||||||
'unicorn/prefer-array-flat-map': 'error',
|
|
||||||
'unicorn/prefer-array-index-of': 'error',
|
|
||||||
'unicorn/prefer-array-some': 'error',
|
|
||||||
'unicorn/prefer-default-parameters': 'error',
|
|
||||||
'unicorn/prefer-includes': 'error',
|
|
||||||
'unicorn/prefer-negative-index': 'error',
|
|
||||||
'unicorn/prefer-object-from-entries': 'error',
|
|
||||||
'unicorn/prefer-string-starts-ends-with': 'error',
|
|
||||||
'unicorn/prefer-string-trim-start-end': 'error',
|
|
||||||
'unicorn/string-content': 'error',
|
|
||||||
'unicorn/prefer-spread': 'error',
|
|
||||||
'unicorn/no-lonely-if': 'error',
|
|
||||||
},
|
|
||||||
overrides: [
|
|
||||||
{
|
|
||||||
files: ['cypress/**', 'demos/**'],
|
|
||||||
rules: {
|
|
||||||
'no-console': 'off',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
files: ['*.{js,jsx,mjs,cjs}'],
|
|
||||||
extends: ['plugin:jsdoc/recommended'],
|
|
||||||
rules: {
|
|
||||||
'jsdoc/check-indentation': 'off',
|
|
||||||
'jsdoc/check-alignment': 'off',
|
|
||||||
'jsdoc/check-line-alignment': 'off',
|
|
||||||
'jsdoc/multiline-blocks': 'off',
|
|
||||||
'jsdoc/newline-after-description': 'off',
|
|
||||||
'jsdoc/tag-lines': 'off',
|
|
||||||
'jsdoc/require-param-description': 'off',
|
|
||||||
'jsdoc/require-param-type': 'off',
|
|
||||||
'jsdoc/require-returns': 'off',
|
|
||||||
'jsdoc/require-returns-description': 'off',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
files: ['*.{ts,tsx}'],
|
|
||||||
plugins: ['tsdoc'],
|
|
||||||
rules: {
|
|
||||||
'no-restricted-syntax': [
|
|
||||||
'error',
|
|
||||||
{
|
|
||||||
selector: 'TSEnumDeclaration',
|
|
||||||
message:
|
|
||||||
'Prefer using TypeScript union types over TypeScript enum, since TypeScript enums have a bunch of issues, see https://dev.to/dvddpl/whats-the-problem-with-typescript-enums-2okj',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
'tsdoc/syntax': 'error',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
files: ['*.spec.{ts,js}', 'cypress/**', 'demos/**', '**/docs/**'],
|
|
||||||
rules: {
|
|
||||||
'jsdoc/require-jsdoc': 'off',
|
|
||||||
'@typescript-eslint/no-unused-vars': 'off',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
files: ['*.spec.{ts,js}', 'tests/**', 'cypress/**/*.js'],
|
|
||||||
rules: {
|
|
||||||
'@cspell/spellchecker': [
|
|
||||||
'error',
|
|
||||||
{
|
|
||||||
checkIdentifiers: false,
|
|
||||||
checkStrings: false,
|
|
||||||
checkStringTemplates: false,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
files: ['*.html', '*.md', '**/*.md/*'],
|
|
||||||
rules: {
|
|
||||||
'no-var': 'error',
|
|
||||||
'no-undef': 'off',
|
|
||||||
'@typescript-eslint/no-unused-vars': 'off',
|
|
||||||
'@typescript-eslint/no-floating-promises': 'off',
|
|
||||||
'@typescript-eslint/no-misused-promises': 'off',
|
|
||||||
},
|
|
||||||
parserOptions: {
|
|
||||||
project: null,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
2
.github/lychee.toml
vendored
2
.github/lychee.toml
vendored
@@ -44,7 +44,7 @@ exclude = [
|
|||||||
"https://chromewebstore.google.com",
|
"https://chromewebstore.google.com",
|
||||||
|
|
||||||
# Drupal 403
|
# Drupal 403
|
||||||
"https://www.drupal.org"
|
"https://(www.)?drupal.org"
|
||||||
]
|
]
|
||||||
|
|
||||||
# Exclude all private IPs from checking.
|
# Exclude all private IPs from checking.
|
||||||
|
|||||||
2
.github/workflows/build-docs.yml
vendored
2
.github/workflows/build-docs.yml
vendored
@@ -18,7 +18,7 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- uses: pnpm/action-setup@v2
|
- uses: pnpm/action-setup@v4
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
|
|||||||
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@@ -18,7 +18,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- uses: pnpm/action-setup@v2
|
- uses: pnpm/action-setup@v4
|
||||||
# uses version from "packageManager" field in package.json
|
# uses version from "packageManager" field in package.json
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
|
|||||||
2
.github/workflows/e2e-applitools.yml
vendored
2
.github/workflows/e2e-applitools.yml
vendored
@@ -32,7 +32,7 @@ jobs:
|
|||||||
|
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- uses: pnpm/action-setup@v2
|
- uses: pnpm/action-setup@v4
|
||||||
# uses version from "packageManager" field in package.json
|
# uses version from "packageManager" field in package.json
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
|
|||||||
4
.github/workflows/e2e.yml
vendored
4
.github/workflows/e2e.yml
vendored
@@ -32,7 +32,7 @@ jobs:
|
|||||||
options: --user 1001
|
options: --user 1001
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: pnpm/action-setup@v2
|
- uses: pnpm/action-setup@v4
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
@@ -79,7 +79,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- uses: pnpm/action-setup@v2
|
- uses: pnpm/action-setup@v4
|
||||||
# uses version from "packageManager" field in package.json
|
# uses version from "packageManager" field in package.json
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
|
|||||||
2
.github/workflows/lint.yml
vendored
2
.github/workflows/lint.yml
vendored
@@ -19,7 +19,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- uses: pnpm/action-setup@v2
|
- uses: pnpm/action-setup@v4
|
||||||
# uses version from "packageManager" field in package.json
|
# uses version from "packageManager" field in package.json
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
|
|||||||
2
.github/workflows/publish-docs.yml
vendored
2
.github/workflows/publish-docs.yml
vendored
@@ -25,7 +25,7 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- uses: pnpm/action-setup@v2
|
- uses: pnpm/action-setup@v4
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- uses: pnpm/action-setup@v2
|
- uses: pnpm/action-setup@v4
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
|
|||||||
2
.github/workflows/release-publish.yml
vendored
2
.github/workflows/release-publish.yml
vendored
@@ -11,7 +11,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: fregante/setup-git-user@v2
|
- uses: fregante/setup-git-user@v2
|
||||||
|
|
||||||
- uses: pnpm/action-setup@v2
|
- uses: pnpm/action-setup@v4
|
||||||
# uses version from "packageManager" field in package.json
|
# uses version from "packageManager" field in package.json
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
|
|||||||
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
@@ -11,7 +11,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- uses: pnpm/action-setup@v2
|
- uses: pnpm/action-setup@v4
|
||||||
# uses version from "packageManager" field in package.json
|
# uses version from "packageManager" field in package.json
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
|
|||||||
2
.github/workflows/update-browserlist.yml
vendored
2
.github/workflows/update-browserlist.yml
vendored
@@ -9,7 +9,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: pnpm/action-setup@v2
|
- uses: pnpm/action-setup@v4
|
||||||
- run: npx update-browserslist-db@latest
|
- run: npx update-browserslist-db@latest
|
||||||
- name: Commit changes
|
- name: Commit changes
|
||||||
uses: EndBug/add-and-commit@v9
|
uses: EndBug/add-and-commit@v9
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { build, InlineConfig, type PluginOption } from 'vite';
|
import type { InlineConfig } from 'vite';
|
||||||
|
import { build, type PluginOption } from 'vite';
|
||||||
import { resolve } from 'path';
|
import { resolve } from 'path';
|
||||||
import { fileURLToPath } from 'url';
|
import { fileURLToPath } from 'url';
|
||||||
import jisonPlugin from './jisonPlugin.js';
|
import jisonPlugin from './jisonPlugin.js';
|
||||||
@@ -46,9 +47,10 @@ interface BuildOptions {
|
|||||||
|
|
||||||
export const getBuildConfig = ({ minify, core, watch, entryName }: BuildOptions): InlineConfig => {
|
export const getBuildConfig = ({ minify, core, watch, entryName }: BuildOptions): InlineConfig => {
|
||||||
const external: (string | RegExp)[] = ['require', 'fs', 'path'];
|
const external: (string | RegExp)[] = ['require', 'fs', 'path'];
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
console.log(entryName, packageOptions[entryName]);
|
console.log(entryName, packageOptions[entryName]);
|
||||||
const { name, file, packageName } = packageOptions[entryName];
|
const { name, file, packageName } = packageOptions[entryName];
|
||||||
let output: OutputOptions = [
|
const output: OutputOptions = [
|
||||||
{
|
{
|
||||||
name,
|
name,
|
||||||
format: 'esm',
|
format: 'esm',
|
||||||
@@ -83,7 +85,6 @@ export const getBuildConfig = ({ minify, core, watch, entryName }: BuildOptions)
|
|||||||
plugins: [
|
plugins: [
|
||||||
jisonPlugin(),
|
jisonPlugin(),
|
||||||
jsonSchemaPlugin(), // handles `.schema.yaml` files
|
jsonSchemaPlugin(), // handles `.schema.yaml` files
|
||||||
// @ts-expect-error According to the type definitions, rollup plugins are incompatible with vite
|
|
||||||
typescript({ compilerOptions: { declaration: false } }),
|
typescript({ compilerOptions: { declaration: false } }),
|
||||||
istanbul({
|
istanbul({
|
||||||
exclude: ['node_modules', 'test/', '__mocks__', 'generated'],
|
exclude: ['node_modules', 'test/', '__mocks__', 'generated'],
|
||||||
@@ -121,10 +122,10 @@ await generateLangium();
|
|||||||
|
|
||||||
if (watch) {
|
if (watch) {
|
||||||
await build(getBuildConfig({ minify: false, watch, core: false, entryName: 'parser' }));
|
await build(getBuildConfig({ minify: false, watch, core: false, entryName: 'parser' }));
|
||||||
build(getBuildConfig({ minify: false, watch, core: false, entryName: 'mermaid' }));
|
void build(getBuildConfig({ minify: false, watch, core: false, entryName: 'mermaid' }));
|
||||||
if (!mermaidOnly) {
|
if (!mermaidOnly) {
|
||||||
build(getBuildConfig({ minify: false, watch, entryName: 'mermaid-example-diagram' }));
|
void build(getBuildConfig({ minify: false, watch, entryName: 'mermaid-example-diagram' }));
|
||||||
build(getBuildConfig({ minify: false, watch, entryName: 'mermaid-zenuml' }));
|
void build(getBuildConfig({ minify: false, watch, entryName: 'mermaid-zenuml' }));
|
||||||
}
|
}
|
||||||
} else if (visualize) {
|
} else if (visualize) {
|
||||||
await build(getBuildConfig({ minify: false, watch, core: false, entryName: 'parser' }));
|
await build(getBuildConfig({ minify: false, watch, core: false, entryName: 'parser' }));
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { PluginOption } from 'vite';
|
import type { PluginOption } from 'vite';
|
||||||
import { getDefaults, getSchema, loadSchema } from '../.build/jsonSchema.js';
|
import { getDefaults, getSchema, loadSchema } from '../.build/jsonSchema.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -23,8 +23,9 @@ async function createServer() {
|
|||||||
app.use(express.static('cypress/platform'));
|
app.use(express.static('cypress/platform'));
|
||||||
|
|
||||||
app.listen(9000, () => {
|
app.listen(9000, () => {
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
console.log(`Listening on http://localhost:9000`);
|
console.log(`Listening on http://localhost:9000`);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
createServer();
|
void createServer();
|
||||||
|
|||||||
@@ -21,13 +21,11 @@ export default eyesPlugin(
|
|||||||
});
|
});
|
||||||
// copy any needed variables from process.env to config.env
|
// copy any needed variables from process.env to config.env
|
||||||
config.env.useAppli = process.env.USE_APPLI ? true : false;
|
config.env.useAppli = process.env.USE_APPLI ? true : false;
|
||||||
config.env.useArgos = !!process.env.ARGOS_TOKEN;
|
config.env.useArgos = !!process.env.CI;
|
||||||
|
|
||||||
if (config.env.useArgos) {
|
if (config.env.useArgos) {
|
||||||
// Argos
|
|
||||||
registerArgosTask(on, config, {
|
registerArgosTask(on, config, {
|
||||||
uploadToArgos: !!process.env.CI,
|
token: 'fc3a35cf5200db928d65b2047861582d9444032b',
|
||||||
token: process.env.ARGOS_TOKEN,
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
addMatchImageSnapshotPlugin(on, config);
|
addMatchImageSnapshotPlugin(on, config);
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ export const mermaidUrl = (
|
|||||||
};
|
};
|
||||||
const objStr: string = JSON.stringify(codeObject);
|
const objStr: string = JSON.stringify(codeObject);
|
||||||
let url = `http://localhost:9000/e2e.html?graph=${utf8ToB64(objStr)}`;
|
let url = `http://localhost:9000/e2e.html?graph=${utf8ToB64(objStr)}`;
|
||||||
if (api) {
|
if (api && typeof graphStr === 'string') {
|
||||||
url = `http://localhost:9000/xss.html?graph=${graphStr}`;
|
url = `http://localhost:9000/xss.html?graph=${graphStr}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -54,14 +54,13 @@ export const imgSnapshotTest = (
|
|||||||
): void => {
|
): void => {
|
||||||
const options: CypressMermaidConfig = {
|
const options: CypressMermaidConfig = {
|
||||||
..._options,
|
..._options,
|
||||||
fontFamily: _options.fontFamily || 'courier',
|
fontFamily: _options.fontFamily ?? 'courier',
|
||||||
// @ts-ignore TODO: Fix type of fontSize
|
// @ts-ignore TODO: Fix type of fontSize
|
||||||
fontSize: _options.fontSize || '16px',
|
fontSize: _options.fontSize ?? '16px',
|
||||||
sequence: {
|
sequence: {
|
||||||
...(_options.sequence || {}),
|
...(_options.sequence ?? {}),
|
||||||
actorFontFamily: 'courier',
|
actorFontFamily: 'courier',
|
||||||
noteFontFamily:
|
noteFontFamily: _options.sequence?.noteFontFamily
|
||||||
_options.sequence && _options.sequence.noteFontFamily
|
|
||||||
? _options.sequence.noteFontFamily
|
? _options.sequence.noteFontFamily
|
||||||
: 'courier',
|
: 'courier',
|
||||||
messageFontFamily: 'courier',
|
messageFontFamily: 'courier',
|
||||||
@@ -95,7 +94,7 @@ export const openURLAndVerifyRendering = (
|
|||||||
options: CypressMermaidConfig,
|
options: CypressMermaidConfig,
|
||||||
validation?: any
|
validation?: any
|
||||||
): void => {
|
): void => {
|
||||||
const name: string = (options.name || cy.state('runnable').fullTitle()).replace(/\s+/g, '-');
|
const name: string = (options.name ?? cy.state('runnable').fullTitle()).replace(/\s+/g, '-');
|
||||||
|
|
||||||
cy.visit(url);
|
cy.visit(url);
|
||||||
cy.window().should('have.property', 'rendered', true);
|
cy.window().should('have.property', 'rendered', true);
|
||||||
|
|||||||
@@ -119,7 +119,6 @@ describe('Configuration', () => {
|
|||||||
const url = 'http://localhost:9000/regression/issue-1874.html';
|
const url = 'http://localhost:9000/regression/issue-1874.html';
|
||||||
cy.visit(url);
|
cy.visit(url);
|
||||||
cy.window().should('have.property', 'rendered', true);
|
cy.window().should('have.property', 'rendered', true);
|
||||||
cy.get('svg').should('be.visible');
|
|
||||||
verifyScreenshot(
|
verifyScreenshot(
|
||||||
'configuration.spec-should-not-taint-initial-configuration-when-using-multiple-directives'
|
'configuration.spec-should-not-taint-initial-configuration-when-using-multiple-directives'
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ describe('XSS', () => {
|
|||||||
cy.wait(1000).then(() => {
|
cy.wait(1000).then(() => {
|
||||||
cy.get('.mermaid').should('exist');
|
cy.get('.mermaid').should('exist');
|
||||||
});
|
});
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should not allow tags in the css', () => {
|
it('should not allow tags in the css', () => {
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ describe('C4 diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('should render a simple C4Container diagram', () => {
|
it('should render a simple C4Container diagram', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -50,7 +49,6 @@ describe('C4 diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('should render a simple C4Component diagram', () => {
|
it('should render a simple C4Component diagram', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -69,7 +67,6 @@ describe('C4 diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('should render a simple C4Dynamic diagram', () => {
|
it('should render a simple C4Dynamic diagram', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -93,7 +90,6 @@ describe('C4 diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('should render a simple C4Deployment diagram', () => {
|
it('should render a simple C4Deployment diagram', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -117,6 +113,5 @@ describe('C4 diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ describe('Class diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1 }
|
{ logLevel: 1 }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('2: should render a simple class diagrams with cardinality', () => {
|
it('2: should render a simple class diagrams with cardinality', () => {
|
||||||
@@ -61,7 +60,6 @@ describe('Class diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('3: should render a simple class diagram with different visibilities', () => {
|
it('3: should render a simple class diagram with different visibilities', () => {
|
||||||
@@ -79,7 +77,6 @@ describe('Class diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('4: should render a simple class diagram with comments', () => {
|
it('4: should render a simple class diagram with comments', () => {
|
||||||
@@ -109,7 +106,6 @@ describe('Class diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('5: should render a simple class diagram with abstract method', () => {
|
it('5: should render a simple class diagram with abstract method', () => {
|
||||||
@@ -121,7 +117,6 @@ describe('Class diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('6: should render a simple class diagram with static method', () => {
|
it('6: should render a simple class diagram with static method', () => {
|
||||||
@@ -133,7 +128,6 @@ describe('Class diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('7: should render a simple class diagram with Generic class', () => {
|
it('7: should render a simple class diagram with Generic class', () => {
|
||||||
@@ -153,7 +147,6 @@ describe('Class diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('8: should render a simple class diagram with Generic class and relations', () => {
|
it('8: should render a simple class diagram with Generic class and relations', () => {
|
||||||
@@ -174,7 +167,6 @@ describe('Class diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('9: should render a simple class diagram with clickable link', () => {
|
it('9: should render a simple class diagram with clickable link', () => {
|
||||||
@@ -196,7 +188,6 @@ describe('Class diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('10: should render a simple class diagram with clickable callback', () => {
|
it('10: should render a simple class diagram with clickable callback', () => {
|
||||||
@@ -218,7 +209,6 @@ describe('Class diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('11: should render a simple class diagram with return type on method', () => {
|
it('11: should render a simple class diagram with return type on method', () => {
|
||||||
@@ -233,7 +223,6 @@ describe('Class diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('12: should render a simple class diagram with generic types', () => {
|
it('12: should render a simple class diagram with generic types', () => {
|
||||||
@@ -249,7 +238,6 @@ describe('Class diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('13: should render a simple class diagram with css classes applied', () => {
|
it('13: should render a simple class diagram with css classes applied', () => {
|
||||||
@@ -267,7 +255,6 @@ describe('Class diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('14: should render a simple class diagram with css classes applied directly', () => {
|
it('14: should render a simple class diagram with css classes applied directly', () => {
|
||||||
@@ -283,7 +270,6 @@ describe('Class diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('15: should render a simple class diagram with css classes applied to multiple classes', () => {
|
it('15: should render a simple class diagram with css classes applied to multiple classes', () => {
|
||||||
@@ -298,7 +284,6 @@ describe('Class diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('16: should render multiple class diagrams', () => {
|
it('16: should render multiple class diagrams', () => {
|
||||||
@@ -351,7 +336,6 @@ describe('Class diagram', () => {
|
|||||||
],
|
],
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// it('17: should render a class diagram when useMaxWidth is true (default)', () => {
|
// it('17: should render a class diagram when useMaxWidth is true (default)', () => {
|
||||||
@@ -421,7 +405,6 @@ describe('Class diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1 }
|
{ logLevel: 1 }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render class diagram with newlines in title', () => {
|
it('should render class diagram with newlines in title', () => {
|
||||||
@@ -439,7 +422,6 @@ describe('Class diagram', () => {
|
|||||||
+quack()
|
+quack()
|
||||||
}
|
}
|
||||||
`);
|
`);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render class diagram with many newlines in title', () => {
|
it('should render class diagram with many newlines in title', () => {
|
||||||
|
|||||||
@@ -218,7 +218,6 @@ describe('Entity Relationship Diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{ loglevel: 1 }
|
{ loglevel: 1 }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render entities with keys', () => {
|
it('should render entities with keys', () => {
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ describe('Quadrant Chart', () => {
|
|||||||
`,
|
`,
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('should render a complete quadrant chart', () => {
|
it('should render a complete quadrant chart', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -30,7 +29,6 @@ describe('Quadrant Chart', () => {
|
|||||||
`,
|
`,
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('should render without points', () => {
|
it('should render without points', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -46,7 +44,6 @@ describe('Quadrant Chart', () => {
|
|||||||
`,
|
`,
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('should able to render y-axix on right side', () => {
|
it('should able to render y-axix on right side', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -63,7 +60,6 @@ describe('Quadrant Chart', () => {
|
|||||||
`,
|
`,
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('should able to render x-axix on bottom', () => {
|
it('should able to render x-axix on bottom', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -80,7 +76,6 @@ describe('Quadrant Chart', () => {
|
|||||||
`,
|
`,
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('should able to render x-axix on bottom and y-axis on right', () => {
|
it('should able to render x-axix on bottom and y-axis on right', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -97,7 +92,6 @@ describe('Quadrant Chart', () => {
|
|||||||
`,
|
`,
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('should render without title', () => {
|
it('should render without title', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -112,7 +106,6 @@ describe('Quadrant Chart', () => {
|
|||||||
`,
|
`,
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('should use all the config', () => {
|
it('should use all the config', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -135,7 +128,6 @@ describe('Quadrant Chart', () => {
|
|||||||
`,
|
`,
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('should use all the theme variable', () => {
|
it('should use all the theme variable', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -158,7 +150,6 @@ describe('Quadrant Chart', () => {
|
|||||||
`,
|
`,
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('should render x-axis labels in the center, if x-axis has two labels', () => {
|
it('should render x-axis labels in the center, if x-axis has two labels', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -180,7 +171,6 @@ describe('Quadrant Chart', () => {
|
|||||||
`,
|
`,
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('should render y-axis labels in the center, if y-axis has two labels', () => {
|
it('should render y-axis labels in the center, if y-axis has two labels', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -202,7 +192,6 @@ describe('Quadrant Chart', () => {
|
|||||||
`,
|
`,
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('should render both axes labels on the left and bottom, if both axes have only one label', () => {
|
it('should render both axes labels on the left and bottom, if both axes have only one label', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -224,7 +213,6 @@ describe('Quadrant Chart', () => {
|
|||||||
`,
|
`,
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('it should render data points with styles', () => {
|
it('it should render data points with styles', () => {
|
||||||
@@ -249,7 +237,6 @@ describe('Quadrant Chart', () => {
|
|||||||
`,
|
`,
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('it should render data points with styles + classes', () => {
|
it('it should render data points with styles + classes', () => {
|
||||||
|
|||||||
@@ -44,6 +44,5 @@ describe('Requirement diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
/// <reference types="Cypress" />
|
|
||||||
|
|
||||||
import { imgSnapshotTest, renderGraph } from '../../helpers/util.ts';
|
import { imgSnapshotTest, renderGraph } from '../../helpers/util.ts';
|
||||||
|
|
||||||
context('Sequence diagram', () => {
|
describe('Sequence diagram', () => {
|
||||||
it('should render a sequence diagram with boxes', () => {
|
it('should render a sequence diagram with boxes', () => {
|
||||||
renderGraph(
|
renderGraph(
|
||||||
`
|
`
|
||||||
@@ -68,6 +66,19 @@ context('Sequence diagram', () => {
|
|||||||
{ sequence: { actorFontFamily: 'courier' } }
|
{ sequence: { actorFontFamily: 'courier' } }
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
it('should render bidirectional arrows', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
sequenceDiagram
|
||||||
|
Alice<<->>John: Hello John, how are you?
|
||||||
|
Alice<<-->>John: Hi Alice, I can hear you!
|
||||||
|
John<<->>Alice: This also works the other way
|
||||||
|
John<<-->>Alice: Yes
|
||||||
|
Alice->John: Test
|
||||||
|
John->>Alice: Still works
|
||||||
|
`
|
||||||
|
);
|
||||||
|
});
|
||||||
it('should handle different line breaks', () => {
|
it('should handle different line breaks', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
`
|
`
|
||||||
@@ -231,7 +242,7 @@ context('Sequence diagram', () => {
|
|||||||
`
|
`
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
context('font settings', () => {
|
describe('font settings', () => {
|
||||||
it('should render different note fonts when configured', () => {
|
it('should render different note fonts when configured', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
`
|
`
|
||||||
@@ -328,7 +339,7 @@ context('Sequence diagram', () => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
context('auth width scaling', () => {
|
describe('auth width scaling', () => {
|
||||||
it('should render long actor descriptions', () => {
|
it('should render long actor descriptions', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
`
|
`
|
||||||
@@ -464,6 +475,18 @@ context('Sequence diagram', () => {
|
|||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
it('should render notes over actors and participant', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
sequenceDiagram
|
||||||
|
actor Alice
|
||||||
|
participant Charlie
|
||||||
|
note over Alice: some note
|
||||||
|
note over Charlie: other note
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
});
|
||||||
it('should render long messages from an actor to the left to one to the right', () => {
|
it('should render long messages from an actor to the left to one to the right', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
`
|
`
|
||||||
@@ -505,7 +528,7 @@ context('Sequence diagram', () => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
context('background rects', () => {
|
describe('background rects', () => {
|
||||||
it('should render a single and nested rects', () => {
|
it('should render a single and nested rects', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
`
|
`
|
||||||
@@ -785,7 +808,7 @@ context('Sequence diagram', () => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
context('directives', () => {
|
describe('directives', () => {
|
||||||
it('should override config with directive settings', () => {
|
it('should override config with directive settings', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
`
|
`
|
||||||
@@ -817,7 +840,7 @@ context('Sequence diagram', () => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
context('links', () => {
|
describe('links', () => {
|
||||||
it('should support actor links', () => {
|
it('should support actor links', () => {
|
||||||
renderGraph(
|
renderGraph(
|
||||||
`
|
`
|
||||||
@@ -833,7 +856,7 @@ context('Sequence diagram', () => {
|
|||||||
);
|
);
|
||||||
cy.get('#actor0_popup').should((popupMenu) => {
|
cy.get('#actor0_popup').should((popupMenu) => {
|
||||||
const style = popupMenu.attr('style');
|
const style = popupMenu.attr('style');
|
||||||
expect(style).to.undefined;
|
// expect(style).to.undefined;
|
||||||
});
|
});
|
||||||
cy.get('#root-0').click();
|
cy.get('#root-0').click();
|
||||||
cy.get('#actor0_popup').should((popupMenu) => {
|
cy.get('#actor0_popup').should((popupMenu) => {
|
||||||
@@ -908,7 +931,7 @@ context('Sequence diagram', () => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
context('svg size', () => {
|
describe('svg size', () => {
|
||||||
it('should render a sequence diagram when useMaxWidth is true (default)', () => {
|
it('should render a sequence diagram when useMaxWidth is true (default)', () => {
|
||||||
renderGraph(
|
renderGraph(
|
||||||
`
|
`
|
||||||
@@ -987,7 +1010,7 @@ context('Sequence diagram', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
context('render after error', () => {
|
describe('render after error', () => {
|
||||||
it('should render diagram after fixing destroy participant error', () => {
|
it('should render diagram after fixing destroy participant error', () => {
|
||||||
cy.on('uncaught:exception', (err) => {
|
cy.on('uncaught:exception', (err) => {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ describe('State diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 1, fontFamily: 'courier' }
|
{ logLevel: 1, fontFamily: 'courier' }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('v2 should render a simple state diagrams', () => {
|
it('v2 should render a simple state diagrams', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -20,7 +19,6 @@ describe('State diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 0, fontFamily: 'courier' }
|
{ logLevel: 0, fontFamily: 'courier' }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('v2 should render a long descriptions instead of id when available', () => {
|
it('v2 should render a long descriptions instead of id when available', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -32,7 +30,6 @@ describe('State diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 0, fontFamily: 'courier' }
|
{ logLevel: 0, fontFamily: 'courier' }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('v2 should render a long descriptions with additional descriptions', () => {
|
it('v2 should render a long descriptions with additional descriptions', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -44,7 +41,6 @@ describe('State diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 0, fontFamily: 'courier' }
|
{ logLevel: 0, fontFamily: 'courier' }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('v2 should render a single state with short descriptions', () => {
|
it('v2 should render a single state with short descriptions', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -55,7 +51,6 @@ describe('State diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 0, fontFamily: 'courier' }
|
{ logLevel: 0, fontFamily: 'courier' }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('v2 should render a transition descriptions with new lines', () => {
|
it('v2 should render a transition descriptions with new lines', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -69,7 +64,6 @@ describe('State diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 0, fontFamily: 'courier' }
|
{ logLevel: 0, fontFamily: 'courier' }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('v2 should render a state with a note', () => {
|
it('v2 should render a state with a note', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -83,7 +77,6 @@ describe('State diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 0, fontFamily: 'courier' }
|
{ logLevel: 0, fontFamily: 'courier' }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('v2 should render a state with on the left side when so specified', () => {
|
it('v2 should render a state with on the left side when so specified', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -97,7 +90,6 @@ describe('State diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 0, fontFamily: 'courier' }
|
{ logLevel: 0, fontFamily: 'courier' }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('v2 should render a state with a note together with another state', () => {
|
it('v2 should render a state with a note together with another state', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -113,7 +105,6 @@ describe('State diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 0, fontFamily: 'courier' }
|
{ logLevel: 0, fontFamily: 'courier' }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('v2 should render a note with multiple lines in it', () => {
|
it('v2 should render a note with multiple lines in it', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -156,7 +147,6 @@ describe('State diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 0, fontFamily: 'courier' }
|
{ logLevel: 0, fontFamily: 'courier' }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('v2 should render a simple state diagrams 2', () => {
|
it('v2 should render a simple state diagrams 2', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -169,7 +159,6 @@ describe('State diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 0, fontFamily: 'courier' }
|
{ logLevel: 0, fontFamily: 'courier' }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('v2 should render a simple state diagrams with labels', () => {
|
it('v2 should render a simple state diagrams with labels', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -185,7 +174,6 @@ describe('State diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 0, fontFamily: 'courier' }
|
{ logLevel: 0, fontFamily: 'courier' }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('v2 should render state descriptions', () => {
|
it('v2 should render state descriptions', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -198,7 +186,6 @@ describe('State diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 0, fontFamily: 'courier' }
|
{ logLevel: 0, fontFamily: 'courier' }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('v2 should render composite states', () => {
|
it('v2 should render composite states', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -217,7 +204,6 @@ describe('State diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 0, fontFamily: 'courier' }
|
{ logLevel: 0, fontFamily: 'courier' }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('v2 should render multiple composite states', () => {
|
it('v2 should render multiple composite states', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -287,7 +273,6 @@ describe('State diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 0, fontFamily: 'courier' }
|
{ logLevel: 0, fontFamily: 'courier' }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('v2 should render concurrency states', () => {
|
it('v2 should render concurrency states', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -311,7 +296,6 @@ describe('State diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 0, fontFamily: 'courier' }
|
{ logLevel: 0, fontFamily: 'courier' }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('v2 should render a state with states in it', () => {
|
it('v2 should render a state with states in it', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ describe('State diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 0, fontFamily: 'courier' }
|
{ logLevel: 0, fontFamily: 'courier' }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('should render a long descriptions instead of id when available', () => {
|
it('should render a long descriptions instead of id when available', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -22,7 +21,6 @@ describe('State diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 0, fontFamily: 'courier' }
|
{ logLevel: 0, fontFamily: 'courier' }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('should render a long descriptions with additional descriptions', () => {
|
it('should render a long descriptions with additional descriptions', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -34,7 +32,6 @@ describe('State diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 0, fontFamily: 'courier' }
|
{ logLevel: 0, fontFamily: 'courier' }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('should render a single state with short descriptions', () => {
|
it('should render a single state with short descriptions', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -45,7 +42,6 @@ describe('State diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 0, fontFamily: 'courier' }
|
{ logLevel: 0, fontFamily: 'courier' }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('should render a transition descriptions with new lines', () => {
|
it('should render a transition descriptions with new lines', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -59,7 +55,6 @@ describe('State diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 0, fontFamily: 'courier' }
|
{ logLevel: 0, fontFamily: 'courier' }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('should render a state with a note', () => {
|
it('should render a state with a note', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -73,7 +68,6 @@ describe('State diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 0, fontFamily: 'courier' }
|
{ logLevel: 0, fontFamily: 'courier' }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('should render a state with on the left side when so specified', () => {
|
it('should render a state with on the left side when so specified', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -87,7 +81,6 @@ describe('State diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 0, fontFamily: 'courier' }
|
{ logLevel: 0, fontFamily: 'courier' }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('should render a state with a note together with another state', () => {
|
it('should render a state with a note together with another state', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -103,7 +96,6 @@ describe('State diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 0, fontFamily: 'courier' }
|
{ logLevel: 0, fontFamily: 'courier' }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('should render a note with multiple lines in it', () => {
|
it('should render a note with multiple lines in it', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -146,7 +138,6 @@ describe('State diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 0, fontFamily: 'courier' }
|
{ logLevel: 0, fontFamily: 'courier' }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('should render a simple state diagrams 2', () => {
|
it('should render a simple state diagrams 2', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -159,7 +150,6 @@ describe('State diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 0, fontFamily: 'courier' }
|
{ logLevel: 0, fontFamily: 'courier' }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('should render a simple state diagrams with labels', () => {
|
it('should render a simple state diagrams with labels', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -175,7 +165,6 @@ describe('State diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 0, fontFamily: 'courier' }
|
{ logLevel: 0, fontFamily: 'courier' }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('should render state descriptions', () => {
|
it('should render state descriptions', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -188,7 +177,6 @@ describe('State diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 0, fontFamily: 'courier' }
|
{ logLevel: 0, fontFamily: 'courier' }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('should render composite states', () => {
|
it('should render composite states', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -207,7 +195,6 @@ describe('State diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 0, fontFamily: 'courier' }
|
{ logLevel: 0, fontFamily: 'courier' }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('should render multiple composit states', () => {
|
it('should render multiple composit states', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -277,7 +264,6 @@ describe('State diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 0, fontFamily: 'courier' }
|
{ logLevel: 0, fontFamily: 'courier' }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('should render concurrency states', () => {
|
it('should render concurrency states', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -301,7 +287,6 @@ describe('State diagram', () => {
|
|||||||
`,
|
`,
|
||||||
{ logLevel: 0, fontFamily: 'courier' }
|
{ logLevel: 0, fontFamily: 'courier' }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('should render a state with states in it', () => {
|
it('should render a state with states in it', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ describe('themeCSS balancing, it', () => {
|
|||||||
`,
|
`,
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('should not allow unbalanced CSS definitions 2', () => {
|
it('should not allow unbalanced CSS definitions 2', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -21,7 +20,6 @@ describe('themeCSS balancing, it', () => {
|
|||||||
`,
|
`,
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -45,7 +43,6 @@ describe('Pie Chart', () => {
|
|||||||
`,
|
`,
|
||||||
{ theme }
|
{ theme }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('should render a flowchart diagram', () => {
|
it('should render a flowchart diagram', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -70,7 +67,6 @@ describe('Pie Chart', () => {
|
|||||||
`,
|
`,
|
||||||
{ theme }
|
{ theme }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('should render a new flowchart diagram', () => {
|
it('should render a new flowchart diagram', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -96,7 +92,6 @@ describe('Pie Chart', () => {
|
|||||||
`,
|
`,
|
||||||
{ theme }
|
{ theme }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('should render a sequence diagram', () => {
|
it('should render a sequence diagram', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -125,7 +120,6 @@ describe('Pie Chart', () => {
|
|||||||
`,
|
`,
|
||||||
{ theme }
|
{ theme }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render a class diagram', () => {
|
it('should render a class diagram', () => {
|
||||||
@@ -175,7 +169,6 @@ describe('Pie Chart', () => {
|
|||||||
`,
|
`,
|
||||||
{ theme }
|
{ theme }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('should render a state diagram', () => {
|
it('should render a state diagram', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -210,7 +203,6 @@ stateDiagram
|
|||||||
`,
|
`,
|
||||||
{ theme }
|
{ theme }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('should render a state diagram (v2)', () => {
|
it('should render a state diagram (v2)', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -245,7 +237,6 @@ stateDiagram-v2
|
|||||||
`,
|
`,
|
||||||
{ theme }
|
{ theme }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('should render a er diagram', () => {
|
it('should render a er diagram', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -266,7 +257,6 @@ erDiagram
|
|||||||
`,
|
`,
|
||||||
{ theme }
|
{ theme }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('should render a user journey diagram', () => {
|
it('should render a user journey diagram', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -287,7 +277,6 @@ erDiagram
|
|||||||
`,
|
`,
|
||||||
{ theme }
|
{ theme }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('should render a gantt diagram', () => {
|
it('should render a gantt diagram', () => {
|
||||||
cy.clock(new Date('2014-01-06').getTime());
|
cy.clock(new Date('2014-01-06').getTime());
|
||||||
@@ -326,7 +315,6 @@ erDiagram
|
|||||||
`,
|
`,
|
||||||
{ theme }
|
{ theme }
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ describe('XY Chart', () => {
|
|||||||
`,
|
`,
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('Should render a complete chart', () => {
|
it('Should render a complete chart', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -35,7 +34,6 @@ describe('XY Chart', () => {
|
|||||||
`,
|
`,
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('y-axis title not required', () => {
|
it('y-axis title not required', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -48,7 +46,6 @@ describe('XY Chart', () => {
|
|||||||
`,
|
`,
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('Should render a chart without y-axis with different range', () => {
|
it('Should render a chart without y-axis with different range', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -60,7 +57,6 @@ describe('XY Chart', () => {
|
|||||||
`,
|
`,
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('x axis title not required', () => {
|
it('x axis title not required', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -72,7 +68,6 @@ describe('XY Chart', () => {
|
|||||||
`,
|
`,
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('Multiple plots can be rendered', () => {
|
it('Multiple plots can be rendered', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -87,7 +82,6 @@ describe('XY Chart', () => {
|
|||||||
`,
|
`,
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('Decimals and negative numbers are supported', () => {
|
it('Decimals and negative numbers are supported', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -98,7 +92,6 @@ describe('XY Chart', () => {
|
|||||||
`,
|
`,
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('Render spark line with "plotReservedSpacePercent"', () => {
|
it('Render spark line with "plotReservedSpacePercent"', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -116,7 +109,6 @@ describe('XY Chart', () => {
|
|||||||
`,
|
`,
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('Render spark bar without displaying other property', () => {
|
it('Render spark bar without displaying other property', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -143,7 +135,6 @@ describe('XY Chart', () => {
|
|||||||
`,
|
`,
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('Should use all the config from directive', () => {
|
it('Should use all the config from directive', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -158,7 +149,6 @@ describe('XY Chart', () => {
|
|||||||
`,
|
`,
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('Should use all the config from yaml', () => {
|
it('Should use all the config from yaml', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -199,7 +189,6 @@ describe('XY Chart', () => {
|
|||||||
`,
|
`,
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('Render with show axis title false', () => {
|
it('Render with show axis title false', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -221,7 +210,6 @@ describe('XY Chart', () => {
|
|||||||
`,
|
`,
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('Render with show axis label false', () => {
|
it('Render with show axis label false', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -243,7 +231,6 @@ describe('XY Chart', () => {
|
|||||||
`,
|
`,
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('Render with show axis tick false', () => {
|
it('Render with show axis tick false', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -265,7 +252,6 @@ describe('XY Chart', () => {
|
|||||||
`,
|
`,
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('Render with show axis line false', () => {
|
it('Render with show axis line false', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -287,7 +273,6 @@ describe('XY Chart', () => {
|
|||||||
`,
|
`,
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
cy.get('svg');
|
|
||||||
});
|
});
|
||||||
it('Render all the theme color', () => {
|
it('Render all the theme color', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
@@ -317,6 +302,17 @@ describe('XY Chart', () => {
|
|||||||
`,
|
`,
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
|
});
|
||||||
|
it('should use the correct distances between data points', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
xychart-beta
|
||||||
|
x-axis 0 --> 2
|
||||||
|
line [0, 1, 0, 1]
|
||||||
|
bar [1, 0, 1, 0]
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
cy.get('svg');
|
cy.get('svg');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ const code3 = `flowchart TD
|
|||||||
A(<img scr='https://iconscout.com/ms-icon-310x310.png' width='20' height='20' />)
|
A(<img scr='https://iconscout.com/ms-icon-310x310.png' width='20' height='20' />)
|
||||||
B(<b>Bold text!</b>)`;
|
B(<b>Bold text!</b>)`;
|
||||||
|
|
||||||
if (location.href.match('test-html-escaping')) {
|
if (/test-html-escaping/.exec(location.href)) {
|
||||||
code = code3;
|
code = code3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ if (typeof document !== 'undefined') {
|
|||||||
window.addEventListener(
|
window.addEventListener(
|
||||||
'load',
|
'load',
|
||||||
function () {
|
function () {
|
||||||
if (this.location.href.match('xss.html')) {
|
if (/xss.html/.exec(this.location.href)) {
|
||||||
this.console.log('Using api');
|
this.console.log('Using api');
|
||||||
void contentLoadedApi().finally(markRendered);
|
void contentLoadedApi().finally(markRendered);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -238,6 +238,17 @@
|
|||||||
Alice-xJohn: Hello John, how are you?
|
Alice-xJohn: Hello John, how are you?
|
||||||
John--xAlice: Great!
|
John--xAlice: Great!
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
|
<hr />
|
||||||
|
|
||||||
|
<pre class="mermaid">
|
||||||
|
sequenceDiagram
|
||||||
|
participant Alice
|
||||||
|
participant Bob
|
||||||
|
Alice<<->>Bob: Hello!
|
||||||
|
Alice<<->>Bob: Wow, we said that at the same time!
|
||||||
|
Bob<<-->>Alice: Bidirectional Arrows are so cool
|
||||||
|
</pre>
|
||||||
<script type="module">
|
<script type="module">
|
||||||
import mermaid from './mermaid.esm.mjs';
|
import mermaid from './mermaid.esm.mjs';
|
||||||
mermaid.initialize({
|
mermaid.initialize({
|
||||||
|
|||||||
@@ -10,4 +10,4 @@
|
|||||||
|
|
||||||
- [config](modules/config.md)
|
- [config](modules/config.md)
|
||||||
- [defaultConfig](modules/defaultConfig.md)
|
- [defaultConfig](modules/defaultConfig.md)
|
||||||
- [mermaidAPI](modules/mermaidAPI.md)
|
- [mermaid](modules/mermaid.md)
|
||||||
|
|||||||
171
docs/config/setup/classes/mermaid.UnknownDiagramError.md
Normal file
171
docs/config/setup/classes/mermaid.UnknownDiagramError.md
Normal file
@@ -0,0 +1,171 @@
|
|||||||
|
> **Warning**
|
||||||
|
>
|
||||||
|
> ## THIS IS AN AUTOGENERATED FILE. DO NOT EDIT.
|
||||||
|
>
|
||||||
|
> ## Please edit the corresponding file in [/packages/mermaid/src/docs/config/setup/classes/mermaid.UnknownDiagramError.md](../../../../packages/mermaid/src/docs/config/setup/classes/mermaid.UnknownDiagramError.md).
|
||||||
|
|
||||||
|
# Class: UnknownDiagramError
|
||||||
|
|
||||||
|
[mermaid](../modules/mermaid.md).UnknownDiagramError
|
||||||
|
|
||||||
|
## Hierarchy
|
||||||
|
|
||||||
|
- `Error`
|
||||||
|
|
||||||
|
↳ **`UnknownDiagramError`**
|
||||||
|
|
||||||
|
## Constructors
|
||||||
|
|
||||||
|
### constructor
|
||||||
|
|
||||||
|
• **new UnknownDiagramError**(`message`): [`UnknownDiagramError`](mermaid.UnknownDiagramError.md)
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
|
||||||
|
| Name | Type |
|
||||||
|
| :-------- | :------- |
|
||||||
|
| `message` | `string` |
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
[`UnknownDiagramError`](mermaid.UnknownDiagramError.md)
|
||||||
|
|
||||||
|
#### Overrides
|
||||||
|
|
||||||
|
Error.constructor
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/errors.ts:2](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/errors.ts#L2)
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
### cause
|
||||||
|
|
||||||
|
• `Optional` **cause**: `unknown`
|
||||||
|
|
||||||
|
#### Inherited from
|
||||||
|
|
||||||
|
Error.cause
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
node_modules/.pnpm/typescript\@5.4.5/node_modules/typescript/lib/lib.es2022.error.d.ts:24
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### message
|
||||||
|
|
||||||
|
• **message**: `string`
|
||||||
|
|
||||||
|
#### Inherited from
|
||||||
|
|
||||||
|
Error.message
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
node_modules/.pnpm/typescript\@5.4.5/node_modules/typescript/lib/lib.es5.d.ts:1077
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### name
|
||||||
|
|
||||||
|
• **name**: `string`
|
||||||
|
|
||||||
|
#### Inherited from
|
||||||
|
|
||||||
|
Error.name
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
node_modules/.pnpm/typescript\@5.4.5/node_modules/typescript/lib/lib.es5.d.ts:1076
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### stack
|
||||||
|
|
||||||
|
• `Optional` **stack**: `string`
|
||||||
|
|
||||||
|
#### Inherited from
|
||||||
|
|
||||||
|
Error.stack
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
node_modules/.pnpm/typescript\@5.4.5/node_modules/typescript/lib/lib.es5.d.ts:1078
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### prepareStackTrace
|
||||||
|
|
||||||
|
▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`\[]) => `any`
|
||||||
|
|
||||||
|
Optional override for formatting stack traces
|
||||||
|
|
||||||
|
**`See`**
|
||||||
|
|
||||||
|
<https://v8.dev/docs/stack-trace-api#customizing-stack-traces>
|
||||||
|
|
||||||
|
#### Type declaration
|
||||||
|
|
||||||
|
▸ (`err`, `stackTraces`): `any`
|
||||||
|
|
||||||
|
##### Parameters
|
||||||
|
|
||||||
|
| Name | Type |
|
||||||
|
| :------------ | :------------ |
|
||||||
|
| `err` | `Error` |
|
||||||
|
| `stackTraces` | `CallSite`\[] |
|
||||||
|
|
||||||
|
##### Returns
|
||||||
|
|
||||||
|
`any`
|
||||||
|
|
||||||
|
#### Inherited from
|
||||||
|
|
||||||
|
Error.prepareStackTrace
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
node_modules/@types/node/globals.d.ts:28
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### stackTraceLimit
|
||||||
|
|
||||||
|
▪ `Static` **stackTraceLimit**: `number`
|
||||||
|
|
||||||
|
#### Inherited from
|
||||||
|
|
||||||
|
Error.stackTraceLimit
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
node_modules/@types/node/globals.d.ts:30
|
||||||
|
|
||||||
|
## Methods
|
||||||
|
|
||||||
|
### captureStackTrace
|
||||||
|
|
||||||
|
▸ **captureStackTrace**(`targetObject`, `constructorOpt?`): `void`
|
||||||
|
|
||||||
|
Create .stack property on a target object
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
|
||||||
|
| Name | Type |
|
||||||
|
| :---------------- | :--------- |
|
||||||
|
| `targetObject` | `object` |
|
||||||
|
| `constructorOpt?` | `Function` |
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
`void`
|
||||||
|
|
||||||
|
#### Inherited from
|
||||||
|
|
||||||
|
Error.captureStackTrace
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
node_modules/@types/node/globals.d.ts:21
|
||||||
49
docs/config/setup/interfaces/mermaid.DetailedError.md
Normal file
49
docs/config/setup/interfaces/mermaid.DetailedError.md
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
> **Warning**
|
||||||
|
>
|
||||||
|
> ## THIS IS AN AUTOGENERATED FILE. DO NOT EDIT.
|
||||||
|
>
|
||||||
|
> ## Please edit the corresponding file in [/packages/mermaid/src/docs/config/setup/interfaces/mermaid.DetailedError.md](../../../../packages/mermaid/src/docs/config/setup/interfaces/mermaid.DetailedError.md).
|
||||||
|
|
||||||
|
# Interface: DetailedError
|
||||||
|
|
||||||
|
[mermaid](../modules/mermaid.md).DetailedError
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
### error
|
||||||
|
|
||||||
|
• `Optional` **error**: `any`
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/utils.ts:785](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/utils.ts#L785)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### hash
|
||||||
|
|
||||||
|
• **hash**: `any`
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/utils.ts:783](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/utils.ts#L783)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### message
|
||||||
|
|
||||||
|
• `Optional` **message**: `string`
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/utils.ts:786](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/utils.ts#L786)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### str
|
||||||
|
|
||||||
|
• **str**: `string`
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/utils.ts:781](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/utils.ts#L781)
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
> **Warning**
|
||||||
|
>
|
||||||
|
> ## THIS IS AN AUTOGENERATED FILE. DO NOT EDIT.
|
||||||
|
>
|
||||||
|
> ## Please edit the corresponding file in [/packages/mermaid/src/docs/config/setup/interfaces/mermaid.ExternalDiagramDefinition.md](../../../../packages/mermaid/src/docs/config/setup/interfaces/mermaid.ExternalDiagramDefinition.md).
|
||||||
|
|
||||||
|
# Interface: ExternalDiagramDefinition
|
||||||
|
|
||||||
|
[mermaid](../modules/mermaid.md).ExternalDiagramDefinition
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
### detector
|
||||||
|
|
||||||
|
• **detector**: `DiagramDetector`
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/diagram-api/types.ts:101](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/diagram-api/types.ts#L101)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### id
|
||||||
|
|
||||||
|
• **id**: `string`
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/diagram-api/types.ts:100](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/diagram-api/types.ts#L100)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### loader
|
||||||
|
|
||||||
|
• **loader**: `DiagramLoader`
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/diagram-api/types.ts:102](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/diagram-api/types.ts#L102)
|
||||||
340
docs/config/setup/interfaces/mermaid.Mermaid.md
Normal file
340
docs/config/setup/interfaces/mermaid.Mermaid.md
Normal file
@@ -0,0 +1,340 @@
|
|||||||
|
> **Warning**
|
||||||
|
>
|
||||||
|
> ## THIS IS AN AUTOGENERATED FILE. DO NOT EDIT.
|
||||||
|
>
|
||||||
|
> ## Please edit the corresponding file in [/packages/mermaid/src/docs/config/setup/interfaces/mermaid.Mermaid.md](../../../../packages/mermaid/src/docs/config/setup/interfaces/mermaid.Mermaid.md).
|
||||||
|
|
||||||
|
# Interface: Mermaid
|
||||||
|
|
||||||
|
[mermaid](../modules/mermaid.md).Mermaid
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
### contentLoaded
|
||||||
|
|
||||||
|
• **contentLoaded**: () => `void`
|
||||||
|
|
||||||
|
#### Type declaration
|
||||||
|
|
||||||
|
▸ (): `void`
|
||||||
|
|
||||||
|
\##contentLoaded Callback function that is called when page is loaded. This functions fetches
|
||||||
|
configuration for mermaid rendering and calls init for rendering the mermaid diagrams on the
|
||||||
|
page.
|
||||||
|
|
||||||
|
##### Returns
|
||||||
|
|
||||||
|
`void`
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/mermaid.ts:425](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L425)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### detectType
|
||||||
|
|
||||||
|
• **detectType**: (`text`: `string`, `config?`: [`MermaidConfig`](mermaid.MermaidConfig.md)) => `string`
|
||||||
|
|
||||||
|
#### Type declaration
|
||||||
|
|
||||||
|
▸ (`text`, `config?`): `string`
|
||||||
|
|
||||||
|
Detects the type of the graph text.
|
||||||
|
|
||||||
|
Takes into consideration the possible existence of an `%%init` directive
|
||||||
|
|
||||||
|
##### Parameters
|
||||||
|
|
||||||
|
| Name | Type | Description |
|
||||||
|
| :-------- | :------------------------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||||
|
| `text` | `string` | The text defining the graph. For example: `mermaid %%{initialize: {"startOnLoad": true, logLevel: "fatal" }}%% graph LR a-->b b-->c c-->d d-->e e-->f f-->g g-->h ` |
|
||||||
|
| `config?` | [`MermaidConfig`](mermaid.MermaidConfig.md) | The mermaid config. |
|
||||||
|
|
||||||
|
##### Returns
|
||||||
|
|
||||||
|
`string`
|
||||||
|
|
||||||
|
A graph definition key
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/mermaid.ts:427](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L427)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### init
|
||||||
|
|
||||||
|
• **init**: (`config?`: [`MermaidConfig`](mermaid.MermaidConfig.md), `nodes?`: `string` | `HTMLElement` | `NodeListOf`<`HTMLElement`>, `callback?`: (`id`: `string`) => `unknown`) => `Promise`<`void`>
|
||||||
|
|
||||||
|
**`Deprecated`**
|
||||||
|
|
||||||
|
Use [initialize](mermaid.Mermaid.md#initialize) and [run](mermaid.Mermaid.md#run) instead.
|
||||||
|
|
||||||
|
#### Type declaration
|
||||||
|
|
||||||
|
▸ (`config?`, `nodes?`, `callback?`): `Promise`<`void`>
|
||||||
|
|
||||||
|
##### Parameters
|
||||||
|
|
||||||
|
| Name | Type |
|
||||||
|
| :---------- | :------------------------------------------------------- |
|
||||||
|
| `config?` | [`MermaidConfig`](mermaid.MermaidConfig.md) |
|
||||||
|
| `nodes?` | `string` \| `HTMLElement` \| `NodeListOf`<`HTMLElement`> |
|
||||||
|
| `callback?` | (`id`: `string`) => `unknown` |
|
||||||
|
|
||||||
|
##### Returns
|
||||||
|
|
||||||
|
`Promise`<`void`>
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/mermaid.ts:421](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L421)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### initialize
|
||||||
|
|
||||||
|
• **initialize**: (`config`: [`MermaidConfig`](mermaid.MermaidConfig.md)) => `void`
|
||||||
|
|
||||||
|
#### Type declaration
|
||||||
|
|
||||||
|
▸ (`config`): `void`
|
||||||
|
|
||||||
|
Used to set configurations for mermaid.
|
||||||
|
This function should be called before the run function.
|
||||||
|
|
||||||
|
##### Parameters
|
||||||
|
|
||||||
|
| Name | Type | Description |
|
||||||
|
| :------- | :------------------------------------------ | :-------------------------------- |
|
||||||
|
| `config` | [`MermaidConfig`](mermaid.MermaidConfig.md) | Configuration object for mermaid. |
|
||||||
|
|
||||||
|
##### Returns
|
||||||
|
|
||||||
|
`void`
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/mermaid.ts:424](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L424)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### mermaidAPI
|
||||||
|
|
||||||
|
• **mermaidAPI**: `Readonly`<{ `defaultConfig`: [`MermaidConfig`](mermaid.MermaidConfig.md) = configApi.defaultConfig; `getConfig`: () => [`MermaidConfig`](mermaid.MermaidConfig.md) = configApi.getConfig; `getDiagramFromText`: (`text`: `string`, `metadata`: `Pick`<`DiagramMetadata`, `"title"`>) => `Promise`<`Diagram`> ; `getSiteConfig`: () => [`MermaidConfig`](mermaid.MermaidConfig.md) = configApi.getSiteConfig; `globalReset`: () => `void` ; `initialize`: (`options`: [`MermaidConfig`](mermaid.MermaidConfig.md)) => `void` ; `parse`: (`text`: `string`, `parseOptions`: [`ParseOptions`](mermaid.ParseOptions.md) & { `suppressErrors`: `true` }) => `Promise`<[`ParseResult`](mermaid.ParseResult.md) | `false`>(`text`: `string`, `parseOptions?`: [`ParseOptions`](mermaid.ParseOptions.md)) => `Promise`<[`ParseResult`](mermaid.ParseResult.md)> ; `render`: (`id`: `string`, `text`: `string`, `svgContainingElement?`: `Element`) => `Promise`<[`RenderResult`](mermaid.RenderResult.md)> ; `reset`: () => `void` ; `setConfig`: (`conf`: [`MermaidConfig`](mermaid.MermaidConfig.md)) => [`MermaidConfig`](mermaid.MermaidConfig.md) = configApi.setConfig; `updateSiteConfig`: (`conf`: [`MermaidConfig`](mermaid.MermaidConfig.md)) => [`MermaidConfig`](mermaid.MermaidConfig.md) = configApi.updateSiteConfig }>
|
||||||
|
|
||||||
|
**`Deprecated`**
|
||||||
|
|
||||||
|
Use [parse](mermaid.Mermaid.md#parse) and [render](mermaid.Mermaid.md#render) instead. Please [open a discussion](https://github.com/mermaid-js/mermaid/discussions) if your use case does not fit the new API.
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/mermaid.ts:415](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L415)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### parse
|
||||||
|
|
||||||
|
• **parse**: (`text`: `string`, `parseOptions`: [`ParseOptions`](mermaid.ParseOptions.md) & { `suppressErrors`: `true` }) => `Promise`<[`ParseResult`](mermaid.ParseResult.md) | `false`>(`text`: `string`, `parseOptions?`: [`ParseOptions`](mermaid.ParseOptions.md)) => `Promise`<[`ParseResult`](mermaid.ParseResult.md)>
|
||||||
|
|
||||||
|
#### Type declaration
|
||||||
|
|
||||||
|
▸ (`text`, `parseOptions`): `Promise`<[`ParseResult`](mermaid.ParseResult.md) | `false`>
|
||||||
|
|
||||||
|
Parse the text and validate the syntax.
|
||||||
|
|
||||||
|
##### Parameters
|
||||||
|
|
||||||
|
| Name | Type | Description |
|
||||||
|
| :------------- | :----------------------------------------------------------------------- | :------------------------------ |
|
||||||
|
| `text` | `string` | The mermaid diagram definition. |
|
||||||
|
| `parseOptions` | [`ParseOptions`](mermaid.ParseOptions.md) & { `suppressErrors`: `true` } | Options for parsing. |
|
||||||
|
|
||||||
|
##### Returns
|
||||||
|
|
||||||
|
`Promise`<[`ParseResult`](mermaid.ParseResult.md) | `false`>
|
||||||
|
|
||||||
|
An object with the `diagramType` set to type of the diagram if valid. Otherwise `false` if parseOptions.suppressErrors is `true`.
|
||||||
|
|
||||||
|
**`See`**
|
||||||
|
|
||||||
|
[ParseOptions](mermaid.ParseOptions.md)
|
||||||
|
|
||||||
|
**`Throws`**
|
||||||
|
|
||||||
|
Error if the diagram is invalid and parseOptions.suppressErrors is false or not set.
|
||||||
|
|
||||||
|
▸ (`text`, `parseOptions?`): `Promise`<[`ParseResult`](mermaid.ParseResult.md)>
|
||||||
|
|
||||||
|
##### Parameters
|
||||||
|
|
||||||
|
| Name | Type |
|
||||||
|
| :-------------- | :---------------------------------------- |
|
||||||
|
| `text` | `string` |
|
||||||
|
| `parseOptions?` | [`ParseOptions`](mermaid.ParseOptions.md) |
|
||||||
|
|
||||||
|
##### Returns
|
||||||
|
|
||||||
|
`Promise`<[`ParseResult`](mermaid.ParseResult.md)>
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/mermaid.ts:416](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L416)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### parseError
|
||||||
|
|
||||||
|
• `Optional` **parseError**: [`ParseErrorFunction`](../modules/mermaid.md#parseerrorfunction)
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/mermaid.ts:410](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L410)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### registerExternalDiagrams
|
||||||
|
|
||||||
|
• **registerExternalDiagrams**: (`diagrams`: [`ExternalDiagramDefinition`](mermaid.ExternalDiagramDefinition.md)\[], `opts`: { `lazyLoad?`: `boolean` = true }) => `Promise`<`void`>
|
||||||
|
|
||||||
|
#### Type declaration
|
||||||
|
|
||||||
|
▸ (`diagrams`, `opts?`): `Promise`<`void`>
|
||||||
|
|
||||||
|
Used to register external diagram types.
|
||||||
|
|
||||||
|
##### Parameters
|
||||||
|
|
||||||
|
| Name | Type | Default value | Description |
|
||||||
|
| :--------------- | :--------------------------------------------------------------------- | :------------ | :-------------------------------------------------------------------------- |
|
||||||
|
| `diagrams` | [`ExternalDiagramDefinition`](mermaid.ExternalDiagramDefinition.md)\[] | `undefined` | Array of [ExternalDiagramDefinition](mermaid.ExternalDiagramDefinition.md). |
|
||||||
|
| `opts` | `Object` | `{}` | If opts.lazyLoad is false, the diagrams will be loaded immediately. |
|
||||||
|
| `opts.lazyLoad?` | `boolean` | `true` | - |
|
||||||
|
|
||||||
|
##### Returns
|
||||||
|
|
||||||
|
`Promise`<`void`>
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/mermaid.ts:423](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L423)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### render
|
||||||
|
|
||||||
|
• **render**: (`id`: `string`, `text`: `string`, `svgContainingElement?`: `Element`) => `Promise`<[`RenderResult`](mermaid.RenderResult.md)>
|
||||||
|
|
||||||
|
#### Type declaration
|
||||||
|
|
||||||
|
▸ (`id`, `text`, `svgContainingElement?`): `Promise`<[`RenderResult`](mermaid.RenderResult.md)>
|
||||||
|
|
||||||
|
##### Parameters
|
||||||
|
|
||||||
|
| Name | Type |
|
||||||
|
| :---------------------- | :-------- |
|
||||||
|
| `id` | `string` |
|
||||||
|
| `text` | `string` |
|
||||||
|
| `svgContainingElement?` | `Element` |
|
||||||
|
|
||||||
|
##### Returns
|
||||||
|
|
||||||
|
`Promise`<[`RenderResult`](mermaid.RenderResult.md)>
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/mermaid.ts:417](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L417)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### run
|
||||||
|
|
||||||
|
• **run**: (`options`: [`RunOptions`](mermaid.RunOptions.md)) => `Promise`<`void`>
|
||||||
|
|
||||||
|
#### Type declaration
|
||||||
|
|
||||||
|
▸ (`options?`): `Promise`<`void`>
|
||||||
|
|
||||||
|
## run
|
||||||
|
|
||||||
|
Function that goes through the document to find the chart definitions in there and render them.
|
||||||
|
|
||||||
|
The function tags the processed attributes with the attribute data-processed and ignores found
|
||||||
|
elements with the attribute already set. This way the init function can be triggered several
|
||||||
|
times.
|
||||||
|
|
||||||
|
```mermaid-example
|
||||||
|
graph LR;
|
||||||
|
a(Find elements)-->b{Processed}
|
||||||
|
b-->|Yes|c(Leave element)
|
||||||
|
b-->|No |d(Transform)
|
||||||
|
```
|
||||||
|
|
||||||
|
```mermaid
|
||||||
|
graph LR;
|
||||||
|
a(Find elements)-->b{Processed}
|
||||||
|
b-->|Yes|c(Leave element)
|
||||||
|
b-->|No |d(Transform)
|
||||||
|
```
|
||||||
|
|
||||||
|
Renders the mermaid diagrams
|
||||||
|
|
||||||
|
##### Parameters
|
||||||
|
|
||||||
|
| Name | Type | Description |
|
||||||
|
| :-------- | :------------------------------------ | :----------------------- |
|
||||||
|
| `options` | [`RunOptions`](mermaid.RunOptions.md) | Optional runtime configs |
|
||||||
|
|
||||||
|
##### Returns
|
||||||
|
|
||||||
|
`Promise`<`void`>
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/mermaid.ts:422](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L422)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### setParseErrorHandler
|
||||||
|
|
||||||
|
• **setParseErrorHandler**: (`parseErrorHandler`: (`err`: `any`, `hash`: `any`) => `void`) => `void`
|
||||||
|
|
||||||
|
#### Type declaration
|
||||||
|
|
||||||
|
▸ (`parseErrorHandler`): `void`
|
||||||
|
|
||||||
|
## setParseErrorHandler Alternative to directly setting parseError using:
|
||||||
|
|
||||||
|
```js
|
||||||
|
mermaid.parseError = function (err, hash) {
|
||||||
|
forExampleDisplayErrorInGui(err); // do something with the error
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
This is provided for environments where the mermaid object can't directly have a new member added
|
||||||
|
to it (eg. dart interop wrapper). (Initially there is no parseError member of mermaid).
|
||||||
|
|
||||||
|
##### Parameters
|
||||||
|
|
||||||
|
| Name | Type | Description |
|
||||||
|
| :------------------ | :-------------------------------------- | :------------------------- |
|
||||||
|
| `parseErrorHandler` | (`err`: `any`, `hash`: `any`) => `void` | New parseError() callback. |
|
||||||
|
|
||||||
|
##### Returns
|
||||||
|
|
||||||
|
`void`
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/mermaid.ts:426](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L426)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### startOnLoad
|
||||||
|
|
||||||
|
• **startOnLoad**: `boolean`
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/mermaid.ts:409](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L409)
|
||||||
467
docs/config/setup/interfaces/mermaid.MermaidConfig.md
Normal file
467
docs/config/setup/interfaces/mermaid.MermaidConfig.md
Normal file
@@ -0,0 +1,467 @@
|
|||||||
|
> **Warning**
|
||||||
|
>
|
||||||
|
> ## THIS IS AN AUTOGENERATED FILE. DO NOT EDIT.
|
||||||
|
>
|
||||||
|
> ## Please edit the corresponding file in [/packages/mermaid/src/docs/config/setup/interfaces/mermaid.MermaidConfig.md](../../../../packages/mermaid/src/docs/config/setup/interfaces/mermaid.MermaidConfig.md).
|
||||||
|
|
||||||
|
# Interface: MermaidConfig
|
||||||
|
|
||||||
|
[mermaid](../modules/mermaid.md).MermaidConfig
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
### altFontFamily
|
||||||
|
|
||||||
|
• `Optional` **altFontFamily**: `string`
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/config.type.ts:85](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L85)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### arrowMarkerAbsolute
|
||||||
|
|
||||||
|
• `Optional` **arrowMarkerAbsolute**: `boolean`
|
||||||
|
|
||||||
|
Controls whether or arrow markers in html code are absolute paths or anchors.
|
||||||
|
This matters if you are using base tag settings.
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/config.type.ts:104](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L104)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### block
|
||||||
|
|
||||||
|
• `Optional` **block**: `BlockDiagramConfig`
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/config.type.ts:162](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L162)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### c4
|
||||||
|
|
||||||
|
• `Optional` **c4**: `C4DiagramConfig`
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/config.type.ts:159](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L159)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### class
|
||||||
|
|
||||||
|
• `Optional` **class**: `ClassDiagramConfig`
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/config.type.ts:150](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L150)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### darkMode
|
||||||
|
|
||||||
|
• `Optional` **darkMode**: `boolean`
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/config.type.ts:76](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L76)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### deterministicIDSeed
|
||||||
|
|
||||||
|
• `Optional` **deterministicIDSeed**: `string`
|
||||||
|
|
||||||
|
This option is the optional seed for deterministic ids.
|
||||||
|
If set to `undefined` but deterministicIds is `true`, a simple number iterator is used.
|
||||||
|
You can set this attribute to base the seed on a static string.
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/config.type.ts:144](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L144)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### deterministicIds
|
||||||
|
|
||||||
|
• `Optional` **deterministicIds**: `boolean`
|
||||||
|
|
||||||
|
This option controls if the generated ids of nodes in the SVG are
|
||||||
|
generated randomly or based on a seed.
|
||||||
|
If set to `false`, the IDs are generated based on the current date and
|
||||||
|
thus are not deterministic. This is the default behavior.
|
||||||
|
|
||||||
|
This matters if your files are checked into source control e.g. git and
|
||||||
|
should not change unless content is changed.
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/config.type.ts:137](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L137)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### dompurifyConfig
|
||||||
|
|
||||||
|
• `Optional` **dompurifyConfig**: `Config`
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/config.type.ts:163](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L163)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### er
|
||||||
|
|
||||||
|
• `Optional` **er**: `ErDiagramConfig`
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/config.type.ts:152](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L152)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### flowchart
|
||||||
|
|
||||||
|
• `Optional` **flowchart**: `FlowchartDiagramConfig`
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/config.type.ts:145](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L145)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### fontFamily
|
||||||
|
|
||||||
|
• `Optional` **fontFamily**: `string`
|
||||||
|
|
||||||
|
Specifies the font to be used in the rendered diagrams.
|
||||||
|
Can be any possible CSS `font-family`.
|
||||||
|
See <https://developer.mozilla.org/en-US/docs/Web/CSS/font-family>
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/config.type.ts:84](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L84)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### fontSize
|
||||||
|
|
||||||
|
• `Optional` **fontSize**: `number`
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/config.type.ts:165](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L165)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### forceLegacyMathML
|
||||||
|
|
||||||
|
• `Optional` **forceLegacyMathML**: `boolean`
|
||||||
|
|
||||||
|
This option forces Mermaid to rely on KaTeX's own stylesheet for rendering MathML. Due to differences between OS
|
||||||
|
fonts and browser's MathML implementation, this option is recommended if consistent rendering is important.
|
||||||
|
If set to true, ignores legacyMathML.
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/config.type.ts:126](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L126)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### gantt
|
||||||
|
|
||||||
|
• `Optional` **gantt**: `GanttDiagramConfig`
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/config.type.ts:147](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L147)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### gitGraph
|
||||||
|
|
||||||
|
• `Optional` **gitGraph**: `GitGraphDiagramConfig`
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/config.type.ts:158](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L158)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### htmlLabels
|
||||||
|
|
||||||
|
• `Optional` **htmlLabels**: `boolean`
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/config.type.ts:77](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L77)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### journey
|
||||||
|
|
||||||
|
• `Optional` **journey**: `JourneyDiagramConfig`
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/config.type.ts:148](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L148)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### legacyMathML
|
||||||
|
|
||||||
|
• `Optional` **legacyMathML**: `boolean`
|
||||||
|
|
||||||
|
This option specifies if Mermaid can expect the dependent to include KaTeX stylesheets for browsers
|
||||||
|
without their own MathML implementation. If this option is disabled and MathML is not supported, the math
|
||||||
|
equations are replaced with a warning. If this option is enabled and MathML is not supported, Mermaid will
|
||||||
|
fall back to legacy rendering for KaTeX.
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/config.type.ts:119](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L119)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### logLevel
|
||||||
|
|
||||||
|
• `Optional` **logLevel**: `0` | `2` | `1` | `"trace"` | `"debug"` | `"info"` | `"warn"` | `"error"` | `"fatal"` | `3` | `4` | `5`
|
||||||
|
|
||||||
|
This option decides the amount of logging to be used by mermaid.
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/config.type.ts:90](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L90)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### markdownAutoWrap
|
||||||
|
|
||||||
|
• `Optional` **markdownAutoWrap**: `boolean`
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/config.type.ts:166](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L166)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### maxEdges
|
||||||
|
|
||||||
|
• `Optional` **maxEdges**: `number`
|
||||||
|
|
||||||
|
Defines the maximum number of edges that can be drawn in a graph.
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/config.type.ts:75](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L75)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### maxTextSize
|
||||||
|
|
||||||
|
• `Optional` **maxTextSize**: `number`
|
||||||
|
|
||||||
|
The maximum allowed size of the users text diagram
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/config.type.ts:70](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L70)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### mindmap
|
||||||
|
|
||||||
|
• `Optional` **mindmap**: `MindmapDiagramConfig`
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/config.type.ts:157](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L157)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### packet
|
||||||
|
|
||||||
|
• `Optional` **packet**: `PacketDiagramConfig`
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/config.type.ts:161](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L161)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### pie
|
||||||
|
|
||||||
|
• `Optional` **pie**: `PieDiagramConfig`
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/config.type.ts:153](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L153)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### quadrantChart
|
||||||
|
|
||||||
|
• `Optional` **quadrantChart**: `QuadrantChartConfig`
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/config.type.ts:154](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L154)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### requirement
|
||||||
|
|
||||||
|
• `Optional` **requirement**: `RequirementDiagramConfig`
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/config.type.ts:156](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L156)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### sankey
|
||||||
|
|
||||||
|
• `Optional` **sankey**: `SankeyDiagramConfig`
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/config.type.ts:160](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L160)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### secure
|
||||||
|
|
||||||
|
• `Optional` **secure**: `string`\[]
|
||||||
|
|
||||||
|
This option controls which `currentConfig` keys are considered secure and
|
||||||
|
can only be changed via call to `mermaid.initialize`.
|
||||||
|
This prevents malicious graph directives from overriding a site's default security.
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/config.type.ts:111](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L111)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### securityLevel
|
||||||
|
|
||||||
|
• `Optional` **securityLevel**: `"strict"` | `"loose"` | `"antiscript"` | `"sandbox"`
|
||||||
|
|
||||||
|
Level of trust for parsed diagram
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/config.type.ts:94](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L94)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### sequence
|
||||||
|
|
||||||
|
• `Optional` **sequence**: `SequenceDiagramConfig`
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/config.type.ts:146](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L146)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### startOnLoad
|
||||||
|
|
||||||
|
• `Optional` **startOnLoad**: `boolean`
|
||||||
|
|
||||||
|
Dictates whether mermaid starts on Page load
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/config.type.ts:98](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L98)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### state
|
||||||
|
|
||||||
|
• `Optional` **state**: `StateDiagramConfig`
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/config.type.ts:151](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L151)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### suppressErrorRendering
|
||||||
|
|
||||||
|
• `Optional` **suppressErrorRendering**: `boolean`
|
||||||
|
|
||||||
|
Suppresses inserting 'Syntax error' diagram in the DOM.
|
||||||
|
This is useful when you want to control how to handle syntax errors in your application.
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/config.type.ts:172](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L172)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### theme
|
||||||
|
|
||||||
|
• `Optional` **theme**: `"default"` | `"forest"` | `"dark"` | `"neutral"` | `"null"`
|
||||||
|
|
||||||
|
Theme, the CSS style sheet.
|
||||||
|
You may also use `themeCSS` to override this value.
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/config.type.ts:64](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L64)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### themeCSS
|
||||||
|
|
||||||
|
• `Optional` **themeCSS**: `string`
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/config.type.ts:66](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L66)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### themeVariables
|
||||||
|
|
||||||
|
• `Optional` **themeVariables**: `any`
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/config.type.ts:65](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L65)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### timeline
|
||||||
|
|
||||||
|
• `Optional` **timeline**: `TimelineDiagramConfig`
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/config.type.ts:149](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L149)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### wrap
|
||||||
|
|
||||||
|
• `Optional` **wrap**: `boolean`
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/config.type.ts:164](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L164)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### xyChart
|
||||||
|
|
||||||
|
• `Optional` **xyChart**: `XYChartConfig`
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/config.type.ts:155](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L155)
|
||||||
@@ -2,11 +2,11 @@
|
|||||||
>
|
>
|
||||||
> ## THIS IS AN AUTOGENERATED FILE. DO NOT EDIT.
|
> ## THIS IS AN AUTOGENERATED FILE. DO NOT EDIT.
|
||||||
>
|
>
|
||||||
> ## Please edit the corresponding file in [/packages/mermaid/src/docs/config/setup/interfaces/mermaidAPI.ParseOptions.md](../../../../packages/mermaid/src/docs/config/setup/interfaces/mermaidAPI.ParseOptions.md).
|
> ## Please edit the corresponding file in [/packages/mermaid/src/docs/config/setup/interfaces/mermaid.ParseOptions.md](../../../../packages/mermaid/src/docs/config/setup/interfaces/mermaid.ParseOptions.md).
|
||||||
|
|
||||||
# Interface: ParseOptions
|
# Interface: ParseOptions
|
||||||
|
|
||||||
[mermaidAPI](../modules/mermaidAPI.md).ParseOptions
|
[mermaid](../modules/mermaid.md).ParseOptions
|
||||||
|
|
||||||
## Properties
|
## Properties
|
||||||
|
|
||||||
@@ -19,4 +19,4 @@ The `parseError` function will not be called.
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[mermaidAPI.ts:64](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L64)
|
[packages/mermaid/src/types.ts:43](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/types.ts#L43)
|
||||||
21
docs/config/setup/interfaces/mermaid.ParseResult.md
Normal file
21
docs/config/setup/interfaces/mermaid.ParseResult.md
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
> **Warning**
|
||||||
|
>
|
||||||
|
> ## THIS IS AN AUTOGENERATED FILE. DO NOT EDIT.
|
||||||
|
>
|
||||||
|
> ## Please edit the corresponding file in [/packages/mermaid/src/docs/config/setup/interfaces/mermaid.ParseResult.md](../../../../packages/mermaid/src/docs/config/setup/interfaces/mermaid.ParseResult.md).
|
||||||
|
|
||||||
|
# Interface: ParseResult
|
||||||
|
|
||||||
|
[mermaid](../modules/mermaid.md).ParseResult
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
### diagramType
|
||||||
|
|
||||||
|
• **diagramType**: `string`
|
||||||
|
|
||||||
|
The diagram type, e.g. 'flowchart', 'sequence', etc.
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/types.ts:50](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/types.ts#L50)
|
||||||
@@ -2,11 +2,11 @@
|
|||||||
>
|
>
|
||||||
> ## THIS IS AN AUTOGENERATED FILE. DO NOT EDIT.
|
> ## THIS IS AN AUTOGENERATED FILE. DO NOT EDIT.
|
||||||
>
|
>
|
||||||
> ## Please edit the corresponding file in [/packages/mermaid/src/docs/config/setup/interfaces/mermaidAPI.RenderResult.md](../../../../packages/mermaid/src/docs/config/setup/interfaces/mermaidAPI.RenderResult.md).
|
> ## Please edit the corresponding file in [/packages/mermaid/src/docs/config/setup/interfaces/mermaid.RenderResult.md](../../../../packages/mermaid/src/docs/config/setup/interfaces/mermaid.RenderResult.md).
|
||||||
|
|
||||||
# Interface: RenderResult
|
# Interface: RenderResult
|
||||||
|
|
||||||
[mermaidAPI](../modules/mermaidAPI.md).RenderResult
|
[mermaid](../modules/mermaid.md).RenderResult
|
||||||
|
|
||||||
## Properties
|
## Properties
|
||||||
|
|
||||||
@@ -18,7 +18,7 @@ Bind function to be called after the svg has been inserted into the DOM.
|
|||||||
This is necessary for adding event listeners to the elements in the svg.
|
This is necessary for adding event listeners to the elements in the svg.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const { svg, bindFunctions } = mermaidAPI.render('id1', 'graph TD;A-->B');
|
const { svg, bindFunctions } = await mermaid.render('id1', 'graph TD;A-->B');
|
||||||
div.innerHTML = svg;
|
div.innerHTML = svg;
|
||||||
bindFunctions?.(div); // To call bindFunctions only if it's present.
|
bindFunctions?.(div); // To call bindFunctions only if it's present.
|
||||||
```
|
```
|
||||||
@@ -39,7 +39,7 @@ bindFunctions?.(div); // To call bindFunctions only if it's present.
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[mermaidAPI.ts:94](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L94)
|
[packages/mermaid/src/types.ts:73](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/types.ts#L73)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -51,7 +51,7 @@ The diagram type, e.g. 'flowchart', 'sequence', etc.
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[mermaidAPI.ts:84](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L84)
|
[packages/mermaid/src/types.ts:63](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/types.ts#L63)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -63,4 +63,4 @@ The svg code for the rendered graph.
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[mermaidAPI.ts:80](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L80)
|
[packages/mermaid/src/types.ts:59](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/types.ts#L59)
|
||||||
71
docs/config/setup/interfaces/mermaid.RunOptions.md
Normal file
71
docs/config/setup/interfaces/mermaid.RunOptions.md
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
> **Warning**
|
||||||
|
>
|
||||||
|
> ## THIS IS AN AUTOGENERATED FILE. DO NOT EDIT.
|
||||||
|
>
|
||||||
|
> ## Please edit the corresponding file in [/packages/mermaid/src/docs/config/setup/interfaces/mermaid.RunOptions.md](../../../../packages/mermaid/src/docs/config/setup/interfaces/mermaid.RunOptions.md).
|
||||||
|
|
||||||
|
# Interface: RunOptions
|
||||||
|
|
||||||
|
[mermaid](../modules/mermaid.md).RunOptions
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
### nodes
|
||||||
|
|
||||||
|
• `Optional` **nodes**: `ArrayLike`<`HTMLElement`>
|
||||||
|
|
||||||
|
The nodes to render. If this is set, `querySelector` will be ignored.
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/mermaid.ts:39](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L39)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### postRenderCallback
|
||||||
|
|
||||||
|
• `Optional` **postRenderCallback**: (`id`: `string`) => `unknown`
|
||||||
|
|
||||||
|
A callback to call after each diagram is rendered.
|
||||||
|
|
||||||
|
#### Type declaration
|
||||||
|
|
||||||
|
▸ (`id`): `unknown`
|
||||||
|
|
||||||
|
##### Parameters
|
||||||
|
|
||||||
|
| Name | Type |
|
||||||
|
| :--- | :------- |
|
||||||
|
| `id` | `string` |
|
||||||
|
|
||||||
|
##### Returns
|
||||||
|
|
||||||
|
`unknown`
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/mermaid.ts:43](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L43)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### querySelector
|
||||||
|
|
||||||
|
• `Optional` **querySelector**: `string`
|
||||||
|
|
||||||
|
The query selector to use when finding elements to render. Default: `".mermaid"`.
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/mermaid.ts:35](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L35)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### suppressErrors
|
||||||
|
|
||||||
|
• `Optional` **suppressErrors**: `boolean`
|
||||||
|
|
||||||
|
If `true`, errors will be logged to the console, but not thrown. Default: `false`
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/mermaid.ts:47](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L47)
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
> **Warning**
|
|
||||||
>
|
|
||||||
> ## THIS IS AN AUTOGENERATED FILE. DO NOT EDIT.
|
|
||||||
>
|
|
||||||
> ## Please edit the corresponding file in [/packages/mermaid/src/docs/config/setup/interfaces/mermaidAPI.ParseResult.md](../../../../packages/mermaid/src/docs/config/setup/interfaces/mermaidAPI.ParseResult.md).
|
|
||||||
|
|
||||||
# Interface: ParseResult
|
|
||||||
|
|
||||||
[mermaidAPI](../modules/mermaidAPI.md).ParseResult
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
### diagramType
|
|
||||||
|
|
||||||
• **diagramType**: `string`
|
|
||||||
|
|
||||||
The diagram type, e.g. 'flowchart', 'sequence', etc.
|
|
||||||
|
|
||||||
#### Defined in
|
|
||||||
|
|
||||||
[mermaidAPI.ts:71](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L71)
|
|
||||||
@@ -10,11 +10,11 @@
|
|||||||
|
|
||||||
### defaultConfig
|
### defaultConfig
|
||||||
|
|
||||||
• `Const` **defaultConfig**: `MermaidConfig`
|
• `Const` **defaultConfig**: [`MermaidConfig`](../interfaces/mermaid.MermaidConfig.md)
|
||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[config.ts:8](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L8)
|
[packages/mermaid/src/config.ts:8](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L8)
|
||||||
|
|
||||||
## Functions
|
## Functions
|
||||||
|
|
||||||
@@ -27,8 +27,8 @@ Pushes in a directive to the configuration
|
|||||||
#### Parameters
|
#### Parameters
|
||||||
|
|
||||||
| Name | Type | Description |
|
| Name | Type | Description |
|
||||||
| :---------- | :-------------- | :----------------------- |
|
| :---------- | :-------------------------------------------------------- | :----------------------- |
|
||||||
| `directive` | `MermaidConfig` | The directive to push in |
|
| `directive` | [`MermaidConfig`](../interfaces/mermaid.MermaidConfig.md) | The directive to push in |
|
||||||
|
|
||||||
#### Returns
|
#### Returns
|
||||||
|
|
||||||
@@ -36,13 +36,13 @@ Pushes in a directive to the configuration
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[config.ts:188](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L188)
|
[packages/mermaid/src/config.ts:188](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L188)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### getConfig
|
### getConfig
|
||||||
|
|
||||||
▸ **getConfig**(): `MermaidConfig`
|
▸ **getConfig**(): [`MermaidConfig`](../interfaces/mermaid.MermaidConfig.md)
|
||||||
|
|
||||||
## getConfig
|
## getConfig
|
||||||
|
|
||||||
@@ -54,19 +54,19 @@ Pushes in a directive to the configuration
|
|||||||
|
|
||||||
#### Returns
|
#### Returns
|
||||||
|
|
||||||
`MermaidConfig`
|
[`MermaidConfig`](../interfaces/mermaid.MermaidConfig.md)
|
||||||
|
|
||||||
The currentConfig
|
The currentConfig
|
||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[config.ts:131](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L131)
|
[packages/mermaid/src/config.ts:131](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L131)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### getSiteConfig
|
### getSiteConfig
|
||||||
|
|
||||||
▸ **getSiteConfig**(): `MermaidConfig`
|
▸ **getSiteConfig**(): [`MermaidConfig`](../interfaces/mermaid.MermaidConfig.md)
|
||||||
|
|
||||||
## getSiteConfig
|
## getSiteConfig
|
||||||
|
|
||||||
@@ -78,13 +78,13 @@ The currentConfig
|
|||||||
|
|
||||||
#### Returns
|
#### Returns
|
||||||
|
|
||||||
`MermaidConfig`
|
[`MermaidConfig`](../interfaces/mermaid.MermaidConfig.md)
|
||||||
|
|
||||||
The siteConfig
|
The siteConfig
|
||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[config.ts:96](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L96)
|
[packages/mermaid/src/config.ts:96](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L96)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -109,8 +109,8 @@ The siteConfig
|
|||||||
#### Parameters
|
#### Parameters
|
||||||
|
|
||||||
| Name | Type | Default value | Description |
|
| Name | Type | Default value | Description |
|
||||||
| :------- | :-------------- | :------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
| :------- | :-------------------------------------------------------- | :------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||||
| `config` | `MermaidConfig` | `siteConfig` | base set of values, which currentConfig could be **reset** to. Defaults to the current siteConfig (e.g returned by [getSiteConfig](config.md#getsiteconfig)). |
|
| `config` | [`MermaidConfig`](../interfaces/mermaid.MermaidConfig.md) | `siteConfig` | base set of values, which currentConfig could be **reset** to. Defaults to the current siteConfig (e.g returned by [getSiteConfig](config.md#getsiteconfig)). |
|
||||||
|
|
||||||
#### Returns
|
#### Returns
|
||||||
|
|
||||||
@@ -118,7 +118,7 @@ The siteConfig
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[config.ts:218](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L218)
|
[packages/mermaid/src/config.ts:218](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L218)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -147,7 +147,7 @@ options in-place
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[config.ts:146](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L146)
|
[packages/mermaid/src/config.ts:146](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L146)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -158,8 +158,8 @@ options in-place
|
|||||||
#### Parameters
|
#### Parameters
|
||||||
|
|
||||||
| Name | Type |
|
| Name | Type |
|
||||||
| :----- | :-------------- |
|
| :----- | :-------------------------------------------------------- |
|
||||||
| `conf` | `MermaidConfig` |
|
| `conf` | [`MermaidConfig`](../interfaces/mermaid.MermaidConfig.md) |
|
||||||
|
|
||||||
#### Returns
|
#### Returns
|
||||||
|
|
||||||
@@ -167,13 +167,13 @@ options in-place
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[config.ts:75](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L75)
|
[packages/mermaid/src/config.ts:75](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L75)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### setConfig
|
### setConfig
|
||||||
|
|
||||||
▸ **setConfig**(`conf`): `MermaidConfig`
|
▸ **setConfig**(`conf`): [`MermaidConfig`](../interfaces/mermaid.MermaidConfig.md)
|
||||||
|
|
||||||
## setConfig
|
## setConfig
|
||||||
|
|
||||||
@@ -188,24 +188,24 @@ corresponding siteConfig value.
|
|||||||
#### Parameters
|
#### Parameters
|
||||||
|
|
||||||
| Name | Type | Description |
|
| Name | Type | Description |
|
||||||
| :----- | :-------------- | :-------------------------- |
|
| :----- | :-------------------------------------------------------- | :-------------------------- |
|
||||||
| `conf` | `MermaidConfig` | The potential currentConfig |
|
| `conf` | [`MermaidConfig`](../interfaces/mermaid.MermaidConfig.md) | The potential currentConfig |
|
||||||
|
|
||||||
#### Returns
|
#### Returns
|
||||||
|
|
||||||
`MermaidConfig`
|
[`MermaidConfig`](../interfaces/mermaid.MermaidConfig.md)
|
||||||
|
|
||||||
The currentConfig merged with the sanitized conf
|
The currentConfig merged with the sanitized conf
|
||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[config.ts:113](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L113)
|
[packages/mermaid/src/config.ts:113](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L113)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### setSiteConfig
|
### setSiteConfig
|
||||||
|
|
||||||
▸ **setSiteConfig**(`conf`): `MermaidConfig`
|
▸ **setSiteConfig**(`conf`): [`MermaidConfig`](../interfaces/mermaid.MermaidConfig.md)
|
||||||
|
|
||||||
## setSiteConfig
|
## setSiteConfig
|
||||||
|
|
||||||
@@ -221,56 +221,56 @@ function _Default value: At default, will mirror Global Config_
|
|||||||
#### Parameters
|
#### Parameters
|
||||||
|
|
||||||
| Name | Type | Description |
|
| Name | Type | Description |
|
||||||
| :----- | :-------------- | :------------------------------------------ |
|
| :----- | :-------------------------------------------------------- | :------------------------------------------ |
|
||||||
| `conf` | `MermaidConfig` | The base currentConfig to use as siteConfig |
|
| `conf` | [`MermaidConfig`](../interfaces/mermaid.MermaidConfig.md) | The base currentConfig to use as siteConfig |
|
||||||
|
|
||||||
#### Returns
|
#### Returns
|
||||||
|
|
||||||
`MermaidConfig`
|
[`MermaidConfig`](../interfaces/mermaid.MermaidConfig.md)
|
||||||
|
|
||||||
The new siteConfig
|
The new siteConfig
|
||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[config.ts:61](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L61)
|
[packages/mermaid/src/config.ts:61](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L61)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### updateCurrentConfig
|
### updateCurrentConfig
|
||||||
|
|
||||||
▸ **updateCurrentConfig**(`siteCfg`, `_directives`): `MermaidConfig`
|
▸ **updateCurrentConfig**(`siteCfg`, `_directives`): [`MermaidConfig`](../interfaces/mermaid.MermaidConfig.md)
|
||||||
|
|
||||||
#### Parameters
|
#### Parameters
|
||||||
|
|
||||||
| Name | Type |
|
| Name | Type |
|
||||||
| :------------ | :----------------- |
|
| :------------ | :----------------------------------------------------------- |
|
||||||
| `siteCfg` | `MermaidConfig` |
|
| `siteCfg` | [`MermaidConfig`](../interfaces/mermaid.MermaidConfig.md) |
|
||||||
| `_directives` | `MermaidConfig`\[] |
|
| `_directives` | [`MermaidConfig`](../interfaces/mermaid.MermaidConfig.md)\[] |
|
||||||
|
|
||||||
#### Returns
|
#### Returns
|
||||||
|
|
||||||
`MermaidConfig`
|
[`MermaidConfig`](../interfaces/mermaid.MermaidConfig.md)
|
||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[config.ts:15](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L15)
|
[packages/mermaid/src/config.ts:15](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L15)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### updateSiteConfig
|
### updateSiteConfig
|
||||||
|
|
||||||
▸ **updateSiteConfig**(`conf`): `MermaidConfig`
|
▸ **updateSiteConfig**(`conf`): [`MermaidConfig`](../interfaces/mermaid.MermaidConfig.md)
|
||||||
|
|
||||||
#### Parameters
|
#### Parameters
|
||||||
|
|
||||||
| Name | Type |
|
| Name | Type |
|
||||||
| :----- | :-------------- |
|
| :----- | :-------------------------------------------------------- |
|
||||||
| `conf` | `MermaidConfig` |
|
| `conf` | [`MermaidConfig`](../interfaces/mermaid.MermaidConfig.md) |
|
||||||
|
|
||||||
#### Returns
|
#### Returns
|
||||||
|
|
||||||
`MermaidConfig`
|
[`MermaidConfig`](../interfaces/mermaid.MermaidConfig.md)
|
||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[config.ts:79](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L79)
|
[packages/mermaid/src/config.ts:79](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L79)
|
||||||
|
|||||||
@@ -14,13 +14,13 @@
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[defaultConfig.ts:275](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/defaultConfig.ts#L275)
|
[packages/mermaid/src/defaultConfig.ts:275](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/defaultConfig.ts#L275)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### default
|
### default
|
||||||
|
|
||||||
• `Const` **default**: `RequiredDeep`<`MermaidConfig`>
|
• `Const` **default**: `RequiredDeep`<[`MermaidConfig`](../interfaces/mermaid.MermaidConfig.md)>
|
||||||
|
|
||||||
Default mermaid configuration options.
|
Default mermaid configuration options.
|
||||||
|
|
||||||
@@ -30,4 +30,4 @@ Non-JSON JS default values are listed in this file, e.g. functions, or
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[defaultConfig.ts:18](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/defaultConfig.ts#L18)
|
[packages/mermaid/src/defaultConfig.ts:18](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/defaultConfig.ts#L18)
|
||||||
|
|||||||
57
docs/config/setup/modules/mermaid.md
Normal file
57
docs/config/setup/modules/mermaid.md
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
> **Warning**
|
||||||
|
>
|
||||||
|
> ## THIS IS AN AUTOGENERATED FILE. DO NOT EDIT.
|
||||||
|
>
|
||||||
|
> ## Please edit the corresponding file in [/packages/mermaid/src/docs/config/setup/modules/mermaid.md](../../../../packages/mermaid/src/docs/config/setup/modules/mermaid.md).
|
||||||
|
|
||||||
|
# Module: mermaid
|
||||||
|
|
||||||
|
## Classes
|
||||||
|
|
||||||
|
- [UnknownDiagramError](../classes/mermaid.UnknownDiagramError.md)
|
||||||
|
|
||||||
|
## Interfaces
|
||||||
|
|
||||||
|
- [DetailedError](../interfaces/mermaid.DetailedError.md)
|
||||||
|
- [ExternalDiagramDefinition](../interfaces/mermaid.ExternalDiagramDefinition.md)
|
||||||
|
- [Mermaid](../interfaces/mermaid.Mermaid.md)
|
||||||
|
- [MermaidConfig](../interfaces/mermaid.MermaidConfig.md)
|
||||||
|
- [ParseOptions](../interfaces/mermaid.ParseOptions.md)
|
||||||
|
- [ParseResult](../interfaces/mermaid.ParseResult.md)
|
||||||
|
- [RenderResult](../interfaces/mermaid.RenderResult.md)
|
||||||
|
- [RunOptions](../interfaces/mermaid.RunOptions.md)
|
||||||
|
|
||||||
|
## Type Aliases
|
||||||
|
|
||||||
|
### ParseErrorFunction
|
||||||
|
|
||||||
|
Ƭ **ParseErrorFunction**: (`err`: `string` | [`DetailedError`](../interfaces/mermaid.DetailedError.md) | `unknown`, `hash?`: `any`) => `void`
|
||||||
|
|
||||||
|
#### Type declaration
|
||||||
|
|
||||||
|
▸ (`err`, `hash?`): `void`
|
||||||
|
|
||||||
|
##### Parameters
|
||||||
|
|
||||||
|
| Name | Type |
|
||||||
|
| :------ | :--------------------------------------------------------------------------------- |
|
||||||
|
| `err` | `string` \| [`DetailedError`](../interfaces/mermaid.DetailedError.md) \| `unknown` |
|
||||||
|
| `hash?` | `any` |
|
||||||
|
|
||||||
|
##### Returns
|
||||||
|
|
||||||
|
`void`
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/Diagram.ts:10](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/Diagram.ts#L10)
|
||||||
|
|
||||||
|
## Variables
|
||||||
|
|
||||||
|
### default
|
||||||
|
|
||||||
|
• `Const` **default**: [`Mermaid`](../interfaces/mermaid.Mermaid.md)
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[packages/mermaid/src/mermaid.ts:430](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L430)
|
||||||
@@ -1,284 +0,0 @@
|
|||||||
> **Warning**
|
|
||||||
>
|
|
||||||
> ## THIS IS AN AUTOGENERATED FILE. DO NOT EDIT.
|
|
||||||
>
|
|
||||||
> ## Please edit the corresponding file in [/packages/mermaid/src/docs/config/setup/modules/mermaidAPI.md](../../../../packages/mermaid/src/docs/config/setup/modules/mermaidAPI.md).
|
|
||||||
|
|
||||||
# Module: mermaidAPI
|
|
||||||
|
|
||||||
## Interfaces
|
|
||||||
|
|
||||||
- [ParseOptions](../interfaces/mermaidAPI.ParseOptions.md)
|
|
||||||
- [ParseResult](../interfaces/mermaidAPI.ParseResult.md)
|
|
||||||
- [RenderResult](../interfaces/mermaidAPI.RenderResult.md)
|
|
||||||
|
|
||||||
## References
|
|
||||||
|
|
||||||
### default
|
|
||||||
|
|
||||||
Renames and re-exports [mermaidAPI](mermaidAPI.md#mermaidapi)
|
|
||||||
|
|
||||||
## Type Aliases
|
|
||||||
|
|
||||||
### D3Element
|
|
||||||
|
|
||||||
Ƭ **D3Element**: `any`
|
|
||||||
|
|
||||||
#### Defined in
|
|
||||||
|
|
||||||
[mermaidAPI.ts:74](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L74)
|
|
||||||
|
|
||||||
## Variables
|
|
||||||
|
|
||||||
### mermaidAPI
|
|
||||||
|
|
||||||
• `Const` **mermaidAPI**: `Readonly`<{ `defaultConfig`: `MermaidConfig` = configApi.defaultConfig; `getConfig`: () => `MermaidConfig` = configApi.getConfig; `getDiagramFromText`: (`text`: `string`, `metadata`: `Pick`<`DiagramMetadata`, `"title"`>) => `Promise`<`Diagram`> ; `getSiteConfig`: () => `MermaidConfig` = configApi.getSiteConfig; `globalReset`: () => `void` ; `initialize`: (`options`: `MermaidConfig`) => `void` ; `parse`: (`text`: `string`, `parseOptions`: [`ParseOptions`](../interfaces/mermaidAPI.ParseOptions.md) & { `suppressErrors`: `true` }) => `Promise`<[`ParseResult`](../interfaces/mermaidAPI.ParseResult.md) | `false`>(`text`: `string`, `parseOptions?`: [`ParseOptions`](../interfaces/mermaidAPI.ParseOptions.md)) => `Promise`<[`ParseResult`](../interfaces/mermaidAPI.ParseResult.md)> ; `render`: (`id`: `string`, `text`: `string`, `svgContainingElement?`: `Element`) => `Promise`<[`RenderResult`](../interfaces/mermaidAPI.RenderResult.md)> ; `reset`: () => `void` ; `setConfig`: (`conf`: `MermaidConfig`) => `MermaidConfig` = configApi.setConfig; `updateSiteConfig`: (`conf`: `MermaidConfig`) => `MermaidConfig` = configApi.updateSiteConfig }>
|
|
||||||
|
|
||||||
## mermaidAPI configuration defaults
|
|
||||||
|
|
||||||
```ts
|
|
||||||
const config = {
|
|
||||||
theme: 'default',
|
|
||||||
logLevel: 'fatal',
|
|
||||||
securityLevel: 'strict',
|
|
||||||
startOnLoad: true,
|
|
||||||
arrowMarkerAbsolute: false,
|
|
||||||
suppressErrorRendering: false,
|
|
||||||
|
|
||||||
er: {
|
|
||||||
diagramPadding: 20,
|
|
||||||
layoutDirection: 'TB',
|
|
||||||
minEntityWidth: 100,
|
|
||||||
minEntityHeight: 75,
|
|
||||||
entityPadding: 15,
|
|
||||||
stroke: 'gray',
|
|
||||||
fill: 'honeydew',
|
|
||||||
fontSize: 12,
|
|
||||||
useMaxWidth: true,
|
|
||||||
},
|
|
||||||
flowchart: {
|
|
||||||
diagramPadding: 8,
|
|
||||||
htmlLabels: true,
|
|
||||||
curve: 'basis',
|
|
||||||
},
|
|
||||||
sequence: {
|
|
||||||
diagramMarginX: 50,
|
|
||||||
diagramMarginY: 10,
|
|
||||||
actorMargin: 50,
|
|
||||||
width: 150,
|
|
||||||
height: 65,
|
|
||||||
boxMargin: 10,
|
|
||||||
boxTextMargin: 5,
|
|
||||||
noteMargin: 10,
|
|
||||||
messageMargin: 35,
|
|
||||||
messageAlign: 'center',
|
|
||||||
mirrorActors: true,
|
|
||||||
bottomMarginAdj: 1,
|
|
||||||
useMaxWidth: true,
|
|
||||||
rightAngles: false,
|
|
||||||
showSequenceNumbers: false,
|
|
||||||
},
|
|
||||||
gantt: {
|
|
||||||
titleTopMargin: 25,
|
|
||||||
barHeight: 20,
|
|
||||||
barGap: 4,
|
|
||||||
topPadding: 50,
|
|
||||||
leftPadding: 75,
|
|
||||||
gridLineStartPadding: 35,
|
|
||||||
fontSize: 11,
|
|
||||||
fontFamily: '"Open Sans", sans-serif',
|
|
||||||
numberSectionStyles: 4,
|
|
||||||
axisFormat: '%Y-%m-%d',
|
|
||||||
topAxis: false,
|
|
||||||
displayMode: '',
|
|
||||||
},
|
|
||||||
};
|
|
||||||
mermaid.initialize(config);
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Defined in
|
|
||||||
|
|
||||||
[mermaidAPI.ts:634](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L634)
|
|
||||||
|
|
||||||
## Functions
|
|
||||||
|
|
||||||
### appendDivSvgG
|
|
||||||
|
|
||||||
▸ **appendDivSvgG**(`parentRoot`, `id`, `enclosingDivId`, `divStyle?`, `svgXlink?`): `any`
|
|
||||||
|
|
||||||
Append an enclosing div, then svg, then g (group) to the d3 parentRoot. Set attributes.
|
|
||||||
Only set the style attribute on the enclosing div if divStyle is given.
|
|
||||||
Only set the xmlns:xlink attribute on svg if svgXlink is given.
|
|
||||||
Return the last node appended
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
| Name | Type | Description |
|
|
||||||
| :--------------- | :------- | :----------------------------------------------- |
|
|
||||||
| `parentRoot` | `any` | the d3 node to append things to |
|
|
||||||
| `id` | `string` | the value to set the id attr to |
|
|
||||||
| `enclosingDivId` | `string` | the id to set the enclosing div to |
|
|
||||||
| `divStyle?` | `string` | if given, the style to set the enclosing div to |
|
|
||||||
| `svgXlink?` | `string` | if given, the link to set the new svg element to |
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`any`
|
|
||||||
|
|
||||||
- returns the parentRoot that had nodes appended
|
|
||||||
|
|
||||||
#### Defined in
|
|
||||||
|
|
||||||
[mermaidAPI.ts:276](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L276)
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### cleanUpSvgCode
|
|
||||||
|
|
||||||
▸ **cleanUpSvgCode**(`svgCode?`, `inSandboxMode`, `useArrowMarkerUrls`): `string`
|
|
||||||
|
|
||||||
Clean up svgCode. Do replacements needed
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
| Name | Type | Default value | Description |
|
|
||||||
| :------------------- | :-------- | :------------ | :---------------------------------------------------------- |
|
|
||||||
| `svgCode` | `string` | `''` | the code to clean up |
|
|
||||||
| `inSandboxMode` | `boolean` | `undefined` | security level |
|
|
||||||
| `useArrowMarkerUrls` | `boolean` | `undefined` | should arrow marker's use full urls? (vs. just the anchors) |
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`string`
|
|
||||||
|
|
||||||
the cleaned up svgCode
|
|
||||||
|
|
||||||
#### Defined in
|
|
||||||
|
|
||||||
[mermaidAPI.ts:222](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L222)
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### createCssStyles
|
|
||||||
|
|
||||||
▸ **createCssStyles**(`config`, `classDefs?`): `string`
|
|
||||||
|
|
||||||
Create the user styles
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
| Name | Type | Description |
|
|
||||||
| :---------- | :--------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------ |
|
|
||||||
| `config` | `MermaidConfig` | configuration that has style and theme settings to use |
|
|
||||||
| `classDefs` | `undefined` \| `null` \| `Map`<`string`, `DiagramStyleClassDef`> | the classDefs in the diagram text. Might be null if none were defined. Usually is the result of a call to getClasses(...) |
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`string`
|
|
||||||
|
|
||||||
the string with all the user styles
|
|
||||||
|
|
||||||
#### Defined in
|
|
||||||
|
|
||||||
[mermaidAPI.ts:153](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L153)
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### createUserStyles
|
|
||||||
|
|
||||||
▸ **createUserStyles**(`config`, `graphType`, `classDefs`, `svgId`): `string`
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
| Name | Type |
|
|
||||||
| :---------- | :----------------------------------------------------- |
|
|
||||||
| `config` | `MermaidConfig` |
|
|
||||||
| `graphType` | `string` |
|
|
||||||
| `classDefs` | `undefined` \| `Map`<`string`, `DiagramStyleClassDef`> |
|
|
||||||
| `svgId` | `string` |
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`string`
|
|
||||||
|
|
||||||
#### Defined in
|
|
||||||
|
|
||||||
[mermaidAPI.ts:199](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L199)
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### cssImportantStyles
|
|
||||||
|
|
||||||
▸ **cssImportantStyles**(`cssClass`, `element`, `cssClasses?`): `string`
|
|
||||||
|
|
||||||
Create a CSS style that starts with the given class name, then the element,
|
|
||||||
with an enclosing block that has each of the cssClasses followed by !important;
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
| Name | Type | Default value | Description |
|
|
||||||
| :----------- | :---------- | :------------ | :--------------------------------------------- |
|
|
||||||
| `cssClass` | `string` | `undefined` | CSS class name |
|
|
||||||
| `element` | `string` | `undefined` | CSS element |
|
|
||||||
| `cssClasses` | `string`\[] | `[]` | list of CSS styles to append after the element |
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`string`
|
|
||||||
|
|
||||||
- the constructed string
|
|
||||||
|
|
||||||
#### Defined in
|
|
||||||
|
|
||||||
[mermaidAPI.ts:138](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L138)
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### putIntoIFrame
|
|
||||||
|
|
||||||
▸ **putIntoIFrame**(`svgCode?`, `svgElement?`): `string`
|
|
||||||
|
|
||||||
Put the svgCode into an iFrame. Return the iFrame code
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
| Name | Type | Default value | Description |
|
|
||||||
| :------------ | :------- | :------------ | :--------------------------------------------------------------------------- |
|
|
||||||
| `svgCode` | `string` | `''` | the svg code to put inside the iFrame |
|
|
||||||
| `svgElement?` | `any` | `undefined` | the d3 node that has the current svgElement so we can get the height from it |
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`string`
|
|
||||||
|
|
||||||
- the code with the iFrame that now contains the svgCode
|
|
||||||
TODO replace btoa(). Replace with buf.toString('base64')?
|
|
||||||
|
|
||||||
#### Defined in
|
|
||||||
|
|
||||||
[mermaidAPI.ts:253](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L253)
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### removeExistingElements
|
|
||||||
|
|
||||||
▸ **removeExistingElements**(`doc`, `id`, `divId`, `iFrameId`): `void`
|
|
||||||
|
|
||||||
Remove any existing elements from the given document
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
| Name | Type | Description |
|
|
||||||
| :--------- | :--------- | :------------------------------------ |
|
|
||||||
| `doc` | `Document` | the document to removed elements from |
|
|
||||||
| `id` | `string` | id for any existing SVG element |
|
|
||||||
| `divId` | `string` | - |
|
|
||||||
| `iFrameId` | `string` | - |
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`void`
|
|
||||||
|
|
||||||
#### Defined in
|
|
||||||
|
|
||||||
[mermaidAPI.ts:326](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L326)
|
|
||||||
@@ -24,12 +24,12 @@ Themes can now be customized at the site-wide level, or on individual Mermaid di
|
|||||||
|
|
||||||
## Site-wide Theme
|
## Site-wide Theme
|
||||||
|
|
||||||
To customize themes site-wide, call the `initialize` method on the `mermaidAPI`.
|
To customize themes site-wide, call the `initialize` method on the `mermaid`.
|
||||||
|
|
||||||
Example of `initialize` call setting `theme` to `base`:
|
Example of `initialize` call setting `theme` to `base`:
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
mermaidAPI.initialize({
|
mermaid.initialize({
|
||||||
securityLevel: 'loose',
|
securityLevel: 'loose',
|
||||||
theme: 'base',
|
theme: 'base',
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -193,7 +193,7 @@ await mermaid.run({
|
|||||||
### Calling `mermaid.init` - Deprecated
|
### Calling `mermaid.init` - Deprecated
|
||||||
|
|
||||||
> **Warning**
|
> **Warning**
|
||||||
> mermaid.init is deprecated in v10 and will be removed in v11. Please use mermaid.run instead.
|
> mermaid.init is deprecated in v10 and will be removed in a future release. Please use mermaid.run instead.
|
||||||
|
|
||||||
By default, `mermaid.init` will be called when the document is ready, finding all elements with
|
By default, `mermaid.init` will be called when the document is ready, finding all elements with
|
||||||
`class="mermaid"`. If you are adding content after mermaid is loaded, or otherwise need
|
`class="mermaid"`. If you are adding content after mermaid is loaded, or otherwise need
|
||||||
@@ -217,9 +217,6 @@ Or with no config object, and a jQuery selection:
|
|||||||
mermaid.init(undefined, $('#someId .yetAnotherClass'));
|
mermaid.init(undefined, $('#someId .yetAnotherClass'));
|
||||||
```
|
```
|
||||||
|
|
||||||
> **Warning**
|
|
||||||
> This type of integration is deprecated. Instead the preferred way of handling more complex integration is to use the mermaidAPI instead.
|
|
||||||
|
|
||||||
## Usage with webpack
|
## Usage with webpack
|
||||||
|
|
||||||
mermaid fully supports webpack. Here is a [working demo](https://github.com/mermaidjs/mermaid-webpack-demo).
|
mermaid fully supports webpack. Here is a [working demo](https://github.com/mermaidjs/mermaid-webpack-demo).
|
||||||
|
|||||||
@@ -42,6 +42,8 @@ To add an integration to this list, see the [Integrations - create page](./integ
|
|||||||
- [CloudScript.io Mermaid Addon](https://marketplace.atlassian.com/apps/1219878/cloudscript-io-mermaid-addon?hosting=cloud&tab=overview)
|
- [CloudScript.io Mermaid Addon](https://marketplace.atlassian.com/apps/1219878/cloudscript-io-mermaid-addon?hosting=cloud&tab=overview)
|
||||||
- [Azure Devops](https://learn.microsoft.com/en-us/azure/devops/project/wiki/markdown-guidance?view=azure-devops#add-mermaid-diagrams-to-a-wiki-page) ✅
|
- [Azure Devops](https://learn.microsoft.com/en-us/azure/devops/project/wiki/markdown-guidance?view=azure-devops#add-mermaid-diagrams-to-a-wiki-page) ✅
|
||||||
- [Deepdwn](https://billiam.itch.io/deepdwn) ✅
|
- [Deepdwn](https://billiam.itch.io/deepdwn) ✅
|
||||||
|
- [Doctave](https://www.doctave.com/) ✅
|
||||||
|
- [Mermaid in Markdown code blocks](https://docs.doctave.com/components/mermaid) ✅
|
||||||
- [GitBook](https://gitbook.com)
|
- [GitBook](https://gitbook.com)
|
||||||
- [Mermaid Plugin](https://github.com/JozoVilcek/gitbook-plugin-mermaid)
|
- [Mermaid Plugin](https://github.com/JozoVilcek/gitbook-plugin-mermaid)
|
||||||
- [Mermaid plugin for GitBook](https://github.com/wwformat/gitbook-plugin-mermaid-pdf)
|
- [Mermaid plugin for GitBook](https://github.com/wwformat/gitbook-plugin-mermaid-pdf)
|
||||||
|
|||||||
@@ -206,14 +206,16 @@ Messages can be of two displayed either solid or with a dotted line.
|
|||||||
[Actor][Arrow][Actor]:Message text
|
[Actor][Arrow][Actor]:Message text
|
||||||
```
|
```
|
||||||
|
|
||||||
There are six types of arrows currently supported:
|
There are ten types of arrows currently supported:
|
||||||
|
|
||||||
| Type | Description |
|
| Type | Description |
|
||||||
| ------ | ------------------------------------------------ |
|
| -------- | ------------------------------------------------------------------------ |
|
||||||
| `->` | Solid line without arrow |
|
| `->` | Solid line without arrow |
|
||||||
| `-->` | Dotted line without arrow |
|
| `-->` | Dotted line without arrow |
|
||||||
| `->>` | Solid line with arrowhead |
|
| `->>` | Solid line with arrowhead |
|
||||||
| `-->>` | Dotted line with arrowhead |
|
| `-->>` | Dotted line with arrowhead |
|
||||||
|
| `<<->>` | Solid line with bidirectional arrowheads (v\<MERMAID_RELEASE_VERSION>+) |
|
||||||
|
| `<<-->>` | Dotted line with bidirectional arrowheads (v\<MERMAID_RELEASE_VERSION>+) |
|
||||||
| `-x` | Solid line with a cross at the end |
|
| `-x` | Solid line with a cross at the end |
|
||||||
| `--x` | Dotted line with a cross at the end. |
|
| `--x` | Dotted line with a cross at the end. |
|
||||||
| `-)` | Solid line with an open arrow at the end (async) |
|
| `-)` | Solid line with an open arrow at the end (async) |
|
||||||
@@ -304,17 +306,35 @@ sequenceDiagram
|
|||||||
Note over Alice,John: A typical interaction
|
Note over Alice,John: A typical interaction
|
||||||
```
|
```
|
||||||
|
|
||||||
It is also possible to add a line break (applies to text input in general):
|
## Line breaks
|
||||||
|
|
||||||
|
Line break can be added to Note and Message:
|
||||||
|
|
||||||
```mermaid-example
|
```mermaid-example
|
||||||
sequenceDiagram
|
sequenceDiagram
|
||||||
Alice->John: Hello John, how are you?
|
Alice->John: Hello John,<br/>how are you?
|
||||||
Note over Alice,John: A typical interaction<br/>But now in two lines
|
Note over Alice,John: A typical interaction<br/>But now in two lines
|
||||||
```
|
```
|
||||||
|
|
||||||
```mermaid
|
```mermaid
|
||||||
sequenceDiagram
|
sequenceDiagram
|
||||||
Alice->John: Hello John, how are you?
|
Alice->John: Hello John,<br/>how are you?
|
||||||
|
Note over Alice,John: A typical interaction<br/>But now in two lines
|
||||||
|
```
|
||||||
|
|
||||||
|
Line breaks in Actor names requires aliases:
|
||||||
|
|
||||||
|
```mermaid-example
|
||||||
|
sequenceDiagram
|
||||||
|
participant Alice as Alice<br/>Johnson
|
||||||
|
Alice->John: Hello John,<br/>how are you?
|
||||||
|
Note over Alice,John: A typical interaction<br/>But now in two lines
|
||||||
|
```
|
||||||
|
|
||||||
|
```mermaid
|
||||||
|
sequenceDiagram
|
||||||
|
participant Alice as Alice<br/>Johnson
|
||||||
|
Alice->John: Hello John,<br/>how are you?
|
||||||
Note over Alice,John: A typical interaction<br/>But now in two lines
|
Note over Alice,John: A typical interaction<br/>But now in two lines
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
221
eslint.config.js
Normal file
221
eslint.config.js
Normal file
@@ -0,0 +1,221 @@
|
|||||||
|
import cspell from '@cspell/eslint-plugin';
|
||||||
|
import eslint from '@eslint/js';
|
||||||
|
import cypress from 'eslint-plugin-cypress';
|
||||||
|
import jsdoc from 'eslint-plugin-jsdoc';
|
||||||
|
import json from 'eslint-plugin-json';
|
||||||
|
import lodash from 'eslint-plugin-lodash';
|
||||||
|
import markdown from 'eslint-plugin-markdown';
|
||||||
|
import noOnlyTests from 'eslint-plugin-no-only-tests';
|
||||||
|
import tsdoc from 'eslint-plugin-tsdoc';
|
||||||
|
import unicorn from 'eslint-plugin-unicorn';
|
||||||
|
import globals from 'globals';
|
||||||
|
import tseslint from 'typescript-eslint';
|
||||||
|
|
||||||
|
export default tseslint.config(
|
||||||
|
eslint.configs.recommended,
|
||||||
|
...tseslint.configs.recommendedTypeChecked,
|
||||||
|
...tseslint.configs.stylisticTypeChecked,
|
||||||
|
{
|
||||||
|
ignores: [
|
||||||
|
'**/dist/',
|
||||||
|
'**/node_modules/',
|
||||||
|
'.git/',
|
||||||
|
'**/generated/',
|
||||||
|
'**/coverage/',
|
||||||
|
'packages/mermaid/src/config.type.ts',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
languageOptions: {
|
||||||
|
parserOptions: {
|
||||||
|
project: [
|
||||||
|
'./tsconfig.eslint.json',
|
||||||
|
'./packages/*/tsconfig.json',
|
||||||
|
'./packages/*/tsconfig.eslint.json',
|
||||||
|
'./packages/mermaid/src/docs/tsconfig.json',
|
||||||
|
],
|
||||||
|
tsconfigRootDir: import.meta.dirname,
|
||||||
|
},
|
||||||
|
globals: {
|
||||||
|
...globals.browser,
|
||||||
|
...globals.node,
|
||||||
|
...globals.es2020,
|
||||||
|
...globals.jest,
|
||||||
|
cy: 'readonly',
|
||||||
|
Cypress: 'readonly',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
plugins: {
|
||||||
|
json,
|
||||||
|
'@cspell': cspell,
|
||||||
|
'no-only-tests': noOnlyTests,
|
||||||
|
lodash,
|
||||||
|
unicorn,
|
||||||
|
cypress,
|
||||||
|
markdown,
|
||||||
|
tsdoc,
|
||||||
|
jsdoc,
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
curly: 'error',
|
||||||
|
'no-console': 'error',
|
||||||
|
'no-prototype-builtins': 'off',
|
||||||
|
'no-unused-vars': 'off',
|
||||||
|
'cypress/no-async-tests': 'off',
|
||||||
|
'@typescript-eslint/consistent-type-imports': 'error',
|
||||||
|
'@typescript-eslint/no-explicit-any': 'warn',
|
||||||
|
'@typescript-eslint/no-floating-promises': 'error',
|
||||||
|
'@typescript-eslint/no-misused-promises': 'error',
|
||||||
|
'@typescript-eslint/no-unused-vars': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
args: 'after-used',
|
||||||
|
argsIgnorePattern: '^_',
|
||||||
|
caughtErrors: 'all',
|
||||||
|
caughtErrorsIgnorePattern: '^_',
|
||||||
|
destructuredArrayIgnorePattern: '^_',
|
||||||
|
varsIgnorePattern: '^_',
|
||||||
|
ignoreRestSiblings: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
'@typescript-eslint/consistent-type-definitions': 'error',
|
||||||
|
'@typescript-eslint/ban-ts-comment': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
'ts-expect-error': 'allow-with-description',
|
||||||
|
'ts-ignore': 'allow-with-description',
|
||||||
|
'ts-nocheck': 'allow-with-description',
|
||||||
|
'ts-check': 'allow-with-description',
|
||||||
|
minimumDescriptionLength: 10,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
'@typescript-eslint/naming-convention': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
selector: 'typeLike',
|
||||||
|
format: ['PascalCase'],
|
||||||
|
custom: {
|
||||||
|
regex: '^I[A-Z]',
|
||||||
|
match: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
// START: These rules should be turned on once the codebase is cleaned up
|
||||||
|
'@typescript-eslint/no-unsafe-argument': 'off',
|
||||||
|
'@typescript-eslint/no-unsafe-assignment': 'off',
|
||||||
|
'@typescript-eslint/no-unsafe-call': 'off',
|
||||||
|
'@typescript-eslint/no-unsafe-member-access': 'off',
|
||||||
|
'@typescript-eslint/no-unsafe-return': 'off',
|
||||||
|
'@typescript-eslint/only-throw-error': 'warn',
|
||||||
|
'@typescript-eslint/prefer-promise-reject-errors': 'warn',
|
||||||
|
// END
|
||||||
|
'json/*': ['error', 'allowComments'],
|
||||||
|
'@cspell/spellchecker': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
checkIdentifiers: true,
|
||||||
|
checkStrings: true,
|
||||||
|
checkStringTemplates: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
'no-empty': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
allowEmptyCatch: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
'no-only-tests/no-only-tests': 'error',
|
||||||
|
'lodash/import-scope': ['error', 'method'],
|
||||||
|
'unicorn/better-regex': 'error',
|
||||||
|
'unicorn/no-abusive-eslint-disable': 'error',
|
||||||
|
'unicorn/no-array-push-push': 'error',
|
||||||
|
'unicorn/no-for-loop': 'error',
|
||||||
|
'unicorn/no-instanceof-array': 'error',
|
||||||
|
'unicorn/no-typeof-undefined': 'error',
|
||||||
|
'unicorn/no-unnecessary-await': 'error',
|
||||||
|
'unicorn/no-unsafe-regex': 'warn',
|
||||||
|
'unicorn/no-useless-promise-resolve-reject': 'error',
|
||||||
|
'unicorn/prefer-array-find': 'error',
|
||||||
|
'unicorn/prefer-array-flat-map': 'error',
|
||||||
|
'unicorn/prefer-array-index-of': 'error',
|
||||||
|
'unicorn/prefer-array-some': 'error',
|
||||||
|
'unicorn/prefer-default-parameters': 'error',
|
||||||
|
'unicorn/prefer-includes': 'error',
|
||||||
|
'unicorn/prefer-negative-index': 'error',
|
||||||
|
'unicorn/prefer-object-from-entries': 'error',
|
||||||
|
'unicorn/prefer-string-starts-ends-with': 'error',
|
||||||
|
'unicorn/prefer-string-trim-start-end': 'error',
|
||||||
|
'unicorn/string-content': 'error',
|
||||||
|
'unicorn/prefer-spread': 'error',
|
||||||
|
'unicorn/no-lonely-if': 'error',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
files: ['cypress/**', 'demos/**'],
|
||||||
|
rules: {
|
||||||
|
'no-console': 'off',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
files: ['**/*.{js,jsx,mjs,cjs}'],
|
||||||
|
rules: {
|
||||||
|
'jsdoc/check-indentation': 'off',
|
||||||
|
'jsdoc/check-alignment': 'off',
|
||||||
|
'jsdoc/check-line-alignment': 'off',
|
||||||
|
'jsdoc/multiline-blocks': 'off',
|
||||||
|
'jsdoc/newline-after-description': 'off',
|
||||||
|
'jsdoc/tag-lines': 'off',
|
||||||
|
'jsdoc/require-param-description': 'off',
|
||||||
|
'jsdoc/require-param-type': 'off',
|
||||||
|
'jsdoc/require-returns': 'off',
|
||||||
|
'jsdoc/require-returns-description': 'off',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
files: ['**/*.{ts,tsx}'],
|
||||||
|
rules: {
|
||||||
|
'no-restricted-syntax': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
selector: 'TSEnumDeclaration',
|
||||||
|
message:
|
||||||
|
'Prefer using TypeScript union types over TypeScript enum, since TypeScript enums have a bunch of issues, see https://dev.to/dvddpl/whats-the-problem-with-typescript-enums-2okj',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
'tsdoc/syntax': 'error',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
files: ['**/*.spec.{ts,js}', 'cypress/**', 'demos/**', '**/docs/**'],
|
||||||
|
rules: {
|
||||||
|
'jsdoc/require-jsdoc': 'off',
|
||||||
|
'@typescript-eslint/no-unused-vars': 'off',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
files: ['**/*.spec.{ts,js}', 'tests/**', 'cypress/**/*.js'],
|
||||||
|
rules: {
|
||||||
|
'@cspell/spellchecker': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
checkIdentifiers: false,
|
||||||
|
checkStrings: false,
|
||||||
|
checkStringTemplates: false,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
files: ['*.html', '*.md', '**/*.md/*'],
|
||||||
|
rules: {
|
||||||
|
'no-var': 'error',
|
||||||
|
'no-undef': 'off',
|
||||||
|
'@typescript-eslint/no-unused-vars': 'off',
|
||||||
|
'@typescript-eslint/no-floating-promises': 'off',
|
||||||
|
'@typescript-eslint/no-misused-promises': 'off',
|
||||||
|
},
|
||||||
|
processor: 'markdown/markdown',
|
||||||
|
}
|
||||||
|
);
|
||||||
38
package.json
38
package.json
@@ -4,7 +4,7 @@
|
|||||||
"version": "10.2.4",
|
"version": "10.2.4",
|
||||||
"description": "Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.",
|
"description": "Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"packageManager": "pnpm@9.1.2+sha512.127dc83b9ea10c32be65d22a8efb4a65fb952e8fefbdfded39bdc3c97efc32d31b48b00420df2c1187ace28c921c902f0cb5a134a4d032b8b5295cbfa2c681e2",
|
"packageManager": "pnpm@9.4.0+sha512.f549b8a52c9d2b8536762f99c0722205efc5af913e77835dbccc3b0b0b2ca9e7dc8022b78062c17291c48e88749c70ce88eb5a74f1fa8c4bf5e18bb46c8bd83a",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"diagram",
|
"diagram",
|
||||||
"markdown",
|
"markdown",
|
||||||
@@ -25,8 +25,8 @@
|
|||||||
"dev:vite": "tsx .vite/server.ts",
|
"dev:vite": "tsx .vite/server.ts",
|
||||||
"dev:coverage": "pnpm coverage:cypress:clean && VITE_COVERAGE=true pnpm dev:vite",
|
"dev:coverage": "pnpm coverage:cypress:clean && VITE_COVERAGE=true pnpm dev:vite",
|
||||||
"release": "pnpm build",
|
"release": "pnpm build",
|
||||||
"lint": "cross-env NODE_OPTIONS=--max_old_space_size=8192 eslint --cache --cache-strategy content . && pnpm lint:jison && prettier --cache --check .",
|
"lint": "eslint --quiet --stats --cache --cache-strategy content . && pnpm lint:jison && prettier --cache --check .",
|
||||||
"lint:fix": "cross-env NODE_OPTIONS=--max_old_space_size=8192 eslint --cache --cache-strategy content --fix . && prettier --write . && tsx scripts/fixCSpell.ts",
|
"lint:fix": "eslint --cache --cache-strategy content --fix . && prettier --write . && tsx scripts/fixCSpell.ts",
|
||||||
"lint:jison": "tsx ./scripts/jison/lint.mts",
|
"lint:jison": "tsx ./scripts/jison/lint.mts",
|
||||||
"contributors": "tsx scripts/updateContributors.ts",
|
"contributors": "tsx scripts/updateContributors.ts",
|
||||||
"cypress": "cypress run",
|
"cypress": "cypress run",
|
||||||
@@ -63,11 +63,11 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@applitools/eyes-cypress": "^3.42.3",
|
"@applitools/eyes-cypress": "^3.42.3",
|
||||||
"@argos-ci/cypress": "^2.0.5",
|
"@argos-ci/cypress": "^2.0.5",
|
||||||
"@cspell/eslint-plugin": "^8.6.0",
|
"@cspell/eslint-plugin": "^8.8.4",
|
||||||
"@cypress/code-coverage": "^3.12.30",
|
"@cypress/code-coverage": "^3.12.30",
|
||||||
|
"@eslint/js": "^9.4.0",
|
||||||
"@rollup/plugin-typescript": "^11.1.6",
|
"@rollup/plugin-typescript": "^11.1.6",
|
||||||
"@types/cors": "^2.8.17",
|
"@types/cors": "^2.8.17",
|
||||||
"@types/eslint": "^8.56.6",
|
|
||||||
"@types/express": "^4.17.21",
|
"@types/express": "^4.17.21",
|
||||||
"@types/js-yaml": "^4.0.9",
|
"@types/js-yaml": "^4.0.9",
|
||||||
"@types/jsdom": "^21.1.6",
|
"@types/jsdom": "^21.1.6",
|
||||||
@@ -75,8 +75,6 @@
|
|||||||
"@types/mdast": "^4.0.3",
|
"@types/mdast": "^4.0.3",
|
||||||
"@types/node": "^20.11.30",
|
"@types/node": "^20.11.30",
|
||||||
"@types/rollup-plugin-visualizer": "^4.2.4",
|
"@types/rollup-plugin-visualizer": "^4.2.4",
|
||||||
"@typescript-eslint/eslint-plugin": "^7.3.1",
|
|
||||||
"@typescript-eslint/parser": "^7.3.1",
|
|
||||||
"@vitest/coverage-v8": "^1.4.0",
|
"@vitest/coverage-v8": "^1.4.0",
|
||||||
"@vitest/spy": "^1.4.0",
|
"@vitest/spy": "^1.4.0",
|
||||||
"@vitest/ui": "^1.4.0",
|
"@vitest/ui": "^1.4.0",
|
||||||
@@ -88,20 +86,21 @@
|
|||||||
"cspell": "^8.6.0",
|
"cspell": "^8.6.0",
|
||||||
"cypress": "^13.7.1",
|
"cypress": "^13.7.1",
|
||||||
"cypress-image-snapshot": "^4.0.1",
|
"cypress-image-snapshot": "^4.0.1",
|
||||||
"esbuild": "^0.20.2",
|
"esbuild": "^0.21.5",
|
||||||
"eslint": "^8.57.0",
|
"eslint": "^9.4.0",
|
||||||
"eslint-config-prettier": "^9.1.0",
|
"eslint-config-prettier": "^9.1.0",
|
||||||
"eslint-plugin-cypress": "^2.15.1",
|
"eslint-plugin-cypress": "^3.3.0",
|
||||||
"eslint-plugin-html": "^8.0.0",
|
"eslint-plugin-html": "^8.1.1",
|
||||||
"eslint-plugin-jest": "^27.9.0",
|
"eslint-plugin-jest": "^28.6.0",
|
||||||
"eslint-plugin-jsdoc": "^48.2.1",
|
"eslint-plugin-jsdoc": "^48.2.9",
|
||||||
"eslint-plugin-json": "^3.1.0",
|
"eslint-plugin-json": "^4.0.0",
|
||||||
"eslint-plugin-lodash": "^7.4.0",
|
"eslint-plugin-lodash": "^8.0.0",
|
||||||
"eslint-plugin-markdown": "^4.0.1",
|
"eslint-plugin-markdown": "^5.0.0",
|
||||||
"eslint-plugin-no-only-tests": "^3.1.0",
|
"eslint-plugin-no-only-tests": "^3.1.0",
|
||||||
"eslint-plugin-tsdoc": "^0.2.17",
|
"eslint-plugin-tsdoc": "^0.3.0",
|
||||||
"eslint-plugin-unicorn": "^51.0.1",
|
"eslint-plugin-unicorn": "^54.0.0",
|
||||||
"express": "^4.19.1",
|
"express": "^4.19.1",
|
||||||
|
"globals": "^15.4.0",
|
||||||
"globby": "^14.0.1",
|
"globby": "^14.0.1",
|
||||||
"husky": "^9.0.11",
|
"husky": "^9.0.11",
|
||||||
"jest": "^29.7.0",
|
"jest": "^29.7.0",
|
||||||
@@ -120,7 +119,8 @@
|
|||||||
"rollup-plugin-visualizer": "^5.12.0",
|
"rollup-plugin-visualizer": "^5.12.0",
|
||||||
"start-server-and-test": "^2.0.3",
|
"start-server-and-test": "^2.0.3",
|
||||||
"tsx": "^4.7.1",
|
"tsx": "^4.7.1",
|
||||||
"typescript": "^5.4.3",
|
"typescript": "~5.4.5",
|
||||||
|
"typescript-eslint": "^8.0.0-alpha.34",
|
||||||
"vite": "^5.2.3",
|
"vite": "^5.2.3",
|
||||||
"vite-plugin-istanbul": "^6.0.0",
|
"vite-plugin-istanbul": "^6.0.0",
|
||||||
"vitest": "^1.4.0"
|
"vitest": "^1.4.0"
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ export const log: Record<keyof typeof LEVELS, typeof console.log> = {
|
|||||||
fatal: warning,
|
fatal: warning,
|
||||||
};
|
};
|
||||||
|
|
||||||
export let setLogLevel: (level: keyof typeof LEVELS | number | string) => void;
|
export let setLogLevel: (level: keyof typeof LEVELS | number) => void;
|
||||||
export let getConfig: () => object;
|
export let getConfig: () => object;
|
||||||
export let sanitizeText: (str: string) => string;
|
export let sanitizeText: (str: string) => string;
|
||||||
export let commonDb: () => object;
|
export let commonDb: () => object;
|
||||||
|
|||||||
11
packages/mermaid-example-diagram/tsconfig.eslint.json
Normal file
11
packages/mermaid-example-diagram/tsconfig.eslint.json
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://json.schemastore.org/tsconfig",
|
||||||
|
"extends": ["./tsconfig.json"],
|
||||||
|
"compilerOptions": {
|
||||||
|
"noEmit": true
|
||||||
|
},
|
||||||
|
"include": [
|
||||||
|
"./src/**/*.spec.js",
|
||||||
|
"./src/**/*.spec.ts" // test files
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -39,6 +39,26 @@ describe('flowchart-elk detector', () => {
|
|||||||
).toBe(true);
|
).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// The error from the issue was reproduced with mindmap, so this is just an example
|
||||||
|
// what matters is the keyword somewhere inside graph definition
|
||||||
|
it('should check only the beginning of the line in search of keywords', () => {
|
||||||
|
expect(
|
||||||
|
detector('mindmap ["Descendant node in flowchart"]', {
|
||||||
|
flowchart: {
|
||||||
|
defaultRenderer: 'elk',
|
||||||
|
},
|
||||||
|
})
|
||||||
|
).toBe(false);
|
||||||
|
|
||||||
|
expect(
|
||||||
|
detector('mindmap ["Descendant node in graph"]', {
|
||||||
|
flowchart: {
|
||||||
|
defaultRenderer: 'elk',
|
||||||
|
},
|
||||||
|
})
|
||||||
|
).toBe(false);
|
||||||
|
});
|
||||||
|
|
||||||
it('should detect flowchart-elk', () => {
|
it('should detect flowchart-elk', () => {
|
||||||
expect(detector('flowchart-elk')).toBe(true);
|
expect(detector('flowchart-elk')).toBe(true);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ const detector: DiagramDetector = (txt, config): boolean => {
|
|||||||
// If diagram explicitly states flowchart-elk
|
// If diagram explicitly states flowchart-elk
|
||||||
/^\s*flowchart-elk/.test(txt) ||
|
/^\s*flowchart-elk/.test(txt) ||
|
||||||
// If a flowchart/graph diagram has their default renderer set to elk
|
// If a flowchart/graph diagram has their default renderer set to elk
|
||||||
(/^\s*flowchart|graph/.test(txt) && config?.flowchart?.defaultRenderer === 'elk')
|
(/^\s*(flowchart|graph)/.test(txt) && config?.flowchart?.defaultRenderer === 'elk')
|
||||||
) {
|
) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,7 +64,6 @@ export const addVertices = async function (vert, svgId, root, doc, diagObj, pare
|
|||||||
let vertexText = vertex.text !== undefined ? vertex.text : vertex.id;
|
let vertexText = vertex.text !== undefined ? vertex.text : vertex.id;
|
||||||
|
|
||||||
// We create a SVG label, either by delegating to addHtmlLabel or manually
|
// We create a SVG label, either by delegating to addHtmlLabel or manually
|
||||||
let vertexNode;
|
|
||||||
const labelData = { width: 0, height: 0 };
|
const labelData = { width: 0, height: 0 };
|
||||||
|
|
||||||
const ports = [
|
const ports = [
|
||||||
@@ -188,19 +187,6 @@ export const addVertices = async function (vert, svgId, root, doc, diagObj, pare
|
|||||||
nodeEl = await insertNode(nodes, node, vertex.dir);
|
nodeEl = await insertNode(nodes, node, vertex.dir);
|
||||||
boundingBox = nodeEl.node().getBBox();
|
boundingBox = nodeEl.node().getBBox();
|
||||||
} else {
|
} else {
|
||||||
const svgLabel = doc.createElementNS('http://www.w3.org/2000/svg', 'text');
|
|
||||||
// svgLabel.setAttribute('style', styles.labelStyle.replace('color:', 'fill:'));
|
|
||||||
// const rows = vertexText.split(common.lineBreakRegex);
|
|
||||||
// for (const row of rows) {
|
|
||||||
// const tspan = doc.createElementNS('http://www.w3.org/2000/svg', 'tspan');
|
|
||||||
// tspan.setAttributeNS('http://www.w3.org/XML/1998/namespace', 'xml:space', 'preserve');
|
|
||||||
// tspan.setAttribute('dy', '1em');
|
|
||||||
// tspan.setAttribute('x', '1');
|
|
||||||
// tspan.textContent = row;
|
|
||||||
// svgLabel.appendChild(tspan);
|
|
||||||
// }
|
|
||||||
// vertexNode = svgLabel;
|
|
||||||
// const bbox = vertexNode.getBBox();
|
|
||||||
const { shapeSvg, bbox } = await labelHelper(nodes, node, undefined, true);
|
const { shapeSvg, bbox } = await labelHelper(nodes, node, undefined, true);
|
||||||
labelData.width = bbox.width;
|
labelData.width = bbox.width;
|
||||||
labelData.wrappingWidth = getConfig().flowchart.wrappingWidth;
|
labelData.wrappingWidth = getConfig().flowchart.wrappingWidth;
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
],
|
],
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@zenuml/core": "^3.19.2"
|
"@zenuml/core": "^3.23.27"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"mermaid": "workspace:^"
|
"mermaid": "workspace:^"
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ export const log: Record<keyof typeof LEVELS, typeof console.log> = {
|
|||||||
fatal: warning,
|
fatal: warning,
|
||||||
};
|
};
|
||||||
|
|
||||||
export let setLogLevel: (level: keyof typeof LEVELS | number | string) => void;
|
export let setLogLevel: (level: keyof typeof LEVELS | number) => void;
|
||||||
export let getConfig: () => MermaidConfig;
|
export let getConfig: () => MermaidConfig;
|
||||||
export let sanitizeText: (str: string) => string;
|
export let sanitizeText: (str: string) => string;
|
||||||
// eslint-disable @typescript-eslint/no-explicit-any
|
// eslint-disable @typescript-eslint/no-explicit-any
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ function createTemporaryZenumlContainer(id: string) {
|
|||||||
container.id = `container-${id}`;
|
container.id = `container-${id}`;
|
||||||
container.style.display = 'flex';
|
container.style.display = 'flex';
|
||||||
container.innerHTML = `<div id="zenUMLApp-${id}"></div>`;
|
container.innerHTML = `<div id="zenUMLApp-${id}"></div>`;
|
||||||
const app = container.querySelector(`#zenUMLApp-${id}`) as HTMLElement;
|
const app = container.querySelector(`#zenUMLApp-${id}`)!;
|
||||||
return { container, app };
|
return { container, app };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"clean": "rimraf dist",
|
"clean": "rimraf dist",
|
||||||
"dev": "pnpm -w dev",
|
"dev": "pnpm -w dev",
|
||||||
"docs:code": "typedoc src/defaultConfig.ts src/config.ts src/mermaidAPI.ts && prettier --write ./src/docs/config/setup",
|
"docs:code": "typedoc src/defaultConfig.ts src/config.ts src/mermaid.ts && prettier --write ./src/docs/config/setup",
|
||||||
"docs:build": "rimraf ../../docs && pnpm docs:spellcheck && pnpm docs:code && tsx scripts/docs.cli.mts",
|
"docs:build": "rimraf ../../docs && pnpm docs:spellcheck && pnpm docs:code && tsx scripts/docs.cli.mts",
|
||||||
"docs:verify": "pnpm docs:spellcheck && pnpm docs:code && tsx scripts/docs.cli.mts --verify",
|
"docs:verify": "pnpm docs:spellcheck && pnpm docs:code && tsx scripts/docs.cli.mts --verify",
|
||||||
"docs:pre:vitepress": "pnpm --filter ./src/docs prefetch && rimraf src/vitepress && pnpm docs:code && tsx scripts/docs.cli.mts --vitepress && pnpm --filter ./src/vitepress install --no-frozen-lockfile --ignore-scripts",
|
"docs:pre:vitepress": "pnpm --filter ./src/docs prefetch && rimraf src/vitepress && pnpm docs:code && tsx scripts/docs.cli.mts --vitepress && pnpm --filter ./src/vitepress install --no-frozen-lockfile --ignore-scripts",
|
||||||
@@ -103,8 +103,6 @@
|
|||||||
"@types/prettier": "^3.0.0",
|
"@types/prettier": "^3.0.0",
|
||||||
"@types/stylis": "^4.2.5",
|
"@types/stylis": "^4.2.5",
|
||||||
"@types/uuid": "^9.0.8",
|
"@types/uuid": "^9.0.8",
|
||||||
"@typescript-eslint/eslint-plugin": "^7.3.1",
|
|
||||||
"@typescript-eslint/parser": "^7.3.1",
|
|
||||||
"ajv": "^8.12.0",
|
"ajv": "^8.12.0",
|
||||||
"chokidar": "^3.6.0",
|
"chokidar": "^3.6.0",
|
||||||
"concurrently": "^8.2.2",
|
"concurrently": "^8.2.2",
|
||||||
@@ -126,7 +124,7 @@
|
|||||||
"type-fest": "^4.13.1",
|
"type-fest": "^4.13.1",
|
||||||
"typedoc": "^0.25.12",
|
"typedoc": "^0.25.12",
|
||||||
"typedoc-plugin-markdown": "^3.17.1",
|
"typedoc-plugin-markdown": "^3.17.1",
|
||||||
"typescript": "^5.4.3",
|
"typescript": "~5.4.3",
|
||||||
"unist-util-flatmap": "^1.0.0",
|
"unist-util-flatmap": "^1.0.0",
|
||||||
"unist-util-visit": "^5.0.0",
|
"unist-util-visit": "^5.0.0",
|
||||||
"vitepress": "^1.0.1",
|
"vitepress": "^1.0.1",
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ async function generateTypescript(mermaidConfigSchema: JSONSchemaType<MermaidCon
|
|||||||
* @returns The schema with `allOf` replaced with `extends`.
|
* @returns The schema with `allOf` replaced with `extends`.
|
||||||
*/
|
*/
|
||||||
function replaceAllOfWithExtends(schema: JSONSchemaType<Record<string, any>>) {
|
function replaceAllOfWithExtends(schema: JSONSchemaType<Record<string, any>>) {
|
||||||
if (schema['allOf']) {
|
if (schema.allOf) {
|
||||||
const { allOf, ...schemaWithoutAllOf } = schema;
|
const { allOf, ...schemaWithoutAllOf } = schema;
|
||||||
return {
|
return {
|
||||||
...schemaWithoutAllOf,
|
...schemaWithoutAllOf,
|
||||||
|
|||||||
@@ -88,9 +88,9 @@ const WARN_DOCSDIR_DOESNT_MATCH = `Changed files were transformed in ${SOURCE_DO
|
|||||||
const prettierConfig = (await prettier.resolveConfig('.')) ?? {};
|
const prettierConfig = (await prettier.resolveConfig('.')) ?? {};
|
||||||
// From https://github.com/vuejs/vitepress/blob/428eec3750d6b5648a77ac52d88128df0554d4d1/src/node/markdownToVue.ts#L20-L21
|
// From https://github.com/vuejs/vitepress/blob/428eec3750d6b5648a77ac52d88128df0554d4d1/src/node/markdownToVue.ts#L20-L21
|
||||||
const includesRE = /<!--\s*@include:\s*(.*?)\s*-->/g;
|
const includesRE = /<!--\s*@include:\s*(.*?)\s*-->/g;
|
||||||
const includedFiles: Set<string> = new Set();
|
const includedFiles = new Set<string>();
|
||||||
|
|
||||||
const filesTransformed: Set<string> = new Set();
|
const filesTransformed = new Set<string>();
|
||||||
|
|
||||||
const generateHeader = (file: string): string => {
|
const generateHeader = (file: string): string => {
|
||||||
// path from file in docs/* to repo root, e.g ../ or ../../ */
|
// path from file in docs/* to repo root, e.g ../ or ../../ */
|
||||||
@@ -181,10 +181,10 @@ export const transformToBlockQuote = (
|
|||||||
) => {
|
) => {
|
||||||
if (vitepress) {
|
if (vitepress) {
|
||||||
const vitepressType = type === 'note' ? 'info' : type;
|
const vitepressType = type === 'note' ? 'info' : type;
|
||||||
return `::: ${vitepressType} ${customTitle || ''}\n${content}\n:::`;
|
return `::: ${vitepressType} ${customTitle ?? ''}\n${content}\n:::`;
|
||||||
} else {
|
} else {
|
||||||
const icon = blockIcons[type] || '';
|
const icon = blockIcons[type] ?? '';
|
||||||
const title = `${icon}${customTitle || capitalize(type)}`;
|
const title = `${icon}${customTitle ?? capitalize(type)}`;
|
||||||
return `> **${title}** \n> ${content.replace(/\n/g, '\n> ')}`;
|
return `> **${title}** \n> ${content.replace(/\n/g, '\n> ')}`;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -201,6 +201,7 @@ const transformIncludeStatements = (file: string, text: string): string => {
|
|||||||
includedFiles.add(changeToFinalDocDir(includePath));
|
includedFiles.add(changeToFinalDocDir(includePath));
|
||||||
return content;
|
return content;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
||||||
throw new Error(`Failed to resolve include "${m1}" in "${file}": ${error}`);
|
throw new Error(`Failed to resolve include "${m1}" in "${file}": ${error}`);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -241,7 +242,7 @@ export function transformMarkdownAst({
|
|||||||
addEditLink,
|
addEditLink,
|
||||||
removeYAML,
|
removeYAML,
|
||||||
}: TransformMarkdownAstOptions) {
|
}: TransformMarkdownAstOptions) {
|
||||||
return (tree: Root, _file?: any): Root => {
|
return (tree: Root): Root => {
|
||||||
const astWithTransformedBlocks = flatmap(tree, (node: Code) => {
|
const astWithTransformedBlocks = flatmap(tree, (node: Code) => {
|
||||||
if (node.type !== 'code' || !node.lang) {
|
if (node.type !== 'code' || !node.lang) {
|
||||||
return [node]; // no transformation if this is not a code block
|
return [node]; // no transformation if this is not a code block
|
||||||
@@ -509,6 +510,7 @@ export const getGlobs = (globs: string[]): string[] => {
|
|||||||
globs.push(
|
globs.push(
|
||||||
'!**/.vitepress/**',
|
'!**/.vitepress/**',
|
||||||
'!**/vite.config.ts',
|
'!**/vite.config.ts',
|
||||||
|
'!**/tsconfig.json',
|
||||||
'!src/docs/index.md',
|
'!src/docs/index.md',
|
||||||
'!**/package.json',
|
'!**/package.json',
|
||||||
'!**/user-avatars/**'
|
'!**/user-avatars/**'
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import { encodeEntities } from './utils.js';
|
|||||||
import type { DetailedError } from './utils.js';
|
import type { DetailedError } from './utils.js';
|
||||||
import type { DiagramDefinition, DiagramMetadata } from './diagram-api/types.js';
|
import type { DiagramDefinition, DiagramMetadata } from './diagram-api/types.js';
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents
|
||||||
export type ParseErrorFunction = (err: string | DetailedError | unknown, hash?: any) => void;
|
export type ParseErrorFunction = (err: string | DetailedError | unknown, hash?: any) => void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -19,7 +20,7 @@ export class Diagram {
|
|||||||
text = encodeEntities(text) + '\n';
|
text = encodeEntities(text) + '\n';
|
||||||
try {
|
try {
|
||||||
getDiagram(type);
|
getDiagram(type);
|
||||||
} catch (e) {
|
} catch {
|
||||||
const loader = getDiagramLoader(type);
|
const loader = getDiagramLoader(type);
|
||||||
if (!loader) {
|
if (!loader) {
|
||||||
throw new UnknownDiagramError(`Diagram ${type} not found.`);
|
throw new UnknownDiagramError(`Diagram ${type} not found.`);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { MockedD3 } from './tests/MockedD3.js';
|
import { MockedD3 } from './tests/MockedD3.js';
|
||||||
import { setA11yDiagramInfo, addSVGa11yTitleDescription } from './accessibility.js';
|
import { setA11yDiagramInfo, addSVGa11yTitleDescription } from './accessibility.js';
|
||||||
import type { D3Element } from './mermaidAPI.js';
|
import type { D3Element } from './types.js';
|
||||||
|
|
||||||
describe('accessibility', () => {
|
describe('accessibility', () => {
|
||||||
const fauxSvgNode: MockedD3 = new MockedD3();
|
const fauxSvgNode: MockedD3 = new MockedD3();
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
* @see https://www.w3.org/TR/wai-aria-1.1/
|
* @see https://www.w3.org/TR/wai-aria-1.1/
|
||||||
* @see https://www.w3.org/TR/svg-aam-1.0/
|
* @see https://www.w3.org/TR/svg-aam-1.0/
|
||||||
*/
|
*/
|
||||||
import type { D3Element } from './mermaidAPI.js';
|
import type { D3Element } from './types.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SVG element role:
|
* SVG element role:
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
||||||
import * as configApi from './config.js';
|
import * as configApi from './config.js';
|
||||||
import type { MermaidConfig } from './config.type.js';
|
import type { MermaidConfig } from './config.type.js';
|
||||||
|
|
||||||
|
|||||||
@@ -189,7 +189,7 @@ export const addDirective = (directive: MermaidConfig) => {
|
|||||||
sanitizeDirective(directive);
|
sanitizeDirective(directive);
|
||||||
|
|
||||||
// If the directive has a fontFamily, but no themeVariables, add the fontFamily to the themeVariables
|
// If the directive has a fontFamily, but no themeVariables, add the fontFamily to the themeVariables
|
||||||
if (directive.fontFamily && (!directive.themeVariables || !directive.themeVariables.fontFamily)) {
|
if (directive.fontFamily && !directive.themeVariables?.fontFamily) {
|
||||||
directive.themeVariables = { fontFamily: directive.fontFamily };
|
directive.themeVariables = { fontFamily: directive.fontFamily };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -104,10 +104,7 @@ export interface MermaidConfig {
|
|||||||
arrowMarkerAbsolute?: boolean;
|
arrowMarkerAbsolute?: boolean;
|
||||||
/**
|
/**
|
||||||
* This option controls which `currentConfig` keys are considered secure and
|
* This option controls which `currentConfig` keys are considered secure and
|
||||||
* can only be changed via call to `mermaidAPI.initialize`.
|
* can only be changed via call to `mermaid.initialize`.
|
||||||
* Calls to `mermaidAPI.reinitialize` cannot make changes to the secure keys
|
|
||||||
* in the current `currentConfig`.
|
|
||||||
*
|
|
||||||
* This prevents malicious graph directives from overriding a site's default security.
|
* This prevents malicious graph directives from overriding a site's default security.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -42,9 +42,6 @@ export const getArrowPoints = (
|
|||||||
// Padding to use, half of the node padding.
|
// Padding to use, half of the node padding.
|
||||||
const padding = node.padding / 2;
|
const padding = node.padding / 2;
|
||||||
|
|
||||||
// Initialize an empty array to store points for the arrow.
|
|
||||||
const points = [];
|
|
||||||
|
|
||||||
if (
|
if (
|
||||||
directions.has('right') &&
|
directions.has('right') &&
|
||||||
directions.has('left') &&
|
directions.has('left') &&
|
||||||
|
|||||||
@@ -25,15 +25,10 @@ function addHtmlLabel(node) {
|
|||||||
|
|
||||||
const label = node.label;
|
const label = node.label;
|
||||||
const labelClass = node.isNode ? 'nodeLabel' : 'edgeLabel';
|
const labelClass = node.isNode ? 'nodeLabel' : 'edgeLabel';
|
||||||
div.html(
|
const span = div.append('span');
|
||||||
'<span class="' +
|
span.html(label);
|
||||||
labelClass +
|
applyStyle(span, node.labelStyle);
|
||||||
'" ' +
|
span.attr('class', labelClass);
|
||||||
(node.labelStyle ? 'style="' + node.labelStyle + '"' : '') +
|
|
||||||
'>' +
|
|
||||||
label +
|
|
||||||
'</span>'
|
|
||||||
);
|
|
||||||
|
|
||||||
applyStyle(div, node.labelStyle);
|
applyStyle(div, node.labelStyle);
|
||||||
div.style('display', 'inline-block');
|
div.style('display', 'inline-block');
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
/* eslint-disable @typescript-eslint/unbound-method */
|
||||||
import type { Mocked } from 'vitest';
|
import type { Mocked } from 'vitest';
|
||||||
import type { SVG } from '../diagram-api/types.js';
|
import type { SVG } from '../diagram-api/types.js';
|
||||||
import { addEdgeMarkers } from './edgeMarker.js';
|
import { addEdgeMarkers } from './edgeMarker.js';
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ const recursiveRender = async (_elem, graph, diagramType, id, parentCluster, sit
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
log.info('(Insert) Node XXX' + v + ': ' + JSON.stringify(graph.node(v)));
|
log.info('(Insert) Node XXX' + v + ': ' + JSON.stringify(graph.node(v)));
|
||||||
if (node && node.clusterNode) {
|
if (node?.clusterNode) {
|
||||||
// const children = graph.children(v);
|
// const children = graph.children(v);
|
||||||
log.info('Cluster identified', v, node.width, graph.node(v));
|
log.info('Cluster identified', v, node.width, graph.node(v));
|
||||||
// `node.graph.setGraph` applies the graph configurations such as nodeSpacing to subgraphs as without this the default values would be used
|
// `node.graph.setGraph` applies the graph configurations such as nodeSpacing to subgraphs as without this the default values would be used
|
||||||
@@ -130,7 +130,7 @@ const recursiveRender = async (_elem, graph, diagramType, id, parentCluster, sit
|
|||||||
' height: ',
|
' height: ',
|
||||||
node.height
|
node.height
|
||||||
);
|
);
|
||||||
if (node && node.clusterNode) {
|
if (node?.clusterNode) {
|
||||||
// clusterDb[node.id].node = node;
|
// clusterDb[node.id].node = node;
|
||||||
node.y += subGraphTitleTotalMargin;
|
node.y += subGraphTitleTotalMargin;
|
||||||
positionNode(node);
|
positionNode(node);
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
node: require('./intersect-node'),
|
|
||||||
circle: require('./intersect-circle'),
|
|
||||||
ellipse: require('./intersect-ellipse'),
|
|
||||||
polygon: require('./intersect-polygon'),
|
|
||||||
rect: require('./intersect-rect'),
|
|
||||||
};
|
|
||||||
@@ -399,7 +399,7 @@ export const extractor = (graph, depth) => {
|
|||||||
|
|
||||||
const graphSettings = graph.graph();
|
const graphSettings = graph.graph();
|
||||||
let dir = graphSettings.rankdir === 'TB' ? 'LR' : 'TB';
|
let dir = graphSettings.rankdir === 'TB' ? 'LR' : 'TB';
|
||||||
if (clusterDb[node] && clusterDb[node].clusterData && clusterDb[node].clusterData.dir) {
|
if (clusterDb[node]?.clusterData?.dir) {
|
||||||
dir = clusterDb[node].clusterData.dir;
|
dir = clusterDb[node].clusterData.dir;
|
||||||
log.warn('Fixing dir', clusterDb[node].clusterData.dir, dir);
|
log.warn('Fixing dir', clusterDb[node].clusterData.dir, dir);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -901,7 +901,7 @@ const class_box = (parent, node) => {
|
|||||||
|
|
||||||
const labelContainer = shapeSvg.insert('g').attr('class', 'label');
|
const labelContainer = shapeSvg.insert('g').attr('class', 'label');
|
||||||
let verticalPos = 0;
|
let verticalPos = 0;
|
||||||
const hasInterface = node.classData.annotations && node.classData.annotations[0];
|
const hasInterface = node.classData.annotations?.[0];
|
||||||
|
|
||||||
// 1. Create the labels
|
// 1. Create the labels
|
||||||
const interfaceLabelText = node.classData.annotations[0]
|
const interfaceLabelText = node.classData.annotations[0]
|
||||||
|
|||||||
@@ -1,52 +0,0 @@
|
|||||||
/** Setup arrow head and define the marker. The result is appended to the svg. */
|
|
||||||
|
|
||||||
// import { log } from '../logger.js';
|
|
||||||
|
|
||||||
// Only add the number of markers that the diagram needs
|
|
||||||
const insertPatterns = (elem, patternArray, type, id) => {
|
|
||||||
patternArray.forEach((patternName) => {
|
|
||||||
patterns[patternName](elem, type, id);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
{
|
|
||||||
/* <svg height="10" width="10" xmlns="http://www.w3.org/2000/svg" version="1.1">
|
|
||||||
{' '}
|
|
||||||
<defs>
|
|
||||||
{' '}
|
|
||||||
<pattern id="circles-1" patternUnits="userSpaceOnUse" width="10" height="10">
|
|
||||||
{' '}
|
|
||||||
<image
|
|
||||||
xlink:href="data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHdpZHRoPScxMCcgaGVpZ2h0PScxMCc+CiAgPHJlY3Qgd2lkdGg9JzEwJyBoZWlnaHQ9JzEwJyBmaWxsPSJ3aGl0ZSIgLz4KICA8Y2lyY2xlIGN4PSIxIiBjeT0iMSIgcj0iMSIgZmlsbD0iYmxhY2siLz4KPC9zdmc+"
|
|
||||||
x="0"
|
|
||||||
y="0"
|
|
||||||
width="10"
|
|
||||||
height="10"
|
|
||||||
>
|
|
||||||
{' '}
|
|
||||||
</image>{' '}
|
|
||||||
</pattern>{' '}
|
|
||||||
</defs>{' '}
|
|
||||||
</svg>; */
|
|
||||||
}
|
|
||||||
|
|
||||||
const dots = (elem, type) => {
|
|
||||||
elem
|
|
||||||
.append('defs')
|
|
||||||
.append('marker')
|
|
||||||
.attr('id', type + '-barbEnd')
|
|
||||||
.attr('refX', 19)
|
|
||||||
.attr('refY', 7)
|
|
||||||
.attr('markerWidth', 20)
|
|
||||||
.attr('markerHeight', 14)
|
|
||||||
.attr('markerUnits', 0)
|
|
||||||
.attr('orient', 'auto')
|
|
||||||
.append('path')
|
|
||||||
.attr('d', 'M 19,7 L9,13 L14,7 L9,1 Z');
|
|
||||||
};
|
|
||||||
|
|
||||||
// TODO rename the class diagram markers to something shape descriptive and semantic free
|
|
||||||
const patterns = {
|
|
||||||
dots,
|
|
||||||
};
|
|
||||||
export default insertPatterns;
|
|
||||||
@@ -23,7 +23,7 @@ const config: RequiredDeep<MermaidConfig> = {
|
|||||||
themeCSS: undefined,
|
themeCSS: undefined,
|
||||||
|
|
||||||
// add non-JSON default config values
|
// add non-JSON default config values
|
||||||
themeVariables: theme['default'].getThemeVariables(),
|
themeVariables: theme.default.getThemeVariables(),
|
||||||
sequence: {
|
sequence: {
|
||||||
...defaultConfigJson.sequence,
|
...defaultConfigJson.sequence,
|
||||||
messageFont: function () {
|
messageFont: function () {
|
||||||
@@ -272,5 +272,5 @@ const keyify = (obj: any, prefix = ''): string[] =>
|
|||||||
return [...res, prefix + el];
|
return [...res, prefix + el];
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
export const configKeys: Set<string> = new Set(keyify(config, ''));
|
export const configKeys = new Set<string>(keyify(config, ''));
|
||||||
export default config;
|
export default config;
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ describe('DiagramAPI', () => {
|
|||||||
`[UnknownDiagramError: No diagram type detected matching given configuration for text: loki diagram]`
|
`[UnknownDiagramError: No diagram type detected matching given configuration for text: loki diagram]`
|
||||||
);
|
);
|
||||||
const detector: DiagramDetector = (str: string) => {
|
const detector: DiagramDetector = (str: string) => {
|
||||||
return str.match('loki') !== null;
|
return /loki/.exec(str) !== null;
|
||||||
};
|
};
|
||||||
registerDiagram(
|
registerDiagram(
|
||||||
'loki',
|
'loki',
|
||||||
|
|||||||
@@ -30,9 +30,7 @@ export const getCommonDb = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const diagrams: Record<string, DiagramDefinition> = {};
|
const diagrams: Record<string, DiagramDefinition> = {};
|
||||||
export interface Detectors {
|
export type Detectors = Record<string, DiagramDetector>;
|
||||||
[key: string]: DiagramDetector;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Registers the given diagram with Mermaid.
|
* Registers the given diagram with Mermaid.
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ export const loadRegisteredDiagrams = async () => {
|
|||||||
if (loader) {
|
if (loader) {
|
||||||
try {
|
try {
|
||||||
getDiagram(key);
|
getDiagram(key);
|
||||||
} catch (error) {
|
} catch {
|
||||||
try {
|
try {
|
||||||
// Register diagram if it is not already registered
|
// Register diagram if it is not already registered
|
||||||
const { diagram, id } = await loader();
|
const { diagram, id } = await loader();
|
||||||
|
|||||||
@@ -30,12 +30,12 @@ const getDummyDiagram = (id: string, title?: string): Awaited<ReturnType<Diagram
|
|||||||
|
|
||||||
describe('diagram detection', () => {
|
describe('diagram detection', () => {
|
||||||
test('should detect inbuilt diagrams', async () => {
|
test('should detect inbuilt diagrams', async () => {
|
||||||
const graph = (await Diagram.fromText('graph TD; A-->B')) as Diagram;
|
const graph = await Diagram.fromText('graph TD; A-->B');
|
||||||
expect(graph).toBeInstanceOf(Diagram);
|
expect(graph).toBeInstanceOf(Diagram);
|
||||||
expect(graph.type).toBe('flowchart-v2');
|
expect(graph.type).toBe('flowchart-v2');
|
||||||
const sequence = (await Diagram.fromText(
|
const sequence = await Diagram.fromText(
|
||||||
'sequenceDiagram; Alice->>+John: Hello John, how are you?'
|
'sequenceDiagram; Alice->>+John: Hello John, how are you?'
|
||||||
)) as Diagram;
|
);
|
||||||
expect(sequence).toBeInstanceOf(Diagram);
|
expect(sequence).toBeInstanceOf(Diagram);
|
||||||
expect(sequence.type).toBe('sequence');
|
expect(sequence.type).toBe('sequence');
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -8,9 +8,9 @@ import { clear as commonClear } from '../common/commonDb.js';
|
|||||||
import type { Block, ClassDef } from './blockTypes.js';
|
import type { Block, ClassDef } from './blockTypes.js';
|
||||||
|
|
||||||
// Initialize the node database for simple lookups
|
// Initialize the node database for simple lookups
|
||||||
let blockDatabase: Map<string, Block> = new Map();
|
let blockDatabase = new Map<string, Block>();
|
||||||
let edgeList: Block[] = [];
|
let edgeList: Block[] = [];
|
||||||
let edgeCount: Map<string, number> = new Map();
|
let edgeCount = new Map<string, number>();
|
||||||
|
|
||||||
const COLOR_KEYWORD = 'color';
|
const COLOR_KEYWORD = 'color';
|
||||||
const FILL_KEYWORD = 'fill';
|
const FILL_KEYWORD = 'fill';
|
||||||
@@ -18,7 +18,7 @@ const BG_FILL = 'bgFill';
|
|||||||
const STYLECLASS_SEP = ',';
|
const STYLECLASS_SEP = ',';
|
||||||
const config = getConfig();
|
const config = getConfig();
|
||||||
|
|
||||||
let classes: Map<string, ClassDef> = new Map();
|
let classes = new Map<string, ClassDef>();
|
||||||
|
|
||||||
const sanitizeText = (txt: string) => common.sanitizeText(txt, config);
|
const sanitizeText = (txt: string) => common.sanitizeText(txt, config);
|
||||||
|
|
||||||
@@ -42,7 +42,7 @@ export const addStyleClass = function (id: string, styleAttributes = '') {
|
|||||||
const fixedAttrib = attrib.replace(/([^;]*);/, '$1').trim();
|
const fixedAttrib = attrib.replace(/([^;]*);/, '$1').trim();
|
||||||
|
|
||||||
// replace some style keywords
|
// replace some style keywords
|
||||||
if (attrib.match(COLOR_KEYWORD)) {
|
if (RegExp(COLOR_KEYWORD).exec(attrib)) {
|
||||||
const newStyle1 = fixedAttrib.replace(FILL_KEYWORD, BG_FILL);
|
const newStyle1 = fixedAttrib.replace(FILL_KEYWORD, BG_FILL);
|
||||||
const newStyle2 = newStyle1.replace(COLOR_KEYWORD, FILL_KEYWORD);
|
const newStyle2 = newStyle1.replace(COLOR_KEYWORD, FILL_KEYWORD);
|
||||||
foundClass.textStyles.push(newStyle2);
|
foundClass.textStyles.push(newStyle2);
|
||||||
@@ -89,7 +89,7 @@ export const setCssClass = function (itemIds: string, cssClassName: string) {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const populateBlockDatabase = (_blockList: Block[] | Block[][], parent: Block): void => {
|
const populateBlockDatabase = (_blockList: Block[], parent: Block): void => {
|
||||||
const blockList = _blockList.flat();
|
const blockList = _blockList.flat();
|
||||||
const children = [];
|
const children = [];
|
||||||
for (const block of blockList) {
|
for (const block of blockList) {
|
||||||
@@ -101,7 +101,7 @@ const populateBlockDatabase = (_blockList: Block[] | Block[][], parent: Block):
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (block.type === 'applyClass') {
|
if (block.type === 'applyClass') {
|
||||||
setCssClass(block.id, block?.styleClass || '');
|
setCssClass(block.id, block?.styleClass ?? '');
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (block.type === 'applyStyles') {
|
if (block.type === 'applyStyles') {
|
||||||
@@ -111,7 +111,7 @@ const populateBlockDatabase = (_blockList: Block[] | Block[][], parent: Block):
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (block.type === 'column-setting') {
|
if (block.type === 'column-setting') {
|
||||||
parent.columns = block.columns || -1;
|
parent.columns = block.columns ?? -1;
|
||||||
} else if (block.type === 'edge') {
|
} else if (block.type === 'edge') {
|
||||||
const count = (edgeCount.get(block.id) ?? 0) + 1;
|
const count = (edgeCount.get(block.id) ?? 0) + 1;
|
||||||
edgeCount.set(block.id, count);
|
edgeCount.set(block.id, count);
|
||||||
@@ -145,7 +145,7 @@ const populateBlockDatabase = (_blockList: Block[] | Block[][], parent: Block):
|
|||||||
}
|
}
|
||||||
if (block.type === 'space') {
|
if (block.type === 'space') {
|
||||||
// log.debug('abc95 space', block);
|
// log.debug('abc95 space', block);
|
||||||
const w = block.width || 1;
|
const w = block.width ?? 1;
|
||||||
for (let j = 0; j < w; j++) {
|
for (let j = 0; j < w; j++) {
|
||||||
const newBlock = clone(block);
|
const newBlock = clone(block);
|
||||||
newBlock.id = newBlock.id + '-' + j;
|
newBlock.id = newBlock.id + '-' + j;
|
||||||
@@ -168,7 +168,7 @@ const clear = (): void => {
|
|||||||
commonClear();
|
commonClear();
|
||||||
rootBlock = { id: 'root', type: 'composite', children: [], columns: -1 } as Block;
|
rootBlock = { id: 'root', type: 'composite', children: [], columns: -1 } as Block;
|
||||||
blockDatabase = new Map([['root', rootBlock]]);
|
blockDatabase = new Map([['root', rootBlock]]);
|
||||||
blocks = [] as Block[];
|
blocks = [];
|
||||||
classes = new Map();
|
classes = new Map();
|
||||||
|
|
||||||
edgeList = [];
|
edgeList = [];
|
||||||
|
|||||||
@@ -1,11 +1,6 @@
|
|||||||
import {
|
import { select as d3select } from 'd3';
|
||||||
scaleOrdinal as d3scaleOrdinal,
|
|
||||||
schemeTableau10 as d3schemeTableau10,
|
|
||||||
select as d3select,
|
|
||||||
} from 'd3';
|
|
||||||
import type { Diagram } from '../../Diagram.js';
|
import type { Diagram } from '../../Diagram.js';
|
||||||
import * as configApi from '../../config.js';
|
import * as configApi from '../../config.js';
|
||||||
import type { MermaidConfig } from '../../config.type.js';
|
|
||||||
import insertMarkers from '../../dagre-wrapper/markers.js';
|
import insertMarkers from '../../dagre-wrapper/markers.js';
|
||||||
import { log } from '../../logger.js';
|
import { log } from '../../logger.js';
|
||||||
import { configureSvgSize } from '../../setupGraphViewbox.js';
|
import { configureSvgSize } from '../../setupGraphViewbox.js';
|
||||||
@@ -75,7 +70,7 @@ export const draw = async function (
|
|||||||
const magicFactor = Math.max(1, Math.round(0.125 * (bounds2.width / bounds2.height)));
|
const magicFactor = Math.max(1, Math.round(0.125 * (bounds2.width / bounds2.height)));
|
||||||
const height = bounds2.height + magicFactor + 10;
|
const height = bounds2.height + magicFactor + 10;
|
||||||
const width = bounds2.width + 10;
|
const width = bounds2.width + 10;
|
||||||
const { useMaxWidth } = conf as Exclude<MermaidConfig['block'], undefined>;
|
const { useMaxWidth } = conf!;
|
||||||
configureSvgSize(svg, height, width, !!useMaxWidth);
|
configureSvgSize(svg, height, width, !!useMaxWidth);
|
||||||
log.debug('Here Bounds', bounds, bounds2);
|
log.debug('Here Bounds', bounds, bounds2);
|
||||||
svg.attr(
|
svg.attr(
|
||||||
@@ -83,9 +78,6 @@ export const draw = async function (
|
|||||||
`${bounds2.x - 5} ${bounds2.y - 5} ${bounds2.width + 10} ${bounds2.height + 10}`
|
`${bounds2.x - 5} ${bounds2.y - 5} ${bounds2.width + 10} ${bounds2.height + 10}`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get color scheme for the graph
|
|
||||||
const colorScheme = d3scaleOrdinal(d3schemeTableau10);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|||||||
@@ -2,7 +2,8 @@ import type { BlockDB } from './blockDB.js';
|
|||||||
import type { Block } from './blockTypes.js';
|
import type { Block } from './blockTypes.js';
|
||||||
import { log } from '../../logger.js';
|
import { log } from '../../logger.js';
|
||||||
import { getConfig } from '../../diagram-api/diagramAPI.js';
|
import { getConfig } from '../../diagram-api/diagramAPI.js';
|
||||||
const padding = getConfig()?.block?.padding || 8;
|
// TODO: This means the number we provide in diagram's config will never be used. Should fix.
|
||||||
|
const padding = getConfig()?.block?.padding ?? 8;
|
||||||
|
|
||||||
interface BlockPosition {
|
interface BlockPosition {
|
||||||
px: number;
|
px: number;
|
||||||
@@ -42,7 +43,7 @@ const getMaxChildSize = (block: Block) => {
|
|||||||
// find max width of children
|
// find max width of children
|
||||||
// log.debug('getMaxChildSize abc95 (start) parent:', block.id);
|
// log.debug('getMaxChildSize abc95 (start) parent:', block.id);
|
||||||
for (const child of block.children) {
|
for (const child of block.children) {
|
||||||
const { width, height, x, y } = child.size || { width: 0, height: 0, x: 0, y: 0 };
|
const { width, height, x, y } = child.size ?? { width: 0, height: 0, x: 0, y: 0 };
|
||||||
log.debug(
|
log.debug(
|
||||||
'getMaxChildSize abc95 child:',
|
'getMaxChildSize abc95 child:',
|
||||||
child.id,
|
child.id,
|
||||||
@@ -60,7 +61,7 @@ const getMaxChildSize = (block: Block) => {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (width > maxWidth) {
|
if (width > maxWidth) {
|
||||||
maxWidth = width / (block.widthInColumns || 1);
|
maxWidth = width / (block.widthInColumns ?? 1);
|
||||||
}
|
}
|
||||||
if (height > maxHeight) {
|
if (height > maxHeight) {
|
||||||
maxHeight = height;
|
maxHeight = height;
|
||||||
@@ -104,10 +105,10 @@ function setBlockSizes(block: Block, db: BlockDB, siblingWidth = 0, siblingHeigh
|
|||||||
for (const child of block.children) {
|
for (const child of block.children) {
|
||||||
if (child.size) {
|
if (child.size) {
|
||||||
log.debug(
|
log.debug(
|
||||||
`abc95 Setting size of children of ${block.id} id=${child.id} ${maxWidth} ${maxHeight} ${child.size}`
|
`abc95 Setting size of children of ${block.id} id=${child.id} ${maxWidth} ${maxHeight} ${JSON.stringify(child.size)}`
|
||||||
);
|
);
|
||||||
child.size.width =
|
child.size.width =
|
||||||
maxWidth * (child.widthInColumns || 1) + padding * ((child.widthInColumns || 1) - 1);
|
maxWidth * (child.widthInColumns ?? 1) + padding * ((child.widthInColumns ?? 1) - 1);
|
||||||
child.size.height = maxHeight;
|
child.size.height = maxHeight;
|
||||||
child.size.x = 0;
|
child.size.x = 0;
|
||||||
child.size.y = 0;
|
child.size.y = 0;
|
||||||
@@ -121,10 +122,10 @@ function setBlockSizes(block: Block, db: BlockDB, siblingWidth = 0, siblingHeigh
|
|||||||
setBlockSizes(child, db, maxWidth, maxHeight);
|
setBlockSizes(child, db, maxWidth, maxHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
const columns = block.columns || -1;
|
const columns = block.columns ?? -1;
|
||||||
let numItems = 0;
|
let numItems = 0;
|
||||||
for (const child of block.children) {
|
for (const child of block.children) {
|
||||||
numItems += child.widthInColumns || 1;
|
numItems += child.widthInColumns ?? 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// The width and height in number blocks
|
// The width and height in number blocks
|
||||||
@@ -133,8 +134,6 @@ function setBlockSizes(block: Block, db: BlockDB, siblingWidth = 0, siblingHeigh
|
|||||||
xSize = columns;
|
xSize = columns;
|
||||||
}
|
}
|
||||||
|
|
||||||
const w = block.widthInColumns || 1;
|
|
||||||
|
|
||||||
const ySize = Math.ceil(numItems / xSize);
|
const ySize = Math.ceil(numItems / xSize);
|
||||||
|
|
||||||
let width = xSize * (maxWidth + padding) + padding;
|
let width = xSize * (maxWidth + padding) + padding;
|
||||||
@@ -206,13 +205,13 @@ function layoutBlocks(block: Block, db: BlockDB) {
|
|||||||
log.debug(
|
log.debug(
|
||||||
`abc85 layout blocks (=>layoutBlocks) ${block.id} x: ${block?.size?.x} y: ${block?.size?.y} width: ${block?.size?.width}`
|
`abc85 layout blocks (=>layoutBlocks) ${block.id} x: ${block?.size?.x} y: ${block?.size?.y} width: ${block?.size?.width}`
|
||||||
);
|
);
|
||||||
const columns = block.columns || -1;
|
const columns = block.columns ?? -1;
|
||||||
log.debug('layoutBlocks columns abc95', block.id, '=>', columns, block);
|
log.debug('layoutBlocks columns abc95', block.id, '=>', columns, block);
|
||||||
if (
|
if (
|
||||||
block.children && // find max width of children
|
block.children && // find max width of children
|
||||||
block.children.length > 0
|
block.children.length > 0
|
||||||
) {
|
) {
|
||||||
const width = block?.children[0]?.size?.width || 0;
|
const width = block?.children[0]?.size?.width ?? 0;
|
||||||
const widthOfChildren = block.children.length * width + (block.children.length - 1) * padding;
|
const widthOfChildren = block.children.length * width + (block.children.length - 1) * padding;
|
||||||
|
|
||||||
log.debug('widthOfChildren 88', widthOfChildren, 'posX');
|
log.debug('widthOfChildren 88', widthOfChildren, 'posX');
|
||||||
@@ -251,7 +250,7 @@ function layoutBlocks(block: Block, db: BlockDB) {
|
|||||||
} ${halfWidth} padding=${padding} width=${width} halfWidth=${halfWidth} => x:${
|
} ${halfWidth} padding=${padding} width=${width} halfWidth=${halfWidth} => x:${
|
||||||
child.size.x
|
child.size.x
|
||||||
} y:${child.size.y} ${child.widthInColumns} (width * (child?.w || 1)) / 2 ${
|
} y:${child.size.y} ${child.widthInColumns} (width * (child?.w || 1)) / 2 ${
|
||||||
(width * (child?.widthInColumns || 1)) / 2
|
(width * (child?.widthInColumns ?? 1)) / 2
|
||||||
}`
|
}`
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -265,15 +264,13 @@ function layoutBlocks(block: Block, db: BlockDB) {
|
|||||||
child.id
|
child.id
|
||||||
}startingPosX${startingPosX}${padding}${halfWidth}=>x:${child.size.x}y:${child.size.y}${
|
}startingPosX${startingPosX}${padding}${halfWidth}=>x:${child.size.x}y:${child.size.y}${
|
||||||
child.widthInColumns
|
child.widthInColumns
|
||||||
}(width * (child?.w || 1)) / 2${(width * (child?.widthInColumns || 1)) / 2}`
|
}(width * (child?.w || 1)) / 2${(width * (child?.widthInColumns ?? 1)) / 2}`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// posY += height + padding;
|
|
||||||
if (child.children) {
|
if (child.children) {
|
||||||
layoutBlocks(child, db);
|
layoutBlocks(child, db);
|
||||||
}
|
}
|
||||||
columnPos += child?.widthInColumns || 1;
|
columnPos += child?.widthInColumns ?? 1;
|
||||||
log.debug('abc88 columnsPos', child, columnPos);
|
log.debug('abc88 columnsPos', child, columnPos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
// @ts-ignore: jison doesn't export types
|
// @ts-ignore: jison doesn't export types
|
||||||
import block from './block.jison';
|
import block from './block.jison';
|
||||||
import db from '../blockDB.js';
|
import db from '../blockDB.js';
|
||||||
import { cleanupComments } from '../../../diagram-api/comments.js';
|
|
||||||
import { prepareTextForParsing } from '../blockUtils.js';
|
|
||||||
import { setConfig } from '../../../config.js';
|
|
||||||
|
|
||||||
describe('Block diagram', function () {
|
describe('Block diagram', function () {
|
||||||
describe('when parsing an block diagram graph it should handle > ', function () {
|
describe('when parsing an block diagram graph it should handle > ', function () {
|
||||||
@@ -13,7 +10,7 @@ describe('Block diagram', function () {
|
|||||||
block.parser.yy.getLogger = () => console;
|
block.parser.yy.getLogger = () => console;
|
||||||
});
|
});
|
||||||
|
|
||||||
it('a diagram with a node', async () => {
|
it('a diagram with a node', () => {
|
||||||
const str = `block-beta
|
const str = `block-beta
|
||||||
id
|
id
|
||||||
`;
|
`;
|
||||||
@@ -24,7 +21,7 @@ describe('Block diagram', function () {
|
|||||||
expect(blocks[0].id).toBe('id');
|
expect(blocks[0].id).toBe('id');
|
||||||
expect(blocks[0].label).toBe('id');
|
expect(blocks[0].label).toBe('id');
|
||||||
});
|
});
|
||||||
it('a node with a square shape and a label', async () => {
|
it('a node with a square shape and a label', () => {
|
||||||
const str = `block-beta
|
const str = `block-beta
|
||||||
id["A label"]
|
id["A label"]
|
||||||
`;
|
`;
|
||||||
@@ -36,7 +33,7 @@ describe('Block diagram', function () {
|
|||||||
expect(blocks[0].label).toBe('A label');
|
expect(blocks[0].label).toBe('A label');
|
||||||
expect(blocks[0].type).toBe('square');
|
expect(blocks[0].type).toBe('square');
|
||||||
});
|
});
|
||||||
it('a diagram with multiple nodes', async () => {
|
it('a diagram with multiple nodes', () => {
|
||||||
const str = `block-beta
|
const str = `block-beta
|
||||||
id1
|
id1
|
||||||
id2
|
id2
|
||||||
@@ -52,7 +49,7 @@ describe('Block diagram', function () {
|
|||||||
expect(blocks[1].label).toBe('id2');
|
expect(blocks[1].label).toBe('id2');
|
||||||
expect(blocks[1].type).toBe('na');
|
expect(blocks[1].type).toBe('na');
|
||||||
});
|
});
|
||||||
it('a diagram with multiple nodes', async () => {
|
it('a diagram with multiple nodes', () => {
|
||||||
const str = `block-beta
|
const str = `block-beta
|
||||||
id1
|
id1
|
||||||
id2
|
id2
|
||||||
@@ -73,7 +70,7 @@ describe('Block diagram', function () {
|
|||||||
expect(blocks[2].type).toBe('na');
|
expect(blocks[2].type).toBe('na');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('a node with a square shape and a label', async () => {
|
it('a node with a square shape and a label', () => {
|
||||||
const str = `block-beta
|
const str = `block-beta
|
||||||
id["A label"]
|
id["A label"]
|
||||||
id2`;
|
id2`;
|
||||||
@@ -88,7 +85,7 @@ describe('Block diagram', function () {
|
|||||||
expect(blocks[1].label).toBe('id2');
|
expect(blocks[1].label).toBe('id2');
|
||||||
expect(blocks[1].type).toBe('na');
|
expect(blocks[1].type).toBe('na');
|
||||||
});
|
});
|
||||||
it('a diagram with multiple nodes with edges abc123', async () => {
|
it('a diagram with multiple nodes with edges abc123', () => {
|
||||||
const str = `block-beta
|
const str = `block-beta
|
||||||
id1["first"] --> id2["second"]
|
id1["first"] --> id2["second"]
|
||||||
`;
|
`;
|
||||||
@@ -102,7 +99,7 @@ describe('Block diagram', function () {
|
|||||||
expect(edges[0].end).toBe('id2');
|
expect(edges[0].end).toBe('id2');
|
||||||
expect(edges[0].arrowTypeEnd).toBe('arrow_point');
|
expect(edges[0].arrowTypeEnd).toBe('arrow_point');
|
||||||
});
|
});
|
||||||
it('a diagram with multiple nodes with edges abc123', async () => {
|
it('a diagram with multiple nodes with edges abc123', () => {
|
||||||
const str = `block-beta
|
const str = `block-beta
|
||||||
id1["first"] -- "a label" --> id2["second"]
|
id1["first"] -- "a label" --> id2["second"]
|
||||||
`;
|
`;
|
||||||
@@ -117,7 +114,7 @@ describe('Block diagram', function () {
|
|||||||
expect(edges[0].arrowTypeEnd).toBe('arrow_point');
|
expect(edges[0].arrowTypeEnd).toBe('arrow_point');
|
||||||
expect(edges[0].label).toBe('a label');
|
expect(edges[0].label).toBe('a label');
|
||||||
});
|
});
|
||||||
it('a diagram with column statements', async () => {
|
it('a diagram with column statements', () => {
|
||||||
const str = `block-beta
|
const str = `block-beta
|
||||||
columns 2
|
columns 2
|
||||||
block1["Block 1"]
|
block1["Block 1"]
|
||||||
@@ -128,7 +125,7 @@ describe('Block diagram', function () {
|
|||||||
const blocks = db.getBlocks();
|
const blocks = db.getBlocks();
|
||||||
expect(blocks.length).toBe(1);
|
expect(blocks.length).toBe(1);
|
||||||
});
|
});
|
||||||
it('a diagram withput column statements', async () => {
|
it('a diagram withput column statements', () => {
|
||||||
const str = `block-beta
|
const str = `block-beta
|
||||||
block1["Block 1"]
|
block1["Block 1"]
|
||||||
`;
|
`;
|
||||||
@@ -138,7 +135,7 @@ describe('Block diagram', function () {
|
|||||||
const blocks = db.getBlocks();
|
const blocks = db.getBlocks();
|
||||||
expect(blocks.length).toBe(1);
|
expect(blocks.length).toBe(1);
|
||||||
});
|
});
|
||||||
it('a diagram with auto column statements', async () => {
|
it('a diagram with auto column statements', () => {
|
||||||
const str = `block-beta
|
const str = `block-beta
|
||||||
columns auto
|
columns auto
|
||||||
block1["Block 1"]
|
block1["Block 1"]
|
||||||
@@ -150,7 +147,7 @@ describe('Block diagram', function () {
|
|||||||
expect(blocks.length).toBe(1);
|
expect(blocks.length).toBe(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('blocks next to each other', async () => {
|
it('blocks next to each other', () => {
|
||||||
const str = `block-beta
|
const str = `block-beta
|
||||||
columns 2
|
columns 2
|
||||||
block1["Block 1"]
|
block1["Block 1"]
|
||||||
@@ -164,7 +161,7 @@ describe('Block diagram', function () {
|
|||||||
expect(blocks.length).toBe(2);
|
expect(blocks.length).toBe(2);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('blocks on top of each other', async () => {
|
it('blocks on top of each other', () => {
|
||||||
const str = `block-beta
|
const str = `block-beta
|
||||||
columns 1
|
columns 1
|
||||||
block1["Block 1"]
|
block1["Block 1"]
|
||||||
@@ -178,7 +175,7 @@ describe('Block diagram', function () {
|
|||||||
expect(blocks.length).toBe(2);
|
expect(blocks.length).toBe(2);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('compound blocks 2', async () => {
|
it('compound blocks 2', () => {
|
||||||
const str = `block-beta
|
const str = `block-beta
|
||||||
block
|
block
|
||||||
aBlock["ABlock"]
|
aBlock["ABlock"]
|
||||||
@@ -206,7 +203,7 @@ describe('Block diagram', function () {
|
|||||||
expect(bBlock.label).toBe('BBlock');
|
expect(bBlock.label).toBe('BBlock');
|
||||||
expect(bBlock.type).toBe('square');
|
expect(bBlock.type).toBe('square');
|
||||||
});
|
});
|
||||||
it('compound blocks of compound blocks', async () => {
|
it('compound blocks of compound blocks', () => {
|
||||||
const str = `block-beta
|
const str = `block-beta
|
||||||
block
|
block
|
||||||
aBlock["ABlock"]
|
aBlock["ABlock"]
|
||||||
@@ -241,7 +238,7 @@ describe('Block diagram', function () {
|
|||||||
expect(bBlock.label).toBe('BBlock');
|
expect(bBlock.label).toBe('BBlock');
|
||||||
expect(bBlock.type).toBe('square');
|
expect(bBlock.type).toBe('square');
|
||||||
});
|
});
|
||||||
it('compound blocks with title', async () => {
|
it('compound blocks with title', () => {
|
||||||
const str = `block-beta
|
const str = `block-beta
|
||||||
block:compoundBlock["Compound block"]
|
block:compoundBlock["Compound block"]
|
||||||
columns 1
|
columns 1
|
||||||
@@ -266,7 +263,7 @@ describe('Block diagram', function () {
|
|||||||
expect(block2.label).toBe('Block 2');
|
expect(block2.label).toBe('Block 2');
|
||||||
expect(block2.type).toBe('square');
|
expect(block2.type).toBe('square');
|
||||||
});
|
});
|
||||||
it('blocks mixed with compound blocks', async () => {
|
it('blocks mixed with compound blocks', () => {
|
||||||
const str = `block-beta
|
const str = `block-beta
|
||||||
columns 1
|
columns 1
|
||||||
block1["Block 1"]
|
block1["Block 1"]
|
||||||
@@ -293,7 +290,7 @@ describe('Block diagram', function () {
|
|||||||
expect(block2.type).toBe('square');
|
expect(block2.type).toBe('square');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Arrow blocks', async () => {
|
it('Arrow blocks', () => {
|
||||||
const str = `block-beta
|
const str = `block-beta
|
||||||
columns 3
|
columns 3
|
||||||
block1["Block 1"]
|
block1["Block 1"]
|
||||||
@@ -317,7 +314,7 @@ describe('Block diagram', function () {
|
|||||||
expect(blockArrow.type).toBe('block_arrow');
|
expect(blockArrow.type).toBe('block_arrow');
|
||||||
expect(blockArrow.directions).toContain('right');
|
expect(blockArrow.directions).toContain('right');
|
||||||
});
|
});
|
||||||
it('Arrow blocks with multiple points', async () => {
|
it('Arrow blocks with multiple points', () => {
|
||||||
const str = `block-beta
|
const str = `block-beta
|
||||||
columns 1
|
columns 1
|
||||||
A
|
A
|
||||||
@@ -340,7 +337,7 @@ describe('Block diagram', function () {
|
|||||||
expect(blockArrow.directions).toContain('down');
|
expect(blockArrow.directions).toContain('down');
|
||||||
expect(blockArrow.directions).not.toContain('right');
|
expect(blockArrow.directions).not.toContain('right');
|
||||||
});
|
});
|
||||||
it('blocks with different widths', async () => {
|
it('blocks with different widths', () => {
|
||||||
const str = `block-beta
|
const str = `block-beta
|
||||||
columns 3
|
columns 3
|
||||||
one["One Slot"]
|
one["One Slot"]
|
||||||
@@ -355,7 +352,7 @@ describe('Block diagram', function () {
|
|||||||
const two = blocks[1];
|
const two = blocks[1];
|
||||||
expect(two.widthInColumns).toBe(2);
|
expect(two.widthInColumns).toBe(2);
|
||||||
});
|
});
|
||||||
it('empty blocks', async () => {
|
it('empty blocks', () => {
|
||||||
const str = `block-beta
|
const str = `block-beta
|
||||||
columns 3
|
columns 3
|
||||||
space
|
space
|
||||||
@@ -374,7 +371,7 @@ describe('Block diagram', function () {
|
|||||||
expect(sp2.type).toBe('space');
|
expect(sp2.type).toBe('space');
|
||||||
expect(middle.label).toBe('In the middle');
|
expect(middle.label).toBe('In the middle');
|
||||||
});
|
});
|
||||||
it('classDef statements applied to a block', async () => {
|
it('classDef statements applied to a block', () => {
|
||||||
const str = `block-beta
|
const str = `block-beta
|
||||||
classDef black color:#ffffff, fill:#000000;
|
classDef black color:#ffffff, fill:#000000;
|
||||||
|
|
||||||
@@ -392,7 +389,7 @@ describe('Block diagram', function () {
|
|||||||
expect(black.id).toBe('black');
|
expect(black.id).toBe('black');
|
||||||
expect(black.styles[0]).toEqual('color:#ffffff');
|
expect(black.styles[0]).toEqual('color:#ffffff');
|
||||||
});
|
});
|
||||||
it('style statements applied to a block', async () => {
|
it('style statements applied to a block', () => {
|
||||||
const str = `block-beta
|
const str = `block-beta
|
||||||
columns 1
|
columns 1
|
||||||
B["A wide one in the middle"]
|
B["A wide one in the middle"]
|
||||||
|
|||||||
@@ -11,14 +11,13 @@ function getNodeFromBlock(block: Block, db: BlockDB, positioned = false) {
|
|||||||
|
|
||||||
let classStr = 'default';
|
let classStr = 'default';
|
||||||
if ((vertex?.classes?.length || 0) > 0) {
|
if ((vertex?.classes?.length || 0) > 0) {
|
||||||
classStr = (vertex?.classes || []).join(' ');
|
classStr = (vertex?.classes ?? []).join(' ');
|
||||||
}
|
}
|
||||||
classStr = classStr + ' flowchart-label';
|
classStr = classStr + ' flowchart-label';
|
||||||
|
|
||||||
// We create a SVG label, either by delegating to addHtmlLabel or manually
|
// We create a SVG label, either by delegating to addHtmlLabel or manually
|
||||||
let radius = 0;
|
let radius = 0;
|
||||||
let shape = '';
|
let shape = '';
|
||||||
let layoutOptions = {};
|
|
||||||
let padding;
|
let padding;
|
||||||
// Set the shape based parameters
|
// Set the shape based parameters
|
||||||
switch (vertex.type) {
|
switch (vertex.type) {
|
||||||
@@ -36,9 +35,6 @@ function getNodeFromBlock(block: Block, db: BlockDB, positioned = false) {
|
|||||||
break;
|
break;
|
||||||
case 'diamond':
|
case 'diamond':
|
||||||
shape = 'question';
|
shape = 'question';
|
||||||
layoutOptions = {
|
|
||||||
portConstraints: 'FIXED_SIDE',
|
|
||||||
};
|
|
||||||
break;
|
break;
|
||||||
case 'hexagon':
|
case 'hexagon':
|
||||||
shape = 'hexagon';
|
shape = 'hexagon';
|
||||||
@@ -89,12 +85,12 @@ function getNodeFromBlock(block: Block, db: BlockDB, positioned = false) {
|
|||||||
shape = 'rect';
|
shape = 'rect';
|
||||||
}
|
}
|
||||||
|
|
||||||
const styles = getStylesFromArray(vertex?.styles || []);
|
const styles = getStylesFromArray(vertex?.styles ?? []);
|
||||||
|
|
||||||
// Use vertex id as text in the box if no text is provided by the graph definition
|
// Use vertex id as text in the box if no text is provided by the graph definition
|
||||||
const vertexText = vertex.label;
|
const vertexText = vertex.label;
|
||||||
|
|
||||||
const bounds = vertex.size || { width: 0, height: 0, x: 0, y: 0 };
|
const bounds = vertex.size ?? { width: 0, height: 0, x: 0, y: 0 };
|
||||||
// Add the node
|
// Add the node
|
||||||
const node = {
|
const node = {
|
||||||
labelStyle: styles.labelStyle,
|
labelStyle: styles.labelStyle,
|
||||||
@@ -113,7 +109,7 @@ function getNodeFromBlock(block: Block, db: BlockDB, positioned = false) {
|
|||||||
positioned,
|
positioned,
|
||||||
intersect: undefined,
|
intersect: undefined,
|
||||||
type: vertex.type,
|
type: vertex.type,
|
||||||
padding: padding ?? (getConfig()?.block?.padding || 0),
|
padding: padding ?? getConfig()?.block?.padding ?? 0,
|
||||||
};
|
};
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
@@ -142,7 +138,7 @@ export async function insertBlockPositioned(elem: any, block: Block, db: any) {
|
|||||||
// Add the element to the DOM to size it
|
// Add the element to the DOM to size it
|
||||||
const obj = db.getBlock(node.id);
|
const obj = db.getBlock(node.id);
|
||||||
if (obj.type !== 'space') {
|
if (obj.type !== 'space') {
|
||||||
const nodeEl = await insertNode(elem, node);
|
await insertNode(elem, node);
|
||||||
block.intersect = node?.intersect;
|
block.intersect = node?.intersect;
|
||||||
positionNode(node);
|
positionNode(node);
|
||||||
}
|
}
|
||||||
@@ -218,7 +214,7 @@ export async function insertEdges(
|
|||||||
{ x: end.x, y: end.y },
|
{ x: end.x, y: end.y },
|
||||||
];
|
];
|
||||||
// edge.points = points;
|
// edge.points = points;
|
||||||
await insertEdge(
|
insertEdge(
|
||||||
elem,
|
elem,
|
||||||
{ v: edge.start, w: edge.end, name: edge.id },
|
{ v: edge.start, w: edge.end, name: edge.id },
|
||||||
{
|
{
|
||||||
@@ -243,7 +239,7 @@ export async function insertEdges(
|
|||||||
points,
|
points,
|
||||||
classes: 'edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1',
|
classes: 'edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1',
|
||||||
});
|
});
|
||||||
await positionEdgeLabel(
|
positionEdgeLabel(
|
||||||
{ ...edge, x: points[1].x, y: points[1].y },
|
{ ...edge, x: points[1].x, y: points[1].y },
|
||||||
{
|
{
|
||||||
originalPath: points,
|
originalPath: points,
|
||||||
|
|||||||
@@ -258,21 +258,21 @@ export const drawC4ShapeArray = function (currentBounds, diagram, c4ShapeArray,
|
|||||||
c4ShapeLabelConf.fontSize = c4ShapeLabelConf.fontSize + 2;
|
c4ShapeLabelConf.fontSize = c4ShapeLabelConf.fontSize + 2;
|
||||||
c4ShapeLabelConf.fontWeight = 'bold';
|
c4ShapeLabelConf.fontWeight = 'bold';
|
||||||
calcC4ShapeTextWH('label', c4Shape, c4ShapeTextWrap, c4ShapeLabelConf, textLimitWidth);
|
calcC4ShapeTextWH('label', c4Shape, c4ShapeTextWrap, c4ShapeLabelConf, textLimitWidth);
|
||||||
c4Shape['label'].Y = Y + 8;
|
c4Shape.label.Y = Y + 8;
|
||||||
Y = c4Shape['label'].Y + c4Shape['label'].height;
|
Y = c4Shape.label.Y + c4Shape.label.height;
|
||||||
|
|
||||||
if (c4Shape.type && c4Shape.type.text !== '') {
|
if (c4Shape.type && c4Shape.type.text !== '') {
|
||||||
c4Shape.type.text = '[' + c4Shape.type.text + ']';
|
c4Shape.type.text = '[' + c4Shape.type.text + ']';
|
||||||
let c4ShapeTypeConf = c4ShapeFont(conf, c4Shape.typeC4Shape.text);
|
let c4ShapeTypeConf = c4ShapeFont(conf, c4Shape.typeC4Shape.text);
|
||||||
calcC4ShapeTextWH('type', c4Shape, c4ShapeTextWrap, c4ShapeTypeConf, textLimitWidth);
|
calcC4ShapeTextWH('type', c4Shape, c4ShapeTextWrap, c4ShapeTypeConf, textLimitWidth);
|
||||||
c4Shape['type'].Y = Y + 5;
|
c4Shape.type.Y = Y + 5;
|
||||||
Y = c4Shape['type'].Y + c4Shape['type'].height;
|
Y = c4Shape.type.Y + c4Shape.type.height;
|
||||||
} else if (c4Shape.techn && c4Shape.techn.text !== '') {
|
} else if (c4Shape.techn && c4Shape.techn.text !== '') {
|
||||||
c4Shape.techn.text = '[' + c4Shape.techn.text + ']';
|
c4Shape.techn.text = '[' + c4Shape.techn.text + ']';
|
||||||
let c4ShapeTechnConf = c4ShapeFont(conf, c4Shape.techn.text);
|
let c4ShapeTechnConf = c4ShapeFont(conf, c4Shape.techn.text);
|
||||||
calcC4ShapeTextWH('techn', c4Shape, c4ShapeTextWrap, c4ShapeTechnConf, textLimitWidth);
|
calcC4ShapeTextWH('techn', c4Shape, c4ShapeTextWrap, c4ShapeTechnConf, textLimitWidth);
|
||||||
c4Shape['techn'].Y = Y + 5;
|
c4Shape.techn.Y = Y + 5;
|
||||||
Y = c4Shape['techn'].Y + c4Shape['techn'].height;
|
Y = c4Shape.techn.Y + c4Shape.techn.height;
|
||||||
}
|
}
|
||||||
|
|
||||||
let rectHeight = Y;
|
let rectHeight = Y;
|
||||||
@@ -281,11 +281,11 @@ export const drawC4ShapeArray = function (currentBounds, diagram, c4ShapeArray,
|
|||||||
if (c4Shape.descr && c4Shape.descr.text !== '') {
|
if (c4Shape.descr && c4Shape.descr.text !== '') {
|
||||||
let c4ShapeDescrConf = c4ShapeFont(conf, c4Shape.typeC4Shape.text);
|
let c4ShapeDescrConf = c4ShapeFont(conf, c4Shape.typeC4Shape.text);
|
||||||
calcC4ShapeTextWH('descr', c4Shape, c4ShapeTextWrap, c4ShapeDescrConf, textLimitWidth);
|
calcC4ShapeTextWH('descr', c4Shape, c4ShapeTextWrap, c4ShapeDescrConf, textLimitWidth);
|
||||||
c4Shape['descr'].Y = Y + 20;
|
c4Shape.descr.Y = Y + 20;
|
||||||
Y = c4Shape['descr'].Y + c4Shape['descr'].height;
|
Y = c4Shape.descr.Y + c4Shape.descr.height;
|
||||||
|
|
||||||
rectWidth = Math.max(c4Shape.label.width, c4Shape.descr.width);
|
rectWidth = Math.max(c4Shape.label.width, c4Shape.descr.width);
|
||||||
rectHeight = Y - c4Shape['descr'].textLines * 5;
|
rectHeight = Y - c4Shape.descr.textLines * 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
rectWidth = rectWidth + conf.c4ShapePadding;
|
rectWidth = rectWidth + conf.c4ShapePadding;
|
||||||
@@ -482,8 +482,8 @@ function drawInsideBoundary(
|
|||||||
currentBoundaryLabelConf,
|
currentBoundaryLabelConf,
|
||||||
currentBounds.data.widthLimit
|
currentBounds.data.widthLimit
|
||||||
);
|
);
|
||||||
currentBoundary['label'].Y = Y + 8;
|
currentBoundary.label.Y = Y + 8;
|
||||||
Y = currentBoundary['label'].Y + currentBoundary['label'].height;
|
Y = currentBoundary.label.Y + currentBoundary.label.height;
|
||||||
|
|
||||||
if (currentBoundary.type && currentBoundary.type.text !== '') {
|
if (currentBoundary.type && currentBoundary.type.text !== '') {
|
||||||
currentBoundary.type.text = '[' + currentBoundary.type.text + ']';
|
currentBoundary.type.text = '[' + currentBoundary.type.text + ']';
|
||||||
@@ -495,8 +495,8 @@ function drawInsideBoundary(
|
|||||||
currentBoundaryTypeConf,
|
currentBoundaryTypeConf,
|
||||||
currentBounds.data.widthLimit
|
currentBounds.data.widthLimit
|
||||||
);
|
);
|
||||||
currentBoundary['type'].Y = Y + 5;
|
currentBoundary.type.Y = Y + 5;
|
||||||
Y = currentBoundary['type'].Y + currentBoundary['type'].height;
|
Y = currentBoundary.type.Y + currentBoundary.type.height;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (currentBoundary.descr && currentBoundary.descr.text !== '') {
|
if (currentBoundary.descr && currentBoundary.descr.text !== '') {
|
||||||
@@ -509,8 +509,8 @@ function drawInsideBoundary(
|
|||||||
currentBoundaryDescrConf,
|
currentBoundaryDescrConf,
|
||||||
currentBounds.data.widthLimit
|
currentBounds.data.widthLimit
|
||||||
);
|
);
|
||||||
currentBoundary['descr'].Y = Y + 20;
|
currentBoundary.descr.Y = Y + 20;
|
||||||
Y = currentBoundary['descr'].Y + currentBoundary['descr'].height;
|
Y = currentBoundary.descr.Y + currentBoundary.descr.height;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i == 0 || i % c4BoundaryInRow === 0) {
|
if (i == 0 || i % c4BoundaryInRow === 0) {
|
||||||
|
|||||||
@@ -256,7 +256,7 @@ boundaryStartStatement
|
|||||||
|
|
||||||
boundaryStart
|
boundaryStart
|
||||||
: ENTERPRISE_BOUNDARY attributes {$2.splice(2, 0, 'ENTERPRISE'); yy.addPersonOrSystemBoundary(...$2); $$=$2;}
|
: ENTERPRISE_BOUNDARY attributes {$2.splice(2, 0, 'ENTERPRISE'); yy.addPersonOrSystemBoundary(...$2); $$=$2;}
|
||||||
| SYSTEM_BOUNDARY attributes {$2.splice(2, 0, 'ENTERPRISE'); yy.addPersonOrSystemBoundary(...$2); $$=$2;}
|
| SYSTEM_BOUNDARY attributes {$2.splice(2, 0, 'SYSTEM'); yy.addPersonOrSystemBoundary(...$2); $$=$2;}
|
||||||
| BOUNDARY attributes {yy.addPersonOrSystemBoundary(...$2); $$=$2;}
|
| BOUNDARY attributes {yy.addPersonOrSystemBoundary(...$2); $$=$2;}
|
||||||
| CONTAINER_BOUNDARY attributes {$2.splice(2, 0, 'CONTAINER'); yy.addContainerBoundary(...$2); $$=$2;}
|
| CONTAINER_BOUNDARY attributes {$2.splice(2, 0, 'CONTAINER'); yy.addContainerBoundary(...$2); $$=$2;}
|
||||||
| NODE attributes {yy.addDeploymentNode('node', ...$2); $$=$2;}
|
| NODE attributes {yy.addDeploymentNode('node', ...$2); $$=$2;}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user