Skip to content

How to add an arrowhead to a drawn line? #2

@q2apro

Description

@q2apro

I would like to add an arrowhead to a drawn line.

You can add an arrow head with CSS and SVG like this (credits):

	<style>
	.arrow {
		stroke:rgb(0,0,0);
		stroke-width:2; 
		marker-end:url(#markerArrow)
	}
	</style>

	<svg height="210" width="500" viewBox="0 0 200 200">
		<defs>
			<marker id="markerArrow" markerWidth="13" markerHeight="13" refX="2" refY="6" orient="auto">
				<path d="M2,2 L2,11 L10,6 L2,2" style="fill: #000000;" />
			</marker>
		</defs>

		<line x1="0" y1="0" x2="200" y2="100" class="arrow" />
	</svg>

Result:
image

But how could this feature be inegrated into InteractiveSVG.js?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions