Node Data
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
}
tip
When using the image
property, width and height of the image are mandatory. You can use new Image()
to obtain them. For detailed methods, refer to this link.
Update a Single Node
You can use reshapeNode
to update a specific node. Similarly, you can use the previously mentioned E
function, where the second parameter is the node data to be updated:
mind.reshapeNode(MindElixir.E('d6e5f69edb6336c3'), { style: { fontWeight } })