Add accDescription field to state diagrams

This commit is contained in:
Tali Herzka
2022-04-07 21:35:13 +00:00
committed by GitHub
parent 0c5252594e
commit 49409241bc
12 changed files with 506 additions and 275 deletions

View File

@@ -9,6 +9,7 @@ import { parser } from './parser/stateDiagram';
import { drawState, addTitleAndBox, drawEdge } from './shapes';
import { getConfig } from '../../config';
import { configureSvgSize } from '../../utils';
import addSVGAccessibilityFields from '../../accessibility';
parser.yy = stateDb;
@@ -97,6 +98,7 @@ export const draw = function (text, id) {
'viewBox',
`${bounds.x - conf.padding} ${bounds.y - conf.padding} ` + width + ' ' + height
);
addSVGAccessibilityFields(parser.yy, diagram, id);
};
const getLabelWidth = (text) => {
return text ? text.length * conf.fontSizeFactor : 1;