R Plotly 多行工具提示 - 框外的文本

R Plotly multi line tooltip - text outside the box

我在 R Plotly(R 包版本:4.7.1)中绘制多行工具提示时遇到问题。工具提示的格式不正确。文本超出工具提示背景。

最小示例:

这可以通过 运行 以下代码复制:

data <- matrix(c(1:16), ncol = 2)
# Plot the chart
plot_ly(
    x = c("a", "b"),
    y = c(letters[1:8]),
    z = data,
    showscale = FALSE,
    hoverinfo = 'text',
    text = matrix(rep("Lorem ipsum dolor sit amet,<br>consectetur adipiscing elit,<br>sed do eiusmod tempor<br>incididunt ut labore et dolore<br>magna aliqua.<br>Ut enim ad minim veniam, quis<br>nostrud exercitation ullamco laboris nisi<br>ut aliquip ex ea commodo consequat.<br>Duis aute irure dolor in<br>reprehenderit in voluptate velit esse<br>cillum dolore eu fugiat nulla pariatur.", 16), ncol = 2),
    type = "heatmap"
)

只有调整浏览器大小才能实现此效果 window。在我的真实情况下,我将它放在一个闪亮的应用程序中,因此 space 是有限的。但是,似乎有足够的 space 来正确绘制工具提示。有什么解决办法吗?

plotly更新到4.8确实解决了问题。