mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-28 07:03:17 +08:00
refactor: fix addVertex
type
parameter
I went through `packages/mermaid/src/diagrams/flowchart/parser/flow.jison` and found every possible value this `type` parameter could be.
This commit is contained in:
parent
7fa8b35bdc
commit
17e2f9e0d4
@ -14,7 +14,15 @@ import {
|
||||
setDiagramTitle,
|
||||
getDiagramTitle,
|
||||
} from '../common/commonDb.js';
|
||||
import type { FlowVertex, FlowClass, FlowSubGraph, FlowText, FlowEdge, FlowLink } from './types.js';
|
||||
import type {
|
||||
FlowVertex,
|
||||
FlowClass,
|
||||
FlowSubGraph,
|
||||
FlowText,
|
||||
FlowEdge,
|
||||
FlowLink,
|
||||
FlowVertexTypeParam,
|
||||
} from './types.js';
|
||||
import type { NodeMetaData } from '../../types.js';
|
||||
|
||||
const MERMAID_DOM_ID_PREFIX = 'flowchart-';
|
||||
@ -53,12 +61,11 @@ export const lookUpDomId = function (id: string) {
|
||||
|
||||
/**
|
||||
* Function called by parser when a node definition has been found
|
||||
*
|
||||
*/
|
||||
export const addVertex = function (
|
||||
id: string,
|
||||
textObj: FlowText,
|
||||
type: 'group',
|
||||
type: FlowVertexTypeParam,
|
||||
style: string[],
|
||||
classes: string[],
|
||||
dir: string,
|
||||
|
@ -1,3 +1,26 @@
|
||||
/**
|
||||
* Valid `type` args to `yy.addVertex` taken from
|
||||
* `packages/mermaid/src/diagrams/flowchart/parser/flow.jison`
|
||||
*/
|
||||
export type FlowVertexTypeParam =
|
||||
| undefined
|
||||
| 'square'
|
||||
| 'doublecircle'
|
||||
| 'circle'
|
||||
| 'ellipse'
|
||||
| 'stadium'
|
||||
| 'subroutine'
|
||||
| 'rect'
|
||||
| 'cylinder'
|
||||
| 'round'
|
||||
| 'diamond'
|
||||
| 'hexagon'
|
||||
| 'odd'
|
||||
| 'trapezoid'
|
||||
| 'inv_trapezoid'
|
||||
| 'lean_right'
|
||||
| 'lean_left';
|
||||
|
||||
export interface FlowVertex {
|
||||
classes: string[];
|
||||
dir?: string;
|
||||
|
Loading…
x
Reference in New Issue
Block a user