Sometimes you just want to know the height of some text, for instance if you want to center it nicely in a container. The APIs in the browser return a height that is much higher than visually apparent ...
The font size of the text is adjusted so that it precisely fills its container. It uses computed width and height so it works for all types of fonts and automatically re-runs when the element resizes.
Learn how to make the most of Observable JavaScript and the Observable Plot library, including a step-by-step guide to eight basic data visualization tasks in Plot. Built-in reactivity is one of ...