Pythagoras tree: Difference between revisions
m
→{{trans|Rust}}: cosmetics comments
(→{{trans|Rust}}: refactoring) |
m (→{{trans|Rust}}: cosmetics comments) |
||
Line 986:
const svg = doc.replace('<svg ', `<svg viewBox="${[x, y, -x - x, -y]}" `);
if (globalThis.global) { // if the script is run from node.js - save the svg to a file
require('node:fs').writeFileSync('Pythagor_tree.svg', svg);
} else { // if
// - display
document.body.innerHTML = svg, '';
}</syntaxhighlight>
|