UNPKG

@rxflow/base

Version:

BaseFlow - 核心 Flow 组件库

61 lines (59 loc) 1.32 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ManhattanEdge = void 0; var _react = require("@xyflow/react"); var _react2 = require("react"); var _manhattan = require("@rxflow/manhattan"); var _jsxRuntime = require("react/jsx-runtime"); /** * @author: yanxianliang * @date: 2025-10-20 09:19 * @modified:2025/10/20 09:19 by yanxianliang * @desc: 智能边 * * Copyright (c) 2025 by yanxianliang, All Rights Reserved. */ const ManhattanEdge = exports.ManhattanEdge = /*#__PURE__*/(0, _react2.memo)(({ source, target, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition }) => { const { getState } = (0, _react.useStoreApi)(); const nodeLookup = getState().nodeLookup; const path = (0, _manhattan.getManHattanPath)({ sourceNodeId: source, targetNodeId: target, sourceX, sourceY, sourcePosition, targetX, targetY, targetPosition, // // sourcePosition: { // x: sourceX, // y: sourceY // }, // targetPosition: { // x: targetX, // y: targetY // }, nodeLookup: nodeLookup // options: { // padding: 10 // } }); return /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.BaseEdge, { path: path }); }); ManhattanEdge.displayName = 'manhattan';