Merge pull request #1332 from Soptq/stateRenderer

Add useMaxWidth to stateRenderer
This commit is contained in:
Knut Sveidqvist 2020-04-11 11:58:22 +02:00 committed by GitHub
commit fffb0eafde
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 2 deletions

View File

@ -75,8 +75,13 @@ export const draw = function(text, id) {
const width = bounds.width + padding * 2;
const height = bounds.height + padding * 2;
// Zoom in a bit
diagram.attr('width', width * 1.75);
if (conf.useMaxWidth) {
diagram.attr('width', '100%');
diagram.attr('style', `max-width: ${width * 1.75}px;`);
} else {
// Zoom in a bit
diagram.attr('width', width * 1.75);
}
// diagram.attr('height', bounds.height * 3 + conf.padding * 2);
diagram.attr(
'viewBox',