chore: Deprecate mermaidAPI
This commit is contained in:
parent
00d06c7282
commit
fcd983d915
|
@ -33,70 +33,9 @@ Renames and re-exports [mermaidAPI](mermaidAPI.md#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)) => `Promise`<`boolean`> ; `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,
|
||||
|
||||
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:662](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L662)
|
||||
[mermaidAPI.ts:602](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L602)
|
||||
|
||||
## Functions
|
||||
|
||||
|
|
|
@ -393,9 +393,16 @@ const render = (id: string, text: string, container?: Element): Promise<RenderRe
|
|||
export interface Mermaid {
|
||||
startOnLoad: boolean;
|
||||
parseError?: ParseErrorFunction;
|
||||
/**
|
||||
* @deprecated Use {@link parse} and {@link render} instead.
|
||||
* @internal
|
||||
*/
|
||||
mermaidAPI: typeof mermaidAPI;
|
||||
parse: typeof parse;
|
||||
render: typeof render;
|
||||
/**
|
||||
* @deprecated Use {@link initialize} and {@link run} instead.
|
||||
*/
|
||||
init: typeof init;
|
||||
run: typeof run;
|
||||
registerExternalDiagrams: typeof registerExternalDiagrams;
|
||||
|
|
|
@ -597,68 +597,8 @@ function addA11yInfo(
|
|||
}
|
||||
|
||||
/**
|
||||
* ## mermaidAPI configuration defaults
|
||||
*
|
||||
* ```ts
|
||||
* const config = {
|
||||
* theme: 'default',
|
||||
* logLevel: 'fatal',
|
||||
* securityLevel: 'strict',
|
||||
* startOnLoad: true,
|
||||
* arrowMarkerAbsolute: 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);
|
||||
* ```
|
||||
* @internal
|
||||
*/
|
||||
|
||||
export const mermaidAPI = Object.freeze({
|
||||
render,
|
||||
parse,
|
||||
|
|
Loading…
Reference in New Issue