I am trying to keep the scale and scale size of my chart constant, no matter what points are actually displayed.
In ggplot I could set these constants using arguments like scale_color_gradient(limits=c(0,1)) . However, I cannot find a parallel function in plot_ly and for other reasons I cannot use ggplotly() here.
I believe that this can also be done using eventReactive() , but itβs hard for me to figure out how to use it.
Here is a minimal example in which the color and size of the plot continue to change.
library(dplyr) library(shiny) library(plotly) df <- as.data.frame(list("UserID"=c(1,1,1,1,2,2,2,2), "Category"=c('A','A','B','B','A','A','B','B'), "Rate"=c(2,3,5,6,8,6,7,1), "x"=c(1,3,5,7,2,4,6,8), "y"=c(1,3,5,7,2,4,6,8) )) ui <- (fluidPage( sidebarLayout( sidebarPanel( selectInput("userInput","Select User", sort(unique(df$UserID)), selected=1), checkboxGroupInput("CategoryInput", "Select Category", sort(unique(df$Category)), selected=c('A','B')) ), mainPanel( plotlyOutput("mainPlot")
Is it possible to update only those points that are displayed without updating the scale / color range / size?