Saltar al contenido principal

Datos de nodos

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
}
consejo

Al usar la propiedad image, el ancho y el alto de la imagen son obligatorios. Puedes obtenerlos con new Image(). Para ver el procedimiento detallado, consulta este enlace.

Actualizar un solo nodo​

Puedes usar reshapeNode para actualizar un nodo concreto. Del mismo modo puedes usar la función E mencionada antes, cuyo segundo parámetro son los datos del nodo que se quieren actualizar:

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