html`${stdlib.plot({
x: [
nearDepths,
depths,
farDepths,
[near, near], [far, far], [0, 10], [0, 10]
],
y: [
nearDepths.map(depthToClipSpaceZ),
depths.map(depthToClipSpaceZ),
farDepths.map(depthToClipSpaceZ),
[-2, 2], [-2, 2], [-1, -1], [1, 1]
],
colors: ['red', 'blue', 'red', 'gray', 'gray', 'gray', 'gray'],
lineStyle: ['-', '-', '-', '--', '--', '--', '--'],
lineWidth: [1, 2, 1, 1, 1, 1, 1],
yMin: -1.5,
yMax: 1.5,
xMin: 0,
xMax: 10,
xLabel: 'world-space depth',
yLabel: 'clip-space depth',
width: 700,
height: 500,
title: 'World-space depth vs. clip-space depth',
autoRender: false,
}).render('html')}
<style>
.canvas .label,
.canvas .tick text {
font-size: 15px;
font-family: var(--serif);
}
</style>`