mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-08-29 13:16:40 +02:00
Add useMaxWidth to stateRenderer
This commit is contained in:
@@ -75,8 +75,13 @@ export const draw = function(text, id) {
|
|||||||
const width = bounds.width + padding * 2;
|
const width = bounds.width + padding * 2;
|
||||||
const height = bounds.height + padding * 2;
|
const height = bounds.height + padding * 2;
|
||||||
|
|
||||||
// Zoom in a bit
|
if (conf.useMaxWidth) {
|
||||||
diagram.attr('width', width * 1.75);
|
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('height', bounds.height * 3 + conf.padding * 2);
|
||||||
diagram.attr(
|
diagram.attr(
|
||||||
'viewBox',
|
'viewBox',
|
||||||
|
Reference in New Issue
Block a user