# Node text wrapping and resizing

**URL:** https://talk.observablehq.com/t/node-text-wrapping-and-resizing/9717
**Category:** Help
**Created:** [August 29, 2024, 5:42pm UTC](https://talk.observablehq.com/t/node-text-wrapping-and-resizing/9717 "2024-08-29T17:42:12Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![johnefleming](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/johnefleming/32/8994_2.png) [@johnefleming](https://talk.observablehq.com/u/johnefleming)
#### Post date: [August 29, 2024, 5:42pm UTC](https://talk.observablehq.com/t/node-text-wrapping-and-resizing/9717/1 "2024-08-29T17:42:12Z")

</div>

I am trying to wrap text in graph nodes but doing quite a bad job! Here’s a simple example:

> **[Node text wrapping](https://observablehq.com/d/799a651ceba9de88)**

How can I get the text to wrap and resize to fit within the dimensions of the node?

---

<div class="post-metadata">

### Author: ![Fil](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/fil/32/207_2.png) [@Fil](https://talk.observablehq.com/u/Fil)
#### Post date: [August 29, 2024, 6:05pm UTC](https://talk.observablehq.com/t/node-text-wrapping-and-resizing/9717/2 "2024-08-29T18:05:11Z")

</div>

See [Fit Text to Circle / Mike Bostock | Observable](https://observablehq.com/@mbostock/fit-text-to-circle)

Also, Observable Plot has some heuristics to measure text and wrap it in SVG. They are used in the text and tip marks, but you can also copy from the source code if you like (provided you respect the license).

---

<div class="post-metadata">

### Author: ![johnefleming](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/johnefleming/32/8994_2.png) [@johnefleming](https://talk.observablehq.com/u/johnefleming)
#### Post date: [September 3, 2024, 2:31pm UTC](https://talk.observablehq.com/t/node-text-wrapping-and-resizing/9717/3 "2024-09-03T14:31:17Z")

</div>

Thanks, Fil!
