Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the on_done_drawing argument #13

Closed
muschellij2 opened this issue Jul 7, 2017 · 1 comment
Closed

Remove the on_done_drawing argument #13

muschellij2 opened this issue Jul 7, 2017 · 1 comment

Comments

@muschellij2
Copy link
Contributor

I can't seem to figure out how if I can currently use shinydrawr to:

  1. Plot a portion of the data (but an x-axis that extends)
  2. Have a user fill in the data for that.
  3. Not have the "true" data revealed.

So either, can you pass in an x_max argument that overrides x_max = scales.x.domain()[1] (I'm not sure how good that'd be) where there is no "true" data passed in. For example, a data.frame that ends with x = 5 but the x-axis extends to 10 and you want to fill it in. Dislike this because you don't know the grid you want to fill in.

You can also have an additional flag for this block of code

if (d3.mean(usersData, function (d) {
        return d.defined;
      }) === 1 && !this.raw_draw) {
        clipRect.transition().duration(1000).attr('width', scales.x(x_max));
      }

other than raw_draw. I may not know how to use raw_draw, but it seems that I'd need another flag for this behavior because setting raw_draw = TRUE indicates nothing should be plotted initially.

@nstrayer
Copy link
Owner

nstrayer commented Jul 28, 2017

This was fixed in #15. To do this you now simply set the values for the x-areas you don't want revealed to be NA and the plot will not display them.

e.g.

timeDataNoReveal <- timeData %>% 
  mutate(
    value = ifelse(date > endDate, NA, value)
  )
  
allModule(
  shinydrawr,
  "no_reveal",
  data = timeDataNoReveal,
  draw_start = endDate,
  x_key = "date",
  y_key = "value",
  y_min = 2
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants