Closed Bug 386674 Opened 17 years ago Closed 17 years ago

Ability to resize graphs

Categories

(Webtools Graveyard :: Graph Server, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mtschrep, Assigned: oremj)

References

()

Details

Attachments

(1 file, 1 obsolete file)

Graphs are currently stuck at a set size and can't be resized. Should be able to drag the corners of the graphs and pull to a larger size, or at least be able to choose from a few pre-set dimensions.
Component: Testing → Graph Server
Product: Core → Webtools
QA Contact: testing → graph.server
Version: unspecified → Trunk
Assignee: nobody → oremj
Attached patch Graph Resize Patch (obsolete) — Splinter Review
This patch allows for graph resizing in graphs.html.  Does this look correct?
Attachment #271254 - Flags: review?
Attachment #271254 - Flags: review? → review?(vladimir)
Once we make a decision on this patch I will make the equivalent change to dgraph.
Comment on attachment 271254 [details] [diff] [review]
Graph Resize Patch

Hmm, does this work correctly with label placement etc?  There are a few wrapper divs there that have a size specified; however, those are only there because my HTML skills suck and I couldn't figure out how to get things lined up properly.

Basically the only requirements are that graph-labels-x/graph-labels-y divs are along the left and bottom side of the big graph (same with smallgraph-labels-x/y for the small graph) -- so if you have any ideas how to get that positioned right that'd probably be even better than what's there now in graph.html :)

Also I think you want to set the dimensions on the SmallPerfGraph as well, just keep its X dimension the same and make its Y dimension match the big graph.
This patch makes it possible to drag the corners of the graph to resize it.  It should work with all elements, so it will be easy to make the other graphs resizeable.  I got many of my ideas on how to do this from: http://blog.craz8.com/files/resize.js although that is written for prototype, so it is quit a bit different.  Do we need to change the license at all for this script?
Attachment #271254 - Attachment is obsolete: true
Attachment #272660 - Flags: review?(vladimir)
Attachment #271254 - Flags: review?(vladimir)
Comment on attachment 272660 [details] [diff] [review]
Makes big graph on graphs.html resizable

hmm, if the code came from somewhere else you should use the original license (unless you rewrote it, in which case what's there is fine).

However, one issue -- this attaches mousedown/mousemove/etc. handlers on the graph canvas element; does this interfere with the normal mouse interaction with the graph?

I guess that's not an issue for the big graph, since the only thing there is the mousemove cursor, so as long as all that stuff works fine, this looks good.
Attachment #272660 - Flags: review?(vladimir) → review+
The idea for the code came from that location, but their script is written for the prototype library and mine is for mochikit.  

The handlers don't seem to interfere with the previous handlers.  

You can see a demo at http://oremj.khan-vm.mozilla.org/graphs/graph.html you will have to be on the VPN to get there.
Checking in graph.html;
/cvsroot/mozilla/webtools/new-graph/graph.html,v  <--  graph.html
new revision: 1.12; previous revision: 1.11
done
Checking in js/GraphCanvas.js;
/cvsroot/mozilla/webtools/new-graph/js/GraphCanvas.js,v  <--  GraphCanvas.js
new revision: 1.6; previous revision: 1.5
done
RCS file: /cvsroot/mozilla/webtools/new-graph/js/ResizeGraph.js,v
done
Checking in js/ResizeGraph.js;
/cvsroot/mozilla/webtools/new-graph/js/ResizeGraph.js,v  <--  ResizeGraph.js
initial revision: 1.1
done
Checking in dgraph.html;
/cvsroot/mozilla/webtools/new-graph/dgraph.html,v  <--  dgraph.html
new revision: 1.4; previous revision: 1.3
done
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
No longer blocks: 386669
Product: Webtools → Webtools Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: