diff --git a/feat/dependencies-of/api.ts b/feat/dependencies-of/api.ts index 7b51d5e..1d0d988 100644 --- a/feat/dependencies-of/api.ts +++ b/feat/dependencies-of/api.ts @@ -117,9 +117,12 @@ async function serveHtmlGraphPage(req: Request, modUrl: string, modSlug: string, .then(dotProc => dotProc.captureAllOutput()) .then(raw => { const fullSvg = new TextDecoder().decode(raw); + const attrs = [`id="graph"`]; + const svgWidth = fullSvg.match(/viewBox="(?:([0-9.-]+) ){3}/)?.[1]; + if (svgWidth) attrs.push(`style="max-width: ${parseInt(svgWidth)*2}px;"`); return fullSvg .slice(fullSvg.indexOf('