There are plenty of examples of drawing SVG paths from D3 geo data using D3's path projection tools. For example, here's one I wrote earlier (D3 v3) and here's a recent example using D3 v4.
They all look something like this:
svg.append("path")
.data(topojson.feature(datafile, datafile.objects.featureOfInterest))
.attr("class", "land")
.attr("d", pathDefinitionObject);
...where the data file is read and associated with some SVG, creating linked empty paths, then a D3 path definition object associated with a certain projection looks at the data and uses it to add SVG path definition strings to the d
attributes of those paths.
What I want is, those path definition strings, but as strings, without touching any SVG. I want to use those strings with Raphael so that I can draw paths on browsers that don't support SVG, because a particular project requires supporting institutional clients who due to legacy software requirements and corporate policies haven't upgraded from IE8 (I know, I know...).
D3 is clearly capable of defining those strings, but I can't see an obvious way of getting the path definition object to output the strings without being linked to a DOM SVG element.
How can I just get the strings, without any SVG on the page?
I'm trying to use a minimal set of D3 v4's "microlibraries" for this, so bonus points for an answer with the fewest D3 dependencies (especially if it can avoid D3-selection.js which is quite large - ideally I'd like to only use D3's data processing and not use its DOM manipulation at all for this project).