* feat(props): add isInteractive * refactor(selection): dont allow if not interactive * feat(renderer): add class if is interactive * chore(inactive): add tests * refactor(inactive): no connection line, no edge selection closes #49
28 lines
1.2 KiB
TypeScript
28 lines
1.2 KiB
TypeScript
import React, { SVGAttributes } from 'react';
|
|
import { Elements, NodeTypesType, EdgeTypesType, GridType, OnLoadFunc } from '../../types';
|
|
export interface GraphViewProps {
|
|
elements: Elements;
|
|
onElementClick: () => void;
|
|
onElementsRemove: (elements: Elements) => void;
|
|
onNodeDragStop: () => void;
|
|
onConnect: () => void;
|
|
onLoad: OnLoadFunc;
|
|
onMove: () => void;
|
|
selectionKeyCode: number;
|
|
nodeTypes: NodeTypesType;
|
|
edgeTypes: EdgeTypesType;
|
|
connectionLineType: string;
|
|
connectionLineStyle: SVGAttributes<{}>;
|
|
deleteKeyCode: number;
|
|
showBackground: boolean;
|
|
backgroundGap: number;
|
|
backgroundColor: string;
|
|
backgroundType: GridType;
|
|
snapToGrid: boolean;
|
|
snapGrid: [number, number];
|
|
onlyRenderVisibleNodes: boolean;
|
|
isInteractive: boolean;
|
|
}
|
|
declare const GraphView: React.MemoExoticComponent<({ nodeTypes, edgeTypes, onMove, onLoad, onElementClick, onNodeDragStop, connectionLineType, connectionLineStyle, selectionKeyCode, onElementsRemove, deleteKeyCode, elements, showBackground, backgroundGap, backgroundColor, backgroundType, onConnect, snapToGrid, snapGrid, onlyRenderVisibleNodes, isInteractive, }: GraphViewProps) => JSX.Element>;
|
|
export default GraphView;
|