James Trimble's ONS work
James Trimble's ONS work
I've made the change to the simplemap template. I'll work on the others when I find time.
Here's an example: That's with the slightly tweaked version below. (It reduces lineHeight to 0.9 ems if there are three or more lines.) ```js function wrap(text, width) { text.each(function(d,i) {...
I know, it feels a bit ugly. I can't think of anything better though!
> Was wondering if you could do some `.attr("transform","translate()")`, maybe even on the parent `text` element? Possibly. It might make the code more complicated though? The decreased line height for...
Just for reference, not necessarily the best way to do it: https://observablehq.com/@jtrim-ons/svg-text-wrapping
If we do this, it might be a good idea to make the lines look exactly like the Our World in Data lines. Their code is open source.