sPlotView-class {iSPlot}R Documentation

Class "sPlotView": A class to represent a scatterplot view

Description

sPlotView is a class to represent a view that is a scatterplot. sPlotView inherits from the class, plotView, which inherits from the virtual class, genView.

Objects from the Class

Objects can be created by calls of the form new("sPlotView", ...).

Slots

dfRows:
the dataframe rows that are plotted, a numeric vector
colx:
the dataframe column plotted on the x axis, a numeric vector of length one
coly:
the dataframe column plotted on the y axis, a numeric vector of length one
plotDevice:
the plot device number
plotPar:
the parameter list for the plot, see par()
drArea:
an object of class "GtkDrawingArea"
dataName:
a character string describing what data is shown in the view
win:
an object of class "GtkWindow" that holds the view
winNum:
a number that tells what number view this is (for example, the first view created will have winNum=1)

Extends

Class "plotView", directly. Class "genView", by class "plotView".

Methods

clickEvent
Handles button press events on a scatterplot: identifies the point and creates and handles a gUpdateDataMessage object depending on the view mode
colx
Returns the colx slot
coly
Returns the coly slot
dfRows
Returns the dfRows slot
motionEvent
Handles motion notify events on a scatterplot: if the view mode is identify, it calls the function checkPoint, which identifies the point and creates and handles a gUpdateDataMessage object
viewUpdateData
Called by the initialize method when creating an object of class, gUpdateDataMessage. The viewUpdateData method determines how the data will be updated based on the view mode, the view object, and the location of the event (which point was clicked in this case). A list containing the slot values for the gUpdateDataMessage object is returned.

Author(s)

Elizabeth Whalen

See Also

genView-class, plotView-class, spreadView-class, gUpdateDataMessage-class

Examples

  if (interactive())
  {
    createControlWindow()
    # should load data through Open Data or Open File under the File menu
    data(USArrests)
    loadDFData(USArrests, "USArrests")

    # plotting the data should occur through Plot Data under 
    # the Display menu
    vMessage<-new("gAddViewMessage", dataName="USArrests", type="plotView",
                  plotType="sPlotView",  dfRows = 1:nrow(USArrests), 
                  dfColumns = 1:2)    
    handleMessage(vMessage)
 
    # this will create an object of class, sPlotView
    is(getViewEnvVar("viewList")[[1]], "sPlotView")  
  }

[Package iSPlot version 1.2.0 Index]