Skip to Content
示例Nodes

可旋转节点

这个例子展示了如何实现一个可以使用 CSS 变换旋转的自定义节点

🌐 This example shows how to implement a custom node that can be rotated using CSS transforms.

import React from 'react'; import { ReactFlow, Background } from '@xyflow/react'; import '@xyflow/react/dist/style.css'; import RotatableNode from './RotatableNode'; import { nodes, edges } from './initialElements'; const nodeTypes = { rotatableNode: RotatableNode, }; function Flow() { return ( <ReactFlow nodeTypes={nodeTypes} defaultNodes={nodes} defaultEdges={edges} fitView > <Background /> </ReactFlow> ); } export default Flow;
Last updated on