什么是减少仪表板和模式栏之间的空间的正确方法?
我正在尝试实时绘制一些数据,并且由于数字尺寸,侧边栏被推到正确的位置。控制差距的正确方法是什么?
我的代码:
app = dash.Dash(__name__)
app.layout = html.Div(
[
dash.dcc.Graph(id='live-graph'),
dash.dcc.Interval(id='time', interval=250),
],
style={"display": "inline-block"}
)
@app.callback(Output('live-graph', 'figure'),
[
Input('time', 'n_intervals')
]
)
def update(t):
if t is None:
return dash.no_update
fig = go.Figure(data={'data':
[
go.Scatter3d(...),
go.Scatter3d(...)
]
}
)
fig.update_layout(uirevision='constant',
scene_camera=camera,
width=2000,
height=2000,
margin=dict(l=20, r=0, t=20, b=20, pad=0),
scene=dict(xaxis=dict(range=[-10, 10]), yaxis=dict(range=[-10, 10]), zaxis=dict(range=[0, 3])))
return fig
I'm trying to live plot some data and the sidebar is getting pushed to the right too much because of the figure dimensions. What's the proper way to control that gap?
My code:
app = dash.Dash(__name__)
app.layout = html.Div(
[
dash.dcc.Graph(id='live-graph'),
dash.dcc.Interval(id='time', interval=250),
],
style={"display": "inline-block"}
)
@app.callback(Output('live-graph', 'figure'),
[
Input('time', 'n_intervals')
]
)
def update(t):
if t is None:
return dash.no_update
fig = go.Figure(data={'data':
[
go.Scatter3d(...),
go.Scatter3d(...)
]
}
)
fig.update_layout(uirevision='constant',
scene_camera=camera,
width=2000,
height=2000,
margin=dict(l=20, r=0, t=20, b=20, pad=0),
scene=dict(xaxis=dict(range=[-10, 10]), yaxis=dict(range=[-10, 10]), zaxis=dict(range=[0, 3])))
return fig
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论