reaviz / reagraph

🕸 WebGL Graph Visualizations for React. Maintained by @goodcodeus.

Home Page:https://reagraph.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Lasso + Drag

amcdnl opened this issue · comments

Make lasso + drag work together. Likely have to refactor how a drag is handled though.

example story:

export const Dragging = () => {
  const graphRef = useRef<GraphCanvasRef | null>(null);
  const { actives, selections, onNodeClick, onCanvasClick, onLasso, onLassoEnd } = useSelection({
    ref: graphRef,
    nodes: complexNodes,
    edges: complexEdges,
    type: 'multi'
  });

  return (
    <GraphCanvas
      ref={graphRef}
      nodes={complexNodes}
      edges={complexEdges}
      selections={selections}
      actives={actives}
      draggable
      lassoType="all"
      onNodeClick={onNodeClick}
      onCanvasClick={onCanvasClick}
      onLasso={onLasso}
      onLassoEnd={onLassoEnd}
    />
  );
};