MCPcopy Index your code
hub / github.com/hizzgdev/jsmind / _add_node_data

Method _add_node_data

src/jsmind.js:427–439  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

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.

Callers 2

add_nodeMethod · 0.95
_add_nodes_recursiveMethod · 0.95

Calls 3

add_nodeMethod · 0.45

Tested by

no test coverage detected