Giter Club home page Giter Club logo

pro-flow's Introduction

ProFlow

A Flow Editor Framework base on React-Flow.



English · 简体中文 · Changelog . Report Bug · Request Feature

Table of contents

TOC

📦 Installation

Important

This package is ESM only.

To install @ant-design/pro-flow, run the following command:

$ pnpm install @ant-design/pro-flow

Compile with Next.js

Note

By work correct with Next.js SSR, add transpilePackages: ['@ant-design/pro-flow'] to next.config.js. For example:

const nextConfig = {
  transpilePackages: ['@ant-design/pro-flow'],
};

✨ Features

Note

ProFlow focuses on quickly setting up a flow node-editor framework. It aims to empower developers to easily create rich, dynamic, and intuitive flow editor interfaces.

ProFlow is a canvas editor built on react-flow. It has the following features:

  • 💠 Modern Node Design: It features modern default nodes and grouped node components, making the interface more intuitive, readable, and user-friendly.
  • 🌐 Out-of-the-box Components: It supports components such as MiniMap, Inspector, and Loading, providing rich extension capabilities and customization options, allowing users to easily customize the canvas interface.
  • 🎨 Automatic Layout Algorithm: It comes with the dagre layout algorithm, allowing users to achieve automatic layout effects with just nodes and relationships, making it easy to achieve an aesthetically pleasing presentation of flowcharts.
  • 🖱️ Flowchart Data Manipulation: It provides the useFlowViewer feature, allowing users to easily manipulate and manage canvas-related data, achieving a personalized interactive experience.
  • 🧩 Custom Nodes and Edges: It supports the ability to customize nodes, custom edges, and provides additional attributes such as label, zoom, and selectType to meet personalized customization needs.
  • 📱 Mobile-Friendly: It defaults to providing touchpad interactive canvas logic in figma mode, adapting to mobile operations for a smoother user experience.
  • 🎨 Canvas Editor Capabilities: It provides out-of-the-box canvas editor capabilities, including rich canvas and node operation functions such as copy-paste, undo-redo, enhancing user operation efficiency and convenience.

🔨 Usage

import { FlowView } from '@ant-design/pro-flow';

function App() {
  const { styles } = useStyles();

  return (
    <div className={'container'}>
      <FlowView nodes={[]} edges={[]} />
    </div>
  );
}

export default App;

Add Data

export const nodes = [
  {
    id: 'a1',
    data: {
      title: 'XXX_API_a1',
      logo: 'https://mdn.alipayobjects.com/huamei_ntgeqc/afts/img/A*kgyiRKi04eUAAAAAAAAAAAAADvuvAQ/original',
      description: 'XXX_XXX_XXX_API',
    },
  },
  {
    id: 'a2',
    data: {
      title: 'XXX_API_a2',
      logo: 'https://mdn.alipayobjects.com/huamei_ntgeqc/afts/img/A*kgyiRKi04eUAAAAAAAAAAAAADvuvAQ/original',
      description: 'XXX_XXX_XXX_API',
    },
  },
  {
    id: 'a3',
    data: {
      title: 'XXX_API_a3',
      logo: 'https://mdn.alipayobjects.com/huamei_ntgeqc/afts/img/A*kgyiRKi04eUAAAAAAAAAAAAADvuvAQ/original',
      description: 'XXX_XXX_XXX_API',
    },
  },
];
export const edges = [
  {
    id: 'a1-a2',
    source: 'a1',
    target: 'a2',
  },
  {
    id: 'a1-a3',
    source: 'a1',
    target: 'a3',
    type: 'radius',
  },
];

Add Interaction

import { FlowView } from '@ant-design/pro-flow';
import useStyles from './css/index.style';
import { edges, nodes } from './data';

function App() {
  const { styles } = useStyles();

  return (
    <div className={styles.container}>
      <FlowView nodes={nodes} edges={edges} />
    </div>
  );
}

export default App;

🖥 Browser compatibility

Note

edge Edge chrome safari electron_48x48
Edge last 2 versions last 2 versions last 2 versions last 2 versions

⌨️ Local Development

You can use Github Codespaces for online development:

Or clone it for local development:

$ git clone https://github.com/ant-design/pro-flow.git
$ cd pro-flow
$ pnpm install
$ pnpm dev

🤝 Contributing

Important

Join our collaborative ecosystem. Your contributions are the heartbeat of our project. Here's how you can be an integral part of our vibrant community:

  • Integrate and Innovate: Incorporate Ant Design Pro, umi, and ProFlow into your projects. Your real-world usage and feedback are invaluable to us.
  • Voice Your Insights: Encounter a glitch? Have a query? Your perspectives matter. Share them by submitting issues and help us enhance the user experience.
  • Shape the Future: Have code enhancements or feature ideas? We invite you to propose pull requests and contribute directly to the evolution of our codebase.

Every contribution, big or small, is celebrated. Join us in our mission to refine and elevate the world of open-source enterprise UI components. 😃





🛣️ Ecosystem

  • ProComponents - Designed for Enterprise-Level Application, Use Ant Design like a Pro!.
  • ProEditor - The Ultimate Editor UI Framework and Components.
  • ProFlow - A Flow Editor Framework base on React-Flow.
  • ProChat - Components Library for Quickly Building LLM Chat Interfaces.


📝 License

Copyright © 2023 - present AFX & Ant Digital.
This project is MIT licensed.

pro-flow's People

Contributors

actions-user avatar arvinxx avatar canisminor1990 avatar chenshuai2144 avatar kazoottt avatar meganjohnson96 avatar modestfun avatar semantic-release-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

