Closed Bug 1174259 Opened 9 years ago Closed 9 years ago

Zoom should reset when clicking on graph

Categories

(Tree Management :: Perfherder, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: wlach, Assigned: akhileshpillai)

Details

(Keywords: ateam-summer-of-contribution)

Attachments

(1 file, 1 obsolete file)

46 bytes, text/x-github-pull-request
wlach
: review+
Details | Review
The zoom on the graph should reset to default when you click on the graph view. Right now it stays zoomed in if you have zoomed in, which is counter-intuitive.

I haven't looked into exactly what should change, but I think this should be relatively simple. It looks like there's a plotunselected method in flot we can bind to which we use in graphs.mozilla.org to get the same effect:

http://hg.mozilla.org/graphs/file/c06641fd7680/js/graph-2.js#l58

Here's the current code to handle the plotselect method. The code you add should be around here:

https://github.com/mozilla/treeherder/blob/master/ui/js/graphs.js#L246
Assignee: nobody → akhileshpillai
I have a fix for this, I am assuming clicking on graph view implies clicking on #overview-plot element. Will send out a patch as pull request, however just an FYI this is how I am doing this. 

$("#overview-plot").bind("plotunselected",function(event,ranges) {
        $scope.zoom = {};
        deselectDataPoint();
        updateDocument();
        // refetch and re-render all graph data
        $q.all($scope.seriesList.map(getSeriesData)).then(function() {
          plotGraph();
        });
        console.log("in plotunselected overview");
});
Attached file Fix for Bug 1174259 (obsolete) —
Hi Will,

Please let me know if I need a new pull req for this.
Attachment #8627173 - Flags: review?(wlachance)
Comment on attachment 8627173 [details] [review]
Fix for  Bug 1174259

Very close, just need to drop one unwanted commit from the PR and make a minor adjustment.
Attachment #8627173 - Flags: review?(wlachance) → review-
Attached file FIx for bug 1174259
Hi Will,
Thanks for earlier reviews. Please have a look modified this one as per your suggestion. 

Thanks
-Akhilesh
Attachment #8627173 - Attachment is obsolete: true
Attachment #8629786 - Flags: review?(wlachance)
Comment on attachment 8629786 [details] [review]
FIx for bug 1174259

So close. Just fix the indentation problem that jfrench pointed out in the PR and then re-raise r? ? :)
Attachment #8629786 - Flags: review?(wlachance) → review-
Comment on attachment 8629786 [details] [review]
FIx for bug 1174259

Corrected the indentation problem. Please have a look.
Attachment #8629786 - Flags: review- → review?(wlachance)
Comment on attachment 8629786 [details] [review]
FIx for bug 1174259

This works, thank you!
Attachment #8629786 - Flags: review?(wlachance) → review+
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: