plotly.js - 为什么 PlotlyJS 不适用于谷歌浏览器?
问题描述
当我的默认浏览器是 Firefox 并且我想在 Julia REPL 中运行以下代码时,它会打开 Firefox 并显示绘图
using PlotlyJS
N=300
X = LinRange(0, 10, N)
Y = -3 .+ 7*rand(N)
trace = scatter(x = [X[1]],
y = [Y[1]],
mode="lines",
line_width=1.5,
line_color="RoyalBlue")
n_frames = length(X)
frames = Vector{PlotlyFrame}(undef, n_frames)
for k in 1:n_frames
frames[k] = frame(data=[attr(x=X[1:k], #update x and y
y=Y[1:k],
)],
layout=attr(title_text="Test frame $k"), #update title
name="fr$k", #frame name; it is passed to slider
traces=[0] # this means that the above data update the first trace (here the unique one)
)
end
updatemenus = [attr(type="buttons",
active=0,
y=1, #(x,y) button position
x=1.1,
buttons=[attr(label="Play",
method="animate",
args=[nothing,
attr(frame=attr(duration=5,
redraw=true),
transition=attr(duration=0),
fromcurrent=true,
mode="immediate"
)])])];
sliders = [attr(active=0,
minorticklen=0,
steps=[attr(label="f$k",
method="animate",
args=[["fr$k"], # match the frame[:name]
attr(mode="immediate",
transition=attr(duration=0),
frame=attr(duration=5,
redraw=true))
]) for k in 1:n_frames ]
)];
ym, yM = extrema(Y)
layout = Layout(title_text="Test", title_x=0.5,
width=700, height=450,
xaxis_range=[-0.1, 10.1],
yaxis_range=[ym-1, yM+1],
updatemenus=updatemenus,
sliders=sliders
)
pl = Plot(trace, layout, frames)
但是当谷歌浏览器是默认浏览器时,什么都没有发生,没有错误,也没有打开 Chrome 选项卡来显示情节。我正在使用 Windows 10 和最新的 Julia 版本 1.6.0。
解决方案
推荐阅读
- azure - Azure Web App 中的 Azure 容器注册表,用于跨订阅的容器
- python - 使用外部 URL 提交 HIT 会引发错误
- javascript - 使用 React 钩子将 setState 传递给子组件
- docker - docker 层是否允许意外的容器操作系统升级?
- codenameone - java.lang.NullPointerException:尝试在空对象引用上调用虚拟方法“int com.codename1.s.aw.aa()”
- excel - 从 VB.net 中的模式中提取时,Excel 表名包含“$”
- postgresql - 如何退出 plpgsql 过程
- javascript - 如何在 gatsbyjs 中更改浏览器选项卡上的图标
- c# - 无法在 gitlab 中使用 pubxml 文件部署 dotnet 核心应用程序
- javascript - 获取从 React 中的函数返回的字符串而不是 html