mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-25 10:20:06 +02:00
feat: adds title and description to flowchart
This commit is contained in:
@@ -17,6 +17,8 @@ let tooltips = {};
|
||||
let subCount = 0;
|
||||
let firstGraphFlag = true;
|
||||
let direction;
|
||||
let title = 'Flow chart';
|
||||
let description = '';
|
||||
|
||||
let version; // As in graph
|
||||
|
||||
@@ -27,6 +29,22 @@ export const parseDirective = function (statement, context, type) {
|
||||
mermaidAPI.parseDirective(this, statement, context, type);
|
||||
};
|
||||
|
||||
const setTitle = function (txt) {
|
||||
title = txt;
|
||||
};
|
||||
|
||||
const getTitle = function () {
|
||||
return title;
|
||||
};
|
||||
|
||||
const setAccDescription = function (txt) {
|
||||
description = txt;
|
||||
};
|
||||
|
||||
const getAccDescription = function () {
|
||||
return description;
|
||||
};
|
||||
|
||||
/**
|
||||
* Function to lookup domId from id in the graph definition.
|
||||
*
|
||||
@@ -736,6 +754,10 @@ const makeUniq = (sg, allSubgraphs) => {
|
||||
export default {
|
||||
parseDirective,
|
||||
defaultConfig: () => configApi.defaultConfig.flowchart,
|
||||
setTitle,
|
||||
getTitle,
|
||||
getAccDescription,
|
||||
setAccDescription,
|
||||
addVertex,
|
||||
lookUpDomId,
|
||||
addLink,
|
||||
|
Reference in New Issue
Block a user