-
Notifications
You must be signed in to change notification settings - Fork 154
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
Group colors in gvisTimeline #51
Comments
I don’t understand, why you can’t use the options argument in the reactive environment.
|
My issue is that the list of colors has to remain reactive but options does not take a reactive object. So the app I am creating uses a data set is created by reading in a google spreadsheet which is updated by users. Now I have the data set in the Shiny app reactive because I need the app to reflect any changes that are made in the spreadsheet, without having to restart the app. This means the list of colors that is used in the gvisTimeline function needs to remain reactive. But it seems like I can't do this. As an example, let's say the reactive data set I had in the previous post, and I can make a list of colors according to this. colors_timeline gives a string list of colors from a function (colors) according to 'Level' variable (Advanced is red, Intermediate is yellow, Elementary is blue). So with the example dataset, this would give "['red', 'red', 'yellow', 'yellow', 'blue', 'blue']". But note, this list is reactive. colors_timeline = reactive({ And I can't use the colors_timeline directly in gvisTimeline function as below because options does not take a reactive object. output$timeline <- renderGvis({ So I was asking if it's possible to add a 'colors' argument in the gvisTimeline function so that color coding with reactive data set is possible. DL |
Hello,
I am using gvisTimeline in Shiny, and I need to color code the timeline bars according to groups. This is different from the colorByRowLabel option because I am trying to use the same colors for groups of rows, not by each row label.
I know we can just use the options for colors, but I am not able to utilize this because the data set I am using to generate the plot is a reactive object. Is there any way we could add a functionality where you can just use a 'colors' column so that each timeline bar uses the corresponding color for the row, or use 'group' colors in the option?
For example, if I wanted to color code by 'Level', in the dataset below,
it would be great if I could do something like:
gvisTimeline(data=dat, rowlabel="Class", barlabel="Day", start="Start", end="End", colors = "Level" ) or
gvisTimeline(data=dat, rowlabel="Class", barlabel="Day", start="Start", end="End", colors = "Color" )
Thanks for your help!
DL
The text was updated successfully, but these errors were encountered: