66 lines
1.5 KiB
TypeScript
66 lines
1.5 KiB
TypeScript
import { devWarn, infiniteExtent } from '@reactflow/utils';
|
|
import { ConnectionMode } from '@reactflow/system';
|
|
|
|
import type { ReactFlowStore } from '../types';
|
|
|
|
const initialState: ReactFlowStore = {
|
|
rfId: '1',
|
|
width: 0,
|
|
height: 0,
|
|
transform: [0, 0, 1],
|
|
nodeInternals: new Map(),
|
|
edges: [],
|
|
onNodesChange: null,
|
|
onEdgesChange: null,
|
|
hasDefaultNodes: false,
|
|
hasDefaultEdges: false,
|
|
panZoom: null,
|
|
minZoom: 0.5,
|
|
maxZoom: 2,
|
|
translateExtent: infiniteExtent,
|
|
nodeExtent: infiniteExtent,
|
|
nodesSelectionActive: false,
|
|
userSelectionActive: false,
|
|
userSelectionRect: null,
|
|
connectionPosition: { x: 0, y: 0 },
|
|
connectionStatus: null,
|
|
connectionMode: ConnectionMode.Strict,
|
|
domNode: null,
|
|
paneDragging: false,
|
|
noPanClassName: 'nopan',
|
|
nodeOrigin: [0, 0],
|
|
|
|
snapGrid: [15, 15],
|
|
snapToGrid: false,
|
|
|
|
nodesDraggable: true,
|
|
nodesConnectable: true,
|
|
nodesFocusable: true,
|
|
edgesFocusable: true,
|
|
edgesUpdatable: true,
|
|
elementsSelectable: true,
|
|
elevateNodesOnSelect: true,
|
|
fitViewOnInit: false,
|
|
fitViewOnInitDone: false,
|
|
fitViewOnInitOptions: undefined,
|
|
selectNodesOnDrag: true,
|
|
|
|
multiSelectionActive: false,
|
|
|
|
connectionStartHandle: null,
|
|
connectionEndHandle: null,
|
|
connectionClickStartHandle: null,
|
|
connectOnClick: true,
|
|
|
|
ariaLiveMessage: '',
|
|
autoPanOnConnect: true,
|
|
autoPanOnNodeDrag: true,
|
|
connectionRadius: 20,
|
|
onError: devWarn,
|
|
isValidConnection: undefined,
|
|
|
|
lib: 'react',
|
|
};
|
|
|
|
export default initialState;
|