Skip to main content

mind-elixir.mindelixir

Home > mind-elixir > MindElixir

MindElixir class

Signature:

declare class MindElixir 

Constructors

Constructor

Modifiers

Description

(constructor)({ el, direction, editable, contextMenu, toolBar, keypress, mouseSelectionButton, selectionContainer, before, newTopicName, allowUndo, generateMainBranch, generateSubBranch, overflowHidden, compact, theme, alignment, scaleSensitivity, scaleMax, scaleMin, handleWheel, markdown, imageProxy, pasteHandler, mobileMultiSelect, })

Constructs a new instance of the MindElixir class

Properties

Property

Modifiers

Type

Description

addChild

(this: MindElixirInstance, el?: Topic | undefined, node?: NodeObj<unknown> | undefined) => Promise<void>

alignment

Alignment

allowUndo

boolean

arrows

Arrow[]

arrowSvg

SVGElement

before

Before

beginEdit

(this: MindElixirInstance, el?: Topic | undefined) => Promise<void>

bus

ReturnType<typeof createBus<EventMap>>

cancelFocus

(this: MindElixirInstance) => void

changeCompact

(this: MindElixirInstance, compact: boolean) => void

changeTheme

(this: MindElixirInstance, theme: Theme, shouldRefresh?: boolean) => void

clearHistory?

() => void

(Optional) Reset the undo/redo stack and update the internal baseline snapshot to the current diagram state. Call this after loading new data into an existing instance (e.g. after refresh()) to prevent users from undoing back into a previously loaded diagram.

Only available when allowUndo is true (the default).

clearSelection

(this: MindElixirInstance) => void

compact

boolean

container

HTMLElement

contextMenu

boolean | ContextMenuOption

copyNode

(this: MindElixirInstance, node: Topic, to: Topic) => Promise<void>

copyNodes

(this: MindElixirInstance, tpcs: Topic[], to: Topic) => Promise<void>

createArrow

(this: MindElixirInstance, from: Topic, to: Topic, options?: ArrowOptions) => void

createArrowFrom

(this: MindElixirInstance, arrow: Omit<Arrow, 'id'>) => void

createChildren

(this: MindElixirInstance, wrappers: Wrapper[]) => Children

createParent

(this: MindElixirInstance, nodeObj: NodeObj) => { p: Parent; tpc: Topic; }

createSummary

(this: MindElixirInstance, options?: SummaryOptions) => void

createSummaryFrom

(this: MindElixirInstance, summary: Omit<Summary, 'id'>) => void

createTopic

(this: MindElixirInstance, nodeObj: NodeObj) => Topic

createWrapper

(this: MindElixirInstance, nodeObj: NodeObj, omitChildren?: boolean) => { grp: Wrapper; top: Parent; tpc: Topic; }

currentArrow

ArrowSvg | null

currentNode

readonly

Topic | null

currentNodes

Topic[]

currentSummary

SummarySvg | null

DARK_THEME

static

readonly

Theme & { cssVar: ThemeCssVar; }

destroy

(this: Partial<MindElixirInstance>) => void

direction

0 | 1 | 2 | 3

disableEdit

(this: MindElixirInstance) => void

disposable

Array<() => void>

DOWN

static

readonly

(not declared)

draggable

boolean

dragged

Topic[] | null

E

static

typeof findEle

MindElixir E

editable

boolean

editArrowLabel

(this: MindElixirInstance, el: ArrowSvg) => void

editSummary

(this: MindElixirInstance, el: SummarySvg) => void

editTopic

(this: MindElixirInstance, el: Topic) => void

el

HTMLElement

enableEdit

(this: MindElixirInstance) => void

enableMobileMultiSelect

(this: MindElixirInstance, enable: boolean) => void

expandNode

(this: MindElixirInstance, el: Topic, isExpand?: boolean) => void

expandNodeAll

(this: MindElixirInstance, el: Topic, isExpand?: boolean) => void

exportPng

(this: MindElixirInstance, noForeignObject?: boolean, injectCss?: string) => Promise<Blob | null>

exportSvg

(this: MindElixirInstance, noForeignObject?: boolean, injectCss?: string) => Blob

findEle

(this: MindElixirInstance, id: string, el?: HTMLElement) => Topic

focusNode

(this: MindElixirInstance, el: Topic) => void

generateMainBranch

(this: MindElixirInstance, params: MainLineParams) => string

generateNewObj

(this: MindElixirInstance) => NodeObjExport

generateSubBranch

(this: MindElixirInstance, params: SubLineParams) => string

getData

(this: MindElixirInstance) => MindElixirData

getDataString

(this: MindElixirInstance) => string

getObjById

(id: string, data: NodeObj) => NodeObj | null

handleWheel

true | ((e: WheelEvent) => void)

history

