aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBob Zeleznik <zzzman@gmail.com>2020-06-27 01:23:56 -0400
committerBob Zeleznik <zzzman@gmail.com>2020-06-27 01:23:56 -0400
commit4a19a4ecc7f51532a30a7a31e4c95bfadce793da (patch)
treedf03a2fbe8283d0abe6c65f9495f75425e1c5c84 /src
parent344d478d6140be1e469cfcd52ca76bbd1c4324f1 (diff)
adjusted arrowheads to be larger
Diffstat (limited to 'src')
-rw-r--r--src/client/util/InteractionUtils.tsx18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/client/util/InteractionUtils.tsx b/src/client/util/InteractionUtils.tsx
index 3634fb704..edeb461e0 100644
--- a/src/client/util/InteractionUtils.tsx
+++ b/src/client/util/InteractionUtils.tsx
@@ -118,18 +118,18 @@ export namespace InteractionUtils {
${(pt.Y - top - width / 2) * scaley + width / 2} `, "");
const dashArray = String(Number(width) * Number(dash));
const defGuid = Utils.GenerateGuid();
+ const arrowDim = Math.max(0.5, 8 / Math.log(Math.max(2, strokeWidth)));
return (<svg fill={fill === "none" ? color : fill}> {/* setting the svg fill sets the arrowhead fill */}
{nodefs ? (null) : <defs>
- <marker id={`dot${defGuid}`} orient="auto" overflow="visible">
+ {arrowStart !== "dot" && arrowEnd !== "dot" ? (null) : <marker id={`dot${defGuid}`} orient="auto" overflow="visible">
<circle r={1} fill="context-stroke" />
- </marker>
- <marker id={`arrowHead${defGuid}`} orient="auto" overflow="visible" refX="3" refY="1" markerWidth="10" markerHeight="7">
- <polygon points="3 0, 3 2, 0 1" />
- </marker>
- <marker id={`arrowEnd${defGuid}`} orient="auto" overflow="visible" refX="0" refY="1" markerWidth="10" markerHeight="7">
- <polygon points="0 0, 3 1, 0 2" />
- </marker>
-
+ </marker>}
+ {arrowStart !== "arrowHead" && arrowEnd !== "arrowHead" ? (null) : <marker id={`arrowHead${defGuid}`} orient="auto" overflow="visible" refX="1.6" refY="0" markerWidth="10" markerHeight="7">
+ <polygon points={`${arrowDim} ${-Math.max(1, arrowDim / 2)}, ${arrowDim} ${Math.max(1, arrowDim / 2)}, -1 0`} />
+ </marker>}
+ {arrowStart !== "arrowEnd" && arrowEnd !== "arrowEnd" ? (null) : <marker id={`arrowEnd${defGuid}`} orient="auto" overflow="visible" refX="1.6" refY="0" markerWidth="10" markerHeight="7">
+ <polygon points={`${2 - arrowDim} ${-Math.max(1, arrowDim / 2)}, ${2 - arrowDim} ${Math.max(1, arrowDim / 2)}, 3 0`} />
+ </marker>}
</defs>}
<polyline