django - 在图形右侧绘制短划线图形输入
问题描述
我有一个带有输入框的绘图图。
有没有办法将这些输入框发送到图表的右侧。我已经检查了文档,但该部分中似乎没有提到这一点dcc.Input
。
https://dash.plotly.com/dash-core-components/input
app.layout = html.Div(
[
dcc.Input(
id = "input_{}".format(_),
type = _,
placeholder="input type {}".format(_),
)
for _ in ALLOWED_TYPES
]
+ [dcc.Graph(id='graph', figure=fig, style={'width': '90vh', 'height': '90vh'})]
)
dcc.Input
似乎没有这个选项。谢谢你的帮助。
解决方案
您可以使用style
propdcc.Input
来将输入元素与 CSS 对齐。
dcc.Input(
...
style={"float": "right"},
)
或者,如果您想对输入元素的定位方式进行更多控制,则可以始终使用 Flexbox。这将涉及style
在外部设置 prop html.Div
,display: flex
然后您可以为输入元素使用 flex 属性。
推荐阅读
- javascript - Angular 6,从由javascript填充的表单字段中的数据外部更新变量
- php - SammyK laravel Facebook PHP SDK,发布到页面
- jenkins - 有没有办法限制使用“与父母一起提交”提交的 Gerrit 合并事件触发的 Jenkins 构建的数量?
- sql - 在 Google BigQuery 中进行交叉透视
- python - 如何修复代码以便 Python 选择随机数
- python - 如何根据条件提取多列
- reactjs - reactjs中如何在两个独立类之间连续传递数据?
- haskell - 描述给定 foldr 函数的前几个评估步骤
- sql - 将日期转换为日期时间会导致 sql 错误
- javascript - 在 opencv.js 中创建轮廓