mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-10-10 09:39:38 +02:00
feat: add accessibility title and description to pie chart
* Reuse the title as the title element * Add description to the parser and then render
This commit is contained in:
@@ -4,6 +4,7 @@ import * as configApi from '../../config';
|
||||
|
||||
let sections = {};
|
||||
let title = '';
|
||||
let description = '';
|
||||
let showData = false;
|
||||
|
||||
export const parseDirective = function (statement, context, type) {
|
||||
@@ -33,6 +34,15 @@ const getShowData = function () {
|
||||
const getTitle = function () {
|
||||
return title;
|
||||
};
|
||||
|
||||
const setAccDescription = function (txt) {
|
||||
description = txt;
|
||||
};
|
||||
|
||||
const getAccDescription = function () {
|
||||
return description;
|
||||
};
|
||||
|
||||
const cleanupValue = function (value) {
|
||||
if (value.substring(0, 1) === ':') {
|
||||
value = value.substring(1).trim();
|
||||
@@ -62,5 +72,7 @@ export default {
|
||||
getTitle,
|
||||
setShowData,
|
||||
getShowData,
|
||||
getAccDescription,
|
||||
setAccDescription,
|
||||
// parseError
|
||||
};
|
||||
|
Reference in New Issue
Block a user