* Add node data to the mind map without triggering UI refresh. * @private * @param {import('./jsmind.node.js').Node} parent_node * @param {string} node_id * @param {string} topic * @param {Record =} data * @param {('left'|'center'|'right'|'-1'|'0'|'1'|number
(parent_node, node_id, topic, data, direction)
| 425 | * @returns {import('./jsmind.node.js').Node|null} |
| 426 | */ |
| 427 | _add_node_data(parent_node, node_id, topic, data, direction) { |
| 428 | var dir = Direction.of(direction); |
| 429 | if (dir === undefined) { |
| 430 | dir = this.layout.calculate_next_child_direction(parent_node); |
| 431 | } |
| 432 | |
| 433 | var node = this.mind.add_node(parent_node, node_id, topic, data, dir); |
| 434 | if (!!node) { |
| 435 | this.view.add_node(node); |
| 436 | this.view.reset_node_custom_style(node); |
| 437 | } |
| 438 | return node; |
| 439 | } |
| 440 | |
| 441 | /** |
| 442 | * Refresh UI after node changes. |
no test coverage detected