diff --git a/static/view-grapher.js b/static/view-grapher.js index 45aaec8..39eaf58 100644 --- a/static/view-grapher.js +++ b/static/view-grapher.js @@ -172,10 +172,12 @@ grapher.Graph = class { edgePathGroupDefs.appendChild(marker("arrowhead-vee-select")); // <==== 显示 边上的箭头 + // console.log(this._modelNodeName2State) for (const nodeId of this.nodes.keys()) { const node = this.node(nodeId); if (this.children(nodeId).length == 0) { if (this._modelNodeName2State.get(node.label.modelNodeName) == 'Exist') { + // console.log("build", node.label.modelNodeName) node.label.build(document, nodeGroup); } } diff --git a/static/view-sidebar.js b/static/view-sidebar.js index 46703b9..0d13b5d 100644 --- a/static/view-sidebar.js +++ b/static/view-sidebar.js @@ -348,7 +348,7 @@ sidebar.NodeSidebar = class { } if (title === 'Recover Node') { buttonElement.addEventListener('click', () => { - this._host._view._graph.reset_node(this._modelNodeName) + this._host._view._graph.recover_node(this._modelNodeName) }); } if (title === 'Enter') { @@ -658,7 +658,7 @@ class NodeAttributeView { this._element.appendChild(this._expander); } const value = this._attribute.value; - console.log(this._attribute.name, value, type) + // console.log(this._attribute.name, value, type) switch (type) { case 'graph': { const line = this._host.document.createElement('div'); diff --git a/static/view.js b/static/view.js index c8e8a28..6427d61 100644 --- a/static/view.js +++ b/static/view.js @@ -480,6 +480,7 @@ view.View = class { this.lastViewGraph = this._graph; // if (this.lastViewGraph) { // // console.log(this.lastViewGraph._addedNode) + // // console.log(this.lastViewGraph._modelNodeName2State) // } const graph = this.activeGraph; // console.log(graph.nodes) @@ -1230,10 +1231,10 @@ view.Graph = class extends grapher.Graph { this._modelNodeName2ViewNode.get(node_name).element.style.opacity = 0.3; } - reset_node(node_name) { - this._modelNodeName2State.set(node_name, 'Existed'); + recover_node(node_name) { + this._modelNodeName2State.set(node_name, 'Exist'); this._modelNodeName2ViewNode.get(node_name).element.style.opacity = 1; - + // console.log(this._modelNodeName2State) } delete_node_with_children(node_name) { @@ -1270,7 +1271,7 @@ view.Graph = class extends grapher.Graph { this._modelNodeName2State.set(node.label.modelNodeName, 'Exist') } - console.log(this._renameMap) + // console.log(this._renameMap) // reset node inputs/outputs for (const changed_node_name of this._renameMap.keys()) { var node = this._modelNodeName2ModelNode.get(changed_node_name)