grafana/public/app/plugins/panel/nodeGraph/EdgeArrowMarker.tsx
Connor Lindsey db9c9b5354
Node Graph: Emphasize hovered or connected nodes (#51925)
* Node Graph: Emphasize hovered or connected nodes

* Add tests and refactor into util functions
2022-07-12 06:14:45 -06:00

25 lines
638 B
TypeScript

import React from 'react';
/**
* In SVG you need to supply this kind of marker that can be then referenced from a line segment as an ending of the
* line turning in into arrow. Needs to be included in the svg element and then referenced as markerEnd="url(#triangle)"
*/
export function EdgeArrowMarker() {
return (
<defs>
<marker
id="triangle"
viewBox="0 0 10 10"
refX="8"
refY="5"
markerUnits="userSpaceOnUse"
markerWidth="10"
markerHeight="10"
orient="auto"
>
<path d="M 0 0 L 10 5 L 0 10 z" fill="#999" />
</marker>
</defs>
);
}