mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-10-13 02:59:36 +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:
@@ -5,6 +5,7 @@ import pieParser from './parser/pie';
|
||||
import { log } from '../../logger';
|
||||
import { configureSvgSize } from '../../utils';
|
||||
import * as configApi from '../../config';
|
||||
import addSVGAccessibilityFields from '../../accessibility';
|
||||
|
||||
let conf = configApi.getConfig();
|
||||
|
||||
@@ -43,6 +44,7 @@ export const draw = (txt, id) => {
|
||||
const diagram = select('#' + id);
|
||||
configureSvgSize(diagram, height, width, conf.pie.useMaxWidth);
|
||||
|
||||
addSVGAccessibilityFields(parser.yy, diagram, id);
|
||||
// Set viewBox
|
||||
elem.setAttribute('viewBox', '0 0 ' + width + ' ' + height);
|
||||
|
||||
|
Reference in New Issue
Block a user