MyGit

11.10.0

xyflow/xyflow

版本发布时间: 2023-11-10 23:55:18

xyflow/xyflow最新发布版本:@xyflow/system@0.0.42(2024-09-12 18:24:16)

Upcoming v12

We want to make the migration for v12 as smooth as possible. That's why we added deprecation warnings for the following util functions:

Deprecations / Renamings

Rename useReactFlow.project to useReactFlow.screenToFlowPosition

⚠️ changes: no need to subtract react flow bounds anymore!

before:

const reactFlowBounds = reactFlowWrapper.current.getBoundingClientRect();

const position = reactFlowInstance.project({
  x: event.clientX - reactFlowBounds.left,
  y: event.clientY - reactFlowBounds.top,
});

after:

const position = reactFlowInstance.screenToFlowPosition({
  x: event.clientX,
  y: event.clientY,
});

Rename getTransformForBounds to getViewportForBounds

⚠️ changes: returns { x: number, y: number, zoom: number } instead of [number, number, number].

before:

const [x, y, zoom] = getTransformForBounds(bounds, width, height, 0.5, 2)

after:

const {x, y, zoom} = getViewportForBounds(bounds, width, height, 0.5, 2)

Rename getRectOfNodes to getNodesBounds

no changes, just a renaming.

New features

Minor Changes

Patch Changes

相关地址:原始地址 下载(tar) 下载(zip)

查看:2023-11-10发行的版本