identifyPoint             package:iSPlot             R Documentation

_I_d_e_n_t_i_f_y _t_h_e _p_o_i_n_t _c_l_i_c_k_e_d _o_n _a _s_c_a_t_t_e_r_p_l_o_t

_D_e_s_c_r_i_p_t_i_o_n:

     identifyPoint determines which point on the scatterplot the user 
     clicked.  If no point was clicked, then identifyPoint returns
     NULL;  otherwise, it returns the point (i.e. the row name).

_U_s_a_g_e:

     identifyPoint(curplot, xyloc)

_A_r_g_u_m_e_n_t_s:

 curplot: the active plot, which is of type sPlotView 

   xyloc: a list that contains the x and y location 

_V_a_l_u_e:

     If no point was clicked, then NULL is returned.  Otherwise, if a
     point  was clicked, then the following list items are returned. 

closestXY: a list of the x and y position of the nearest point; note
          that this is not necessarily the same as the position the
          user clicked

closestPoint: the row name of the point clicked

_A_u_t_h_o_r(_s):

     Elizabeth Whalen

_S_e_e _A_l_s_o:

     'checkPoint',  'sPlotView-class'

_E_x_a_m_p_l_e_s:

       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
         createView(type = "plotView", dataName = "USArrests", 
                    plotType = "sPlotView", dfRows = 1:nrow(USArrests), 
                    dfColumns = 1:2)  
         # should set the view mode using the ViewMode menu
         setHighlightMode()
         # now click on a point on the plot, which will call the function 
         # identifyPoint and if a point was clicked, then that point should be 
         # highlighted
       }

