Add graph viewport drag plane
This commit is contained in:
parent
a45dc466c6
commit
08ba4219bc
1 changed files with 30 additions and 0 deletions
|
|
@ -818,6 +818,36 @@ export function EpiphanyGraphViewer({
|
|||
</g>
|
||||
</svg>
|
||||
)}
|
||||
{status === "ready" && activeLayout && (
|
||||
<div
|
||||
aria-hidden="true"
|
||||
onPointerDown={(event) => {
|
||||
if (event.button !== 0 && !isMiddlePointerEvent(event)) {
|
||||
return;
|
||||
}
|
||||
|
||||
handleViewportPointerDown(event, activeTransform, dragRef);
|
||||
}}
|
||||
onPointerMove={(event) =>
|
||||
handleViewportPointerMove(event, activeGraphKey, dragRef, setTransforms)
|
||||
}
|
||||
onPointerUp={(event) => handleViewportPointerUp(event, dragRef)}
|
||||
onPointerCancel={(event) => handleViewportPointerUp(event, dragRef)}
|
||||
onAuxClick={(event) => {
|
||||
if (isMiddleMouseEvent(event)) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
}
|
||||
}}
|
||||
style={{
|
||||
position: "absolute",
|
||||
inset: 0,
|
||||
zIndex: 3,
|
||||
cursor: dragRef.current?.active ? "grabbing" : "grab",
|
||||
touchAction: "none",
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
{status === "ready" && activeLayout && (
|
||||
<div
|
||||
aria-label={`${labels[activeGraphKey]} node surfaces`}
|
||||
|
|
|
|||
Loading…
Reference in a new issue