这reactable
个包支持嵌入式htmlwidget.我可以在单元格中包括情节图,但我还没有能够适当地调整它们的大小.我希望它们非常紧凑和精致,就像spark 线一样.
plot_ly(..., height = 50, width = 300)
成功地缩小了人物的高度,但线条笔触较重,轴标题占用了大量空间.如果我能把图形做得更精细,并完全go 掉轴标签,也许我就能做到.
layout(xaxis = list(label = NULL))
没有删除标签,我不知道如何阅读布局选项的文档.https://plotly.com/r/reference/#Layout_and_layout_style_objects个
任何 idea 都很受欢迎!
library(tidyverse)
library(reactable)
library(plotly)
dat <- mtcars |>
select(where(is.numeric)) |>
pivot_longer(everything()) |>
group_by(name) |>
summarize(plt = list(value))
my_plot <- function(value, ...) {
tibble(value) |>
plot_ly(type = "violin", x = ~value, width = 300, height = 50) |>
layout(autosize = TRUE, xaxis = list(label = NULL))
}
dat |>
reactable(
columns = list(
plt = colDef(cell = my_plot)
)
)