Explorar el Código

ONNX function support (#773)

Lutz Roeder hace 4 años
padre
commit
50c2a5e9c0
Se han modificado 5 ficheros con 93 adiciones y 35 borrados
  1. 19 3
      source/electron.html
  2. 20 3
      source/index.html
  3. 12 12
      source/view-grapher.css
  4. 2 2
      source/view-sidebar.css
  5. 40 15
      source/view.js

+ 19 - 3
source/electron.html

@@ -10,14 +10,19 @@
 <style>
 html { touch-action: none; overflow: hidden; width: 100%; height: 100%; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; text-rendering: optimizeLegibility; -webkit-text-rendering: optimizeLegibility; -moz-text-rendering: optimizeLegibility; -ms-text-rendering: optimizeLegibility; -o-text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -moz-font-smoothing: antialiased; -ms-font-smoothing: antialiased; -o-font-smoothing: antialiased; }
 body { touch-action: none; overflow: hidden; width: 100%; height: 100%; margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "Ubuntu", "Droid Sans", sans-serif, "PingFang SC"; font-size: 12px; text-rendering: geometricPrecision; }
+button { font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "Ubuntu", "Droid Sans", sans-serif, "PingFang SC"; }
 .center { position: absolute; margin: auto; top: 0; right: 0; bottom: 0; left: 0; user-select: none; -webkit-user-select: none; -moz-user-select: none; }
 .select { user-select: text; -webkit-user-select: text; -moz-user-select: text; }
 .open-file-dialog { display: none; }
 .graph { touch-action: pan-x pan-y; overflow: auto; height: 100%; }
 .canvas { display: block; position: absolute; text-rendering: geometricPrecision; user-select: none; -webkit-user-select: none; -moz-user-select: none; }
 .toolbar { position: absolute; top: 10px; left: 10px; padding: 0; margin: 0; user-select: none; -webkit-user-select: none; -moz-user-select: none; }
-.toolbar-button { background: None; border-radius: 6px; border: 0; margin: 0; padding: 0; fill: None; stroke: #777; cursor: hand; width: 24px; height: 24px; }
 .toolbar button:focus { outline: 0; }
+.toolbar-button { float: left; background: None; border-radius: 6px; border: 0; margin: 0; margin-right: 1px; padding: 0; fill: None; stroke: #777; cursor: pointer; width: 24px; height: 24px; }
+.toolbar-back-button { float: left; background: #777; border-top-left-radius: 6px; border-bottom-left-radius: 6px; border: 0px solid; border-color: #777; margin: 2px 0 2px 8px; padding: 0 8px 0 8px; cursor: pointer; height: 20px; color: #ffffff; font-size: 11px; line-height: 0; transition: 0.1s; }
+.toolbar-back-button:hover { background: #000000; border-color: #000000; }
+.toolbar-name-button { float: left; background: rgba(255, 255, 255, 0.95); border-top-right-radius: 6px; border-bottom-right-radius: 6px; border: 1px solid #777; color: #777; border-left: 1px; border-left-color: #ffffff; margin: 2px 0 2px 0; padding: 0 12px 0 6px; cursor: pointer; width: auto; height: 20px; font-size: 11px; line-height: 0; transition: 0.1s; }
+.toolbar-name-button:hover { color: #000000; }
 .icon .border { stroke: #fff; }
 .icon .stroke { stroke: #808080; }
 .icon:hover .stroke { stroke: #000000; }
@@ -38,7 +43,7 @@ body { touch-action: none; overflow: hidden; width: 100%; height: 100%; margin:
 .welcome .logo-message { display: none; }
 .welcome .logo-github { display: none; }
 .welcome button { font-size: 12px; font-weight: bold; line-height: 1.25; text-align: center; vertical-align: middle; min-width: 60px; height: 32px; border-radius: 16px; transition: 0.1s; user-select: none; -webkit-user-select: none; -moz-user-select: none; color: #444444; background-color: #ececec; border: 1px solid #444444; }
-.welcome button:hover { color: #ececec; background-color: #444444; cursor: hand; transition: 0.2s; }
+.welcome button:hover { color: #ececec; background-color: #444444; cursor: pointer; transition: 0.2s; }
 .welcome button:focus { outline: 0; }
 .welcome .open-file-button { top: 170px; left: -150px; width: 125px; opacity: 1; }
 .welcome .github-button { top: 170px; left: 150px; width: 125px; opacity: 1; }
@@ -62,7 +67,7 @@ body { touch-action: none; overflow: hidden; width: 100%; height: 100%; margin:
 .default { background-color: #ffffff; }
 .default .logo { display: none; }
 .default .graph { display: block; opacity: 1; }
-.default .toolbar { display: block; }
+.default .toolbar { display: table; }
 @media (prefers-color-scheme: dark) {
 .default { background-color: #404040; }
 .graph { background-color: #404040; }
@@ -82,6 +87,10 @@ body { touch-action: none; overflow: hidden; width: 100%; height: 100%; margin:
 .dropdown button { color: #ffffff; }
 .dropdown button:hover { color: #ffffff; background-color: #1d59d1; }
 .dropdown .separator { border-color: #5a5a5a; }
+.toolbar-back-button { background: #aaaaaa; border-color: #aaaaaa; color: #333333; }
+.toolbar-back-button:hover { background: #dfdfdf; border-color: #dfdfdf; }
+.toolbar-name-button { background: #404040; border-color: #aaaaaa; color: #cccccc; }
+.toolbar-name-button:hover { color: #dfdfdf; }
 }
 @media all and (max-width: 640px) {
 .welcome .logo { width: 240px; }
@@ -98,6 +107,8 @@ body { touch-action: none; overflow: hidden; width: 100%; height: 100%; margin:
 }
 @media only screen and (max-device-width: 1024px) {
 .toolbar-button { width: 32px; height: 32px; }
+.toolbar-back-button { margin-top: 6px; margin-bottom: 6px; }
+.toolbar-name-button { margin-top: 6px; margin-bottom: 6px; }
 }
 </style>
 </head>
@@ -141,6 +152,11 @@ body { touch-action: none; overflow: hidden; width: 100%; height: 100%; margin:
             <line class="stroke" x1="78" y1="78" x2="82" y2="82" stroke-width="8" stroke-linecap="square"></line>
         </svg>
     </button>
+    <button id="back-button" class="toolbar-back-button" title="Back">
+        &#x276E;
+    </button>
+    <button id="name-button" class="toolbar-name-button" title="Name">
+    </button>
 </div>
 <div class="center logo">
     <a href="https://github.com/lutzroeder/netron" target="blank_">

+ 20 - 3
source/index.html

@@ -29,6 +29,7 @@
 <style>
 html { touch-action: none; overflow: hidden; width: 100%; height: 100%; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; text-rendering: optimizeLegibility; -webkit-text-rendering: optimizeLegibility; -moz-text-rendering: optimizeLegibility; -ms-text-rendering: optimizeLegibility; -o-text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -moz-font-smoothing: antialiased; -ms-font-smoothing: antialiased; -o-font-smoothing: antialiased; }
 body { touch-action: none; overflow: hidden; width: 100%; height: 100%; margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "Ubuntu", "Droid Sans", sans-serif, "PingFang SC"; font-size: 12px; text-rendering: geometricPrecision; }
+button { font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "Ubuntu", "Droid Sans", sans-serif, "PingFang SC"; }
 .center { position: absolute; margin: auto; top: 0; right: 0; bottom: 0; left: 0; user-select: none; -webkit-user-select: none; -moz-user-select: none; }
 .select { user-select: text; -webkit-user-select: text; -moz-user-select: text; }
 .open-file-dialog { display: none; }
@@ -36,8 +37,13 @@ body { touch-action: none; overflow: hidden; width: 100%; height: 100%; margin:
 .graph { touch-action: pan-x pan-y; overflow: auto; height: 100%; }
 .canvas { display: block; position: absolute; text-rendering: geometricPrecision; user-select: none; -webkit-user-select: none; -moz-user-select: none; }
 .toolbar { position: absolute; top: 10px; left: 10px; padding: 0; margin: 0; user-select: none; -webkit-user-select: none; -moz-user-select: none; }
-.toolbar-button { background: None; border-radius: 6px; border: 0; margin: 0; padding: 0; fill: None; stroke: #777; cursor: hand; width: 24px; height: 24px; }
 .toolbar button:focus { outline: 0; }
+.toolbar-button { background: None; border-radius: 6px; border: 0; margin: 0; padding: 0; fill: None; stroke: #777; cursor: pointer; width: 24px; height: 24px; }
+.toolbar-button { float: left; background: None; border-radius: 6px; border: 0; margin: 0; margin-right: 1px; padding: 0; fill: None; stroke: #777; cursor: pointer; width: 24px; height: 24px; }
+.toolbar-back-button { float: left; background: #777; border-top-left-radius: 6px; border-bottom-left-radius: 6px; border: 0px solid; border-color: #777; margin: 2px 0 2px 8px; padding: 0 8px 0 8px; cursor: pointer; height: 20px; color: #ffffff; font-size: 11px; line-height: 0; transition: 0.1s; }
+.toolbar-back-button:hover { background: #000000; border-color: #000000; }
+.toolbar-name-button { float: left; background: rgba(255, 255, 255, 0.95); border-top-right-radius: 6px; border-bottom-right-radius: 6px; border: 1px solid #777; color: #777; border-left: 1px; border-left-color: #ffffff; margin: 2px 0 2px 0; padding: 0 12px 0 6px; cursor: pointer; width: auto; height: 20px; font-size: 11px; line-height: 0; transition: 0.1s; }
+.toolbar-name-button:hover { color: #000000; }
 .icon .border { stroke: #fff; }
 .icon .stroke { stroke: #808080; }
 .icon:hover .stroke { stroke: #000000; }
@@ -84,7 +90,7 @@ body { touch-action: none; overflow: hidden; width: 100%; height: 100%; margin:
 .welcome .logo-message { display: none; }
 .welcome .logo-github { display: none; }
 .welcome button { font-size: 12px; font-weight: bold; line-height: 1.25; text-align: center; vertical-align: middle; min-width: 60px; height: 32px; border-radius: 16px; transition: 0.1s; user-select: none; -webkit-user-select: none; -moz-user-select: none; color: #444444; background-color: #ececec; border: 1px solid #444444; }
-.welcome button:hover { color: #ececec; background-color: #444444; cursor: hand; transition: 0.2s; }
+.welcome button:hover { color: #ececec; background-color: #444444; cursor: pointer; transition: 0.2s; }
 .welcome button:focus { outline: 0; }
 .welcome .open-file-button { top: 170px; left: -150px; width: 125px; opacity: 1; }
 .welcome .github-button { top: 170px; left: 150px; width: 125px; opacity: 1; }
@@ -108,7 +114,7 @@ body { touch-action: none; overflow: hidden; width: 100%; height: 100%; margin:
 .default { background-color: #ffffff; }
 .default .logo { display: none; }
 .default .graph { display: block; opacity: 1; }
-.default .toolbar { display: block; }
+.default .toolbar { display: table; }
 @media (prefers-color-scheme: dark) {
 .default { background-color: #404040; }
 .graph { background-color: #404040; }
@@ -136,6 +142,10 @@ body { touch-action: none; overflow: hidden; width: 100%; height: 100%; margin:
 .dropdown button { color: #ffffff; }
 .dropdown button:hover { color: #ffffff; background-color: #1d59d1; }
 .dropdown .separator { border-color: #5a5a5a; }
+.toolbar-back-button { background: #aaaaaa; border-color: #aaaaaa; color: #333333; }
+.toolbar-back-button:hover { background: #dfdfdf; border-color: #dfdfdf; }
+.toolbar-name-button { background: #404040; border-color: #aaaaaa; color: #cccccc; }
+.toolbar-name-button:hover { color: #dfdfdf; }
 }
 @media all and (max-width: 640px) {
 .welcome .logo { width: 240px; }
@@ -152,6 +162,8 @@ body { touch-action: none; overflow: hidden; width: 100%; height: 100%; margin:
 }
 @media only screen and (max-device-width: 1024px) {
 .toolbar-button { width: 32px; height: 32px; }
+.toolbar-back-button { margin-top: 6px; margin-bottom: 6px; }
+.toolbar-name-button { margin-top: 6px; margin-bottom: 6px; }
 }
 </style>
 </head>
@@ -195,6 +207,11 @@ body { touch-action: none; overflow: hidden; width: 100%; height: 100%; margin:
             <line class="stroke" x1="78" y1="78" x2="82" y2="82" stroke-width="8" stroke-linecap="square"></line>
         </svg>
     </button>
+    <button id="back-button" class="toolbar-back-button" title="Back">
+        &#x276E;
+    </button>
+    <button id="name-button" class="toolbar-name-button" title="Name">
+    </button>
     <div id="menu-dropdown" class="dropdown"></div>
 </div>
 <div id="transparent" class="transparent"></div>

+ 12 - 12
source/view-grapher.css

@@ -7,12 +7,12 @@
 
 .node-item-function path { fill: #fff; }
 .node-item-function text { fill: #000; }
-.node-item-function:hover { cursor: hand; }
+.node-item-function:hover { cursor: pointer; }
 .node-item-function:hover path { fill: #eee; }
 
 .node-item-type path { fill: #000; }
 .node-item-type text { fill: #fff; }
-.node-item-type:hover { cursor: hand; }
+.node-item-type:hover { cursor: pointer; }
 .node-item-type:hover path { fill: #fff; }
 .node-item-type:hover text { fill: #000; }
 
@@ -38,28 +38,28 @@
 .node-item-type-custom path { fill: rgb(128, 128, 128); }
 
 .node-item-input path { fill: #fff; }
-.node-item-input:hover { cursor: hand; }
+.node-item-input:hover { cursor: pointer; }
 .node-item-input:hover path { fill: #fff; }
 
 .node-item-constant path { fill: #eee; }
-.node-item-constant:hover { cursor: hand; }
+.node-item-constant:hover { cursor: pointer; }
 .node-item-constant:hover path { fill: #fff; }
 
 .node-item-undefined path { fill: #f00; }
-.node-item-undefined:hover { cursor: hand; }
+.node-item-undefined:hover { cursor: pointer; }
 .node-item-undefined:hover path { fill: #fff; }
 
-.node-attribute:hover { cursor: hand; }
+.node-attribute:hover { cursor: pointer; }
 .node-attribute text { font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "Ubuntu", "Droid Sans", sans-serif, "PingFang SC"; font-size: 9px; font-weight: normal; text-rendering: geometricPrecision; }
 .node-attribute path { fill: #fff; stroke-width: 0; stroke: #000; }
 .node-attribute:hover path { fill: #f6f6f6; }
 
 .graph-item-input path { fill: #eee; }
-.graph-item-input:hover { cursor: hand; }
+.graph-item-input:hover { cursor: pointer; }
 .graph-item-input:hover path { fill: #fff; }
 
 .graph-item-output path { fill: #eee; }
-.graph-item-output:hover { cursor: hand; }
+.graph-item-output:hover { cursor: pointer; }
 .graph-item-output:hover path { fill: #fff; }
 
 .edge-label text { font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "Ubuntu", "Droid Sans", sans-serif, "PingFang SC"; font-size: 10px; }
@@ -90,12 +90,12 @@
 
     .node-item-function path { fill: #404040; }
     .node-item-function text { fill: #dfdfdfdf; }
-    .node-item-function:hover { cursor: hand; }
+    .node-item-function:hover { cursor: pointer; }
     .node-item-function:hover path { fill: #666666; }
     
     .node-item-type path { fill: #303030; }
     .node-item-type text { fill: #dfdfdf; }
-    .node-item-type:hover { cursor: hand; }
+    .node-item-type:hover { cursor: pointer; }
     .node-item-type:hover path { fill: #808080; }
     .node-item-type:hover text { fill: #dfdfdf; }
 
@@ -107,11 +107,11 @@
     .node-attribute:hover path { fill: #666666; }
 
     .graph-item-input path { fill: #404040; }
-    .graph-item-input:hover { cursor: hand; }
+    .graph-item-input:hover { cursor: pointer; }
     .graph-item-input:hover path { fill: #666666; }
 
     .graph-item-output path { fill: #404040; }
-    .graph-item-output:hover { cursor: hand; }
+    .graph-item-output:hover { cursor: pointer; }
     .graph-item-output:hover path { fill: #666666; }
 
     .node-item-input path { fill: #404040; }

+ 2 - 2
source/view-sidebar.css

@@ -6,7 +6,7 @@
 .sidebar-content { padding-left: 20px; padding-right: 20px; margin-bottom: 20px; overflow-y: auto; height: calc(100vh - 60px); }
 
 .sidebar-view-title { font-weight: bold; font-size: 11px; line-height: 1.25; border-bottom: 1px solid #ececec; padding-bottom: 0.3em; margin-top: 0; margin-bottom: 16px; color: #333; user-select: none; -webkit-user-select: none; -moz-user-select: none; cursor: default; }
-.sidebar-view-title-button { display: inline-block; color: #888; text-align: center; vertical-align: middle; font-weight: bold; width: 12px; height: 12px; font-size: 10px; line-height: 12px; border-radius: 50%; transform: translateY(-1px); padding: 1px; background: transparent; border: 1px solid #aaa; text-decoration: none; cursor: hand; user-select: none; -webkit-user-select: none; -moz-user-select: none; }
+.sidebar-view-title-button { display: inline-block; color: #888; text-align: center; vertical-align: middle; font-weight: bold; width: 12px; height: 12px; font-size: 10px; line-height: 12px; border-radius: 50%; transform: translateY(-1px); padding: 1px; background: transparent; border: 1px solid #aaa; text-decoration: none; cursor: pointer; user-select: none; -webkit-user-select: none; -moz-user-select: none; }
 .sidebar-view-title-button:hover { color: #333; border: 1px solid #333; }
 .sidebar-view-header { font-weight: bold; font-size: 11px; text-transform: uppercase; line-height: 1.25; margin-top: 16px; margin-bottom: 16px; border-bottom: 1px solid #ececec; display: block; user-select: none; -webkit-user-select: none; -moz-user-select: none; cursor: default; }
 .sidebar-view-item { margin-bottom: 0px; display: block; }
@@ -23,7 +23,7 @@
 .sidebar-view-item-value-line-link:hover { text-decoration: underline; }
 .sidebar-view-item-value-line-border { padding: 4px 6px 4px 6px; border-top: 1px solid rgba(27, 31, 35, 0.05); }
 .sidebar-view-item-value-line-content { white-space: pre; word-wrap: normal; overflow: auto; display: block; }
-.sidebar-view-item-value-expander { font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace; float: right; color: #aaa; cursor: hand; user-select: none; -webkit-user-select: none; -moz-user-select: none; padding: 4px 6px 4px 6px; }
+.sidebar-view-item-value-expander { font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace; float: right; color: #aaa; cursor: pointer; user-select: none; -webkit-user-select: none; -moz-user-select: none; padding: 4px 6px 4px 6px; }
 .sidebar-view-item-value-expander:hover { color: #000; }
 .sidebar-view-item-select {
     font-family: inherit; font-size: 12px;

+ 40 - 15
source/view.js

@@ -35,6 +35,12 @@ view.View = class {
             this._getElementById('zoom-out-button').addEventListener('click', () => {
                 this.zoomOut();
             });
+            this._getElementById('back-button').addEventListener('click', () => {
+                this.popGraph();
+            });
+            this._getElementById('name-button').addEventListener('click', () => {
+                this.showDocumentation(this.activeGraph);
+            });
             this._getElementById('sidebar').addEventListener('mousewheel', (e) => {
                 this._preventZoom(e);
             }, { passive: true });
@@ -125,7 +131,7 @@ view.View = class {
 
     show(page) {
         if (!page) {
-            page = (!this._model && !this._graphs[0]) ? 'welcome' : 'default';
+            page = (!this._model && !this.activeGraph) ? 'welcome' : 'default';
         }
         this._host.screen(page);
         if (this._sidebar) {
@@ -151,10 +157,11 @@ view.View = class {
     }
 
     find() {
-        if (this._graphs[0]) {
+        const graph = this.activeGraph;
+        if (graph) {
             this.clearSelection();
             const graphElement = this._getElementById('canvas');
-            const view = new sidebar.FindSidebar(this._host, graphElement, this._graphs[0]);
+            const view = new sidebar.FindSidebar(this._host, graphElement, graph);
             view.on('search-text-changed', (sender, text) => {
                 this._searchText = text;
             });
@@ -209,7 +216,7 @@ view.View = class {
 
     _reload() {
         this.show('welcome spinner');
-        if (this._model && this._graphs[0]) {
+        if (this._model && this._graphs.length > 0) {
             this._updateGraph(this._model, this._graphs).catch((error) => {
                 if (error) {
                     this.error(error, 'Graph update failed.', 'welcome');
@@ -462,11 +469,28 @@ view.View = class {
         }
     }
 
+    get activeGraph() {
+        return Array.isArray(this._graphs) && this._graphs.length > 0 ? this._graphs[0] : null;
+    }
+
     _updateGraph(model, graphs) {
-        const active = (graphs) => {
-            return Array.isArray(graphs) && graphs.length > 0 ? graphs[0] : null;
+        const update = () => {
+            const nameButton = this._getElementById('name-button');
+            const backButton = this._getElementById('back-button');
+            if (this._graphs.length > 1) {
+                // backButton.style.display = 'block';
+                // nameButton.style.display = 'block';
+                const graph = this.activeGraph;
+                nameButton.innerHTML = graph ? graph.name : '';
+                backButton.style.opacity = 1;
+                nameButton.style.opacity = 1;
+            }
+            else {
+                backButton.style.opacity = 0;
+                nameButton.style.opacity = 0;
+            }
         };
-        const graph = active(graphs);
+        const graph = Array.isArray(graphs) && graphs.length > 0 ? graphs[0] : null;
         return this._timeout(100).then(() => {
             if (graph && graph != this._graphs[0]) {
                 const nodes = graph.nodes;
@@ -484,12 +508,14 @@ view.View = class {
                 if (!graphs || graphs.length <= 1) {
                     this.show('default');
                 }
+                update();
                 return this._model;
             }).catch((error) => {
-                return this.renderGraph(this._model, active(this._graphs)).then(() => {
+                return this.renderGraph(this._model, this.activeGraph).then(() => {
                     if (!graphs || graphs.length <= 1) {
                         this.show('default');
                     }
+                    update();
                     throw error;
                 }).catch(() => {
                     throw error;
@@ -499,7 +525,7 @@ view.View = class {
     }
 
     pushGraph(graph) {
-        if (graph !== this._graphs[0]) {
+        if (graph !== this.activeGraph) {
             return this._updateGraph(this._model, [ graph ].concat(this._graphs));
         }
         return Promise.resolve();
@@ -507,7 +533,7 @@ view.View = class {
 
     popGraph() {
         if (this._graphs.length > 1) {
-            return this._updateGraph(this._model, this._graphs.subarray(1));
+            return this._updateGraph(this._model, this._graphs.slice(1));
         }
     }
 
@@ -811,7 +837,7 @@ view.View = class {
     export(file) {
         const lastIndex = file.lastIndexOf('.');
         const extension = (lastIndex != -1) ? file.substring(lastIndex + 1) : '';
-        if (this._graphs[0] && (extension === 'png' || extension === 'svg')) {
+        if (this.activeGraph && (extension === 'png' || extension === 'svg')) {
             const graphElement = this._getElementById('canvas');
             const exportElement = graphElement.cloneNode(true);
             this.applyStyleSheet(exportElement, 'view-grapher.css');
@@ -881,7 +907,7 @@ view.View = class {
 
     showModelProperties() {
         if (this._model) {
-            const modelSidebar = new sidebar.ModelSidebar(this._host, this._model, this._graphs[0]);
+            const modelSidebar = new sidebar.ModelSidebar(this._host, this._model, this.activeGraph);
             modelSidebar.on('update-active-graph', (sender, name) => {
                 this._updateActiveGraph(name);
             });
@@ -893,7 +919,7 @@ view.View = class {
         if (node) {
             const nodeSidebar = new sidebar.NodeSidebar(this._host, node);
             nodeSidebar.on('show-documentation', (/* sender, e */) => {
-                this.showNodeDocumentation(node);
+                this.showDocumentation(node.type);
             });
             nodeSidebar.on('show-graph', (sender, graph) => {
                 this.pushGraph(graph);
@@ -937,8 +963,7 @@ view.View = class {
         }
     }
 
-    showNodeDocumentation(node) {
-        const type = node.type;
+    showDocumentation(type) {
         if (type && (type.description || type.inputs || type.outputs || type.attributes)) {
             if (type.nodes) {
                 this.pushGraph(type);