노드 데이터
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
}
팁
image 속성을 사용할 때는 이미지의 너비와 높이가 필수입니다. new Image()로 구할 수 있습니다. 자세한 방법은 이 링크를 참고하세요.
단일 노드 수정
특정 노드를 수정할 때는 reshapeNode를 사용할 수 있습니다. 앞서 언급한 E 함수도 같은 방식으로 쓸 수 있으며, 두 번째 매개변수가 수정할 노드 데이터입니다:
mind.reshapeNode(MindElixir.E('d6e5f69edb6336c3'), { style: { fontWeight } })