I'm using an SVG file to depict intra-regional migration flows of people in the Netherlands. Here's what I made so far:
The looped arrow is the only SVG image here, the other arrows are rendered by other means. As one can see, the looped arrow does not have a black outline (unlike the other arrows). I'd like to make the outline style and color of the arrows uniform.
To that end, I tried adjusting the code of the SVG file, which has been provided to me by Billy Ker (here) and Simbamangu (here). This is the latter's code, which resizes the former's in such a way that it is viewable in QGIS:
<svg width=".1mm" height=".1mm" version="1.1" viewBox="0 0 2.1694 2.1665" xmlns="http://www.w3.org/2000/svg">
<g transform="matrix(.1 0 0 .1 .013859 .018301)" fill="none" image-rendering="auto" stroke="#d40000" stroke-width="2.5862">
<path d="m26.8 13.9a12.8 12.8 0 0 1-10.6 12.6 12.8 12.8 0 0 1-14.3-8.22 12.8 12.8 0 0 1 5.6-15.5 12.8 12.8 0 0 1 16.2 2.81" stop-color="#000000"/>
<path d="m24.7 0.472-0.434 5.65-5.58-0.401" stop-color="#000000" style="font-variation-settings:normal"/>
</g>
</svg>
This renders a static image of a loop. In order to make it dynamic, I used information from this GIS.SE question to make its colors and outlines modifiable in QGIS. Here's the adjusted code:
<svg width=".1mm" height=".1mm" version="1.1" viewBox="0 0 3.1694 3.1665" xmlns="http://www.w3.org/2000/svg">
<g transform="matrix(.1 0 0 .1 .013859 .018301)" fill="none" image-rendering="auto" stroke="#d40000" stroke-width="3.0862">
<path d="m26.8 13.9a12.8 12.8 0 0 1-10.6 12.6 12.8 12.8 0 0 1-14.3-8.22 12.8 12.8 0 0 1 5.6-15.5 12.8 12.8 0 0 1 16.2 2.81" stop-color="#000000" stroke-width="param(outline-width) 50" stroke="param(outline) #000" fill="param(fill) #FFF"/>
<path d="m24.7 0.472-0.434 5.65-5.58-0.401" stop-color="#000000" fill="param(fill) #FFF" stroke="param(outline) #000" stroke-width="param(outline-width) 1"/>
</g>
</svg>
However, this code creates the follow loop:
So then I removed the
fill="param(fill) #FFF"
parts of both paths, to obtain:
Unfortunately, I now can't change the color of the arrows anymore. So instead, I changed the code to:
<svg width=".1mm" height=".1mm" version="1.1" viewBox="0 0 3.1694 3.1665" xmlns="http://www.w3.org/2000/svg">
<g transform="matrix(.1 0 0 .1 .013859 .018301)" fill="none" image-rendering="auto" stroke="#d40000" stroke-width="3.0862">
<path d="m26.8 13.9a12.8 12.8 0 0 1-10.6 12.6 12.8 12.8 0 0 1-14.3-8.22 12.8 12.8 0 0 1 5.6-15.5 12.8 12.8 0 0 1 16.2 2.81" stroke="param(outline) #000" stroke-width="param(outline-width) 40"/>
<path d="m24.7 0.472-0.434 5.65-5.58-0.401" fill="param(fill) #FFF" stroke="param(outline) #000" stroke-width="1"/>
</g>
</svg>
This is somewhat better. However, it's still not quite what I'm after, because when I now change the stroke color to black, this is what it looks like:
I can adjust the stroke width, but then I get a very thin arrow, instead of a thin outline of the arrow.
What I would like is to have code for the looped arrow that make it look similar to the other (non-looped) arrows in the image. So preferably, the loop would have:
- A thin black outline of the whole arrow;
- A modifiable arrow width that is proportionate with the size of the arrow head;
- The arrow starting off slightly less wide, and getting a bit wider towards the end, like the other arrows
Question do you know how I could change the code of the SVG file of the looped arrow in such a way that it satisfies the properties listed above? (The first two properties are the most important, the third one is perhaps somewhat more difficult and slightly less essential, but it would be nice to have.)