GraphPageWidget.js 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644
  1. /*##############################################################################
  2. # HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems.
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. ############################################################################## */
  16. define([
  17. "dojo/_base/declare",
  18. "dojo/_base/lang",
  19. "dojo/_base/array",
  20. "dojo/dom",
  21. "dojo/dom-construct",
  22. "dojo/on",
  23. "dojo/html",
  24. "dojo/store/Memory",
  25. "dojo/store/Observable",
  26. "dijit/layout/_LayoutWidget",
  27. "dijit/_TemplatedMixin",
  28. "dijit/_WidgetsInTemplateMixin",
  29. "dijit/layout/BorderContainer",
  30. "dijit/layout/TabContainer",
  31. "dijit/layout/ContentPane",
  32. "dijit/registry",
  33. "dijit/Dialog",
  34. "dojox/html/entities",
  35. "dgrid/OnDemandGrid",
  36. "dgrid/Keyboard",
  37. "dgrid/Selection",
  38. "dgrid/selector",
  39. "dgrid/extensions/ColumnResizer",
  40. "dgrid/extensions/DijitRegistry",
  41. "hpcc/GraphWidget",
  42. "hpcc/ESPUtil",
  43. "hpcc/ESPWorkunit",
  44. "hpcc/TimingGridWidget",
  45. "hpcc/TimingTreeMapWidget",
  46. "dojo/text!../templates/GraphPageWidget.html",
  47. "dijit/PopupMenuItem",
  48. "dijit/Menu",
  49. "dijit/MenuItem",
  50. "dijit/MenuSeparator",
  51. "dijit/Dialog",
  52. "dijit/form/TextBox",
  53. "dijit/form/SimpleTextarea",
  54. "dijit/form/NumberSpinner",
  55. "dijit/form/DropDownButton"
  56. ], function (declare, lang, arrayUtil, dom, domConstruct, on, html, Memory, Observable,
  57. _LayoutWidget, _TemplatedMixin, _WidgetsInTemplateMixin, BorderContainer, TabContainer, ContentPane, registry, Dialog,
  58. entities,
  59. OnDemandGrid, Keyboard, Selection, selector, ColumnResizer, DijitRegistry,
  60. GraphWidget, ESPUtil, ESPWorkunit, TimingGridWidget, TimingTreeMapWidget,
  61. template) {
  62. return declare("GraphPageWidget", [_LayoutWidget, _TemplatedMixin, _WidgetsInTemplateMixin], {
  63. templateString: template,
  64. baseClass: "GraphPageWidget",
  65. borderContainer: null,
  66. rightBorderContainer: null,
  67. graphName: "",
  68. wu: null,
  69. editorControl: null,
  70. global: null,
  71. main: null,
  72. overview: null,
  73. local: null,
  74. timingGrid: null,
  75. timingTreeMap: null,
  76. subgraphsGrid: null,
  77. verticesGrid: null,
  78. edgesGrid: null,
  79. xgmmlDialog: null,
  80. infoDialog: null,
  81. findField: null,
  82. findText: "",
  83. found: [],
  84. foundIndex: 0,
  85. overviewDepth: null,
  86. localDepth: null,
  87. localDistance: null,
  88. initalized: false,
  89. buildRendering: function (args) {
  90. this.inherited(arguments);
  91. },
  92. postCreate: function (args) {
  93. this.inherited(arguments);
  94. this.borderContainer = registry.byId(this.id + "BorderContainer");
  95. this.rightBorderContainer = registry.byId(this.id + "RightBorderContainer");
  96. this.findField = registry.byId(this.id + "FindField");
  97. this.mainDepth = registry.byId(this.id + "MainDepth");
  98. this.overviewDepth = registry.byId(this.id + "OverviewDepth");
  99. this.localDepth = registry.byId(this.id + "LocalDepth");
  100. this.localDistance = registry.byId(this.id + "LocalDistance");
  101. this._initGraphControls();
  102. this._initTimings();
  103. this._initDialogs();
  104. },
  105. startup: function (args) {
  106. this.inherited(arguments);
  107. this._initSubgraphs();
  108. this._initVertices();
  109. this._initEdges();
  110. var splitter = this.borderContainer.getSplitter("right");
  111. this.main.watchSplitter(splitter);
  112. this.overview.watchSplitter(splitter);
  113. this.local.watchSplitter(splitter);
  114. splitter = this.rightBorderContainer.getSplitter("bottom");
  115. this.main.watchSplitter(splitter);
  116. this.overview.watchSplitter(splitter);
  117. this.local.watchSplitter(splitter);
  118. this.main.watchSelect(registry.byId(this.id + "AdvancedMenu"));
  119. },
  120. resize: function (args) {
  121. this.inherited(arguments);
  122. this.borderContainer.resize();
  123. },
  124. layout: function (args) {
  125. this.inherited(arguments);
  126. },
  127. destroy: function (args) {
  128. this.xgmmlDialog.destroyRecursive();
  129. this.infoDialog.destroyRecursive();
  130. this.inherited(arguments);
  131. },
  132. // Implementation ---
  133. _initGraphControls: function () {
  134. var context = this;
  135. this.global = registry.byId(this.id + "GlobalGraphWidget");
  136. this.main = registry.byId(this.id + "MainGraphWidget");
  137. this.main.onSelectionChanged = function (items) {
  138. context.syncSelectionFrom(context.main);
  139. };
  140. this.main.onLayoutFinished = function () {
  141. // TODO: Could be too expensive ---
  142. //context.wu.setGraphSvg(context.graphName, context.main.svg);
  143. };
  144. this.overview = registry.byId(this.id + "MiniGraphWidget");
  145. this.overview.onSelectionChanged = function (items) {
  146. context.syncSelectionFrom(context.overview);
  147. };
  148. this.overview.onDoubleClick = function (globalID) {
  149. var mainItem = context.main.getItem(globalID);
  150. context.main.centerOnItem(mainItem, true);
  151. };
  152. this.local = registry.byId(this.id + "LocalGraphWidget");
  153. this.local.onSelectionChanged = function (items) {
  154. context.syncSelectionFrom(context.local);
  155. };
  156. this.local.onDoubleClick = function (globalID) {
  157. var mainItem = context.main.getItem(globalID);
  158. context.main.centerOnItem(mainItem, true);
  159. };
  160. },
  161. _initTimings: function () {
  162. this.timingGrid = registry.byId(this.id + "TimingsGrid");
  163. var context = this;
  164. this.timingGrid.onClick = function (items) {
  165. context.syncSelectionFrom(context.timingGrid);
  166. };
  167. this.timingGrid.onDblClick = function (item) {
  168. var subgraphID = item.SubGraphId;
  169. var mainItem = context.main.getItem(subgraphID);
  170. context.main.centerOnItem(mainItem, true);
  171. };
  172. this.timingTreeMap = registry.byId(this.id + "TimingsTreeMap");
  173. this.timingTreeMap.onClick = function (value) {
  174. context.syncSelectionFrom(context.timingTreeMap);
  175. }
  176. this.timingTreeMap.onDblClick = function (value) {
  177. var mainItem = context.main.getItem(value.SubGraphId);
  178. context.main.centerOnItem(mainItem, true);
  179. }
  180. },
  181. _initDialogs: function () {
  182. var context = this;
  183. this.infoDialog = registry.byId(this.id + "InfoDialog");
  184. on(dom.byId(this.id + "InfoDialogCancel"), "click", function (event) {
  185. context.infoDialog.hide();
  186. });
  187. this.xgmmlDialog = registry.byId(this.id + "XGMMLDialog");
  188. this.xgmmlTextArea = registry.byId(this.id + "XGMMLTextArea");
  189. on(dom.byId(this.id + "XGMMLDialogApply"), "click", function (event) {
  190. context.xgmmlDialog.hide();
  191. if (context.xgmmlDialog.get("hpccMode") === "XGMML") {
  192. var xgmml = context.xgmmlTextArea.get("value");
  193. context.loadGraphFromXGMML(xgmml);
  194. } else if (context.xgmmlDialog.get("hpccMode") === "DOT") {
  195. var dot = context.xgmmlTextArea.get("value");
  196. context.loadGraphFromDOT(dot);
  197. } else if (context.xgmmlDialog.get("hpccMode") === "DOTATTRS") {
  198. var dotAttrs = context.xgmmlTextArea.get("value");
  199. context.global.setDotMetaAttributes(dotAttrs);
  200. context.main.setDotMetaAttributes(dotAttrs);
  201. context.overview.setDotMetaAttributes(dotAttrs);
  202. context.local.setDotMetaAttributes(dotAttrs);
  203. context._onMainRefresh();
  204. }
  205. });
  206. on(dom.byId(this.id + "XGMMLDialogCancel"), "click", function (event) {
  207. context.xgmmlDialog.hide();
  208. });
  209. },
  210. _initItemGrid: function (grid) {
  211. var context = this;
  212. grid.on(".dgrid-row:click", function (evt) {
  213. context.syncSelectionFrom(grid);
  214. });
  215. grid.on(".dgrid-row:dblclick", function (evt) {
  216. var item = grid.row(evt).data;
  217. if (item._globalID) {
  218. var mainItem = context.main.getItem(item._globalID);
  219. context.main.centerOnItem(mainItem, true);
  220. }
  221. });
  222. },
  223. _initSubgraphs: function () {
  224. var store = new Memory({
  225. idProperty: "id",
  226. data: []
  227. });
  228. this.subgraphsStore = Observable(store);
  229. this.subgraphsGrid = new declare([OnDemandGrid, Keyboard, Selection, ColumnResizer, DijitRegistry, ESPUtil.GridHelper])({
  230. store: this.subgraphsStore
  231. }, this.id + "SubgraphsGrid");
  232. this._initItemGrid(this.subgraphsGrid);
  233. },
  234. _initVertices: function () {
  235. var store = new Memory({
  236. idProperty: "id",
  237. data: []
  238. });
  239. this.verticesStore = Observable(store);
  240. this.verticesGrid = new declare([OnDemandGrid, Keyboard, Selection, ColumnResizer, DijitRegistry, ESPUtil.GridHelper])({
  241. store: this.verticesStore
  242. }, this.id + "VerticesGrid");
  243. this._initItemGrid(this.verticesGrid);
  244. },
  245. _initEdges: function () {
  246. var store = new Memory({
  247. idProperty: "id",
  248. data: []
  249. });
  250. this.edgesStore = Observable(store);
  251. this.edgesGrid = new declare([OnDemandGrid, Keyboard, Selection, ColumnResizer, DijitRegistry, ESPUtil.GridHelper])({
  252. store: this.edgesStore
  253. }, this.id + "EdgesGrid");
  254. this._initItemGrid(this.edgesGrid);
  255. },
  256. _onMainRefresh: function () {
  257. this.main.setMessage("Performing Layout...");
  258. this.main.startLayout("dot");
  259. },
  260. _onLocalRefresh: function () {
  261. this.refreshLocal(this.local.getSelectionAsGlobalID());
  262. },
  263. _doFind: function (prev) {
  264. if (this.findText != this.findField.value) {
  265. this.findText = this.findField.value;
  266. this.found = this.global.findAsGlobalID(this.findText);
  267. this.global.setSelectedAsGlobalID(this.found);
  268. this.syncSelectionFrom(this.global);
  269. this.foundIndex = -1;
  270. }
  271. this.foundIndex += prev ? -1 : +1;
  272. if (this.foundIndex < 0) {
  273. this.foundIndex = this.found.length - 1;
  274. } else if (this.foundIndex >= this.found.length) {
  275. this.foundIndex = 0;
  276. }
  277. if (this.found.length) {
  278. this.main.centerOnGlobalID(this.found[this.foundIndex], true);
  279. this.local.centerOnGlobalID(this.found[this.foundIndex], true);
  280. }
  281. },
  282. _onFind: function (prev) {
  283. this.findText = "";
  284. this._doFind(false);
  285. },
  286. _onFindNext: function () {
  287. this._doFind(false);
  288. },
  289. _onFindPrevious: function () {
  290. this._doFind(true);
  291. },
  292. _onAbout: function () {
  293. html.set(dom.byId(this.id + "InfoDialogContent"), "<div style='width: 320px; height: 120px; text-align: center;'><p>Version: " + this.main.getVersion() + "</p><p>" + this.main.getResourceLinks() + "</p>");
  294. this.infoDialog.set("title", "About HPCC Systems Graph Control");
  295. this.infoDialog.show();
  296. },
  297. _onGetSVG: function () {
  298. html.set(dom.byId(this.id + "InfoDialogContent"), "<textarea rows='25' cols='80'>" + entities.encode(this.main.getSVG()) + "</textarea>");
  299. this.infoDialog.set("title", "SVG Source");
  300. this.infoDialog.show();
  301. },
  302. _onRenderSVG: function () {
  303. var context = this
  304. this.main.localLayout(function (svg) {
  305. html.set(dom.byId(context.id + "InfoDialogContent"), "<div style='border: 1px inset grey; width: 640px; height: 480px; overflow : auto; '>" + svg + "</div>");
  306. context.infoDialog.set("title", "Rendered SVG");
  307. context.infoDialog.show();
  308. });
  309. },
  310. _onGetXGMML: function () {
  311. this.xgmmlDialog.set("title", "XGMML");
  312. this.xgmmlDialog.set("hpccMode", "XGMML");
  313. this.xgmmlTextArea.set("value", this.main.getXGMML());
  314. this.xgmmlDialog.show();
  315. },
  316. _onEditDOT: function () {
  317. this.xgmmlDialog.set("title", "DOT");
  318. this.xgmmlDialog.set("hpccMode", "DOT");
  319. this.xgmmlTextArea.set("value", this.main.getDOT());
  320. this.xgmmlDialog.show();
  321. },
  322. _onGetGraphAttributes: function () {
  323. this.xgmmlDialog.set("title", "DOT Attributes");
  324. this.xgmmlDialog.set("hpccMode", "DOTATTRS");
  325. this.xgmmlTextArea.set("value", this.global.getDotMetaAttributes());
  326. this.xgmmlDialog.show();
  327. },
  328. _onMainDepthChange: function (value) {
  329. this.refreshMain();
  330. },
  331. _onOverviewDepthChange: function (value) {
  332. this.refreshOverview();
  333. },
  334. _onLocalDepthChange: function (value) {
  335. this._onLocalRefresh();
  336. },
  337. _onLocalDistanceChange: function (value) {
  338. this._onLocalRefresh();
  339. },
  340. init: function (params) {
  341. if (this.initalized) {
  342. return;
  343. }
  344. this.initalized = true;
  345. if (params.SafeMode) {
  346. this.overviewDepth.set("value", 0)
  347. this.mainDepth.set("value", 1)
  348. this.localDepth.set("value", 2)
  349. var dotAttrs = this.global.getDotMetaAttributes();
  350. dotAttrs += "\r\ngraph[splines=\"line\"];";
  351. this.global.setDotMetaAttributes(dotAttrs);
  352. }
  353. if (params.Wuid) {
  354. this.graphName = params.GraphName;
  355. this.wu = ESPWorkunit.Get(params.Wuid);
  356. var firstLoad = true;
  357. var context = this;
  358. this.wu.monitor(function () {
  359. context.wu.getInfo({
  360. onGetApplicationValues: function (applicationValues) {
  361. },
  362. onGetGraphs: function (graphs) {
  363. if (firstLoad == true) {
  364. firstLoad = false;
  365. context.loadGraph(context.wu, context.graphName);
  366. } else {
  367. context.refreshGraph(context.wu, context.graphName);
  368. }
  369. }
  370. });
  371. });
  372. }
  373. this.timingGrid.init(lang.mixin({
  374. query: this.graphName
  375. }, params));
  376. this.timingTreeMap.init(lang.mixin({
  377. query: this.graphName
  378. }, params));
  379. },
  380. loadGraphFromXGMML: function (xgmml) {
  381. this.global.loadXGMML(xgmml, false);
  382. this.refreshMain();
  383. this.refreshOverview();
  384. this.loadSubgraphs();
  385. this.loadVertices();
  386. this.loadEdges();
  387. },
  388. loadGraphFromDOT: function (dot) {
  389. this.global.loadDOT(dot);
  390. this.refreshMain();
  391. this.refreshOverview();
  392. this.loadSubgraphs();
  393. this.loadVertices();
  394. this.loadEdges();
  395. },
  396. loadGraph: function (wu, graphName) {
  397. this.overview.setMessage("Fetching Data...");
  398. this.main.setMessage("Fetching Data...");
  399. this.local.setMessage("Fetching Data...");
  400. var context = this;
  401. wu.fetchGraphXgmmlByName(graphName, function (xgmml, svg) {
  402. context.overview.setMessage("");
  403. context.main.setMessage("");
  404. context.local.setMessage("");
  405. context.loadGraphFromXGMML(xgmml, svg);
  406. });
  407. },
  408. refreshGraph: function (wu, graphName) {
  409. var context = this;
  410. wu.fetchGraphXgmmlByName(graphName, function (xgmml) {
  411. context.main.mergeXGMML(xgmml);
  412. context.loadSubgraphs();
  413. context.loadVertices();
  414. context.loadEdges();
  415. });
  416. },
  417. loadSubgraphs: function () {
  418. var subgraphs = this.main.getSubgraphsWithProperties();
  419. var layoutMap = [];
  420. for (var i = 0; i < subgraphs.length; ++i) {
  421. for (var key in subgraphs[i]) {
  422. if (key != "id" && key.substring(0, 1) != "_") {
  423. layoutMap[key] = true;
  424. }
  425. }
  426. }
  427. var layout = [
  428. { label: "ID", field: "id", width: 50 }
  429. ];
  430. for (var key in layoutMap) {
  431. layout.push({ label: key, field: key, width: 100 });
  432. }
  433. this.subgraphsStore.setData(subgraphs);
  434. this.subgraphsGrid.set("columns", layout);
  435. this.subgraphsGrid.refresh();
  436. },
  437. loadVertices: function () {
  438. var vertices = this.main.getVerticesWithProperties();
  439. var layoutMap = [];
  440. for (var i = 0; i < vertices.length; ++i) {
  441. for (var key in vertices[i]) {
  442. if (key != "id" && key != "ecl" && key != "label" && key.substring(0, 1) != "_") {
  443. layoutMap[key] = true;
  444. }
  445. }
  446. }
  447. var layout = [
  448. { label: "ID", field: "id", width: 50 },
  449. { label: "Label", field: "label", width: 150 }
  450. ];
  451. for (var key in layoutMap) {
  452. layout.push({ label: key, field: key, width: 200 });
  453. }
  454. layout.push({ label: "ECL", field: "ecl", width: 1024 });
  455. this.verticesStore.setData(vertices);
  456. this.verticesGrid.set("columns", layout);
  457. this.verticesGrid.refresh();
  458. },
  459. loadEdges: function () {
  460. var edges = this.main.getEdgesWithProperties();
  461. var layoutMap = [];
  462. for (var i = 0; i < edges.length; ++i) {
  463. for (var key in edges[i]) {
  464. if (key != "id" && key.substring(0, 1) != "_") {
  465. layoutMap[key] = true;
  466. }
  467. }
  468. }
  469. var layout = [
  470. { label: "ID", field: "id", width: 50 }
  471. ];
  472. for (var key in layoutMap) {
  473. layout.push({ label: key, field: key, width: 100 });
  474. }
  475. this.edgesStore.setData(edges);
  476. this.edgesGrid.set("columns", layout);
  477. this.edgesGrid.refresh();
  478. },
  479. syncSelectionFrom: function (sourceControl) {
  480. var selectedGlobalIDs = [];
  481. // Get Selected Items ---
  482. if (sourceControl == this.timingGrid || sourceControl == this.timingTreeMap) {
  483. var items = sourceControl.getSelected();
  484. for (var i = 0; i < items.length; ++i) {
  485. if (items[i].SubGraphId) {
  486. selectedGlobalIDs.push(items[i].SubGraphId);
  487. }
  488. }
  489. } else if (sourceControl == this.verticesGrid || sourceControl == this.edgesGrid || sourceControl == this.subgraphsGrid) {
  490. var items = sourceControl.getSelected();
  491. for (var i = 0; i < items.length; ++i) {
  492. if (items[i]._globalID) {
  493. selectedGlobalIDs.push(items[i]._globalID);
  494. }
  495. }
  496. } else {
  497. selectedGlobalIDs = sourceControl.getSelectionAsGlobalID();
  498. }
  499. // Set Selected Items ---
  500. if (sourceControl != this.timingGrid) {
  501. this.timingGrid.setSelectedAsGlobalID(selectedGlobalIDs);
  502. }
  503. if (sourceControl != this.timingTreeMap) {
  504. this.timingTreeMap.setSelectedAsGlobalID(selectedGlobalIDs);
  505. }
  506. if (sourceControl != this.subgraphsGrid && this.subgraphsGrid.store) {
  507. this.subgraphsGrid.setSelection(selectedGlobalIDs);
  508. }
  509. if (sourceControl != this.verticesGrid && this.verticesGrid.store) {
  510. this.verticesGrid.setSelection(selectedGlobalIDs);
  511. }
  512. if (sourceControl != this.edgesGrid && this.edgesGrid.store) {
  513. this.edgesGrid.setSelection(selectedGlobalIDs);
  514. }
  515. if (sourceControl != this.main) {
  516. this.main.setSelectedAsGlobalID(selectedGlobalIDs);
  517. }
  518. if (sourceControl != this.overview) {
  519. this.overview.setSelectedAsGlobalID(selectedGlobalIDs);
  520. }
  521. if (sourceControl != this.local) {
  522. this.refreshLocal(selectedGlobalIDs);
  523. }
  524. var propertiesDom = dom.byId(this.id + "Properties");
  525. propertiesDom.innerHTML = "";
  526. for (var i = 0; i < selectedGlobalIDs.length; ++i) {
  527. this.global.displayProperties(selectedGlobalIDs[i], propertiesDom);
  528. }
  529. },
  530. resetPage: function () {
  531. this.main.clear();
  532. },
  533. refreshMain: function () {
  534. var xgmml = this.global.getLocalisedXGMML([0], this.mainDepth.get("value"));
  535. this.main.loadXGMML(xgmml);
  536. },
  537. refreshOverview: function () {
  538. var xgmml = this.global.getLocalisedXGMML([0], this.overviewDepth.get("value"));
  539. this.overview.loadXGMML(xgmml);
  540. },
  541. refreshLocal: function (selectedGlobalIDs) {
  542. var globalItems = [];
  543. for (var i = 0; i < selectedGlobalIDs.length; ++i) {
  544. globalItems.push(this.global.getItem(selectedGlobalIDs[i]));
  545. }
  546. var xgmml = this.global.getLocalisedXGMML(globalItems, this.localDepth.get("value"), this.localDistance.get("value"));
  547. this.local.loadXGMML(xgmml);
  548. this.local.setSelectedAsGlobalID(selectedGlobalIDs);
  549. },
  550. displayGraphs: function (graphs) {
  551. for (var i = 0; i < graphs.length; ++i) {
  552. this.wu.fetchGraphXgmml(i, function (xgmml) {
  553. this.main.loadXGMML(xgmml, true);
  554. });
  555. }
  556. }
  557. });
  558. });