Skip to content

Commit add9a9f

Browse files
committed
refactor: rename this.box -> this.mainNodes
1 parent 347f059 commit add9a9f

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

src/index.lite.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ function MindElixir(
9090
this.mindElixirBox.appendChild(this.container)
9191
this.root = $d.createElement('me-root')
9292

93-
this.box = $d.createElement('me-children')
94-
this.box.className = 'box'
93+
this.mainNodes = $d.createElement('me-children')
94+
this.mainNodes.className = 'box'
9595

9696
// infrastructure
9797

@@ -109,7 +109,7 @@ function MindElixir(
109109
this.linkSvgGroup = createLinkSvg('topiclinks') // storage user custom link svg
110110

111111
this.map.appendChild(this.root)
112-
this.map.appendChild(this.box)
112+
this.map.appendChild(this.mainNodes)
113113
this.map.appendChild(this.lines)
114114
this.map.appendChild(this.linkController)
115115
this.map.appendChild(this.linkSvgGroup)

src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,8 @@ function MindElixir(
194194
this.mindElixirBox.appendChild(this.container)
195195
this.root = $d.createElement('me-root')
196196

197-
this.box = $d.createElement('me-children')
198-
this.box.className = 'box'
197+
this.mainNodes = $d.createElement('me-children')
198+
this.mainNodes.className = 'box'
199199

200200
// infrastructure
201201

@@ -213,7 +213,7 @@ function MindElixir(
213213
this.linkSvgGroup = createLinkSvg('topiclinks') // storage user custom link svg
214214

215215
this.map.appendChild(this.root)
216-
this.map.appendChild(this.box)
216+
this.map.appendChild(this.mainNodes)
217217
this.map.appendChild(this.lines)
218218
this.map.appendChild(this.linkController)
219219
this.map.appendChild(this.linkSvgGroup)

src/linkDiv.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export default function linkDiv(mainNode: Wrapper) {
1919
console.time('linkDiv')
2020
const root = this.root
2121
root.style.cssText = `top:${10000 - root.offsetHeight / 2}px;left:${10000 - root.offsetWidth / 2}px;`
22-
const mainNodeList = this.box.children
22+
const mainNodeList = this.mainNodes.children
2323
this.lines.innerHTML = ''
2424

2525
// 1. calculate position of main nodes

src/utils/layout.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const $d = document
77
export const layout = function () {
88
console.time('layout')
99
this.root.innerHTML = ''
10-
this.box.innerHTML = ''
10+
this.mainNodes.innerHTML = ''
1111
const tpc = this.createTopic(this.nodeData)
1212
shapeTpc(tpc, this.nodeData) // shape root tpc
1313
tpc.draggable = false
@@ -35,7 +35,7 @@ export const layout = function () {
3535
}
3636
})
3737
}
38-
this.layoutChildren(this.nodeData.children, this.box, this.direction)
38+
this.layoutChildren(this.nodeData.children, this.mainNodes, this.direction)
3939
console.timeEnd('layout')
4040
}
4141

types/mind-elixir/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ interface MindElixirInstance {
5858
container: HTMLElement
5959
map: HTMLElement
6060
root: HTMLElement
61-
box: HTMLElement
61+
mainNodes: HTMLElement
6262
lines: SVGElement
6363
linkController: SVGElement
6464
P2: HTMLElement

0 commit comments

Comments
 (0)