pro-flow's Issues

🧐[问题] 自定义节点时参数问题

🧐 问题描述

reactflow 自定义节点时会会有一个 NodeProps 的类型别名,可以通过这个类型别名明确参数。但是 ProFlow 并没有导出这个类型别名,可以导出这个类型别名吗?如果 NodeProps 不符合 ProFlow 的参数要求,那么有没有别的类型别名可以用于定义自定义组件的参数?或者自定义组件这部分给出指导?

💻 示例代码

🚑 其他信息

关于和 XFlow 的区别 🤔️

🧐 问题描述

由于最近也在调研流程图相关的一些能力,目前比较好奇,ProFlow 与 XFlow 的一些具体区别,以及各自对应的具体应用场景是哪些?

🐛[BUG]

Here we go again...

When rendering the component, there are errors related to the import of ReactFlow. I will also attach screenshots below. Version of pro-flow is 1.0.0.

image
image

🐛[BUG]

Hello! I have encountered an issue when rendering the component, facing the following problem:
chunk-MKLIEGNN.js?v=1e762b64:3318 Uncaught TypeError: Cannot read properties of undefined (reading 'zh_CN')
at @ant-design_pro-flow.js?v=c67f97d6:256307:79
Version 0.21.0
I will attach screenshots below.
image

image

🧐[问题] Antd 4.x的项目无法使用吗

🧐 问题描述

使用umimax+antd4的cli
无法使用proflow 直接工程报错

💻 示例代码

依赖情况:
"dependencies": {
"@ant-design/charts": "^1.4.3",
"@ant-design/icons": "^4.7.0",
"@ant-design/pro-components": "1.1.1",
"@ant-design/pro-flow": "^1.2.2",
"@umijs/route-utils": "^2.0.0",
"@wangeditor/editor": "^5.1.23",
"@wangeditor/editor-for-react": "^1.0.6",
"ahooks": "^3.7.8",
"antd": "^4.20.0",
"classnames": "^2.3.0",
"dagre": "^0.8.5",
"intro.js": "^7.2.0",
"intro.js-react": "^1.0.0",
"lodash": "^4.17.0",
"moment": "^2.29.0",
"omit.js": "^2.0.2",
"rc-menu": "^9.1.0",
"rc-util": "^5.16.0",
"react": "^17.0.0",
"react-dev-inspector": "^1.7.0",
"react-dom": "^17.0.0",
"react-flow-renderer": "^10.3.17",
"react-form-simple": "^1.4.1",
"react-helmet-async": "^1.2.0",
"umi": "^3.5.0"
},
"devDependencies": {
"@ant-design/pro-cli": "^2.1.0",
"@playwright/test": "^1.17.0",
"@types/classnames": "^2.3.1",
"@types/express": "^4.17.0",
"@types/history": "^4.7.0",
"@types/jest": "^26.0.0",
"@types/lodash": "^4.14.0",
"@types/react": "^18.2.35",
"@types/react-dom": "^18.2.14",
"@types/react-helmet": "^6.1.0",
"@umijs/fabric": "^2.11.1",
"@umijs/openapi": "^1.6.0",
"@umijs/plugin-blocks": "^2.2.0",
"@umijs/plugin-esbuild": "^1.4.0",
"@umijs/plugin-openapi": "^1.3.3",
"@umijs/preset-ant-design-pro": "^1.3.0",
"@umijs/preset-dumi": "^1.1.0",
"@umijs/preset-react": "^2.1.0",
"cross-env": "^7.0.0",
"cross-port-killer": "^1.3.0",
"detect-installer": "^1.0.0",
"eslint": "^7.32.0",
"gh-pages": "^3.2.0",
"husky": "^7.0.4",
"jsdom-global": "^3.0.0",
"lint-staged": "^10.0.0",
"mockjs": "^1.1.0",
"prettier": "^2.5.0",
"stylelint": "^13.0.0",
"swagger-ui-dist": "^4.12.0",
"typescript": "^4.5.0",
"umi-serve": "^1.9.10"
},

🚑 其他信息

screenshot-20240223-183621

🐛[BUG] FlowEditor在节点为空时会一直处于画布初始化状态,导出无法渲染空画布

🐛 bug 描述

新建FlowEditor时,如果没有节点,则会一直处于画布初始化状态,导致无法初始化一个空画布。源码中是用的useNodesInitialized 获取节点加载完成的状态,并根据这个状态区渲染加载中还是画布。但是这个hooks官网说没有节点时始终返回false,导致没有节点时一直处于画布加载中的状态
官网文档: https://reactflow.dev/api-reference/hooks/use-nodes-initialized#notes

📷 复现步骤

官网任意一个 FlowEditor 的demo去掉其中的 useEffect 添加节点的代码即可

🏞 期望结果

FlowEditor在没有节点时能正常渲染画布

💻 复现代码

可复现 demo

© 版本信息

  • pro-flow-editor 版本: [e.g. 1.0.0] 1.2.1
  • 浏览器环境 chrome 120
  • 开发环境 [e.g. mac OS] linux kde

🚑 其他信息

🐛[BUG] BasicGroupNode 没有导出

🐛 bug 描述

使用 import { BasicGroupNode } from '@ant-design/pro-flow'; 导入 BasicGroupNode 时提示没有此导出成员

📷 复现步骤

🏞 期望结果

能正常导入

💻 复现代码

© 版本信息

  • pro-flow-editor 版本: [e.g. 1.0.0] 1.1.0
  • 浏览器环境 linux kde chrome 120
  • 开发环境 [e.g. mac OS]

🚑 其他信息

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.