Files

28 lines
1.5 KiB
XML

<svg width="400" height="120" xmlns="http://www.w3.org/2000/svg">
<defs>
<marker id="arr-a" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6" fill="#e74c3c"/>
</marker>
<marker id="arr-b" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6" fill="#3498db"/>
</marker>
<marker id="arr-nb" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6" fill="#9b59b6"/>
</marker>
</defs>
<!-- a -->
<circle cx="20" cy="40" r="3" fill="#333"/>
<line x1="20" y1="40" x2="168" y2="40" stroke="#e74c3c" stroke-width="2.5" marker-end="url(#arr-a)"/>
<text x="90" y="30" fill="#e74c3c" font-size="14" font-weight="bold">a</text>
<!-- b (same direction, shorter) -->
<circle cx="20" cy="80" r="3" fill="#333"/>
<line x1="20" y1="80" x2="98" y2="80" stroke="#3498db" stroke-width="2.5" marker-end="url(#arr-b)"/>
<text x="55" y="70" fill="#3498db" font-size="14" font-weight="bold">b</text>
<!-- -b (opposite direction) -->
<circle cx="260" cy="80" r="3" fill="#333"/>
<line x1="260" y1="80" x2="172" y2="80" stroke="#9b59b6" stroke-width="2.5" marker-end="url(#arr-nb)"/>
<text x="205" y="70" fill="#9b59b6" font-size="14" font-weight="bold">-b</text>
<!-- labels -->
<text x="20" y="110" fill="#666" font-size="11">same direction</text>
<text x="200" y="110" fill="#666" font-size="11">opposite direction</text>
</svg>