A highly customizable streaming flow builder. The registration ability can flexibly customize your nodes, different types of node display and form, etc.
Called on save node data (automatically close the drawer, no need to call cancel). FlowBuilder will set the validateStatusError property according to the second param (useDrawer is recommended since V1)
Introduction
English | 简体中文
A highly customizable streaming flow builder. The registration ability can flexibly customize your nodes, different types of node display and form, etc.
Try it out
https://bytedance.github.io/flow-builder
Github
https://github.com/bytedance/flow-builder
Installation
Usage
API
FlowBuilder
stringstringbooleanReact.FC<DragComponent>React.FC<DropComponent>(type?: string) => stringReact.FC<DrawerComponent>React.FC<PopoverComponent>React.FC<PopconfirmComponent>anybooleanboolean| HistoryToolConfigvertical|horizontalverticalstringbooleanbooleanbooleanbooleanReactNodenumber16number16boolean| ZoomToolConfigstring, nodeChanged?: INode) => void(undoDisabled: boolean, redoDisabled: boolean) => void(outDisabled: boolean, value: number, inDisabled: boolean) => voidbooleanReactNode(type: string, node: INode) => void(type: string, node: INode) => void(node: INode) => voidbooleanbooleanbooleanHistoryToolConfig
booleannumberZoomToolConfig
booleannumbernumbernumbernumberDragComponent
(nodeType: string) => void() => voidDropComponent
() => voidDrawerComponent
anyanyanyanyanyanyanyReact.MutableRefObject<any>PopoverComponent
anyanyanyanyanyanyanyanyPopconfirmComponent
anyanyanyanyFlowBuilderInstance
(node: INode, newNodeType: string) => void|(newNodeType: string) => void(type: 'undo' | 'redo') => void(nodes: INode | INode[] = useContext(NodeContext)) => void(type: 'out' | 'in' | number) => void() => voidFormatter
(params: {registerNodes: IRegisterNode[], nodes: INode[]}) => INode[](params: {nodes: INode[]}) => INode[](prefix?: string) => stringRegisterNode
React.FC<AddableComponent>string[]ReactNodeReactNodestringnumberstringReact.FC<ConfigComponent> |React.ForwardRefExoticComponent<ConfigComponent &React.RefAttributes<any>>string | ((node: INode, nodes: INode[]) => string)booleanReact.FC<DisplayComponent>Record<string, any>booleanbooleanbooleanstringstring|ReactNodebooleanbooleanstartis start node type andendis end node typestringRegisterRemoteNode
stringstringDisplayComponent
boolean(nodes?: INode | INode[]) => voidConfigComponent
() => voidvalidateStatusErrorproperty according to the second param (useDrawer is recommended since V1)(values: any, validateStatusError?: boolean) => voidAddableComponent
(type: string) => voidNode
booleananystringnameof the registered nodestringstring[]typeof the registered nodestringbooleanContext
Added since V1
In the context of FlowBuilder the following contexts can be used
BuilderContext
Contains props and state. The following is the state:
number(zoomValue: number) => voidINode[][](records: INode[][]) => voidnumber(index: number) => voidINode | undefined(node: INode | undefined) => voidstring(title: string) => voidstring(type: string) => voidNodeContext
Get the data of the node where it is used. For details Node
Hooks
Added since V1
In the context of FlowBuilder the following hooks can be used
useAction
(node: INode = useContext(NodeContext)) => void(node: INode, newNodeType: string) => void|(newNodeType: string) => void(newNodeType: string) => void(targetNode: INode | INode[] = useContext(NodeContext)) => voiduseDrawer
() => void(values: any, validateStatusError?: boolean) => voiduseZoom
numbernumber(type: 'out' | 'in' | number) => voiduseHistory
number(record?: INode[] = useContext(BuilderContext).nodes) => void(type: 'undo' | 'redo') => voiduseSort
(node: INode = useContext(NodeContext)) => void(node: INode = useContext(NodeContext)) => void(node: INode = useContext(NodeContext)) => void(node: INode = useContext(NodeContext)) => void