Skip to content

Commit 59e13e3

Browse files
committed
graphviz: make the diagrams' background transparent by default
No need to set a background color, is there? Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 514678d commit 59e13e3

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

assets/js/application.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,12 @@ var Graphviz = {
787787
let vizInstance
788788
[...document.querySelectorAll("pre[class=graphviz]")].forEach(async (x) => {
789789
if (!vizInstance) vizInstance = await Viz.instance()
790-
const svg = vizInstance.renderSVGElement(x.innerText)
790+
const options = {
791+
graphAttributes: {
792+
bgcolor: "transparent",
793+
},
794+
}
795+
const svg = vizInstance.renderSVGElement(x.innerText, options)
791796
x.parentNode.insertBefore(svg, x);
792797
x.style.display = 'none'
793798
});

assets/sass/layout.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,10 @@ p.center {
317317
}
318318
}
319319

320+
svg.graphviz {
321+
width: 100%;
322+
}
323+
320324
// Dropdowns
321325
a.dropdown-trigger {
322326
padding: 4px 5px;

0 commit comments

Comments
 (0)