Hi!
I am working with data from a single-cell RNA sequencing experiment and I have plotted UMAP coordinates in a 3D plot. The data contains information of three different conditions (GT), control+condition1+condition2, and I have created an animation slider to these accordingly by using frame = ~GT. Now I also want to add a regular slider that allows the user to change the size of the data points. However, the slider does not seem to appear when I have defined the frame parameter. Is there any chance that I can plot these two sliders in the same plot? You can find my code below:
p3d_v2 ← plot_ly(data = plot.data,
x = ~UMAP_1, y = ~UMAP_2, z = ~UMAP_3,
color = ~seurat_clusters,
frame = ~GT,
colors = c(“lightseagreen”,
“gray50”,
“darkgreen”,
“red4”,
“red”,
“turquoise4”,
“black”,
“yellow4”,
“royalblue1”,
“lightcyan3”,
“peachpuff3”,
“khaki3”,
“gray20”,
“orange2”,
“royalblue4”,
“yellow3”,
“gray80”,
“darkorchid1”,
“lawngreen”,
“plum2”,
“darkmagenta”),
type = “scatter3d”,
mode = “markers”,
marker = list(size = 1.5, width=1),
text=~label,
hoverinfo=“text”) %>% plotly_build() %>% animation_opts(frame = 8000, easing = “circle”, redraw = FALSE)steps ← list(
list(args = list(“marker.size”, 0.5),
label = “0.5”,
method = “restyle”,
value = “0.5”
),
list(args = list(“marker.size”, 1),
label = “1”,
method = “restyle”,
value = “1”
),
list(args = list(“marker.size”, 2),
label = “2”,
method = “restyle”,
value = “2”
)
)p3d_v2 ← p3d_v2 %>% layout(title = “H75 UMAP 3D”,
sliders = list(
list(
active = 1,
currentvalue = list(prefix = "Size: "),
pad = list(t = 60),
steps = steps))
Thanks!
Br,
Madeleine