coco-mxgraph-editor
mxgraph editor
基于 mxgraph,vue3,typescript 的 editor 组件
<template>
<MyDraw :nodes="[]" />
</template>
<script setup lang="ts">
import { MyDraw } from "coco-mxgraph-editor"
import "coco-mxgraph-editor/dist/style.css"
</script>
props
nodes
SidebarNode[]
出现在侧边栏的节点
interface SidebarNode {
name: string
nodes?: SidebarNodeConfig[]
children?: SidebarNode[]
}
interface SidebarNodeConfig {
name: string
style: string
type: ItemType
width: number
height: number
value?: string
info?: Record<string, any>
}
hideSidebar
隐藏侧边栏
boolean
toolbar
自定义 toolbar
string[]
//默认值
// ['undo', 'redo', 'zoomIn', 'zoomOut', 'delete']
handleAddVertex?
添加 vertex 节点触发
(
cell: mxCell,
x: number,
y: number,
target: mxCell
) => void
handleDeleteCell?
删除节点触发
(cell: mxCell) => void
handleAddEdge?
添加 edge 节点触发
(cell: mxCell) => void
handleMoveCell?
移动节点触发
(cell: mxCell) => void
cellRightClick?
自定义侧边栏
(cells: mxCell[], menu: mxPopupMenuHandler) => void
beforeDeleteCell?
删除节点前触发,返回false不会触发删除
(cell: mxCell) => boolean
beforeAddCell?
添加节点前触发,返回false不会添加节点
(cell: mxCell) => boolean
连接规则
mx.mxConnectionHandler.prototype.connect = function (
source: mxCell,
target: mxCell,
evt: MouseEvent,
dropTarget: mxCell
) {
this.originConnect.apply(this, arguments as any)
}
outlineMap
鸟瞰图
boolean
Related Packages
Version History
| Version | Released | Vue | License |
|---|---|---|---|
| 0.0.88 | ^3.2.41 | MIT | |
| 0.0.87 | ^3.2.41 | MIT | |
| 0.0.86 | ^3.2.41 | MIT | |
| 0.0.84 | ^3.2.41 | MIT | |
| 0.0.83 | ^3.2.41 | MIT | |
| 0.0.82 | ^3.2.41 | MIT | |
| 0.0.81 | ^3.2.41 | MIT | |
| 0.0.79 | ^3.2.41 | MIT | |
| 0.0.78 | ^3.2.41 | MIT | |
| 0.0.77 | ^3.2.41 | MIT | |
| 0.0.76 | ^3.2.41 | MIT | |
| 0.0.75 | ^3.2.41 | MIT | |
| 0.0.74 | ^3.2.41 | MIT | |
| 0.0.73 | ^3.2.41 | MIT | |
| 0.0.72 | ^3.2.41 | MIT | |
| 0.0.71 | ^3.2.41 | MIT | |
| 0.0.58 | ^3.2.41 | MIT | |
| 0.0.56 | ^3.2.41 | ||
| 0.0.55 | ^3.2.41 | ||
| 0.0.53 | ^3.2.41 | ||
| 0.0.52 | ^3.2.41 | ||
| 0.0.51 | ^3.2.41 | ||
| 0.0.8 | ^3.2.41 | MIT | |
| 0.0.7 | ^3.2.41 | MIT | |
| 0.0.6 | ^3.2.41 | MIT | |
| 0.0.5 | ^3.2.41 | ||
| 0.0.4 | ^3.2.41 | ||
| 0.0.3 | ^3.2.41 | ||
| 0.0.2 | ^3.2.41 | ||
| 0.0.1 | ^3.2.41 |
Showing the latest 30 of 31. See every release on npm