Operation[]

imageProxy?

(url: string) => string

(Optional)

init

(this: MindElixirInstance, data: MindElixirData) => Error | undefined

initDown

(this: MindElixirInstance) => void

initLeft

(this: MindElixirInstance) => void

initRight

(this: MindElixirInstance) => void

initSide

(this: MindElixirInstance) => void

insertParent

(this: MindElixirInstance, el?: Topic | undefined, node?: NodeObj<unknown> | undefined) => Promise<void>

insertSibling

(this: MindElixirInstance, type: 'before' | 'after', el?: Topic | undefined, node?: NodeObj<unknown> | undefined) => Promise<void>

install

(this: MindElixirInstance, plugin: (instance: MindElixirInstance) => void) => void

isFocusMode

boolean

keypress

boolean | KeypressOptions

labelContainer

HTMLElement

layout

(this: MindElixirInstance) => void

LEFT

static

readonly

(not declared)

line1

SVGElement

line2

SVGElement

lines

SVGElement

linkController

SVGElement

linkDiv

(this: MindElixirInstance, mainNode?: Wrapper) => void

locale

string

map

HTMLElement

markdown?

(markdown: string, obj: NodeObj | Arrow | Summary) => string

(Optional)

meta?

Record<string, any>

(Optional)

mobileMultiSelect

boolean

mouseSelectionButton

0 | 2

move

(this: MindElixirInstance, dx: number, dy: number, smooth?: boolean) => boolean

moveDownNode

(this: MindElixirInstance, el?: Topic | undefined) => Promise<void>

moveNodeAfter

(this: MindElixirInstance, from: Topic[], to: Topic) => Promise<void>

moveNodeBefore

(this: MindElixirInstance, from: Topic[], to: Topic) => Promise<void>

moveNodeIn

(this: MindElixirInstance, from: Topic[], to: Topic) => Promise<void>

moveUpNode

(this: MindElixirInstance, el?: Topic | undefined) => Promise<void>

new

static

(topic: string) => MindElixirData

new MindElixir

newTopicName

string

nodeData

NodeObj

nodeDataBackup

NodeObj

nodes

HTMLElement

overflowHidden

boolean

P2

HTMLElement

P3

HTMLElement

panHelper

ReturnType<typeof createPanHelper>

pasteHandler

(e: ClipboardEvent) => void

ptState?

number

(Optional)

redo

() => void

refresh

(this: MindElixirInstance, data?: MindElixirData) => void

removeArrow

(this: MindElixirInstance, linkSvg?: ArrowSvg) => void

removeNodes

(this: MindElixirInstance, tpcs: Topic[]) => Promise<void>

removeSummary

(this: MindElixirInstance, id: string) => void

renderArrow

(this: MindElixirInstance) => void

renderSummary

(this: MindElixirInstance) => void

reshapeArrow

(this: MindElixirInstance, arrow: Arrow, patchData: Partial<Arrow>) => void

reshapeNode

(this: MindElixirInstance, tpc: Topic, patchData: Partial<NodeObj<unknown>>) => Promise<void>

RIGHT

static

readonly

(not declared)

rmSubline

(this: MindElixirInstance, tpc: Topic) => Promise<void>

root

HTMLElement

scale

(this: MindElixirInstance, scaleVal: number, offset?: { x: number; y: number; }) => void

scaleFit

(this: MindElixirInstance) => void

scaleMax

number

scaleMin

number

scaleSensitivity

number

scaleVal

number

scrollIntoView

(this: MindElixirInstance, el: HTMLElement, forceCenter?: boolean) => void

selectArrow

(this: MindElixirInstance, link: ArrowSvg) => void

selection

SelectionArea

selectionContainer

string | HTMLElement

selectNode

(this: MindElixirInstance, tpc: Topic, isNewNode?: boolean, e?: MouseEvent) => void

selectNodes

(this: MindElixirInstance, tpcs: Topic[]) => void

selectSummary

(this: MindElixirInstance, el: SummarySvg) => void

setNodeTopic

(this: MindElixirInstance, el: Topic, topic: string) => Promise<void>

SIDE

static

readonly

(not declared)

spacePressed

boolean

stringifyData

(data: object) => string

summaries

Summary[]

summarySvg

SVGElement

tempDirection

0 | 1 | 2 | 3 | null

theme

ResolvedTheme

THEME

static

readonly

Theme & { cssVar: ThemeCssVar; }

tidyArrow

(this: MindElixirInstance) => void

toCenter

(this: MindElixirInstance) => void

toolBar

boolean

undo

() => void

unselectArrow

(this: MindElixirInstance) => void

unselectNodes

(this: MindElixirInstance, tpcs: Topic[]) => void

unselectSummary

(this: MindElixirInstance) => void

version

static

string

MindElixir