diff --git a/luigi/static/visualiser/js/graph.js b/luigi/static/visualiser/js/graph.js index e23ceb706e..04549695f0 100644 --- a/luigi/static/visualiser/js/graph.js +++ b/luigi/static/visualiser/js/graph.js @@ -33,7 +33,7 @@ Graph = (function() { name: task.name, taskId: task.taskId, status: task.status, - trackingUrl: "#tab=graph&taskId=" + task.taskId, + trackingUrl: this.hashBase + task.taskId, deps: deps, params: task.params, priority: task.priority, @@ -125,9 +125,10 @@ Graph = (function() { } /* Parses a list of tasks to a graph format */ - function createGraph(tasks) { + function createGraph(tasks, hashBase) { if (tasks.length === 0) return {nodes: [], links: []}; + this.hashBase = hashBase; var nodes = $.map(tasks, nodeFromTask); var nodeIndex = uniqueIndexByProperty(nodes, "taskId"); @@ -259,9 +260,9 @@ Graph = (function() { }); }; - DependencyGraph.prototype.updateData = function(taskList) { + DependencyGraph.prototype.updateData = function(taskList, hashBase) { $('.popover').popover('destroy'); - this.graph = createGraph(taskList); + this.graph = createGraph(taskList, hashBase); bounds = findBounds(this.graph.nodes); this.renderGraph(); this.svg.attr("height", bounds.y+10); diff --git a/luigi/static/visualiser/js/visualiserApp.js b/luigi/static/visualiser/js/visualiserApp.js index 7a00eb2059..c505fc7894 100644 --- a/luigi/static/visualiser/js/visualiserApp.js +++ b/luigi/static/visualiser/js/visualiserApp.js @@ -359,7 +359,10 @@ function visualiserApp(luigi) { $("#searchError").removeClass(); if(dependencyGraph.length > 0) { $("#dependencyTitle").text(dependencyGraph[0].display_name); - $("#graphPlaceholder").get(0).graph.updateData(dependencyGraph); + var hashBaseObj = URI.parseQuery(location.hash.replace('#', '')); + delete hashBaseObj.taskId; + var hashBase = '#' + URI.buildQuery(hashBaseObj) + '&taskId='; + $("#graphPlaceholder").get(0).graph.updateData(dependencyGraph, hashBase); $("#graphContainer").show(); bindGraphEvents(); } else {