summaryrefslogtreecommitdiffstats
path: root/grapher/Graph.cxx
Commit message (Collapse)AuthorAgeFilesLines
* grapher: remove _zoomFactor from horizontal scaling calculationTim Moore2009-12-231-1/+1
| | | | | | | | | | | | This makes zooming more consistent and less buggy. * grapher/Graph.cxx (Graph::draw): Set graph time spread using _zoomFactor. * grapher/Graph.hxx (Graph::getHorizontalScale): no _zoomFactor * grapher/GraphWidget.cxx (on_motion_notify_event): Dragging increment uses _zoomFactor. (on_scroll_event): Set extents after changing the zoom factor with the scroll wheel.
* grapher: scale from right end of graphTim Moore2009-12-231-9/+8
| | | | | | | | | | | | | The right side of the graph represents the most recent time. Since there is never anything interesting to the right of that, it makes sense to have the origin of the scaling be there. * grapher/Graph.hxx (getHorizontalScale): new function * grapher/GraphStyle.cxx (GraphStyleBar::draw, GraphStyleDot::draw, GraphStyleEvent::draw): Use cairo transform functions to set up scaling. (GraphStyleBar::dataIndexAtPoint, GraphStyleEvent::dataIndexAtPoint): Base calculations on scaling from right.
* grapher: draw axes on multiples of the axis "major unit"Tim Moore2009-12-231-1/+1
| | | | | * grapher/Graph.cxx (Graph::draw): Make axis values end up on multiples of majorUnit.
* grapher: scroll continuously with timeTim Moore2009-12-231-49/+6
| | | | | | | | | | | | | | | Don't scale graph based on how much data will fit. This didn't work very well and resulted in distracting, weird scale changes. We now assume that scripts output their time (x axis) in milliseconds. * grapher/Graph.hxx (setCurrentTime): New function. * grapher/Graph.cxx (Graph::draw): Assume a fixed default scale of 1 pixel = 5 milliseconds and don't do any autoscaling. * grapher/GraphWidget.cxx (GraphWidget constructor): Set global time base on startup. (on_expose_event): Don't search graphs for earliest time. * grapher/GraphWidget.hxx (_timeBaseInitialized): delete * grapher/Time.hxx: new file; interface to timeval.
* change namespace indentation to 0Tim Moore2009-12-211-193/+193
| | | | | A silly change, but this works better with other tools, like git diff. I should have started the C++ files this way.
* refactor list of data sets out of GraphWidget into a global data structure.Tim Moore2009-12-081-3/+6
| | | | | | | | | | | | | | Also, add a sigc signal for broadcasting data set changes. * grapher/GraphData.hxx (GraphDataList) new typedef (getGraphData, graphDataSignal): new functions * grapher/Graph.hxx (DatasetList): remove typedef in favor of systemtap::GraphDataList * grapher/GraphWidget.cxx (GraphWidget, onGraphDataChanged): Use graphDataSignal to notice new data sets that need to be added. Use the global data set list instead of one embedded in GraphWidget. * grapher/StapParser.hxx: delete the _widget member; use signals to broadcast that there are new data sets instead of calling into the widget.
* add copyright and license to grapher filesTim Moore2009-12-071-0/+8
|
* option to display graph times relative to the start timeTim Moore2009-12-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | This avoids having humongous numbers displayed on the graphs' x axis. Also, the dialog for adding a data set to a graph was cleaned up. * grapher/graph-dialog.glade: Add check box for display of relative time and a label for the data set list. Force the list of data sets to be larger. * grapher/Graph.hxx (_timeBase): new member * grapher/Graph.cxx (draw): Subtract _timeBase from displayed time value. * grapher/GraphWidget.hxx (DataModelColumns): Add a column for a data set's title, which is optional at the moment. * grapher/GraphWidget.hxx (_globalTimeBase, _timeBaseInitialized, _relativeTimesButton, _displayRelativeTimes): new members * grapher/GraphWidget.hxx (GraphWidget): Hook up check button for displaying relative time. (on_expose_event): Determine base time if needed; set base time in graphs. (onDataDialogOpen): Insert graph data set's name (key) and title into the list of data sets.
* hover text on the additional graphsTim Moore2009-12-041-1/+1
| | | | | | | | | * grapher/Graph.cxx (window2GraphCoords): Take the entire graph's position into account too. * grapher/GraphWidget.cxx (GraphWidget): Hook up the data dialog's OK button. (onDataDialogOpen): If a data set doesn't have a title, use it's name (key) instead.
* Hover text for event-style graphsTim Moore2009-12-031-0/+7
| | | | | | | | | Don't draw the data value for an event; only display it in hover text. * grapher/Graph.hxx (window2GraphCoords): new function * grapher/Graph.cxx (window2GraphCoords): ditto * grapher/GraphStyle.cxx (GraphStyleEvent::dataIndexAtPoint): new function implementation.
* Make the hover text conform to data displayed.Tim Moore2009-12-021-8/+10
| | | | | | | | | Start of code to be more selective about the association between the hover text and the underling graph. Also, show the data set name in hover text. * grapher/GraphStyle.hxx (dataIndexAtPoint): New virtual function. * grapher/GraphStyle.cxx (dataIndexAtPoint): Implementation for bar graphs * grapher/GraphWidget.cxx (onHoverTimeout): Use dataIndexAtPoint.
* Refactor drawing of different styles of graph into classesTim Moore2009-12-021-65/+1
| | | | | | * grapher/GraphStyle.cxx: New file * grapher/GraphStyle.hxx: New file * grapher/Graph(draw): Move much drawing code to GraphStyle::draw
* Account for zoom factor when choosing hover textTim Moore2009-12-021-5/+5
| | | | * grapher/Graph.cxx (getTimeAtPoint): Divide by _zoomFactor too.
* some aesthetic tweaks to the grapherTim Moore2009-12-011-1/+1
| | | | | | * grapher/Graph.cxx (draw): Draw tick labels (times) below the graph. * grapher/grapher.cxx (main): Open main window with a size big enough to display an entire graph.
* Add hover text to the graph.Tim Moore2009-12-011-1/+1
| | | | | | | | | | | | | | When the graph display is paused, leaving the mouse stationary over the graph will display the data point under the pointer. * grapher/CairoWidget.hxx (CairoTextBox): new class (CairoWidget, CairoPlayButton): refector some play button-specific things from CairoWidget to CairoPlayButton. * grapher/CairoWidget.cxx (CairoTextBox::draw): new function. * grapher/GraphWidget.hxx (GraphWidget): new members for supporting hover text. * grapher/GraphWidget.cxx (on_motion_notify_event): Set up hover text box. (establishHoverTimeout, onHoverTimeout, getGraphUnderPoint): new functions.
* change time type from double to int64_tTim Moore2009-12-011-15/+22
| | | | | | | | | | | | | | * grapher/Graph.hxx (Graph): Change variables holding the time limits of the displayed graph from double to int64_t. * grapher/Graph.cxx (Graph::draw): Do calculations of time differences using int64_t. (Graph::getExtents, Graph::setExtents): Change left and right arguments to int64_t. * grapher/GraphData.hxx (GraphDataBase): Change time type to int64_t. (GraphDataBase::elementAsString): New function. (GraphData::elementAsString): Implementation of that function. * grapher/StapParser.cxx (parseData): Parse time values from the stap script as 64 bit values.
* cleanup of graph data parser, using Boost functions where usefulTim Moore2009-10-141-1/+1
| | | | | | * grapher/StapParser.cxx (commaSplit): Use Boost string split function (findTaggedValue): Return bool instead of position (ioCallback): Avoid using hard-coded string lengths
* more multiple graph fixesTim Moore2009-09-301-0/+2
| | | | | | * grapher/Graph.cxx (Graph constructor): set _drawX, _drawY * grapher/GraphWidget.cxx (addGraph): Fix graph layout (on_button_press_event): Fix test of play button in multiple graphs
* Draw multiple graphsTim Moore2009-09-301-5/+2
| | | | | | | | | | | | | | * grapher/Graph.cxx (Graph constructor): Initialize graph dimensions. (draw): Don't clear the drawing area. * grapher/GraphWidget.hxx (GraphWidget): Add dimensions and on_size_request() method. * grapher/GraphWidget.cxx (GraphWidget constructor): Initialize dimensions. (addGraph): New method. (on_size_request): New method to pass widget's size to parent widgets * grapher/grapher.cxx (GrapherWindow constructor): add "add graph" action. (addGraph): New method.
* Initialize CairoWidget origin of graphTim Moore2009-09-161-2/+4
| | | | | | | * grapher/Graph.hxx (Graph constructor): add origin arguments * grapher/Graph.cxx: ditto * grapher/GraphWidget.cxx (on_expose_event): Use CairoWidget origin to position graphs.
* Fix grapher compilation warnings from rpm buildJosh Stone2009-08-041-3/+3
| | | | | | * grapher/Graph.cxx (Graph::Graph): Initialize in declaration order. * grapher/GraphWidget.cxx (GraphWidget::on_expose_event): Remove several unused local variables.
* Add #include and casting to allow compilations of grapher on RHEL5.William Cohen2009-08-041-2/+2
|
* Support for presenting multiple graphsTim Moore2009-07-281-0/+262
* grapher/Graph.hxx: New file; class for single graph display. * grapher/Graph.cxx: New file. * grapher/GraphData.hxx: Associate title and axis labels with graph data and not a graph display. * grapher/GraphWidget.hxx: Move graph-related members to Graph class. * grapher/GraphWidget.cxx (getExtents, setExtents): Move to Graph class (on_expose_event): Move graph rendering to Graph. (on_button_press_event): Delegate to Graph. (on_motion_notify_event, on_scroll_event): Modify "active" graph. * grapher/StapParser.cxx (findTaggedValue): New parsing helper function. (io_callback): Support new syntax where properties are attached to graph data and not the entire graph. * grapher/grapher.cxx (GrapherWindow): Don't set graph values. * grapher/Makefile.am: Add Graph.cxx. * testsuite/systemtap.examples/general/grapher.stp: New property syntax.