MCPcopy Create free account
hub / github.com/breck7/scroll / _toHtmlCubeLine

Method _toHtmlCubeLine

external/.scrollLibs.js:16017–16026  ·  view source on GitHub ↗
(indents = 0, lineIndex = 0, planeIndex = 0)

Source from the content-addressed store, hash-verified

16015 return this._subparticlesToHtml(0)
16016 }
16017 _toHtmlCubeLine(indents = 0, lineIndex = 0, planeIndex = 0) {
16018 const getLine = (atomIndex, atom = "") =>
16019 `<span class="htmlCubeSpan" style="top: calc(var(--topIncrement) * ${planeIndex} + var(--rowHeight) * ${lineIndex}); left:calc(var(--leftIncrement) * ${planeIndex} + var(--atomWidth) * ${atomIndex});">${atom.replace(
16020 /</g,
16021 "&lt;"
16022 )}</span>`
16023 let atoms = []
16024 this.atoms.forEach((atom, index) => (atom ? atoms.push(getLine(index + indents, atom)) : ""))
16025 return atoms.join("")
16026 }
16027 get asHtmlCube() {
16028 return this.map((plane, planeIndex) => plane.topDownArray.map((line, lineIndex) => line._toHtmlCubeLine(line.getIndentLevel() - 2, lineIndex, planeIndex)).join("")).join("")
16029 }

Callers 1

asHtmlCubeMethod · 0.80

Calls 3

getLineFunction · 0.85
forEachMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected