feat(panzoom): add paneClickDistance prop
This commit is contained in:
@@ -248,6 +248,10 @@ export function createStore({
|
||||
return elementsChanged;
|
||||
}
|
||||
|
||||
function setPaneClickDistance(distance: number) {
|
||||
get(store.panZoom)?.setClickDistance(distance);
|
||||
}
|
||||
|
||||
function unselectNodesAndEdges(params?: { nodes?: Node[]; edges?: Edge[] }) {
|
||||
const resetNodes = resetSelectedElements(params?.nodes || get(store.nodes));
|
||||
if (resetNodes) store.nodes.set(get(store.nodes));
|
||||
@@ -448,6 +452,7 @@ export function createStore({
|
||||
setMinZoom,
|
||||
setMaxZoom,
|
||||
setTranslateExtent,
|
||||
setPaneClickDistance,
|
||||
unselectNodesAndEdges,
|
||||
addSelectedNodes,
|
||||
addSelectedEdges,
|
||||
|
||||
@@ -25,6 +25,7 @@ export type SvelteFlowStoreActions = {
|
||||
setMinZoom: (minZoom: number) => void;
|
||||
setMaxZoom: (maxZoom: number) => void;
|
||||
setTranslateExtent: (extent: CoordinateExtent) => void;
|
||||
setPaneClickDistance: (distance: number) => void;
|
||||
fitView: (options?: FitViewOptions) => Promise<boolean>;
|
||||
updateNodePositions: UpdateNodePositions;
|
||||
updateNodeInternals: (updates: Map<string, InternalNodeUpdate>) => void;
|
||||
|
||||
Reference in New Issue
Block a user