mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-08-15 14:29:25 +02:00
create missing type
This commit is contained in:
@@ -15,6 +15,7 @@ import {
|
|||||||
getDiagramTitle,
|
getDiagramTitle,
|
||||||
} from '../common/commonDb.js';
|
} from '../common/commonDb.js';
|
||||||
import type { FlowVertex, FlowClass, FlowSubGraph, FlowText, FlowEdge, FlowLink } from './types.js';
|
import type { FlowVertex, FlowClass, FlowSubGraph, FlowText, FlowEdge, FlowLink } from './types.js';
|
||||||
|
import type { NodeMetaData } from '$root/types.js';
|
||||||
|
|
||||||
const MERMAID_DOM_ID_PREFIX = 'flowchart-';
|
const MERMAID_DOM_ID_PREFIX = 'flowchart-';
|
||||||
let vertexCounter = 0;
|
let vertexCounter = 0;
|
||||||
@@ -135,7 +136,7 @@ export const addVertex = function (
|
|||||||
yamlData = yamlData.substring(0, lastPos) + '\n';
|
yamlData = yamlData.substring(0, lastPos) + '\n';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const doc = yaml.load(yamlData, { schema: yaml.JSON_SCHEMA });
|
const doc = yaml.load(yamlData, { schema: yaml.JSON_SCHEMA }) as NodeMetaData;
|
||||||
// console.log('yamlData doc', doc);
|
// console.log('yamlData doc', doc);
|
||||||
if (doc?.shape) {
|
if (doc?.shape) {
|
||||||
vertex.type = doc?.shape;
|
vertex.type = doc?.shape;
|
||||||
|
@@ -1,3 +1,7 @@
|
|||||||
|
export interface NodeMetaData {
|
||||||
|
shape?: string;
|
||||||
|
label?: string;
|
||||||
|
}
|
||||||
export interface Point {
|
export interface Point {
|
||||||
x: number;
|
x: number;
|
||||||
y: number;
|
y: number;
|
||||||
|
Reference in New Issue
Block a user