added nodeExtent to Svelte Flow and React Flow Provider

This commit is contained in:
peterkogo
2024-08-22 10:34:52 +02:00
parent 535744efa1
commit 04774e5011
11 changed files with 61 additions and 15 deletions
+9 -4
View File
@@ -37,7 +37,8 @@ export function createStore({
width,
height,
fitView: fitViewOnCreate,
nodeOrigin
nodeOrigin,
nodeExtent
}: {
nodes?: Node[];
edges?: Edge[];
@@ -45,6 +46,7 @@ export function createStore({
height?: number;
fitView?: boolean;
nodeOrigin?: NodeOrigin;
nodeExtent?: CoordinateExtent;
}): SvelteFlowStore {
const store = getInitialStore({
nodes,
@@ -52,7 +54,8 @@ export function createStore({
width,
height,
fitView: fitViewOnCreate,
nodeOrigin
nodeOrigin,
nodeExtent
});
function setNodeTypes(nodeTypes: NodeTypes) {
@@ -482,7 +485,8 @@ export function createStoreContext({
width,
height,
fitView,
nodeOrigin
nodeOrigin,
nodeExtent
}: {
nodes?: Node[];
edges?: Edge[];
@@ -490,8 +494,9 @@ export function createStoreContext({
height?: number;
fitView?: boolean;
nodeOrigin?: NodeOrigin;
nodeExtent?: CoordinateExtent;
}) {
const store = createStore({ nodes, edges, width, height, fitView, nodeOrigin });
const store = createStore({ nodes, edges, width, height, fitView, nodeOrigin, nodeExtent });
setContext(key, {
getStore: () => store