shinydrawr.RdUpon completion of line draw, returns a reactive variable that contains a vector of the y coordinates of what the user has drawn. This also includes the start point specified with `draw_start` This is the server component of shinydrawr. You never directly use this function but instead call it through the shiny function `callModule()`. See the example for how to do this.
shinydrawr(input, output, session, data, x_col, y_col = NULL, free_draw = FALSE, draw_start = NULL, title = NULL, pin_start = TRUE, x_range = NULL, y_range = NULL, x_lab = NULL, y_lab = NULL, line_style = NULL, drawn_line_color = "orangered", data_line_color = "steelblue", x_axis_buffer = 0.02, y_axis_buffer = 0.1)
| input | you can ignore these as it is taken care of by
|
|---|---|
| output | you can ignore these as it is taken care of by
|
| session | you can ignore these as it is taken care of by
|
| data | Tibble to draw |
| x_col | Name of column for x axis |
| y_col | Name of column for y axis |
| free_draw | Do you just want the user to draw data on a supplied x-range? I.e. no revealed line? |
| draw_start | Where on the x axis to start obscuring data for drawing? Defaults to very start of data. |
| title | Text for title, if desired. |
| pin_start | Pin start of drawn line to end of shown data? Defaults to
|
| x_range | Two element array of min and max of x range. Otherwise defaults to min and max of data. |
| y_range | Two element array of min and max of y range. Otherwise defaults to min and max of data. |
| x_lab | Text to label x axis, defaults to name of column used for x-axis |
| y_lab | Text to label y axis, defaults to name of column, or in
free-draw case, to just |
| line_style | List containing any styling that is desired for the default line. For options see MDN: SVG line. Make sure to camelCase all attributes. |
| drawn_line_color | CSS valid color for user-drawn line. Defaults to
|
| data_line_color | CSS valid color for data line. Defaults to
|
| x_axis_buffer | Scaler for how much to pad ends of x axis if not
specifying range directly. Defaults to 2% ( |
| y_axis_buffer | Scaler for how much to pad ends of y axis if not
specifying range directly. Defaults to 10% ( |
if (FALSE) { callModule( shinydrawr, 'drawr_widget', data, x_col = time, y_col = metric, draw_start = 20 ) }