MCPcopy Index your code
hub / github.com/alibaba/GGEditor

github.com/alibaba/GGEditor @3.1.3 sqlite

repository ↗ · DeepWiki ↗ · release 3.1.3 ↗
394 symbols 662 edges 76 files 41 documented · 10% 12 cross-repo links
README

English | 简体中文

GGEditor

基于 G6React 的可视化图编辑器

GitHub npm npm

安装

npm

npm install gg-editor --save

umd

<script src="https://unpkg.com/gg-editor@${version}/dist/index.js"></script>

使用

流程图

Edit GGEditor - Flow

import GGEditor, { Flow } from 'gg-editor';

const data = {
  nodes: [
    {
      id: '0',
      label: 'Node',
      x: 55,
      y: 55,
    },
    {
      id: '1',
      label: 'Node',
      x: 55,
      y: 255,
    },
  ],
  edges: [
    {
      label: 'Label',
      source: '0',
      target: '1',
    },
  ],
};

<GGEditor>
  <Flow style={{ width: 500, height: 500 }} data={data} />
</GGEditor>;

脑图

Edit GGEditor - Mind

import GGEditor, { Mind } from 'gg-editor';

const data = {
  label: 'Central Topic',
  children: [
    {
      label: 'Main Topic 1',
    },
    {
      label: 'Main Topic 2',
    },
    {
      label: 'Main Topic 3',
    },
  ],
};

<GGEditor>
  <Mind style={{ width: 500, height: 500 }} data={data} />
</GGEditor>;

示例

# 克隆仓库
$ git clone https://github.com/alibaba/GGEditor.git

# 切换目录
$ cd gg-editor

# 安装依赖
$ npm install

# 运行示例
$ npm start

Extension points exported contracts — how you extend this code

DetailPanelComponentProps (Interface)
(no doc)
src/components/DetailPanel/index.tsx
GShape (Interface)
(no doc)
src/common/interfaces/index.ts
ItemPopoverProps (Interface)
(no doc)
src/plugins/ItemPopover/index.tsx
AnchorPointContextProps (Interface)
(no doc)
src/shape/common/anchor.ts
PanelProps (Interface)
(no doc)
examples/component/detail-panel/Panel/index.tsx
WrappedClassComponentProps (Interface)
(no doc)
examples/editor/context/WrappedClassComponent.tsx
CommandProps (Interface)
(no doc)
src/components/Command/index.tsx
GGroup (Interface)
(no doc)
src/common/interfaces/index.ts

Core symbols most depended-on inside this repo

getSelectedNodes
called by 11
src/components/Graph/command/base.ts
guid
called by 11
src/utils/index.ts
isMind
called by 11
src/utils/index.ts
register
called by 9
src/common/CommandManager/index.ts
executeBatch
called by 8
src/utils/index.ts
canExecute
called by 7
src/common/interfaces/index.ts
getSelectedNodes
called by 6
src/utils/index.ts
execute
called by 6
src/common/interfaces/index.ts

Shape

Function 168
Method 98
Interface 71
Class 40
Enum 17

Languages

TypeScript100%

Modules by API surface

src/common/interfaces/index.ts28 symbols
src/components/Flow/behavior/dragAddEdge.ts27 symbols
src/components/Graph/behavior/dragCanvas.ts22 symbols
src/utils/index.ts16 symbols
src/common/constants/index.ts15 symbols
src/components/Graph/index.tsx13 symbols
src/components/Graph/command/base.ts13 symbols
src/components/Graph/behavior/recallEdge.ts12 symbols
src/components/Graph/behavior/clickItem.ts12 symbols
src/shape/nodes/bizNode.ts11 symbols
src/components/Editor/index.tsx10 symbols
src/components/Register/index.ts9 symbols

Dependencies from manifests, versioned

@antv/g63.5.2 · 1×
@babel/cli7.7.5 · 1×
@babel/core7.7.5 · 1×
@babel/plugin-transform-runtime7.7.6 · 1×
@babel/preset-env7.7.6 · 1×
@babel/preset-react7.7.4 · 1×
@babel/runtime7.7.6 · 1×
@rollup/plugin-commonjs11.0.2 · 1×
@rollup/plugin-node-resolve7.1.1 · 1×
@rollup/plugin-replace2.3.1 · 1×
@types/lodash4.14.149 · 1×
@types/react16.9.9 · 1×

For agents

$ claude mcp add GGEditor \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact