mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-11-18 03:34:12 +01:00
#1029 Linting fixes
This commit is contained in:
@@ -414,7 +414,10 @@ export const draw = function (text, id) {
|
|||||||
const svgBounds = svg.node().getBBox();
|
const svgBounds = svg.node().getBBox();
|
||||||
const width = svgBounds.width + padding * 2;
|
const width = svgBounds.width + padding * 2;
|
||||||
const height = svgBounds.height + padding * 2;
|
const height = svgBounds.height + padding * 2;
|
||||||
logger.debug(`new ViewBox 0 0 ${width} ${height}`, `translate(${padding - g._label.marginx}, ${padding - g._label.marginy})`);
|
logger.debug(
|
||||||
|
`new ViewBox 0 0 ${width} ${height}`,
|
||||||
|
`translate(${padding - g._label.marginx}, ${padding - g._label.marginy})`
|
||||||
|
);
|
||||||
|
|
||||||
if (conf.useMaxWidth) {
|
if (conf.useMaxWidth) {
|
||||||
svg.attr('width', '100%');
|
svg.attr('width', '100%');
|
||||||
@@ -425,8 +428,9 @@ export const draw = function (text, id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
svg.attr('viewBox', `0 0 ${width} ${height}`);
|
svg.attr('viewBox', `0 0 ${width} ${height}`);
|
||||||
svg.select('g').attr('transform', `translate(${padding - g._label.marginx}, ${padding - svgBounds.y})`);
|
svg
|
||||||
|
.select('g')
|
||||||
|
.attr('transform', `translate(${padding - g._label.marginx}, ${padding - svgBounds.y})`);
|
||||||
} else {
|
} else {
|
||||||
const width = g.maxX - g.minX + padding * 2;
|
const width = g.maxX - g.minX + padding * 2;
|
||||||
const height = g.maxY - g.minY + padding * 2;
|
const height = g.maxY - g.minY + padding * 2;
|
||||||
@@ -439,7 +443,10 @@ export const draw = function (text, id) {
|
|||||||
svg.attr('width', width);
|
svg.attr('width', width);
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.debug(`Org ViewBox 0 0 ${width} ${height}`, `translate(${padding - g.minX}, ${padding - g.minY})\n${location.href}`)
|
logger.debug(
|
||||||
|
`Org ViewBox 0 0 ${width} ${height}`,
|
||||||
|
`translate(${padding - g.minX}, ${padding - g.minY})\n${location.href}`
|
||||||
|
);
|
||||||
|
|
||||||
svg.attr('viewBox', `0 0 ${width} ${height}`);
|
svg.attr('viewBox', `0 0 ${width} ${height}`);
|
||||||
svg.select('g').attr('transform', `translate(${padding - g.minX}, ${padding - g.minY})`);
|
svg.select('g').attr('transform', `translate(${padding - g.minX}, ${padding - g.minY})`);
|
||||||
|
|||||||
Reference in New Issue
Block a user