@rxflow/base
Version:
BaseFlow - 核心 Flow 组件库
44 lines (43 loc) • 1.27 kB
JavaScript
/**
* @author: yanxianliang
* @date: 2025-07-23 16:29
* @modified:2025/7/23 16:29 by yanxianliang
* @desc: Mark
*
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
*/
import { symbols } from "./symbols";
import { jsx as _jsx } from "react/jsx-runtime";
export var Marker = function Marker(_ref) {
var id = _ref.id,
type = _ref.type,
color = _ref.color,
_ref$width = _ref.width,
width = _ref$width === void 0 ? 12.5 : _ref$width,
_ref$height = _ref.height,
height = _ref$height === void 0 ? 12.5 : _ref$height,
_ref$markerUnits = _ref.markerUnits,
markerUnits = _ref$markerUnits === void 0 ? 'strokeWidth' : _ref$markerUnits,
strokeWidth = _ref.strokeWidth,
_ref$orient = _ref.orient,
orient = _ref$orient === void 0 ? 'auto-start-reverse' : _ref$orient;
var _Symbol = symbols[type];
if (!_Symbol) {
return null;
}
return /*#__PURE__*/_jsx("marker", {
className: "react-flow__arrowhead",
id: id,
markerWidth: "".concat(width),
markerHeight: "".concat(height),
viewBox: "-10 -10 20 20",
markerUnits: markerUnits,
orient: orient,
refX: "0",
refY: "0",
children: /*#__PURE__*/_jsx(_Symbol, {
color: color,
strokeWidth: strokeWidth
})
});
};