Public
Edited
Jan 22, 2024
Insert cell
Insert cell
boundingBox = {
let svg = d3.select(DOM.svg(textWidth, textHeight))
.style("background-color", "#e0e0e0")
.style("outline", "thin dashed black")
.style("overflow", "visible")

let label = svg
.append('text')
.text(text)
.style("text-anchor", "start")
.attr("font-family", font)
.attr("font-weight","bold")
.attr("font-size",size+"pt")
.attr("fill", 'black')
.attr('y', textY )

return svg.node()
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
measure = measureText( text, size, font )
Insert cell
textWidth = measure.width * widthCorrection
Insert cell
textHeight = (measure.fontBoundingBoxAscent + measure.fontBoundingBoxDescent) * heightCorrection
Insert cell
textY = measure.fontBoundingBoxAscent * heightCorrection
Insert cell
Insert cell
htl.html`
<link rel="stylesheet" href="${fonts_link}">
`
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more