@zsviczian/mermaid-to-excalidraw
Advanced tools
Comparing version 0.1.1-obsidian-6 to 0.1.1-obsidian-7
export interface MermaidOptions { | ||
fontSize?: number; | ||
} | ||
declare const parseMermaidToExcalidraw: (definition: string, options?: MermaidOptions) => Promise<import("./interfaces.js").MermaidToExcalidrawResult>; | ||
declare const parseMermaidToExcalidraw: (definition: string, options?: MermaidOptions, forceSVG?: boolean) => Promise<import("./interfaces.js").MermaidToExcalidrawResult>; | ||
export { parseMermaidToExcalidraw }; |
import { graphToExcalidraw } from "./graphToExcalidraw.js"; | ||
import { parseMermaid } from "./parseMermaid.js"; | ||
const parseMermaidToExcalidraw = async (definition, options = {}) => { | ||
const parsedMermaidData = await parseMermaid(definition); | ||
const parseMermaidToExcalidraw = async (definition, options = {}, forceSVG = false) => { | ||
const parsedMermaidData = await parseMermaid(definition, forceSVG); //zsviczian | ||
const excalidrawElements = graphToExcalidraw(parsedMermaidData, options); | ||
@@ -6,0 +6,0 @@ return excalidrawElements; |
@@ -9,2 +9,2 @@ import { GraphImage } from "./interfaces.js"; | ||
} | ||
export declare const parseMermaid: (definition: string) => Promise<Flowchart | GraphImage | Sequence>; | ||
export declare const parseMermaid: (definition: string, forceSVG?: boolean) => Promise<Flowchart | GraphImage | Sequence>; |
@@ -37,3 +37,4 @@ //import { DEFAULT_FONT_SIZE } from "./constants.js"; //zsviczian | ||
}; | ||
export const parseMermaid = async (definition) => { | ||
export const parseMermaid = async (definition, forceSVG = false //zsviczian | ||
) => { | ||
/*mermaid.initialize({ | ||
@@ -56,2 +57,4 @@ startOnLoad: false, | ||
document.body.appendChild(svgContainer); | ||
if (forceSVG) | ||
return convertSvgToGraphImage(svgContainer); //zsviczian | ||
let data; | ||
@@ -58,0 +61,0 @@ switch (diagram.type) { |
{ | ||
"name": "@zsviczian/mermaid-to-excalidraw", | ||
"version": "0.1.1-obsidian-6", | ||
"version": "0.1.1-obsidian-7", | ||
"description": "Mermaid to Excalidraw Diagrams", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
116952
2062