Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Unified Diff: tools/turbolizer/view.js

Issue 729913004: Add a html-based visualizer for TurboFan graphs (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Review feedback Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/turbolizer/util.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/turbolizer/view.js
diff --git a/tools/turbolizer/view.js b/tools/turbolizer/view.js
new file mode 100644
index 0000000000000000000000000000000000000000..2c90c6da5bb5b8c5264bcb8deef7c8b40406abbe
--- /dev/null
+++ b/tools/turbolizer/view.js
@@ -0,0 +1,42 @@
+// Copyright 2015 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+"use strict";
+
+class View {
+ constructor(id, broker) {
+ this.divElement = d3.select("#" + id);
+ this.divNode = this.divElement[0][0];
+ this.parentNode = this.divNode.parentNode;
+ this.hide();
+ }
+
+ isScrollable() {
+ return false;
+ }
+
+ show(data, rememberedSelection) {
+ this.parentNode.appendChild(this.divElement[0][0]);
+ this.initializeContent(data, rememberedSelection);
+ this.resizeToParent();
+ this.divElement.attr(VISIBILITY, 'visible');
+ }
+
+ resizeToParent() {
+ var view = this;
+ var documentElement = document.documentElement;
+ var y = this.parentNode.clientHeight || documentElement.clientHeight;
+ this.parentNode.style.height = y + 'px';
+ }
+
+ hide() {
+ this.divElement.attr(VISIBILITY, 'hidden');
+ this.deleteContent();
+ this.parentNode.removeChild(this.divNode);
+ }
+
+ detachSelection() {
+ return null;
+ }
+}
« no previous file with comments | « tools/turbolizer/util.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698