๐งฐ Functions โ
- createTopic
- toCanvas
- string2Yjs
- yjs2string
- getDefaultData
- getClassName
- connectNodeView
- createLine
- nonLayeredTidyTree
- right2left
- layout
- layout
- layout
- moveRootMindmapToCenter
- createSubTopic
- Tab
โ๏ธ createTopic โ
Function | Type |
---|---|
createTopic | (node: Node<ITopicNodeAttrs>, context: NodeToCanvasContext) => Box |
โ๏ธ toCanvas โ
Function | Type |
---|---|
toCanvas | (node: Node<ITopicNodeAttrs and { marginHeight: string; marginWidth: string; childMarginHeight: string; childMarginWidth: string; theme: string; structure: string; left?: string or undefined; top?: string or undefined; }>, context: NodeToCanvasContext) => Box |
โ๏ธ string2Yjs โ
Function | Type |
---|---|
string2Yjs | (xmlString: string) => Uint8Array |
โ๏ธ yjs2string โ
Function | Type |
---|---|
yjs2string | (doc: Doc) => string |
โ๏ธ getDefaultData โ
Function | Type |
---|---|
getDefaultData | () => string |
โ๏ธ getClassName โ
Function | Type |
---|---|
getClassName | (from: NodeView, to: NodeView) => string |
โ๏ธ connectNodeView โ
Function | Type |
---|---|
connectNodeView | (this: EdgeLine) => void |
โ๏ธ createLine โ
Function | Type |
---|---|
createLine | (this: ILayoutController, from: NodeView, to: NodeView, isHorizontal: boolean) => void |
โ๏ธ nonLayeredTidyTree โ
Function | Type |
---|---|
nonLayeredTidyTree | (this: ILayoutController, nodeView: NodeView, isHorizontal: boolean or undefined, children: View<UI>[], offset?: number) => void |
โ๏ธ right2left โ
ๅณไพง็ๆ ๅบไบๆไธช่็น่ชๅจๆ่ฝฌ
Function | Type |
---|---|
right2left | (reference: NodeView, child?: NodeView[] or undefined) => void |
โ๏ธ layout โ
่ทๅไธไธช่็นๆฏๅทฆไพง่ฟๆฏๅณไพง
Function | Type |
---|---|
layout | (this: ILayoutController, node: View<UI>) => void |
โ๏ธ layout โ
Function | Type |
---|---|
layout | (this: ILayoutController, node: View<UI>) => void |
โ๏ธ layout โ
Function | Type |
---|---|
layout | (this: ILayoutController, node: View<UI>) => void |
โ๏ธ moveRootMindmapToCenter โ
็งปๅจๅฐไธญๅฟ
Function | Type |
---|---|
moveRootMindmapToCenter | () => Command |
โ๏ธ createSubTopic โ
ๅๅปบๅญ่็น
Function | Type |
---|---|
createSubTopic | (topic: Node<any>, storage: IStorage) => Command |
โ๏ธ Tab โ
Function | Type |
---|---|
Tab | (state: State, view: BoardView) => boolean |
๐ง Constants โ
โ๏ธ VIEW_KEY โ
Constant | Type |
---|---|
VIEW_KEY | "__Y_MINDMAP_VIEW__" |
โ๏ธ theme โ
Constant | Type |
---|---|
theme | Theme |
โ๏ธ topic โ
Constant | Type |
---|---|
topic | NodeType<NodeSpec<ITopicNodeAttrs>> |
โ๏ธ CLASS_NAME โ
Constant | Type |
---|---|
CLASS_NAME | "_mindmap-edge-line_" |
โ๏ธ structures โ
Constant | Type |
---|---|
structures | { left: (this: ILayoutController, node: View<UI>) => void; right: (this: ILayoutController, node: View<UI>) => void; standard: (this: ILayoutController, node: View<...>) => void; } |
๐ญ Schema โ
Methods โ
โ๏ธ registerNode โ
Method | Type |
---|---|
registerNode | (node: NodeType<NodeSpec<any>>) => void |
โ๏ธ parseNode โ
parseNode from xmlElement
Method | Type |
---|---|
parseNode | (xml: YXmlElement<{ [key: string]: string; }> or YXmlText) => Node<any> or null |
โ๏ธ createNode โ
createNode
Method | Type |
---|---|
createNode | (type: string or NodeType<NodeSpec<any>>, attrs: IAttrs, content: INodeContent) => Node<any> |
๐ญ NodeType โ
Methods โ
โ๏ธ setSchema โ
Method | Type |
---|---|
setSchema | (schema: Schema) => void |
โ๏ธ create โ
Method | Type |
---|---|
create | (attrs?: IAttrs, content?: INodeContent, initYFragment?: YXmlElement<{ [key: string]: string; }> or YXmlText or null) => Node<any> |
โ๏ธ parse โ
Method | Type |
---|---|
parse | (xml: YXmlElement<{ [key: string]: string; }> or YXmlText) => Node<any> |
โ๏ธ createNode โ
Method | Type |
---|---|
createNode | <T extends NodeSpec<any>>(options: { name: string; } and T) => NodeType<T> |
๐ญ Node โ
ไธไธชๅบ็ก็node ไฝไธบๅฎไน่ฝฌไธบyjs็ไปฃ็
Methods โ
โ๏ธ appendChild โ
Method | Type |
---|---|
appendChild | (node: Node<any>, reference?: Node<any> or undefined) => void |
โ๏ธ removeChild โ
Method | Type |
---|---|
removeChild | (node: Node<any>) => void |
๐ญ View โ
Methods โ
โ๏ธ pointFromPos โ
Method | Type |
---|---|
pointFromPos | (pos: number, preferBefore: boolean) => { object: UI or null; offset: number; } |
โ๏ธ destroy โ
Method | Type |
---|---|
destroy | () => void |
โ๏ธ nodeAt โ
Method | Type |
---|---|
nodeAt | (node: Node<any>) => View<UI> or undefined |
๐ญ TextView โ
Methods โ
โ๏ธ pointFromPos โ
Method | Type |
---|---|
pointFromPos | (pos: number) => { object: Text or null; offset: number; } |
๐ญ NodeView โ
Methods โ
โ๏ธ createChildView โ
Method | Type |
---|---|
createChildView | (yFragment: YXmlElement<{ [key: string]: string; }> or YXmlText, index?: number) => void |
โ๏ธ removeChildView โ
็งป้คๅญ่็น
Method | Type |
---|---|
removeChildView | (index: number, size: number) => void |
โ๏ธ getMatrix โ
Method | Type |
---|---|
getMatrix | (inner?: boolean or undefined) => Matrix |
๐ญ State โ
Methods โ
โ๏ธ create โ
Method | Type |
---|---|
create | (data: Doc or Uint8Array or undefined, config: Omit<StateConfig, "doc" or "undoManager">) => State |
๐ญ BoardView โ
Methods โ
โ๏ธ setTheme โ
Method | Type |
---|---|
setTheme | (theme: Theme) => void |
โ๏ธ toDataUrl โ
Method | Type |
---|---|
toDataUrl | (type?: "jpg" or "png" or "webp", quality?: number or undefined) => string or Promise<string> |
โ๏ธ toSvg โ
่ฝฌไธบsvg็ๆนๆณ
Method | Type |
---|---|
toSvg | () => string or Promise<any> |
โ๏ธ destroy โ
Method | Type |
---|---|
destroy | () => void |
โ๏ธ create โ
Method | Type |
---|---|
create | (state: State, theme: Theme, options?: ViewOptions or undefined) => BoardView |
๐ญ CommandManager โ
Methods โ
โ๏ธ registerCommands โ
Method | Type |
---|---|
registerCommands | (rawCommands: RawCommands) => void |
๐ญ Extension โ
Methods โ
โ๏ธ create โ
Method | Type |
---|---|
create | (options: IExtensionOptions, boardOptions: Record<string, any>) => Extension<Record<string, any>, Record<string, any>> |
๐ญ ExtensionManager โ
Methods โ
โ๏ธ invokeUpdate โ
Method | Type |
---|---|
invokeUpdate | () => void |
โ๏ธ invokeCreate โ
Method | Type |
---|---|
invokeCreate | () => void |
โ๏ธ invokeDestroy โ
Method | Type |
---|---|
invokeDestroy | () => void |
โ๏ธ registerExtension โ
Method | Type |
---|---|
registerExtension | (extensions: Record<string, IExtensionConfig<any, any>>, defaultOptions: Record<string, any>) => void |
๐ญ Board โ
Methods โ
โ๏ธ init โ
Method | Type |
---|---|
init | (data?: string or Doc or Uint8Array or undefined) => void |
โ๏ธ undo โ
Method | Type |
---|---|
undo | () => void |
โ๏ธ redo โ
Method | Type |
---|---|
redo | () => void |
โ๏ธ toDataUrl โ
Method | Type |
---|---|
toDataUrl | (type?: "jpg" or "png" or "webp", quality?: number or undefined) => string or Promise<string> |
โ๏ธ toSvg โ
่ฝฌไธบsvg็ๆนๆณ
Method | Type |
---|---|
toSvg | () => string or Promise<any> or null |
โ๏ธ getData โ
Method | Type |
---|---|
getData | () => string |
โ๏ธ toString โ
Method | Type |
---|---|
toString | () => string |
โ๏ธ destroy โ
้ๆฏ็ๅๆณ
Method | Type |
---|---|
destroy | () => void |
๐ญ EdgeLine โ
๐ญ LayoutController โ
Methods โ
โ๏ธ setStructure โ
Method | Type |
---|---|
setStructure | (structure: string) => void |
โ๏ธ setMargin โ
Method | Type |
---|---|
setMargin | (margin: IMargin) => void |
โ๏ธ doLayout โ
Method | Type |
---|---|
doLayout | (nodeView?: NodeView) => void |
โ๏ธ handleMindmapUpdate โ
Method | Type |
---|---|
handleMindmapUpdate | (e: PropertyEvent) => void |
โ๏ธ destroy โ
Method | Type |
---|---|
destroy | () => void |
๐น Interfaces โ
โ๏ธ NodeSpec โ
Property | Type | Description |
---|---|---|
content | string or undefined | |
group | string or undefined | |
attrs | { [key in keyof K]: IAttrSpec; } or undefined | |
selectable | boolean or undefined | |
draggable | boolean or undefined | |
toCanvas | ((node: Node<K>, context: NodeToCanvasContext) => UI) or undefined |
โ๏ธ ISchemaSpec โ
Property | Type | Description |
---|---|---|
nodes | { [key: string]: NodeType<NodeSpec<any>>; } | |
topNodeType | NodeType<NodeSpec<any>> |
โ๏ธ StateConfig โ
Property | Type | Description |
---|---|---|
schema | Schema | |
doc | Doc | |
undoManager | UndoManager | |
plugins | unknown[] or undefined | |
selected | Node<any>[] or undefined | |
pluginState | Record<string, any> or undefined |
โ๏ธ IExtensionConfig โ
Property | Type | Description |
---|---|---|
addCommands | ((this: Extension<IOptions, IStorage>, extension: Extension<IOptions, IStorage>) => RawCommands) or undefined | |
addNodes | ((this: Board<any>) => Record<string, NodeType<NodeSpec<any>>>) or undefined | |
addOptions | ((this: Extension<IOptions, IStorage>) => IOptions) or undefined | |
addStorage | ((this: Extension<IOptions, IStorage>) => IStorage) or undefined | |
addKeymap | ((this: Extension<IOptions, IStorage>) => Record<string, Command>) or undefined | |
onBeforeCreate | ((this: Extension<IOptions, IStorage>, board: Board<any>) => void) or undefined | |
onCreate | ((this: Extension<IOptions, IStorage>, board: Board<any>) => void) or undefined | |
onDestroy | ((this: Extension<IOptions, IStorage>, board: Board<any>) => void) or undefined | |
onUpdate | ((this: Extension<IOptions, IStorage>, board: Board<any>) => void) or undefined |
โ๏ธ IEdgeLineData โ
Property | Type | Description |
---|---|---|
from | NodeView | |
to | NodeView | |
isHorizontal | boolean | |
mode | IEdgeLineMode or undefined |
๐ธ Types โ
โ๏ธ NodeToCanvasContext โ
Type | Type |
---|---|
NodeToCanvasContext | `{ |
theme: Theme;
render: Leafer;
}` |
โ๏ธ INodeContent โ
Type | Type |
---|---|
INodeContent | Array<XmlElement or XmlText or Node> or XmlElement or XmlText or string or null |
โ๏ธ ViewOptions โ
Type | Type |
---|---|
ViewOptions | `{ |
width?: number,
height?: number,
debug?: boolean,
container?: any
}` |
โ๏ธ IExtensionOptions โ
Type | Type |
---|---|
IExtensionOptions | `IExtensionConfig and { |
name: string,
board: Board
}` |
โ๏ธ Options โ
Type | Type |
---|---|
Options | `{ |
data?: string or Uint8Array;
width?: number;
height?: number;
theme?: string;
themeList?: { [key: string]: Theme };
options?: Record<string, any>;
extensions?: Record<string, IExtensionConfig>
container?: any
} and { schema?: Schema; debug?: boolean; }` |
โ๏ธ IEdgeLineMode โ
Type | Type |
---|---|
IEdgeLineMode | 'curve' or 'direct' or 'corner' or 'bezier' |
โ๏ธ IOptions โ
Type | Type |
---|---|
IOptions | NonNullable<unknown> |
โ๏ธ IStorage โ
Type | Type |
---|---|
IStorage | `{ |
nodeLayoutControllerMap: WeakMap<NodeView, LayoutController>
}` |