UNPKG

50.3 kBTypeScriptView Raw
1import { InjectionToken } from '@angular/core';
2export declare const MERMAID_OPTIONS: InjectionToken<MermaidAPI.MermaidConfig>;
3export declare namespace MermaidAPI {
4 /**
5 * JavaScript function that returns a `FontConfig`.
6 *
7 * By default, these return the appropriate `*FontSize`, `*FontFamily`, `*FontWeight`
8 * values.
9 *
10 * For example, the font calculator called `boundaryFont` might be defined as:
11 *
12 * ```javascript
13 * boundaryFont: function () {
14 * return {
15 * fontFamily: this.boundaryFontFamily,
16 * fontSize: this.boundaryFontSize,
17 * fontWeight: this.boundaryFontWeight,
18 * };
19 * }
20 * ```
21 *
22 *
23 * This interface was referenced by `MermaidConfig`'s JSON-Schema
24 * via the `definition` "FontCalculator".
25 */
26 type FontCalculator = () => Partial<FontConfig>;
27 /**
28 * Picks the color of the sankey diagram links, using the colors of the source and/or target of the links.
29 *
30 *
31 * This interface was referenced by `MermaidConfig`'s JSON-Schema
32 * via the `definition` "SankeyLinkColor".
33 */
34 type SankeyLinkColor = 'source' | 'target' | 'gradient';
35 /**
36 * Controls the alignment of the Sankey diagrams.
37 *
38 * See <https://github.com/d3/d3-sankey#alignments>.
39 *
40 *
41 * This interface was referenced by `MermaidConfig`'s JSON-Schema
42 * via the `definition` "SankeyNodeAlignment".
43 */
44 type SankeyNodeAlignment = 'left' | 'right' | 'center' | 'justify';
45 /**
46 * The font size to use
47 */
48 type CSSFontSize = string | number;
49 interface MermaidConfig {
50 /**
51 * Theme, the CSS style sheet.
52 * You may also use `themeCSS` to override this value.
53 *
54 */
55 theme?: 'default' | 'base' | 'dark' | 'forest' | 'neutral' | 'null';
56 themeVariables?: any;
57 themeCSS?: string;
58 /**
59 * Defines which main look to use for the diagram.
60 *
61 */
62 look?: 'classic' | 'handDrawn';
63 /**
64 * Defines the seed to be used when using handDrawn look. This is important for the automated tests as they will always find differences without the seed. The default value is 0 which gives a random seed.
65 *
66 */
67 handDrawnSeed?: number;
68 /**
69 * Defines which layout algorithm to use for rendering the diagram.
70 *
71 */
72 layout?: string;
73 /**
74 * The maximum allowed size of the users text diagram
75 */
76 maxTextSize?: number;
77 /**
78 * Defines the maximum number of edges that can be drawn in a graph.
79 *
80 */
81 maxEdges?: number;
82 elk?: {
83 /**
84 * Elk specific option that allows edges to share path where it convenient. It can make for pretty diagrams but can also make it harder to read the diagram.
85 *
86 */
87 mergeEdges?: boolean;
88 /**
89 * Elk specific option affecting how nodes are placed.
90 *
91 */
92 nodePlacementStrategy?: 'SIMPLE' | 'NETWORK_SIMPLEX' | 'LINEAR_SEGMENTS' | 'BRANDES_KOEPF';
93 /**
94 * This strategy decides how to find cycles in the graph and deciding which edges need adjustment to break loops.
95 *
96 */
97 cycleBreakingStrategy?: 'GREEDY' | 'DEPTH_FIRST' | 'INTERACTIVE' | 'MODEL_ORDER' | 'GREEDY_MODEL_ORDER';
98 };
99 darkMode?: boolean;
100 htmlLabels?: boolean;
101 /**
102 * Specifies the font to be used in the rendered diagrams.
103 * Can be any possible CSS `font-family`.
104 * See https://developer.mozilla.org/en-US/docs/Web/CSS/font-family
105 *
106 */
107 fontFamily?: string;
108 altFontFamily?: string;
109 /**
110 * This option decides the amount of logging to be used by mermaid.
111 *
112 */
113 logLevel?: 'trace' | 0 | 'debug' | 1 | 'info' | 2 | 'warn' | 3 | 'error' | 4 | 'fatal' | 5;
114 /**
115 * Level of trust for parsed diagram
116 */
117 securityLevel?: 'strict' | 'loose' | 'antiscript' | 'sandbox';
118 /**
119 * Dictates whether mermaid starts on Page load
120 */
121 startOnLoad?: boolean;
122 /**
123 * Controls whether or arrow markers in html code are absolute paths or anchors.
124 * This matters if you are using base tag settings.
125 *
126 */
127 arrowMarkerAbsolute?: boolean;
128 /**
129 * This option controls which `currentConfig` keys are considered secure and
130 * can only be changed via call to `mermaid.initialize`.
131 * This prevents malicious graph directives from overriding a site's default security.
132 *
133 */
134 secure?: string[];
135 /**
136 * This option specifies if Mermaid can expect the dependent to include KaTeX stylesheets for browsers
137 * without their own MathML implementation. If this option is disabled and MathML is not supported, the math
138 * equations are replaced with a warning. If this option is enabled and MathML is not supported, Mermaid will
139 * fall back to legacy rendering for KaTeX.
140 *
141 */
142 legacyMathML?: boolean;
143 /**
144 * This option forces Mermaid to rely on KaTeX's own stylesheet for rendering MathML. Due to differences between OS
145 * fonts and browser's MathML implementation, this option is recommended if consistent rendering is important.
146 * If set to true, ignores legacyMathML.
147 *
148 */
149 forceLegacyMathML?: boolean;
150 /**
151 * This option controls if the generated ids of nodes in the SVG are
152 * generated randomly or based on a seed.
153 * If set to `false`, the IDs are generated based on the current date and
154 * thus are not deterministic. This is the default behavior.
155 *
156 * This matters if your files are checked into source control e.g. git and
157 * should not change unless content is changed.
158 *
159 */
160 deterministicIds?: boolean;
161 /**
162 * This option is the optional seed for deterministic ids.
163 * If set to `undefined` but deterministicIds is `true`, a simple number iterator is used.
164 * You can set this attribute to base the seed on a static string.
165 *
166 */
167 deterministicIDSeed?: string;
168 flowchart?: FlowchartDiagramConfig;
169 sequence?: SequenceDiagramConfig;
170 gantt?: GanttDiagramConfig;
171 journey?: JourneyDiagramConfig;
172 timeline?: TimelineDiagramConfig;
173 class?: ClassDiagramConfig;
174 state?: StateDiagramConfig;
175 er?: ErDiagramConfig;
176 pie?: PieDiagramConfig;
177 quadrantChart?: QuadrantChartConfig;
178 xyChart?: XYChartConfig;
179 requirement?: RequirementDiagramConfig;
180 architecture?: ArchitectureDiagramConfig;
181 mindmap?: MindmapDiagramConfig;
182 kanban?: KanbanDiagramConfig;
183 gitGraph?: GitGraphDiagramConfig;
184 c4?: C4DiagramConfig;
185 sankey?: SankeyDiagramConfig;
186 packet?: PacketDiagramConfig;
187 block?: BlockDiagramConfig;
188 wrap?: boolean;
189 fontSize?: number;
190 markdownAutoWrap?: boolean;
191 /**
192 * Suppresses inserting 'Syntax error' diagram in the DOM.
193 * This is useful when you want to control how to handle syntax errors in your application.
194 *
195 */
196 suppressErrorRendering?: boolean;
197 }
198 /**
199 * The object containing configurations specific for flowcharts
200 *
201 * This interface was referenced by `MermaidConfig`'s JSON-Schema
202 * via the `definition` "FlowchartDiagramConfig".
203 */
204 interface FlowchartDiagramConfig extends BaseDiagramConfig {
205 /**
206 * Margin top for the text over the diagram
207 */
208 titleTopMargin?: number;
209 /**
210 * Defines a top/bottom margin for subgraph titles
211 *
212 */
213 subGraphTitleMargin?: {
214 top?: number;
215 bottom?: number;
216 };
217 arrowMarkerAbsolute?: boolean;
218 /**
219 * The amount of padding around the diagram as a whole so that embedded
220 * diagrams have margins, expressed in pixels.
221 *
222 */
223 diagramPadding?: number;
224 /**
225 * Flag for setting whether or not a html tag should be used for rendering labels on the edges.
226 *
227 */
228 htmlLabels?: boolean;
229 /**
230 * Defines the spacing between nodes on the same level
231 *
232 * Pertains to horizontal spacing for TB (top to bottom) or BT (bottom to top) graphs,
233 * and the vertical spacing for LR as well as RL graphs.
234 *
235 */
236 nodeSpacing?: number;
237 /**
238 * Defines the spacing between nodes on different levels
239 *
240 * Pertains to horizontal spacing for TB (top to bottom) or BT (bottom to top) graphs,
241 * and the vertical spacing for LR as well as RL graphs.
242 *
243 */
244 rankSpacing?: number;
245 /**
246 * Defines how mermaid renders curves for flowcharts.
247 *
248 */
249 curve?: 'basis' | 'linear' | 'cardinal';
250 /**
251 * Represents the padding between the labels and the shape
252 *
253 * **Only used in new experimental rendering.**
254 *
255 */
256 padding?: number;
257 /**
258 * Decides which rendering engine that is to be used for the rendering.
259 *
260 */
261 defaultRenderer?: 'dagre-d3' | 'dagre-wrapper' | 'elk';
262 /**
263 * Width of nodes where text is wrapped.
264 *
265 * When using markdown strings the text ius wrapped automatically, this
266 * value sets the max width of a text before it continues on a new line.
267 *
268 */
269 wrappingWidth?: number;
270 }
271 /**
272 * This interface was referenced by `MermaidConfig`'s JSON-Schema
273 * via the `definition` "BaseDiagramConfig".
274 */
275 interface BaseDiagramConfig {
276 useWidth?: number;
277 /**
278 * When this flag is set to `true`, the height and width is set to 100%
279 * and is then scaled with the available space.
280 * If set to `false`, the absolute space required is used.
281 *
282 */
283 useMaxWidth?: boolean;
284 }
285 /**
286 * The object containing configurations specific for sequence diagrams
287 *
288 * This interface was referenced by `MermaidConfig`'s JSON-Schema
289 * via the `definition` "SequenceDiagramConfig".
290 */
291 interface SequenceDiagramConfig extends BaseDiagramConfig {
292 arrowMarkerAbsolute?: boolean;
293 hideUnusedParticipants?: boolean;
294 /**
295 * Width of the activation rect
296 */
297 activationWidth?: number;
298 /**
299 * Margin to the right and left of the sequence diagram
300 */
301 diagramMarginX?: number;
302 /**
303 * Margin to the over and under the sequence diagram
304 */
305 diagramMarginY?: number;
306 /**
307 * Margin between actors
308 */
309 actorMargin?: number;
310 /**
311 * Width of actor boxes
312 */
313 width?: number;
314 /**
315 * Height of actor boxes
316 */
317 height?: number;
318 /**
319 * Margin around loop boxes
320 */
321 boxMargin?: number;
322 /**
323 * Margin around the text in loop/alt/opt boxes
324 */
325 boxTextMargin?: number;
326 /**
327 * Margin around notes
328 */
329 noteMargin?: number;
330 /**
331 * Space between messages.
332 */
333 messageMargin?: number;
334 /**
335 * Multiline message alignment
336 */
337 messageAlign?: 'left' | 'center' | 'right';
338 /**
339 * Mirror actors under diagram
340 *
341 */
342 mirrorActors?: boolean;
343 /**
344 * forces actor popup menus to always be visible (to support E2E testing).
345 *
346 */
347 forceMenus?: boolean;
348 /**
349 * Prolongs the edge of the diagram downwards.
350 *
351 * Depending on css styling this might need adjustment.
352 *
353 */
354 bottomMarginAdj?: number;
355 /**
356 * Curved Arrows become Right Angles
357 *
358 * This will display arrows that start and begin at the same node as
359 * right angles, rather than as curves.
360 *
361 */
362 rightAngles?: boolean;
363 /**
364 * This will show the node numbers
365 */
366 showSequenceNumbers?: boolean;
367 /**
368 * This sets the font size of the actor's description
369 */
370 actorFontSize?: string | number;
371 /**
372 * This sets the font family of the actor's description
373 */
374 actorFontFamily?: string;
375 /**
376 * This sets the font weight of the actor's description
377 */
378 actorFontWeight?: string | number;
379 /**
380 * This sets the font size of actor-attached notes
381 */
382 noteFontSize?: string | number;
383 /**
384 * This sets the font family of actor-attached notes
385 */
386 noteFontFamily?: string;
387 /**
388 * This sets the font weight of actor-attached notes
389 */
390 noteFontWeight?: string | number;
391 /**
392 * This sets the text alignment of actor-attached notes
393 */
394 noteAlign?: 'left' | 'center' | 'right';
395 /**
396 * This sets the font size of actor messages
397 */
398 messageFontSize?: string | number;
399 /**
400 * This sets the font family of actor messages
401 */
402 messageFontFamily?: string;
403 /**
404 * This sets the font weight of actor messages
405 */
406 messageFontWeight?: string | number;
407 /**
408 * This sets the auto-wrap state for the diagram
409 */
410 wrap?: boolean;
411 /**
412 * This sets the auto-wrap padding for the diagram (sides only)
413 */
414 wrapPadding?: number;
415 /**
416 * This sets the width of the loop-box (loop, alt, opt, par)
417 */
418 labelBoxWidth?: number;
419 /**
420 * This sets the height of the loop-box (loop, alt, opt, par)
421 */
422 labelBoxHeight?: number;
423 messageFont?: FontCalculator;
424 noteFont?: FontCalculator;
425 actorFont?: FontCalculator;
426 }
427 /**
428 * The object containing configurations specific for gantt diagrams
429 *
430 *
431 * This interface was referenced by `MermaidConfig`'s JSON-Schema
432 * via the `definition` "GanttDiagramConfig".
433 */
434 interface GanttDiagramConfig extends BaseDiagramConfig {
435 /**
436 * Margin top for the text over the diagram
437 */
438 titleTopMargin?: number;
439 /**
440 * The height of the bars in the graph
441 */
442 barHeight?: number;
443 /**
444 * The margin between the different activities in the gantt diagram
445 */
446 barGap?: number;
447 /**
448 * Margin between title and gantt diagram and between axis and gantt diagram.
449 *
450 */
451 topPadding?: number;
452 /**
453 * The space allocated for the section name to the right of the activities
454 *
455 */
456 rightPadding?: number;
457 /**
458 * The space allocated for the section name to the left of the activities
459 *
460 */
461 leftPadding?: number;
462 /**
463 * Vertical starting position of the grid lines
464 */
465 gridLineStartPadding?: number;
466 /**
467 * Font size
468 */
469 fontSize?: number;
470 /**
471 * Font size for sections
472 */
473 sectionFontSize?: string | number;
474 /**
475 * The number of alternating section styles
476 */
477 numberSectionStyles?: number;
478 /**
479 * Date/time format of the axis
480 *
481 * This might need adjustment to match your locale and preferences.
482 *
483 */
484 axisFormat?: string;
485 /**
486 * axis ticks
487 *
488 * Pattern is:
489 *
490 * ```javascript
491 * /^([1-9][0-9]*)(millisecond|second|minute|hour|day|week|month)$/
492 * ```
493 *
494 */
495 tickInterval?: string;
496 /**
497 * When this flag is set, date labels will be added to the top of the chart
498 *
499 */
500 topAxis?: boolean;
501 /**
502 * Controls the display mode.
503 *
504 */
505 displayMode?: '' | 'compact';
506 /**
507 * On which day a week-based interval should start
508 *
509 */
510 weekday?: 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday' | 'sunday';
511 }
512 /**
513 * The object containing configurations specific for journey diagrams
514 *
515 *
516 * This interface was referenced by `MermaidConfig`'s JSON-Schema
517 * via the `definition` "JourneyDiagramConfig".
518 */
519 interface JourneyDiagramConfig extends BaseDiagramConfig {
520 /**
521 * Margin to the right and left of the c4 diagram, must be a positive value.
522 *
523 */
524 diagramMarginX?: number;
525 /**
526 * Margin to the over and under the c4 diagram, must be a positive value.
527 *
528 */
529 diagramMarginY?: number;
530 /**
531 * Margin between actors
532 */
533 leftMargin?: number;
534 /**
535 * Width of actor boxes
536 */
537 width?: number;
538 /**
539 * Height of actor boxes
540 */
541 height?: number;
542 /**
543 * Margin around loop boxes
544 */
545 boxMargin?: number;
546 /**
547 * Margin around the text in loop/alt/opt boxes
548 */
549 boxTextMargin?: number;
550 /**
551 * Margin around notes
552 */
553 noteMargin?: number;
554 /**
555 * Space between messages.
556 */
557 messageMargin?: number;
558 /**
559 * Multiline message alignment
560 */
561 messageAlign?: 'left' | 'center' | 'right';
562 /**
563 * Prolongs the edge of the diagram downwards.
564 *
565 * Depending on css styling this might need adjustment.
566 *
567 */
568 bottomMarginAdj?: number;
569 /**
570 * Curved Arrows become Right Angles
571 *
572 * This will display arrows that start and begin at the same node as
573 * right angles, rather than as curves.
574 *
575 */
576 rightAngles?: boolean;
577 taskFontSize?: string | number;
578 taskFontFamily?: string;
579 taskMargin?: number;
580 /**
581 * Width of activation box
582 */
583 activationWidth?: number;
584 /**
585 * text placement as: tspan | fo | old only text as before
586 *
587 */
588 textPlacement?: string;
589 actorColours?: string[];
590 sectionFills?: string[];
591 sectionColours?: string[];
592 }
593 /**
594 * This interface was referenced by `MermaidConfig`'s JSON-Schema
595 * via the `definition` "TimelineDiagramConfig".
596 */
597 interface TimelineDiagramConfig extends BaseDiagramConfig {
598 /**
599 * Margin to the right and left of the c4 diagram, must be a positive value.
600 *
601 */
602 diagramMarginX?: number;
603 /**
604 * Margin to the over and under the c4 diagram, must be a positive value.
605 *
606 */
607 diagramMarginY?: number;
608 /**
609 * Margin between actors
610 */
611 leftMargin?: number;
612 /**
613 * Width of actor boxes
614 */
615 width?: number;
616 /**
617 * Height of actor boxes
618 */
619 height?: number;
620 padding?: number;
621 /**
622 * Margin around loop boxes
623 */
624 boxMargin?: number;
625 /**
626 * Margin around the text in loop/alt/opt boxes
627 */
628 boxTextMargin?: number;
629 /**
630 * Margin around notes
631 */
632 noteMargin?: number;
633 /**
634 * Space between messages.
635 */
636 messageMargin?: number;
637 /**
638 * Multiline message alignment
639 */
640 messageAlign?: 'left' | 'center' | 'right';
641 /**
642 * Prolongs the edge of the diagram downwards.
643 *
644 * Depending on css styling this might need adjustment.
645 *
646 */
647 bottomMarginAdj?: number;
648 /**
649 * Curved Arrows become Right Angles
650 *
651 * This will display arrows that start and begin at the same node as
652 * right angles, rather than as curves.
653 *
654 */
655 rightAngles?: boolean;
656 taskFontSize?: string | number;
657 taskFontFamily?: string;
658 taskMargin?: number;
659 /**
660 * Width of activation box
661 */
662 activationWidth?: number;
663 /**
664 * text placement as: tspan | fo | old only text as before
665 *
666 */
667 textPlacement?: string;
668 actorColours?: string[];
669 sectionFills?: string[];
670 sectionColours?: string[];
671 disableMulticolor?: boolean;
672 }
673 /**
674 * This interface was referenced by `MermaidConfig`'s JSON-Schema
675 * via the `definition` "ClassDiagramConfig".
676 */
677 interface ClassDiagramConfig extends BaseDiagramConfig {
678 /**
679 * Margin top for the text over the diagram
680 */
681 titleTopMargin?: number;
682 /**
683 * Controls whether or arrow markers in html code are absolute paths or anchors.
684 * This matters if you are using base tag settings.
685 *
686 */
687 arrowMarkerAbsolute?: boolean;
688 dividerMargin?: number;
689 padding?: number;
690 textHeight?: number;
691 /**
692 * Decides which rendering engine that is to be used for the rendering.
693 *
694 */
695 defaultRenderer?: 'dagre-d3' | 'dagre-wrapper' | 'elk';
696 nodeSpacing?: number;
697 rankSpacing?: number;
698 /**
699 * The amount of padding around the diagram as a whole so that embedded
700 * diagrams have margins, expressed in pixels.
701 *
702 */
703 diagramPadding?: number;
704 htmlLabels?: boolean;
705 hideEmptyMembersBox?: boolean;
706 }
707 /**
708 * The object containing configurations specific for entity relationship diagrams
709 *
710 * This interface was referenced by `MermaidConfig`'s JSON-Schema
711 * via the `definition` "StateDiagramConfig".
712 */
713 interface StateDiagramConfig extends BaseDiagramConfig {
714 /**
715 * Margin top for the text over the diagram
716 */
717 titleTopMargin?: number;
718 arrowMarkerAbsolute?: boolean;
719 dividerMargin?: number;
720 sizeUnit?: number;
721 padding?: number;
722 textHeight?: number;
723 titleShift?: number;
724 noteMargin?: number;
725 nodeSpacing?: number;
726 rankSpacing?: number;
727 forkWidth?: number;
728 forkHeight?: number;
729 miniPadding?: number;
730 /**
731 * Font size factor, this is used to guess the width of the edges labels
732 * before rendering by dagre layout.
733 * This might need updating if/when switching font
734 *
735 */
736 fontSizeFactor?: number;
737 fontSize?: number;
738 labelHeight?: number;
739 edgeLengthFactor?: string;
740 compositTitleSize?: number;
741 radius?: number;
742 /**
743 * Decides which rendering engine that is to be used for the rendering.
744 *
745 */
746 defaultRenderer?: 'dagre-d3' | 'dagre-wrapper' | 'elk';
747 }
748 /**
749 * The object containing configurations specific for entity relationship diagrams
750 *
751 * This interface was referenced by `MermaidConfig`'s JSON-Schema
752 * via the `definition` "ErDiagramConfig".
753 */
754 interface ErDiagramConfig extends BaseDiagramConfig {
755 /**
756 * Margin top for the text over the diagram
757 */
758 titleTopMargin?: number;
759 /**
760 * The amount of padding around the diagram as a whole so that embedded
761 * diagrams have margins, expressed in pixels.
762 *
763 */
764 diagramPadding?: number;
765 /**
766 * Directional bias for layout of entities
767 */
768 layoutDirection?: 'TB' | 'BT' | 'LR' | 'RL';
769 /**
770 * The minimum width of an entity box. Expressed in pixels.
771 */
772 minEntityWidth?: number;
773 /**
774 * The minimum height of an entity box. Expressed in pixels.
775 */
776 minEntityHeight?: number;
777 /**
778 * The minimum internal padding between text in an entity box and the enclosing box borders.
779 * Expressed in pixels.
780 *
781 */
782 entityPadding?: number;
783 /**
784 * Stroke color of box edges and lines.
785 */
786 stroke?: string;
787 /**
788 * Fill color of entity boxes
789 */
790 fill?: string;
791 /**
792 * Font size (expressed as an integer representing a number of pixels)
793 */
794 fontSize?: number;
795 }
796 /**
797 * This interface was referenced by `MermaidConfig`'s JSON-Schema
798 * via the `definition` "PieDiagramConfig".
799 */
800 interface PieDiagramConfig extends BaseDiagramConfig {
801 /**
802 * Axial position of slice's label from zero at the center to 1 at the outside edges.
803 *
804 */
805 textPosition?: number;
806 }
807 /**
808 * This interface was referenced by `MermaidConfig`'s JSON-Schema
809 * via the `definition` "QuadrantChartConfig".
810 */
811 interface QuadrantChartConfig extends BaseDiagramConfig {
812 /**
813 * Width of the chart
814 */
815 chartWidth?: number;
816 /**
817 * Height of the chart
818 */
819 chartHeight?: number;
820 /**
821 * Chart title top and bottom padding
822 */
823 titleFontSize?: number;
824 /**
825 * Padding around the quadrant square
826 */
827 titlePadding?: number;
828 /**
829 * quadrant title padding from top if the quadrant is rendered on top
830 */
831 quadrantPadding?: number;
832 /**
833 * Padding around x-axis labels
834 */
835 xAxisLabelPadding?: number;
836 /**
837 * Padding around y-axis labels
838 */
839 yAxisLabelPadding?: number;
840 /**
841 * x-axis label font size
842 */
843 xAxisLabelFontSize?: number;
844 /**
845 * y-axis label font size
846 */
847 yAxisLabelFontSize?: number;
848 /**
849 * quadrant title font size
850 */
851 quadrantLabelFontSize?: number;
852 /**
853 * quadrant title padding from top if the quadrant is rendered on top
854 */
855 quadrantTextTopPadding?: number;
856 /**
857 * padding between point and point label
858 */
859 pointTextPadding?: number;
860 /**
861 * point title font size
862 */
863 pointLabelFontSize?: number;
864 /**
865 * radius of the point to be drawn
866 */
867 pointRadius?: number;
868 /**
869 * position of x-axis labels
870 */
871 xAxisPosition?: 'top' | 'bottom';
872 /**
873 * position of y-axis labels
874 */
875 yAxisPosition?: 'left' | 'right';
876 /**
877 * stroke width of edges of the box that are inside the quadrant
878 */
879 quadrantInternalBorderStrokeWidth?: number;
880 /**
881 * stroke width of edges of the box that are outside the quadrant
882 */
883 quadrantExternalBorderStrokeWidth?: number;
884 }
885 /**
886 * This object contains configuration specific to XYCharts
887 *
888 * This interface was referenced by `MermaidConfig`'s JSON-Schema
889 * via the `definition` "XYChartConfig".
890 */
891 interface XYChartConfig extends BaseDiagramConfig {
892 /**
893 * width of the chart
894 */
895 width?: number;
896 /**
897 * height of the chart
898 */
899 height?: number;
900 /**
901 * Font size of the chart title
902 */
903 titleFontSize?: number;
904 /**
905 * Top and bottom space from the chart title
906 */
907 titlePadding?: number;
908 /**
909 * Should show the chart title
910 */
911 showTitle?: boolean;
912 xAxis?: XYChartAxisConfig;
913 yAxis?: XYChartAxisConfig;
914 /**
915 * How to plot will be drawn horizontal or vertical
916 */
917 chartOrientation?: 'vertical' | 'horizontal';
918 /**
919 * Minimum percent of space plots of the chart will take
920 */
921 plotReservedSpacePercent?: number;
922 }
923 /**
924 * This object contains configuration for XYChart axis config
925 *
926 * This interface was referenced by `MermaidConfig`'s JSON-Schema
927 * via the `definition` "XYChartAxisConfig".
928 */
929 interface XYChartAxisConfig {
930 /**
931 * Should show the axis labels (tick text)
932 */
933 showLabel?: boolean;
934 /**
935 * font size of the axis labels (tick text)
936 */
937 labelFontSize?: number;
938 /**
939 * top and bottom space from axis label (tick text)
940 */
941 labelPadding?: number;
942 /**
943 * Should show the axis title
944 */
945 showTitle?: boolean;
946 /**
947 * font size of the axis title
948 */
949 titleFontSize?: number;
950 /**
951 * top and bottom space from axis title
952 */
953 titlePadding?: number;
954 /**
955 * Should show the axis tick lines
956 */
957 showTick?: boolean;
958 /**
959 * length of the axis tick lines
960 */
961 tickLength?: number;
962 /**
963 * width of the axis tick lines
964 */
965 tickWidth?: number;
966 /**
967 * Show line across the axis
968 */
969 showAxisLine?: boolean;
970 /**
971 * Width of the axis line
972 */
973 axisLineWidth?: number;
974 }
975 /**
976 * The object containing configurations specific for req diagrams
977 *
978 * This interface was referenced by `MermaidConfig`'s JSON-Schema
979 * via the `definition` "RequirementDiagramConfig".
980 */
981 interface RequirementDiagramConfig extends BaseDiagramConfig {
982 rect_fill?: string;
983 text_color?: string;
984 rect_border_size?: string;
985 rect_border_color?: string;
986 rect_min_width?: number;
987 rect_min_height?: number;
988 fontSize?: number;
989 rect_padding?: number;
990 line_height?: number;
991 }
992 /**
993 * The object containing configurations specific for architecture diagrams
994 *
995 * This interface was referenced by `MermaidConfig`'s JSON-Schema
996 * via the `definition` "ArchitectureDiagramConfig".
997 */
998 interface ArchitectureDiagramConfig extends BaseDiagramConfig {
999 padding?: number;
1000 iconSize?: number;
1001 fontSize?: number;
1002 }
1003 /**
1004 * The object containing configurations specific for mindmap diagrams
1005 *
1006 * This interface was referenced by `MermaidConfig`'s JSON-Schema
1007 * via the `definition` "MindmapDiagramConfig".
1008 */
1009 interface MindmapDiagramConfig extends BaseDiagramConfig {
1010 padding?: number;
1011 maxNodeWidth?: number;
1012 }
1013 /**
1014 * The object containing configurations specific for kanban diagrams
1015 *
1016 * This interface was referenced by `MermaidConfig`'s JSON-Schema
1017 * via the `definition` "KanbanDiagramConfig".
1018 */
1019 interface KanbanDiagramConfig extends BaseDiagramConfig {
1020 padding?: number;
1021 sectionWidth?: number;
1022 ticketBaseUrl?: string;
1023 }
1024 /**
1025 * This interface was referenced by `MermaidConfig`'s JSON-Schema
1026 * via the `definition` "GitGraphDiagramConfig".
1027 */
1028 interface GitGraphDiagramConfig extends BaseDiagramConfig {
1029 /**
1030 * Margin top for the text over the diagram
1031 */
1032 titleTopMargin?: number;
1033 diagramPadding?: number;
1034 nodeLabel?: NodeLabel;
1035 mainBranchName?: string;
1036 mainBranchOrder?: number;
1037 showCommitLabel?: boolean;
1038 showBranches?: boolean;
1039 rotateCommitLabel?: boolean;
1040 parallelCommits?: boolean;
1041 /**
1042 * Controls whether or arrow markers in html code are absolute paths or anchors.
1043 * This matters if you are using base tag settings.
1044 *
1045 */
1046 arrowMarkerAbsolute?: boolean;
1047 }
1048 /**
1049 * This interface was referenced by `MermaidConfig`'s JSON-Schema
1050 * via the `definition` "NodeLabel".
1051 */
1052 interface NodeLabel {
1053 width?: number;
1054 height?: number;
1055 x?: number;
1056 y?: number;
1057 }
1058 /**
1059 * The object containing configurations specific for c4 diagrams
1060 *
1061 * This interface was referenced by `MermaidConfig`'s JSON-Schema
1062 * via the `definition` "C4DiagramConfig".
1063 */
1064 interface C4DiagramConfig extends BaseDiagramConfig {
1065 /**
1066 * Margin to the right and left of the c4 diagram, must be a positive value.
1067 *
1068 */
1069 diagramMarginX?: number;
1070 /**
1071 * Margin to the over and under the c4 diagram, must be a positive value.
1072 *
1073 */
1074 diagramMarginY?: number;
1075 /**
1076 * Margin between shapes
1077 */
1078 c4ShapeMargin?: number;
1079 /**
1080 * Padding between shapes
1081 */
1082 c4ShapePadding?: number;
1083 /**
1084 * Width of person boxes
1085 */
1086 width?: number;
1087 /**
1088 * Height of person boxes
1089 */
1090 height?: number;
1091 /**
1092 * Margin around boxes
1093 */
1094 boxMargin?: number;
1095 /**
1096 * How many shapes to place in each row.
1097 */
1098 c4ShapeInRow?: number;
1099 nextLinePaddingX?: number;
1100 /**
1101 * How many boundaries to place in each row.
1102 */
1103 c4BoundaryInRow?: number;
1104 /**
1105 * This sets the font size of Person shape for the diagram
1106 */
1107 personFontSize?: string | number;
1108 /**
1109 * This sets the font weight of Person shape for the diagram
1110 */
1111 personFontFamily?: string;
1112 /**
1113 * This sets the font weight of Person shape for the diagram
1114 */
1115 personFontWeight?: string | number;
1116 /**
1117 * This sets the font size of External Person shape for the diagram
1118 */
1119 external_personFontSize?: string | number;
1120 /**
1121 * This sets the font family of External Person shape for the diagram
1122 */
1123 external_personFontFamily?: string;
1124 /**
1125 * This sets the font weight of External Person shape for the diagram
1126 */
1127 external_personFontWeight?: string | number;
1128 /**
1129 * This sets the font size of System shape for the diagram
1130 */
1131 systemFontSize?: string | number;
1132 /**
1133 * This sets the font family of System shape for the diagram
1134 */
1135 systemFontFamily?: string;
1136 /**
1137 * This sets the font weight of System shape for the diagram
1138 */
1139 systemFontWeight?: string | number;
1140 /**
1141 * This sets the font size of External System shape for the diagram
1142 */
1143 external_systemFontSize?: string | number;
1144 /**
1145 * This sets the font family of External System shape for the diagram
1146 */
1147 external_systemFontFamily?: string;
1148 /**
1149 * This sets the font weight of External System shape for the diagram
1150 */
1151 external_systemFontWeight?: string | number;
1152 /**
1153 * This sets the font size of System DB shape for the diagram
1154 */
1155 system_dbFontSize?: string | number;
1156 /**
1157 * This sets the font family of System DB shape for the diagram
1158 */
1159 system_dbFontFamily?: string;
1160 /**
1161 * This sets the font weight of System DB shape for the diagram
1162 */
1163 system_dbFontWeight?: string | number;
1164 /**
1165 * This sets the font size of External System DB shape for the diagram
1166 */
1167 external_system_dbFontSize?: string | number;
1168 /**
1169 * This sets the font family of External System DB shape for the diagram
1170 */
1171 external_system_dbFontFamily?: string;
1172 /**
1173 * This sets the font weight of External System DB shape for the diagram
1174 */
1175 external_system_dbFontWeight?: string | number;
1176 /**
1177 * This sets the font size of System Queue shape for the diagram
1178 */
1179 system_queueFontSize?: string | number;
1180 /**
1181 * This sets the font family of System Queue shape for the diagram
1182 */
1183 system_queueFontFamily?: string;
1184 /**
1185 * This sets the font weight of System Queue shape for the diagram
1186 */
1187 system_queueFontWeight?: string | number;
1188 /**
1189 * This sets the font size of External System Queue shape for the diagram
1190 */
1191 external_system_queueFontSize?: string | number;
1192 /**
1193 * This sets the font family of External System Queue shape for the diagram
1194 */
1195 external_system_queueFontFamily?: string;
1196 /**
1197 * This sets the font weight of External System Queue shape for the diagram
1198 */
1199 external_system_queueFontWeight?: string | number;
1200 /**
1201 * This sets the font size of Boundary shape for the diagram
1202 */
1203 boundaryFontSize?: string | number;
1204 /**
1205 * This sets the font family of Boundary shape for the diagram
1206 */
1207 boundaryFontFamily?: string;
1208 /**
1209 * This sets the font weight of Boundary shape for the diagram
1210 */
1211 boundaryFontWeight?: string | number;
1212 /**
1213 * This sets the font size of Message shape for the diagram
1214 */
1215 messageFontSize?: string | number;
1216 /**
1217 * This sets the font family of Message shape for the diagram
1218 */
1219 messageFontFamily?: string;
1220 /**
1221 * This sets the font weight of Message shape for the diagram
1222 */
1223 messageFontWeight?: string | number;
1224 /**
1225 * This sets the font size of Container shape for the diagram
1226 */
1227 containerFontSize?: string | number;
1228 /**
1229 * This sets the font family of Container shape for the diagram
1230 */
1231 containerFontFamily?: string;
1232 /**
1233 * This sets the font weight of Container shape for the diagram
1234 */
1235 containerFontWeight?: string | number;
1236 /**
1237 * This sets the font size of External Container shape for the diagram
1238 */
1239 external_containerFontSize?: string | number;
1240 /**
1241 * This sets the font family of External Container shape for the diagram
1242 */
1243 external_containerFontFamily?: string;
1244 /**
1245 * This sets the font weight of External Container shape for the diagram
1246 */
1247 external_containerFontWeight?: string | number;
1248 /**
1249 * This sets the font size of Container DB shape for the diagram
1250 */
1251 container_dbFontSize?: string | number;
1252 /**
1253 * This sets the font family of Container DB shape for the diagram
1254 */
1255 container_dbFontFamily?: string;
1256 /**
1257 * This sets the font weight of Container DB shape for the diagram
1258 */
1259 container_dbFontWeight?: string | number;
1260 /**
1261 * This sets the font size of External Container DB shape for the diagram
1262 */
1263 external_container_dbFontSize?: string | number;
1264 /**
1265 * This sets the font family of External Container DB shape for the diagram
1266 */
1267 external_container_dbFontFamily?: string;
1268 /**
1269 * This sets the font weight of External Container DB shape for the diagram
1270 */
1271 external_container_dbFontWeight?: string | number;
1272 /**
1273 * This sets the font size of Container Queue shape for the diagram
1274 */
1275 container_queueFontSize?: string | number;
1276 /**
1277 * This sets the font family of Container Queue shape for the diagram
1278 */
1279 container_queueFontFamily?: string;
1280 /**
1281 * This sets the font weight of Container Queue shape for the diagram
1282 */
1283 container_queueFontWeight?: string | number;
1284 /**
1285 * This sets the font size of External Container Queue shape for the diagram
1286 */
1287 external_container_queueFontSize?: string | number;
1288 /**
1289 * This sets the font family of External Container Queue shape for the diagram
1290 */
1291 external_container_queueFontFamily?: string;
1292 /**
1293 * This sets the font weight of External Container Queue shape for the diagram
1294 */
1295 external_container_queueFontWeight?: string | number;
1296 /**
1297 * This sets the font size of Component shape for the diagram
1298 */
1299 componentFontSize?: string | number;
1300 /**
1301 * This sets the font family of Component shape for the diagram
1302 */
1303 componentFontFamily?: string;
1304 /**
1305 * This sets the font weight of Component shape for the diagram
1306 */
1307 componentFontWeight?: string | number;
1308 /**
1309 * This sets the font size of External Component shape for the diagram
1310 */
1311 external_componentFontSize?: string | number;
1312 /**
1313 * This sets the font family of External Component shape for the diagram
1314 */
1315 external_componentFontFamily?: string;
1316 /**
1317 * This sets the font weight of External Component shape for the diagram
1318 */
1319 external_componentFontWeight?: string | number;
1320 /**
1321 * This sets the font size of Component DB shape for the diagram
1322 */
1323 component_dbFontSize?: string | number;
1324 /**
1325 * This sets the font family of Component DB shape for the diagram
1326 */
1327 component_dbFontFamily?: string;
1328 /**
1329 * This sets the font weight of Component DB shape for the diagram
1330 */
1331 component_dbFontWeight?: string | number;
1332 /**
1333 * This sets the font size of External Component DB shape for the diagram
1334 */
1335 external_component_dbFontSize?: string | number;
1336 /**
1337 * This sets the font family of External Component DB shape for the diagram
1338 */
1339 external_component_dbFontFamily?: string;
1340 /**
1341 * This sets the font weight of External Component DB shape for the diagram
1342 */
1343 external_component_dbFontWeight?: string | number;
1344 /**
1345 * This sets the font size of Component Queue shape for the diagram
1346 */
1347 component_queueFontSize?: string | number;
1348 /**
1349 * This sets the font family of Component Queue shape for the diagram
1350 */
1351 component_queueFontFamily?: string;
1352 /**
1353 * This sets the font weight of Component Queue shape for the diagram
1354 */
1355 component_queueFontWeight?: string | number;
1356 /**
1357 * This sets the font size of External Component Queue shape for the diagram
1358 */
1359 external_component_queueFontSize?: string | number;
1360 /**
1361 * This sets the font family of External Component Queue shape for the diagram
1362 */
1363 external_component_queueFontFamily?: string;
1364 /**
1365 * This sets the font weight of External Component Queue shape for the diagram
1366 */
1367 external_component_queueFontWeight?: string | number;
1368 /**
1369 * This sets the auto-wrap state for the diagram
1370 */
1371 wrap?: boolean;
1372 /**
1373 * This sets the auto-wrap padding for the diagram (sides only)
1374 */
1375 wrapPadding?: number;
1376 person_bg_color?: string;
1377 person_border_color?: string;
1378 external_person_bg_color?: string;
1379 external_person_border_color?: string;
1380 system_bg_color?: string;
1381 system_border_color?: string;
1382 system_db_bg_color?: string;
1383 system_db_border_color?: string;
1384 system_queue_bg_color?: string;
1385 system_queue_border_color?: string;
1386 external_system_bg_color?: string;
1387 external_system_border_color?: string;
1388 external_system_db_bg_color?: string;
1389 external_system_db_border_color?: string;
1390 external_system_queue_bg_color?: string;
1391 external_system_queue_border_color?: string;
1392 container_bg_color?: string;
1393 container_border_color?: string;
1394 container_db_bg_color?: string;
1395 container_db_border_color?: string;
1396 container_queue_bg_color?: string;
1397 container_queue_border_color?: string;
1398 external_container_bg_color?: string;
1399 external_container_border_color?: string;
1400 external_container_db_bg_color?: string;
1401 external_container_db_border_color?: string;
1402 external_container_queue_bg_color?: string;
1403 external_container_queue_border_color?: string;
1404 component_bg_color?: string;
1405 component_border_color?: string;
1406 component_db_bg_color?: string;
1407 component_db_border_color?: string;
1408 component_queue_bg_color?: string;
1409 component_queue_border_color?: string;
1410 external_component_bg_color?: string;
1411 external_component_border_color?: string;
1412 external_component_db_bg_color?: string;
1413 external_component_db_border_color?: string;
1414 external_component_queue_bg_color?: string;
1415 external_component_queue_border_color?: string;
1416 personFont?: FontCalculator;
1417 external_personFont?: FontCalculator;
1418 systemFont?: FontCalculator;
1419 external_systemFont?: FontCalculator;
1420 system_dbFont?: FontCalculator;
1421 external_system_dbFont?: FontCalculator;
1422 system_queueFont?: FontCalculator;
1423 external_system_queueFont?: FontCalculator;
1424 containerFont?: FontCalculator;
1425 external_containerFont?: FontCalculator;
1426 container_dbFont?: FontCalculator;
1427 external_container_dbFont?: FontCalculator;
1428 container_queueFont?: FontCalculator;
1429 external_container_queueFont?: FontCalculator;
1430 componentFont?: FontCalculator;
1431 external_componentFont?: FontCalculator;
1432 component_dbFont?: FontCalculator;
1433 external_component_dbFont?: FontCalculator;
1434 component_queueFont?: FontCalculator;
1435 external_component_queueFont?: FontCalculator;
1436 boundaryFont?: FontCalculator;
1437 messageFont?: FontCalculator;
1438 }
1439 /**
1440 * The object containing configurations specific for sankey diagrams.
1441 *
1442 * This interface was referenced by `MermaidConfig`'s JSON-Schema
1443 * via the `definition` "SankeyDiagramConfig".
1444 */
1445 interface SankeyDiagramConfig extends BaseDiagramConfig {
1446 width?: number;
1447 height?: number;
1448 /**
1449 * The color of the links in the sankey diagram.
1450 *
1451 */
1452 linkColor?: SankeyLinkColor | string;
1453 nodeAlignment?: SankeyNodeAlignment;
1454 useMaxWidth?: boolean;
1455 /**
1456 * Toggle to display or hide values along with title.
1457 *
1458 */
1459 showValues?: boolean;
1460 /**
1461 * The prefix to use for values
1462 *
1463 */
1464 prefix?: string;
1465 /**
1466 * The suffix to use for values
1467 *
1468 */
1469 suffix?: string;
1470 }
1471 /**
1472 * The object containing configurations specific for packet diagrams.
1473 *
1474 * This interface was referenced by `MermaidConfig`'s JSON-Schema
1475 * via the `definition` "PacketDiagramConfig".
1476 */
1477 interface PacketDiagramConfig extends BaseDiagramConfig {
1478 /**
1479 * The height of each row in the packet diagram.
1480 */
1481 rowHeight?: number;
1482 /**
1483 * The width of each bit in the packet diagram.
1484 */
1485 bitWidth?: number;
1486 /**
1487 * The number of bits to display per row.
1488 */
1489 bitsPerRow?: number;
1490 /**
1491 * Toggle to display or hide bit numbers.
1492 */
1493 showBits?: boolean;
1494 /**
1495 * The horizontal padding between the blocks in a row.
1496 */
1497 paddingX?: number;
1498 /**
1499 * The vertical padding between the rows.
1500 */
1501 paddingY?: number;
1502 }
1503 /**
1504 * The object containing configurations specific for block diagrams.
1505 *
1506 * This interface was referenced by `MermaidConfig`'s JSON-Schema
1507 * via the `definition` "BlockDiagramConfig".
1508 */
1509 interface BlockDiagramConfig extends BaseDiagramConfig {
1510 padding?: number;
1511 }
1512 /**
1513 * This interface was referenced by `MermaidConfig`'s JSON-Schema
1514 * via the `definition` "FontConfig".
1515 */
1516 interface FontConfig {
1517 fontSize?: CSSFontSize;
1518 /**
1519 * The CSS [`font-family`](https://developer.mozilla.org/en-US/docs/Web/CSS/font-family) to use.
1520 */
1521 fontFamily?: string;
1522 /**
1523 * The font weight to use.
1524 */
1525 fontWeight?: string | number;
1526 }
1527 /**
1528 * Optional runtime configs.
1529 */
1530 interface RunOptions {
1531 /**
1532 * The query selector to use when finding elements to render. Default: `".mermaid"`.
1533 */
1534 querySelector?: string;
1535 /**
1536 * The nodes to render. If this is set, `querySelector` will be ignored.
1537 */
1538 nodes?: ArrayLike<HTMLElement>;
1539 /**
1540 * A callback to call after each diagram is rendered.
1541 */
1542 postRenderCallback?: (id: string) => unknown;
1543 /**
1544 * If `true`, errors will be logged to the console, but not thrown. Default: `false`
1545 */
1546 suppressErrors?: boolean;
1547 }
1548}