feat: adds title and description to flowchart

This commit is contained in:
Lindsey Wild
2022-04-06 16:06:57 -04:00
parent f2e77917d7
commit 7a5149e39e
8 changed files with 82 additions and 22 deletions

View File

@@ -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,