CoolFace
Datasetpublic

basant307/AI_Governance_Project

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes48downloads
createText.d.ts36 linesDownload Raw Back to rendering-util
1import type { MermaidConfig } from '../config.type.js';2import type { SVGGroup } from '../diagram-api/types.js';3import type { D3Selection } from '../types.js';4export declare function computeDimensionOfText(parentNode: SVGGroup, lineHeight: number, text: string): DOMRect | undefined;5/**6 * Convert fontawesome labels into fontawesome icons by using a regex pattern7 * @param text - The raw string to convert8 * @param config - Mermaid config9 * @returns string with fontawesome icons as svg if the icon is registered otherwise as i tags10 */11export declare function replaceIconSubstring(text: string, config?: MermaidConfig): Promise<string>;12/**13 * Creates a text element within the given SVG group element.14 *15 * If `markdown` is `true`, basic markdown syntax will be processed.16 * Otherwise, if:17 *   - `useHtmlLabels` is `true`, the text will be sanitized and set in `<foreignObject>` as HTML.18 *   - `useHtmlLabels` is `false`, the text will be added as a `<text>` element using `.text`19 *20 * @param el - The parent SVG `<g>` element to append the text element to.21 * @param text - The text content to be displayed.22 * @param options - Optional options23 * @param config - Mermaid configuration object24 * @returns The created text element, either a `<foreignObject>` or a `<text>` element depending on the options.25 */26export declare const createText: (el: D3Selection<SVGGElement>, text?: string, { style, isTitle, classes, useHtmlLabels, markdown, isNode, width, addSvgBackground, }?: {27    style?: string | undefined;28    isTitle?: boolean | undefined;29    classes?: string | undefined;30    useHtmlLabels?: boolean | undefined;31    markdown?: boolean | undefined;32    isNode?: boolean | undefined;33    width?: number | undefined;34    addSvgBackground?: boolean | undefined;35}, config?: MermaidConfig) => Promise<SVGGElement>;36 
basant307/AI_Governance_Project · CoolFace