npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@graphscope/studio-flow-editor

v0.1.13

Published

一个基于 ReactFlow 的流程图编辑器组件,提供图形化编辑、节点管理、边连接等功能。

Downloads

5

Readme

Studio Flow Editor

一个基于 ReactFlow 的流程图编辑器组件,提供图形化编辑、节点管理、边连接等功能。

特性

  • 🎨 基于 ReactFlow 的流程图编辑器
  • 📦 支持节点和边的增删改查
  • 🖱️ 支持拖拽、缩放、平移等交互
  • 🎯 支持自定义节点和边的样式
  • 🔄 支持数据导入导出
  • 🎮 提供丰富的工具函数和 hooks

安装

npm install @graphscope/studio-flow-editor
# 或
yarn add @graphscope/studio-flow-editor

快速开始

import { GraphEditor, GraphProvider } from '@graphscope/studio-flow-editor';

function App() {
  return (
    <GraphProvider>
      <GraphEditor/>
    </GraphProvider>
  );
}

组件

GraphEditor

流程图编辑器主组件。

<GraphEditor/>

Props

| 参数 | 类型 | 说明 | | -------------- | --------------- | ------------------------------------------ | | children | React.ReactNode | 可以在 ReactFlow 内部添加自定义子组件 | | showBackground | boolean | 可以在 ReactFlow 是否显示背景,默认为 true | | showMinimap | boolean | 是否显示迷你地图,默认为 true | | showDefaultBtn | boolean | 是否显示默认按钮控制器,默认为 true |

按钮组件

AddNode

添加节点按钮。

import { AddNode } from '@graphscope/studio-flow-editor';

<AddNode />

ClearCanvas

清空画布按钮。

import { ClearCanvas } from '@graphscope/studio-flow-editor';

<ClearCanvas />

ExportSvg

导出 SVG 按钮。

import { ExportSvg } from '@graphscope/studio-flow-editor';

<ExportSvg />

Hooks

useGraphStore

状态管理 hook。

import { useGraphStore } from '@graphscope/studio-flow-editor';

const { store, updateStore } = useGraphStore();

useClearCanvas

清空画布 hook。

import { useClearCanvas } from '@graphscope/studio-flow-editor';

const { clearCanvas } = useClearCanvas();

useAddNode

添加节点 hook。

import { useAddNode } from '@graphscope/studio-flow-editor';

const { addNode } = useAddNode();

useExportSvg

导出 SVG hook。

import { useExportSvg } from '@graphscope/studio-flow-editor';

const { exportSvg } = useExportSvg();

工具函数

布局工具

import {  getBBox } from '@graphscope/studio-flow-editor';

// 获取节点边界框
const bbox = getBBox(nodes);

标签工具

import { createNodeLabel, createEdgeLabel } from '@graphscope/studio-flow-editor';

// 创建节点标签
const nodeLabel = createNodeLabel();

// 创建边标签
const edgeLabel = createEdgeLabel();

数据处理

import { fakeSnapshot } from '@graphscope/studio-flow-editor';

// 创建数据快照
const snapshot = fakeSnapshot(data);


## 类型定义

```typescript
import { ISchemaNode, ISchemaEdge } from '@graphscope/studio-flow-editor';

// 节点类型
const node: ISchemaNode = {
  id: '1',
  type: 'default',
  position: { x: 0, y: 0 },
  data: { label: 'Node 1' }
};

// 边类型
const edge: ISchemaEdge = {
  id: 'e1-2',
  source: '1',
  target: '2',
  data: { label: 'Edge 1-2' }
};