Pular para o conteúdo principal

Dados dos nós

export type NodeObj = {
topic: string // Topic Content
id: Uid // Node ID (Auto-generated)
style?: {
// Node Style
fontSize?: string
color?: string
background?: string
fontWeight?: string
}
children?: NodeObj[] // Child Nodes
tags?: string[] // Tags
icons?: string[] // Icons
hyperLink?: string // Hyperlink
expanded?: boolean // Whether expanded
direction?: number // Node direction (Only effective for main nodes)
root?: boolean // Whether root node
image?: {
// Add an image to the node, must provide width and height when adding an image
url: string // Image link
width: number
height: number
}
branchColor?: string // Color of this branch
parent?: NodeObj // Parent node object (Generated by the program)
dangerouslySetInnerHTML?: string // Directly insert HTML
}
dica

Ao usar a propriedade image, largura e altura da imagem são obrigatórias. Você pode obtê-las com new Image(). Para os detalhes, consulte este link.

Atualizar um único nó​

Você pode usar reshapeNode para atualizar um nó específico. Da mesma forma, pode usar a função E mencionada antes, cujo segundo parâmetro são os dados do nó a serem atualizados:

mind.reshapeNode(MindElixir.E('d6e5f69edb6336c3'), { style: { fontWeight } })