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 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-mindflow

v1.0.0

Published

A React mindmap component based on D3.js

Readme

React MindFlow

基于 React 和 AntV G6 的思维导图组件。

特性

  • 🎨 支持自定义节点样式
  • 🌓 支持亮色/暗色主题
  • 📐 支持水平/垂直布局
  • 🖱️ 支持节点拖拽
  • 🔍 支持画布缩放
  • 📦 支持 TypeScript

安装

npm install react-mindflow
# 或
yarn add react-mindflow
# 或
pnpm add react-mindflow

使用

import { MindFlow } from 'react-mindflow';

const data = {
  id: 'root',
  label: '思维导图',
  children: [
    {
      id: '1',
      label: '子节点1',
      children: [
        { id: '1-1', label: '子节点1.1' },
        { id: '1-2', label: '子节点1.2' },
      ],
    },
    {
      id: '2',
      label: '子节点2',
    },
  ],
};

function App() {
  return (
    <MindFlow
      data={data}
      width={800}
      height={600}
      theme="light"
      direction="H"
      onNodeClick={(node) => console.log('点击节点:', node)}
    />
  );
}

API

MindFlow Props

| 属性 | 说明 | 类型 | 默认值 | | --- | --- | --- | --- | | data | 思维导图数据 | MindFlowNode | - | | width | 画布宽度 | number | 800 | | height | 画布高度 | number | 600 | | direction | 布局方向 | 'H' | 'V' | 'H' | | theme | 主题 | 'light' | 'dark' | 'light' | | nodePadding | 节点内边距 | number | 16 | | nodeSpacing | 同级节点间距 | number | 50 | | levelSpacing | 层级间距 | number | 100 | | onNodeClick | 节点点击事件 | (node: MindFlowNode) => void | - | | onNodeDoubleClick | 节点双击事件 | (node: MindFlowNode) => void | - | | onNodeContextMenu | 节点右键菜单事件 | (node: MindFlowNode, e: MouseEvent) => void | - |

MindFlowNode

interface MindFlowNode {
  id: string;
  label: string;
  children?: MindFlowNode[];
  style?: {
    fill?: string;
    stroke?: string;
    lineWidth?: number;
    [key: string]: any;
  };
}

开发

# 安装依赖
pnpm install

# 启动开发服务器
pnpm dev

# 构建库文件
pnpm build

# 构建示例
pnpm build:example

License

MIT